Changeset 5660
- Timestamp:
- 10/09/08 10:36:27 (6 weeks ago)
- Location:
- trunk/SRC/org/openmicroscopy/shoola/agents/editor
- Files:
-
- 3 modified
-
browser/FieldPanel.java (modified) (2 diffs)
-
browser/NavTree.java (modified) (2 diffs)
-
model/TreeModelMethods.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/org/openmicroscopy/shoola/agents/editor/browser/FieldPanel.java
r5626 r5660 63 63 import org.openmicroscopy.shoola.agents.editor.model.IField; 64 64 import org.openmicroscopy.shoola.agents.editor.model.Lock; 65 import org.openmicroscopy.shoola.agents.editor.model.TreeModelMethods; 65 66 import org.openmicroscopy.shoola.agents.editor.model.params.IParam; 66 67 import org.openmicroscopy.shoola.agents.editor.uiComponents.CustomButton; … … 506 507 paintedColour = getColorFromString(field.getAttribute( 507 508 Field.BACKGROUND_COLOUR)); 509 510 if (paintedColour == null) { 511 String ancestorColour = TreeModelMethods.getAttributeFromAncestor 512 (Field.BACKGROUND_COLOUR, treeNode); 513 paintedColour = getColorFromString(ancestorColour); 514 } 508 515 509 516 refreshHighlighted(); -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/browser/NavTree.java
r5590 r5660 70 70 /** 71 71 * Creates an instance of the Navigation tree, based on the model 72 * from mainTree. Also calls initialise() to add treeSelectionListeners and72 * from mainTree. Also calls #initialise() to add treeSelectionListeners and 73 73 * mouseListeners. 74 74 * … … 115 115 { 116 116 TreePath path = navTree.getSelectionPath(); 117 // path could be null if user double-clicks on expand-collapse 118 if (path == null) return; 117 119 118 120 mainTree.expandPath(path.getParentPath()); -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/model/TreeModelMethods.java
r5625 r5660 290 290 } 291 291 292 /** 293 * This method progressively checks the ancestors of the given node, 294 * looking for the closest ancestor that has a non-null value for 295 * the named attribute. 296 * The value of this attribute is returned for the closest ancestor. 297 * If the root node is reached (parent == null) then null is returned. 298 * 299 * @param attributeName The name of the attribute to query 300 * @param node The node to start at. 301 * 302 * @return String The value of the attribute from closest 303 * ancestor where this is not null. 304 */ 305 public static String getAttributeFromAncestor(String attributeName, 306 TreeNode node) 307 { 308 DefaultMutableTreeNode parent; 309 Object userObject; 310 IAttributes field; 311 String value; 312 313 parent = (DefaultMutableTreeNode)node.getParent(); 314 while(parent != null) { 315 userObject = parent.getUserObject(); 316 if (userObject instanceof IAttributes) { 317 field = (IAttributes)userObject; 318 value = field.getAttribute(attributeName); 319 if (value != null) { 320 return value; 321 } 322 } 323 parent = (DefaultMutableTreeNode)parent.getParent(); 324 } 325 326 return null; 327 } 292 328 }
