Package org.jgraph.graph

Examples of org.jgraph.graph.PortView


      // If remembered Start Point is Valid
      if (start != null) {
        // Fetch Graphics from Graph
        Graphics g = graph.getGraphics();
        // Reset Remembered Port
        PortView newPort = getTargetPortAt(e.getPoint());
        // Do not flicker (repaint only on real changes)
        if (newPort == null || newPort != port) {
          // Xor-Paint the old Connector (Hide old Connector)
          paintConnector(Color.black, graph.getBackground(), g);
          // If Port was found then Point to Port Location
View Full Code Here


    }

    public PortView getSourcePortAt(Point2D point) {
      // Disable jumping
      graph.setJumpToDefaultPort(false);
      PortView result;
      try {
        // Find a Port View in Model Coordinates and Remember
        result = graph.getPortViewAt(point.getX(), point.getY());
      } finally {
        graph.setJumpToDefaultPort(true);
View Full Code Here

  /**
   * Convenience method to return the port at the specified location.
   */
  public Object getPortForLocation(double x, double y) {
    PortView view = getPortViewAt(x, y);
    if (view != null)
      return view.getCell();
    return null;
  }
View Full Code Here

        if (ports[i] != null && ports[i].intersects(this, r))
          return ports[i];
      if (isJumpToDefaultPort()) {
        CellView cellView = getLeafViewAt(x, y);
        if (cellView != null) {
          PortView defaultPort = getDefaultPortForCell(cellView
              .getCell());
          if (defaultPort != null)
            return defaultPort;
        }
      }
View Full Code Here

  //  heavely modified by Giuseppe De Cicco & Fabio Granara
  @Override
  public void handleRelease(MouseEvent e) {

    if (e != null && !e.isConsumed()) {
      PortView end = getInPortViewAt(e.getX(), e.getY());

      if (end != null) {
        mediator.connect(start, current, end, firstPort);

        //        bb = (JmtCell)((InputPort)(end.getCell())).getParent();
View Full Code Here

      // If remembered Start Point is Valid
      if (start != null) {
        // Fetch Graphics from Graph
        Graphics g = graph.getGraphics();
        // Reset Remembered Port
        PortView newPort = getTargetPortAt(e.getPoint());
        // Do not flicker (repaint only on real changes)
        if (newPort == null || newPort != port) {
          // Xor-Paint the old Connector (Hide old Connector)
          paintConnector(Color.black, graph.getBackground(), g);
          // If Port was found then Point to Port Location
View Full Code Here

    }

    public PortView getSourcePortAt(Point2D point) {
      // Disable jumping
      graph.setJumpToDefaultPort(false);
      PortView result;
      try {
        // Find a Port View in Model Coordinates and Remember
        result = graph.getPortViewAt(point.getX(), point.getY());
      } finally {
        graph.setJumpToDefaultPort(true);
View Full Code Here

    }
 
  @Override
    protected PortView createPortView(Object cell)
    {
      return new PortView(cell);
    }
View Full Code Here

  /**
   * Convenience method to return the port at the specified location.
   */
  public Object getPortForLocation(double x, double y) {
    PortView view = getPortViewAt(x, y, tolerance);
    if (view != null)
      return view.getCell();
    return null;
  }
View Full Code Here

            nextView = getNextViewAt(nextView, x, y, true);
          }
          cellView = nextView;
        }
        if (cellView != null) {
          PortView defaultPort = getDefaultPortForCell(cellView
              .getCell());
          return defaultPort;
        }
      }
    }
View Full Code Here

TOP

Related Classes of org.jgraph.graph.PortView

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.