Examples of INodeForObject


Examples of net.sf.joafip.meminspector.entity.INodeForObject

              + ")");
        } else {
          // final INodeForObject node = (INodeForObject) path
          // .getLastPathComponent();
          final Object[] nodes = path.getPath();
          final INodeForObject node = (INodeForObject) nodes[nodes.length - 1];
          listener.nodeSelected(node);
        }
      }
    });
  }
View Full Code Here

Examples of net.sf.joafip.meminspector.entity.INodeForObject

   * @throws MemInspectorException
   */
  private Deque<INodeForObject> pathList(final INodeForObject node)
      throws MemInspectorException {
    final Deque<INodeForObject> list = new LinkedList<INodeForObject>();
    INodeForObject current = node;
    do {
      if (list.contains(current)) {
        final StringBuilder stringBuilder=new StringBuilder();
        for(INodeForObject nodeOfList:list) {
          stringBuilder.append(nodeOfList.toString());
          stringBuilder.append('\n');
        }
        throw new MemInspectorException(
            "main father node infinite loop.\ncurrent:\n"+current+"\npath:\n"+stringBuilder.toString());
      } else {
        list.addFirst(current);
        current = current.getMainFatherNode();
      }
    } while (current != null);
    if (!rootNode.equals(list.peekFirst())) {
      throw new MemInspectorException("first node must be root node");
    }
View Full Code Here

Examples of net.sf.joafip.meminspector.entity.INodeForObject

  }

  /* TreeModel interface implementation */

  public Object getChild(final Object parent, final int index) {
    final INodeForObject parentNode = (INodeForObject) parent;
    return parentNode.getChildAt(index);
  }
View Full Code Here

Examples of net.sf.joafip.meminspector.entity.INodeForObject

    final INodeForObject parentNode = (INodeForObject) parent;
    return parentNode.getChildAt(index);
  }

  public int getChildCount(final Object parent) {
    final INodeForObject parentNode = (INodeForObject) parent;
    return parentNode.getChildCount();
  }
View Full Code Here

Examples of net.sf.joafip.meminspector.entity.INodeForObject

    final INodeForObject parentNode = (INodeForObject) parent;
    return parentNode.getChildCount();
  }

  public int getIndexOfChild(final Object parent, final Object child) {
    final INodeForObject parentNode = (INodeForObject) parent;
    return parentNode.getIndexOfChild((INodeForObject) child);
  }
View Full Code Here

Examples of net.sf.joafip.meminspector.entity.INodeForObject

  public Object getRoot() {
    return rootNode;
  }

  public boolean isLeaf(final Object object) {
    final INodeForObject node = (INodeForObject) object;
    return node.getChildCount() == 0;
  }
View Full Code Here

Examples of net.sf.joafip.meminspector.entity.INodeForObject

              + ")");
        } else {
          // final INodeForObject node = (INodeForObject) path
          // .getLastPathComponent();
          final Object[] nodes = path.getPath();
          final INodeForObject node = (INodeForObject) nodes[nodes.length - 1];
          listener.nodeSelected(node);
        }
      }
    });
  }
View Full Code Here

Examples of net.sf.joafip.meminspector.entity.INodeForObject

   * @throws MemInspectorException
   */
  private Deque<INodeForObject> pathList(final INodeForObject node)
      throws MemInspectorException {
    final Deque<INodeForObject> list = new LinkedList<INodeForObject>();
    INodeForObject current = node;
    do {
      if (list.contains(current)) {
        final StringBuilder stringBuilder=new StringBuilder();
        for(INodeForObject nodeOfList:list) {
          stringBuilder.append(nodeOfList.toString());
          stringBuilder.append('\n');
        }
        throw new MemInspectorException(
            "main father node infinite loop.\ncurrent:\n"+current+"\npath:\n"+stringBuilder.toString());
      } else {
        list.addFirst(current);
        current = current.getMainFatherNode();
      }
    } while (current != null);
    if (!rootNode.equals(list.peekFirst())) {
      throw new MemInspectorException("first node must be root node");
    }
View Full Code Here

Examples of net.sf.joafip.meminspector.entity.INodeForObject

  }

  public Component getTreeCellRendererComponent(final JTree tree,
      final Object value, final boolean selected, final boolean expanded,
      final boolean leaf, final int row, final boolean hasFocus) {
    final INodeForObject nodeForObject = (INodeForObject) value;
    //final TreePath path = tree.getPathForRow(row);
    //String field;
    final boolean fieldIsStatic=false;
//    if (path == null) {
//      field = "-no path for row-";
//      fieldIsStatic = false;
//    } else {
//      final TreePath parentPath = path.getParentPath();
//      if (/* nodeForObject.isLeafNode() || */parentPath == null) {
//        field = "";
//        fieldIsStatic = false;
//      } else {
//        final INodeForObject parentNode = (INodeForObject) parentPath
//            .getLastPathComponent();
//        final String field2 = parentNode.getField(nodeForObject);
//        if (field2 == null) {
//          field = " -" + parentNode.getId() + " have not child #"
//              + nodeForObject.getId() + "-";
//          fieldIsStatic = false;
//        } else {
//          field = " " + field2;
//          final Boolean fieldIsStatic2 = parentNode
//              .fieldIsStatic(nodeForObject);
//          if (fieldIsStatic2 == null) {
//            fieldIsStatic = false;
//          } else {
//            fieldIsStatic = fieldIsStatic2;
//          }
//        }
//      }
//    }

    final Font font = tree.getFont();
    setFont(font);

    try {
      final StringBuilder stringBuilder=new StringBuilder();
      stringBuilder.append(nodeForObject.identificationString());
      setText(stringBuilder.toString());
     
//      if (nodeForObject == null) {
//        setText("null");
//      } else {
//        final String string = nodeForObject.identificationString();
//        if (string == null) {
//          setText("<null string>");
//        } else {
//          setText(string + field);
//        }
//      }
     
      Icon icon;
      if (nodeForObject.isLeafNode()) {
        if (nodeForObject.isMarkedNew()) {
          icon = fieldIsStatic ? sobjectLeafNewIcon
              : objectLeafNewIcon;
        } else if (nodeForObject.isMarkedNewSon()) {
          icon = fieldIsStatic ? sobjectLeafNewSonIcon
              : objectLeafNewSonIcon;
        } else {
          icon = fieldIsStatic ? sobjectLeafIcon : objectLeafIcon;
        }
      } else {
        if (nodeForObject.isMarkedNew()) {
          icon = fieldIsStatic ? sobjectNewIcon : objectNewIcon;
        } else if (nodeForObject.isMarkedNewSon()) {
          icon = fieldIsStatic ? sobjectNewSonIcon : objectNewSonIcon;
        } else {
          icon = fieldIsStatic ? sobjectIcon : objectIcon;
        }
      }
View Full Code Here

Examples of net.sf.joafip.meminspector.entity.INodeForObject

        if (!event.getValueIsAdjusting()) {
          final ListSelectionModel lsm = (ListSelectionModel) event
              .getSource();
          if (!lsm.isSelectionEmpty()) {
            final int selectedRow = lsm.getMinSelectionIndex();
            final INodeForObject fatherNode = ((NodeInfo) dataModel
                .getValueAt(selectedRow, 0)).getNodeForObject();
            try {
              listener.fatherNodeSelected(fatherNode, node);
            } catch (MemInspectorException exception) {
              LOGGER.error("error processing row selected event",
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.