Package org.jgraph.graph

Examples of org.jgraph.graph.VertexView


          position = i + 1;
        }
      }
     
      // Looking for position of source/target nodes (edge=>port=>vertex)
      VertexView nodeFrom = (VertexView) edge.getSource().getParentView();
      VertexView nodeTo = (VertexView) edge.getTarget().getParentView();
      Point2D from = AbstractCellView.getCenterPoint(nodeFrom);
      Point2D to = AbstractCellView.getCenterPoint(nodeTo);
     
      if (from != null && to != null) {
        double dy = from.getY() - to.getY();
        double dx = from.getX() - to.getX();
       
        // Calc of radius
        double m = dy / dx;
        double theta = Math.atan(-1 / m);
        double rx = dx / Math.sqrt(dx * dx + dy * dy);
        double ry = dy / Math.sqrt(dx * dx + dy * dy);
       
        // Memorize size of source/target nodes
        double sizeFrom = Math.max(nodeFrom.getBounds().getWidth(),
            nodeFrom.getBounds().getHeight()) / 2.;
        double sizeTo = Math.max(nodeTo.getBounds().getWidth(), nodeTo
            .getBounds().getHeight()) / 2.;
       
        // Calc position of central point
        double edgeMiddleDeparture = (Math.sqrt(dx * dx + dy * dy)
            - sizeFrom - sizeTo)
View Full Code Here


            }

        } else if (cell instanceof GroupModel)
        {
            // return super.createVertexView(cell);
          return new VertexView(cell) {
            private VertexRenderer renderer = new VertexRenderer()
            {
              protected void paintSelectionBorder(Graphics g) {
                if (selected)
                {
View Full Code Here

          position = i + 1;
        }
      }

      // Looking for position of source/target nodes (edge=>port=>vertex)
      VertexView nodeFrom = (VertexView) edge.getSource().getParentView();
      VertexView nodeTo = (VertexView) edge.getTarget().getParentView();
      Point2D from = AbstractCellView.getCenterPoint(nodeFrom);
      Point2D to = AbstractCellView.getCenterPoint(nodeTo);

      if (from != null && to != null) {
        double dy = from.getY() - to.getY();
        double dx = from.getX() - to.getX();

        // Calc of radius
        double m = dy / dx;
        double theta = Math.atan(-1 / m);
        double rx = dx / Math.sqrt(dx * dx + dy * dy);
        double ry = dy / Math.sqrt(dx * dx + dy * dy);

        // Memorize size of source/target nodes
        double sizeFrom = Math.max(nodeFrom.getBounds().getWidth(),
            nodeFrom.getBounds().getHeight()) / 2.;
        double sizeTo = Math.max(nodeTo.getBounds().getWidth(), nodeTo
            .getBounds().getHeight()) / 2.;

        // Calc position of central point
        double edgeMiddleDeparture = (Math.sqrt(dx * dx + dy * dy)
            - sizeFrom - sizeTo)
View Full Code Here

TOP

Related Classes of org.jgraph.graph.VertexView

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.