Package org.jgraph.graph

Examples of org.jgraph.graph.CellView


    if (cells != null) {
      Rectangle2D r = fromScreen(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


    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 = getNextViewAt(null, x, y, true);

        // Finds a non-edge cell under the mousepointer
        if (cellView != null && graphModel.isEdge(cellView.getCell())) {
          CellView nextView = getNextViewAt(cellView, x, y, true);
          while (nextView != cellView
              && graphModel.isEdge(nextView.getCell())) {
            nextView = getNextViewAt(nextView, x, y, true);
          }
          cellView = nextView;
        }
        if (cellView != null) {
View Full Code Here

  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

   * 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

   * @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

   *         <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

TOP

Related Classes of org.jgraph.graph.CellView

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.