Examples of EdgeView


Examples of de.hpi.eworld.editor.tls.views.EdgeView

    //double scale = 1.0 / 8.0;
    //graph.getView().setScale(scale);

    if (currentTrafficLight != null) {
      for (EdgeModel edge : currentTrafficLight.getUsedBy()) {
        EdgeView way = new EdgeView(edge);
        previewWidget.addEdge(way);
      }
     
      TrafficLightView trafficLight = new TrafficLightView(currentTrafficLight);
      trafficLight.setIgnoreLevelOfDetail(true);
View Full Code Here

Examples of org.freeplane.view.swing.map.edge.EdgeView

              }
              continue;
            }
            }
          if (nodeView.isContentVisible()) {
            final EdgeView edge = EdgeViewFactory.getInstance().getEdge(source, nodeView, source);
            edge.paint(g);
          }
          else {
            nodeView.paintEdges(g, source);
          }
        }
View Full Code Here

Examples of org.freeplane.view.swing.map.edge.EdgeView

    final Point start1 = new Point(currentX, currentY1);
    final Point start2 = new Point(currentX, currentY2);
    final NodeView parentView = target.getParentView();
    UITools.convertPointToAncestor(parentView, start1, source);
    UITools.convertPointToAncestor(parentView, start2, source);
    final EdgeView edgeView = new SummaryEdgeView(source, target, source);
    edgeView.setStart(start1);
    edgeView.paint(g);
    edgeView.setStart(start2);
    edgeView.paint(g);
    return true;
  }
View Full Code Here

