Examples of CellView


Examples of org.jgraph.graph.CellView

  /**
   * Returns the bounding rectangle of the specified cell.
   */
  public Rectangle2D getCellBounds(Object cell) {
    CellView view = graphLayoutCache.getMapping(cell, false);
    if (view != null)
      return view.getBounds();
    return null;
  }
View Full Code Here

Examples of org.jgraph.graph.CellView

      y /= scale;
      Rectangle2D r = new Rectangle2D.Double(x - tolerance,
          y - tolerance, 2 * tolerance, 2 * tolerance);
      // Iterate through cells and switch to active
      // if current is traversed. Cache first cell.
      CellView first = null;
      boolean active = (c == null);
      for (int i = 0; i < cells.length; i++) {
        if (cells[i] != null && (!leafsOnly || cells[i].isLeaf())
            && cells[i].intersects(this, r)) {
          // TODO: This behaviour is specific to selection and
View Full Code Here

Examples of org.jgraph.graph.CellView

    if (ports != null) {
      for (int i = ports.length - 1; i >= 0; i--)
        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

Examples of org.jgraph.graph.CellView

  public PortView getDefaultPortForCell(Object cell) {
    if (cell != null && !getModel().isEdge(cell)) {
      int childCount = getModel().getChildCount(cell);
      for (int i = 0; i < childCount; i++) {
        Object childCell = getModel().getChild(cell, i);
        CellView child = getGraphLayoutCache().getMapping(childCell,
            false);
        if (child instanceof PortView) {
          Point2D offset = GraphConstants.getOffset(child
              .getAllAttributes());
          if (offset == null || childCount == 1)
            return (PortView) child;
        }
      }
View Full Code Here

Examples of org.jgraph.graph.CellView

   * Converts the specified value to string. If the value is an instance of
   * CellView then the corresponding value or cell is used.
   */
  public String convertValueToString(Object value) {
    if (value instanceof CellView) {
      CellView view = (CellView) value;
      Object newValue = GraphConstants.getValue(view.getAllAttributes());
      if (newValue != null)
        value = newValue;
      else
        value = view.getCell();
    }
    return String.valueOf(value);
  }
View Full Code Here

Examples of org.jgraph.graph.CellView

   * returns a view for the cell then this method returns allAttributes,
   * otherwise the method returns model.getAttributes(cell).
   */
  public AttributeMap getAttributes(Object cell) {
    AttributeMap attrs;
    CellView cellView = getGraphLayoutCache().getMapping(cell, false);
    if (cellView != null) {
      attrs = cellView.getAllAttributes();
    } else {
      attrs = getModel().getAttributes(cell);
    }
    return attrs;
  }
View Full Code Here

Examples of org.jgraph.graph.CellView

   * @see #isEditable
   *
   */
  public boolean isCellEditable(Object cell) {
    if (cell != null) {
      CellView view = graphLayoutCache.getMapping(cell, false);
      if (view != null) {
        return isEditable()
            && GraphConstants.isEditable(view.getAllAttributes());
      }
    }
    return false;
  }
View Full Code Here

Examples of org.jgraph.graph.CellView

   *         <code>event</code> is null
   */
  public String getToolTipText(MouseEvent e) {
    if (e != null) {
      Object cell = getFirstCellForLocation(e.getX(), e.getY());
      CellView view = getGraphLayoutCache().getMapping(cell, false);
      if (view != null) {
        Component c = view.getRendererComponent(this, false, false,
            false);
        if (c instanceof JComponent) {
          Rectangle2D rect = getCellBounds(cell);
          Point2D where = fromScreen(e.getPoint());
          // Pass the event to the renderer in graph coordinates;
View Full Code Here

Examples of org.jgraph.graph.CellView

    if (edgeView.getSource() instanceof PortView) {
      from = ((PortView) edgeView.getSource()).getLocation();

    }
    Point2D to = edgeView.getPoint(n - 1);
    CellView trg = edgeView.getTarget();
    if (trg instanceof PortView) {

      to = ((PortView) trg).getLocation();
    }
View Full Code Here

Examples of org.jgraph.graph.CellView

      Point2D point = mediator.fromScreen(new Point(e.getPoint()));
      if (!(ml.getFocus() != null && ml.getFocus().intersects(mediator.getGraph(), r))) {
        ml.setFocus(null);
      }
      // Avoid toggling of selection between inner components and blocking region
      CellView next = mediator.getNextViewAt(ml.getFocus(), point.getX(), point.getY());
      if (next != null && next.getCell() != null) {
        if (!(ml.getFocus() != null && next.getCell() instanceof BlockingRegion)) {
          ml.setCell(next);
        }
      }
      if (ml.getFocus() == null) {
        ml.setFocus(ml.getCell());
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.