Package rinde.sim.ui.renderers

Examples of rinde.sim.ui.renderers.ViewRect


    double minY = Double.POSITIVE_INFINITY;
    double maxY = Double.NEGATIVE_INFINITY;

    boolean isDefined = false;
    for (final CanvasRenderer r : renderers) {
      final ViewRect rect = r.getViewRect();
      if (rect != null) {
        minX = Math.min(minX, rect.min.x);
        maxX = Math.max(maxX, rect.max.x);
        minY = Math.min(minY, rect.min.y);
        maxY = Math.max(maxY, rect.max.y);
        isDefined = true;
      }
    }

    checkState(
        isDefined,
        "none of the available renderers implements getViewRect(), known renderers: %s",
        renderers);

    viewRect = new ViewRect(new Point(minX, minY), new Point(maxX, maxY));

    final Rectangle area = canvas.getClientArea();
    if (viewRect.width > viewRect.height) {
      m = area.width / viewRect.width;
    } else {
View Full Code Here

TOP

Related Classes of rinde.sim.ui.renderers.ViewRect

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.