Examples of org.jgraph.graph.EdgeView

    }

    // Override Superclass Method to Return Custom EdgeView
    protected EdgeView createEdgeView(Object cell) {
      // Return Custom EdgeView
      return new EdgeView(cell) {

        /**
         * Returns a cell handle for the view.
         */
        public CellHandle getHandle(GraphContext context) {
View Full Code Here

Examples of org.jgraph.graph.EdgeView

        for (int i = 0; i < cells.length; i++) {
          if (graphModel.isEdge(cells[i])) {
            CellView cellView = graphLayoutCache.getMapping(
                cells[i], false);
            if (cellView instanceof EdgeView) {
              EdgeView edgeView = (EdgeView) cellView;
              if (edgeView.getSource() == null) {
                Point2D pt = edgeView.getPoint(0);
                if (pt != null) {
                  if (ret == null)
                    ret = new Rectangle2D.Double(pt.getX(),
                        pt.getY(), 0, 0);
                  else
                    Rectangle2D.union(ret,
                        new Rectangle2D.Double(pt
                            .getX(), pt.getY(), 0,
                            0), ret);
                }
              }
              if (edgeView.getTarget() == null) {
                Point2D pt = edgeView.getPoint(edgeView
                    .getPointCount() - 1);
                if (pt != null) {
                  if (ret == null)
                    ret = new Rectangle2D.Double(pt.getX(),
                        pt.getY(), 0, 0);
View Full Code Here

Examples of org.jgraph.graph.EdgeView

  protected Point2D getEditorLocation(Object cell, Dimension2D editorSize,
      Point2D pt) {
    // Edges have different editor position and size
    CellView view = graphLayoutCache.getMapping(cell, false);
    if (view instanceof EdgeView) {
      EdgeView edgeView = (EdgeView) view;
      CellViewRenderer renderer = edgeView.getRenderer();
      if (renderer instanceof EdgeRenderer) {
        Point2D tmp = ((EdgeRenderer) renderer).getLabelPosition(edgeView);
        if (tmp != null) {
          pt = tmp;
          pt.setLocation(Math.max(0, pt.getX() - editorSize.getWidth()
View Full Code Here

Examples of org.jgraph.graph.EdgeView

  //  Giuseppe De Cicco & Fabio Granara
  public boolean intersectsEdge(EdgeView otherEdgeView) {
    boolean sourcesame = false;
    //      edgeView del lato uno
    EdgeView edgeView = (EdgeView) (mediator.getGraph().getGraphLayoutCache()).getMapping(this, false);
    JmtEdge edge2 = (JmtEdge) otherEdgeView.getCell();

    JmtCell sourceOfEdge1 = null;
    JmtCell targetOfEdge1 = null;
    JmtCell sourceOfEdge2 = null;
    JmtCell targetOfEdge2 = null;

    //      if inseriti per evitare eccezioni di tipo nullPointerException
    if ((DefaultPort) edge2.getSource() != null) {
      sourceOfEdge2 = (JmtCell) ((DefaultPort) edge2.getSource()).getParent();
    }
    if ((DefaultPort) edge2.getTarget() != null) {
      targetOfEdge2 = (JmtCell) ((DefaultPort) edge2.getTarget()).getParent();
    }
    if ((DefaultPort) this.getSource() != null) {
      sourceOfEdge1 = (JmtCell) ((DefaultPort) this.getSource()).getParent();
    }
    if ((DefaultPort) this.getTarget() != null) {
      targetOfEdge1 = (JmtCell) ((DefaultPort) this.getTarget()).getParent();
    }

    if (edgeView == null) {
      return false;
    }

    int controlPoint = edgeView.getPointCount();
    int controlPoint2 = otherEdgeView.getPointCount();

    //control point del lato
    Point2D[] controlPoints = new Point2D[controlPoint];
    for (int i = 0; i < controlPoint; i++) {

      controlPoints[i] = edgeView.getPoint(i);
      if ((controlPoints[i] == null)) {
        return false;
      }
      //ho inserito il BigDecimal per approssimare i valori a due cifre ma poi mi sono accorto che occorre approx a intero purche le computazioni
      //siano efficenti per cui ho richiamato il metodo intValue
View Full Code Here

Examples of org.jgraph.graph.EdgeView

    //      Questo mi restituisce la lista dei lati che ho da analizzare per l intersezione   
    listEdges = listEdges2.toArray();

    for (Object listEdge : listEdges) {
      Object[] celle = null;
      EdgeView edgeView = (EdgeView) (mediator.getGraph().getGraphLayoutCache()).getMapping(listEdge, false);
      Rectangle2D rett = edgeView.getBounds();
      //        Questo metodo mi ritorna sia le porte che il lato e i vertici sorgenti, devo quindi
      //          per questione di pesantezza fare un controllo di istanze
      celle = (mediator.getGraph()).getDescendants(mediator.getGraph().getRoots(rett.getBounds()));
      //        System.out.println("le celle che intersecano sono : "+celle.length);
      ArrayList<Object> celle2 = new ArrayList<Object>();
      JmtCell sourceOfEdge = (JmtCell) ((DefaultPort) ((JmtEdge) listEdge).getSource()).getParent();
      JmtCell targetOfEdge = (JmtCell) ((DefaultPort) ((JmtEdge) listEdge).getTarget()).getParent();

      for (int j = 0; j < celle.length; j++) {
        if (celle[j] instanceof JmtCell && !(celle[j] == sourceOfEdge) && !(celle[j] == targetOfEdge)) {
          celle2.add(celle[j]);
        }
      }
      //        System.out.println("le celle che intersecano modificate sono: "+ celle2.size());
      Object[] cellsfinal = celle2.toArray();
      int contatore = 0;
      //        System.out.println("Sono in JmtOverlapping grandezza delle celle che interseco: "+cellsfinal.length);
      for (Object element : cellsfinal) {

        Rectangle2D cellBound = GraphConstants.getBounds(((JmtCell) element).getAttributes());
        EdgeView viewtmp = (EdgeView) (mediator.getGraph().getGraphLayoutCache()).getMapping(listEdge, false);
        //        Point2D[] intersectionPoints=(Point2D[]) ((JmtEdge)listEdges[i]).intersects2(viewtmp,cellBound);
        if (((JmtEdge) listEdge).intersects(viewtmp, cellBound)) {
          //          ________________DATI APPARTENENTI AL VERTICE
          double vertexMinX = (int) cellBound.getMinX();
          double vertexMinY = (int) cellBound.getMinY();
View Full Code Here

Examples of org.jgraph.graph.EdgeView

        for (int i = 0; i < cells.length; i++) {
          if (graphModel != null && graphModel.isEdge(cells[i])) {
            CellView cellView = graphLayoutCache.getMapping(
                cells[i], false);
            if (cellView instanceof EdgeView) {
              EdgeView edgeView = (EdgeView) cellView;
              if (edgeView.getSource() == null) {
                Point2D pt = edgeView.getPoint(0);
                if (pt != null) {
                  if (ret == null)
                    ret = new Rectangle2D.Double(pt.getX(),
                        pt.getY(), 0, 0);
                  else
                    Rectangle2D.union(ret,
                        new Rectangle2D.Double(pt
                            .getX(), pt.getY(), 0,
                            0), ret);
                }
              }
              if (edgeView.getTarget() == null) {
                Point2D pt = edgeView.getPoint(edgeView
                    .getPointCount() - 1);
                if (pt != null) {
                  if (ret == null)
                    ret = new Rectangle2D.Double(pt.getX(),
                        pt.getY(), 0, 0);
View Full Code Here

Examples of org.jgraph.graph.EdgeView

  protected Point2D getEditorLocation(Object cell, Dimension2D editorSize,
      Point2D pt) {
    // Edges have different editor position and size
    CellView view = graphLayoutCache.getMapping(cell, false);
    if (view instanceof EdgeView) {
      EdgeView edgeView = (EdgeView) view;
      CellViewRenderer renderer = edgeView.getRenderer();
      if (renderer instanceof EdgeRenderer) {
        Point2D tmp = ((EdgeRenderer) renderer)
            .getLabelPosition(edgeView);
        if (tmp != null)
          pt = tmp;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.