예제 #1
0
 /*
  * @see javax.swing.tree.TreeNode#isLeaf()
  */
 @Override
 public boolean isLeaf() {
   if (!expanded) {
     model.updateChildren(new TreePath(model.getPathToRoot(this)));
     expanded = true;
   }
   return super.isLeaf();
 }
예제 #2
0
 /** @param node the modified node in the tree */
 public void nodeModified(Object node) {
   if (modifySet.contains(node)) {
     model.getNodeUpdater().schedule(this);
   }
   if (node == getUserObject()) {
     model.nodeChanged(this);
   }
 }
예제 #3
0
 /*
  * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
  */
 public void propertyChange(PropertyChangeEvent evt) {
   if (evt.getSource() instanceof Diagram) {
     if ("name".equals(evt.getPropertyName())) {
       /* The name of the UMLDiagram
        * represented by this node has changed. */
       model.nodeChanged(this);
     }
     if ("namespace".equals(evt.getPropertyName())) {
       /* TODO: Update the old and new node above this!
        * This is issue 5079.
        * The old and new UML namespaces are in the event, but
        * how do we know which nodes to refresh?
        * And how to refresh?
        * Not necessarily the namespaces,
        * depending on the perspective. */
     }
   }
 }