Package org.graphstream.ui.swingViewer.util

Examples of org.graphstream.ui.swingViewer.util.GraphMetrics


    camera.pushView(graph, g);
    renderGraphElements(g);

    if (style.getStrokeMode() != StyleConstants.StrokeMode.NONE
        && style.getStrokeWidth().value != 0) {
      GraphMetrics metrics = camera.getMetrics();
      Rectangle2D rect = new Rectangle2D.Double();
      double px1 = metrics.px1;
      Value stroke = style.getShadowWidth();

      rect.setFrame(metrics.lo.x, metrics.lo.y + px1,
          metrics.size.data[0] - px1, metrics.size.data[1] - px1);
      g.setStroke(new BasicStroke((float) metrics.lengthToGu(stroke)));
      g.setColor(graph.getStyle().getStrokeColor(0));
      g.draw(rect);
    }

    camera.popView(g);
View Full Code Here


    if (foreRenderer != null)
      renderLayer(g, foreRenderer);
  }

  protected void renderLayer(Graphics2D g, LayerRenderer renderer) {
    GraphMetrics metrics = camera.getMetrics();

    renderer.render(g, graph, metrics.ratioPx2Gu,
        (int) metrics.viewport[2], (int) metrics.viewport[3],
        metrics.loVisible.x, metrics.loVisible.y, metrics.hiVisible.x,
        metrics.hiVisible.y);
View Full Code Here

   * Show the centre, the low and high points of the graph, and the visible
   * area (that should always map to the window borders).
   */
  protected void debugVisibleArea(Graphics2D g) {
    Rectangle2D rect = new Rectangle2D.Double();
    GraphMetrics metrics = camera.getMetrics();

    double x = metrics.loVisible.x;
    double y = metrics.loVisible.y;
    double w = Math.abs(metrics.hiVisible.x - x);
    double h = Math.abs(metrics.hiVisible.y - y);
View Full Code Here

TOP

Related Classes of org.graphstream.ui.swingViewer.util.GraphMetrics

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.