ilog.cpl.tree
Class IlpTreeView

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JTree
                  extended by ilog.cpl.tree.IlpTreeView
All Implemented Interfaces:
IlpStylable, AdapterListener, ilog.cpl.graphic.css.internal.IlpCSSGraphicView, IlpGraphicView, IlpStylableGraphicView, IlvStylable, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, Scrollable

public class IlpTreeView
extends JTree
implements IlpStylableGraphicView, ilog.cpl.graphic.css.internal.IlpCSSGraphicView, AdapterListener

Graphic view part of the MVC architecture for the tree component.

This class displays the content of a TreeModel object in the form of a tree.

In addition to the common 'what is highlighted is what is selected' paradigm, this tree offers an alternate look-and-feel using check boxes to render/manipulate the selection. See setSelectionLookAndFeel(int).

Since:
JTGO 3.0
See Also:
Serialized Form

Nested Class Summary
protected  class IlpTreeView.IlpTreeModelHandler
          Listens to the model and updates the graphic representation of the nodes accordingly when nodes are changed.
 
Nested classes/interfaces inherited from class javax.swing.JTree
JTree.AccessibleJTree, JTree.DynamicUtilTreeNode, JTree.EmptySelectionModel, JTree.TreeModelHandler, JTree.TreeSelectionRedirector
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static int CHECKBOX_SELECTION_LOOK_AND_FEEL
          Selection is displayed/modified by check boxes.
static String HIGHLIGHT_MODE_PROPERTY
          Bound property name for highlightMode.
static int HIGHLIGHT_SELECTION_LOOK_AND_FEEL
          Selection is displayed/modified by highlighting nodes.
static int LEAD_SELECTION_HIGHLIGHT
          Only the lead selection is highlighted.
static int SELECTED_SELECTION_HIGHLIGHT
          The selected objects from the selection model are highlighted.
static String SELECTION_CHECKBOX_VISIBLE_PROPERTY
          Bound property name for selectionCheckBoxVisible.
 
Fields inherited from class javax.swing.JTree
ANCHOR_SELECTION_PATH_PROPERTY, CELL_EDITOR_PROPERTY, CELL_RENDERER_PROPERTY, cellEditor, cellRenderer, editable, EDITABLE_PROPERTY, EXPANDS_SELECTED_PATHS_PROPERTY, INVOKES_STOP_CELL_EDITING_PROPERTY, invokesStopCellEditing, LARGE_MODEL_PROPERTY, largeModel, LEAD_SELECTION_PATH_PROPERTY, ROOT_VISIBLE_PROPERTY, rootVisible, ROW_HEIGHT_PROPERTY, rowHeight, SCROLLS_ON_EXPAND_PROPERTY, scrollsOnExpand, SELECTION_MODEL_PROPERTY, selectionModel, selectionRedirector, SHOWS_ROOT_HANDLES_PROPERTY, showsRootHandles, TOGGLE_CLICK_COUNT_PROPERTY, toggleClickCount, TREE_MODEL_PROPERTY, treeModel, treeModelListener, VISIBLE_ROW_COUNT_PROPERTY, visibleRowCount
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface ilog.cpl.css.IlpStylable
UPDATE_ALL_MASK, UPDATE_COMPONENT_MASK, UPDATE_NONE_MASK, UPDATE_OBJECTS_MASK
 
Fields inherited from interface ilog.views.util.styling.IlvStylable
APPLIED_RULE_MASK, BAD_CLASS_MASK, BAD_PROP_MASK, BAD_PROP_WITH_STACK_MASK, CREATED_MASK, DECL_MASK, DECL_VALUE_MASK, FAILED_CONVERSIONS_MASK, TIME_REPORT_MASK, WARNING_PROP_MASK
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
IlpTreeView()
          Creates an IlpTreeView object.
 
Method Summary
 void addPseudoClass(IlpObject bo, String pseudo)
          Adds a pseudoclass to the specified business object.
 void addPseudoClass(IlpRepresentationObject ro, String pseudo)
          Adds a pseudoclass to the given representation object.
protected  TreePath createPathForNode(TreeNode node)
          Creates a tree path for the given node.
protected  TreeModelListener createTreeModelListener()
          Creates and returns an instance of IlpTreeModelHandler.
 boolean ensureVisible(IlpObject object)
          Scrolls the view in such a way that a given object becomes visible.
 boolean ensureVisible(IlpRepresentationObject ro)
          Scrolls the view in such a way that a given representation object becomes visible.
 IlpAttribute getAttribute(IlpPoint viewLocation)
          Returns the IlpAttribute object at the given position in this object.
 boolean getCollapseUnselectsDescendants()
          Returns true if collapsing a node deselects its descendants.
 Container getContainer()
          Returns the concrete container where the graphics are currently being displayed.
 IlpContext getContext()
          Returns the application context.
 IlpGraphicController getController()
          Returns the controller, which is responsible for the interaction between the user and the view.
 IlpGraphic getGraphic(IlpPoint viewLocation)
          Returns the IlpGraphic object at the given position in this object.
 Class getGraphicComponentClass()
          Returns the graphic component class supported by this implementation of graphic view.
 IlpGraphicHolder getGraphicHolder()
          Returns the association between object representations and graphics.
 int getHighlightMode()
          Returns the highlight mode.
 IlpGraphic getInnermostGraphic(IlpPoint viewLocation)
          Returns the innermost graphic at the given position in this object.
 List getPseudoClasses(IlpRepresentationObject ro, IlpAttribute a)
          Returns the custom pseudoclasses currently active for the object
 IlpRepresentationObject getRepresentationObject(IlpPoint viewLocation)
          Returns the IlpRepresentationObject object at the given position in this object.
 IlpRepresentationObjectMapper getRepresentationObjectMapper()
          Returns the mapper that allows the tree view to know the correspondence between IlpRepresentationObject and IlpObject.
 IlpRepresentationObjectSelectionModel getRepresentationObjectSelectionModel()
          Returns the IlpRepresentationObjectSelectionModel used to handle the selection of representation objects.
 IlpGraphicViewStyleManager getStyleManager()
          Deprecated. The Style API has been replaced by the Cascading Style Sheet mechanism. Please use the method setStyleSheets or getStyleSheets instead.
 int getStyleSheetDebugMask()
          Returns the current debug level.
 String[] getStyleSheets()
          Returns the cascading style sheets.
 String getStyleSheets(int index)
          Returns one of the cascading style sheets.
 ilog.cpl.tree.internal.IlpTreeViewSupport getTreeViewSupport()
          useful for our friend: the controller.
 String getUIClassID()
          Returns the name of the L&F class that renders this component.
 ilog.cpl.graphic.css.internal.IlpViewCSSContext getViewCSSContext()
          Returns the context information that provides Cascading Style Sheets support for this graphic view.
 boolean hasStyleSheets()
          Returns true if style sheets have been defined for this view.
 void invalidate(IlpRepresentationObject ro)
          Invalidates the graphic representation of the given object.
 void invalidateGraphics()
          Invalidates all the graphic representations in this view.
 void invalidateLayoutCache()
          This is a convenient method to allow for explicitely invalidating the layout cache.
 void invalidateLayoutCache(IlpRepresentationObject ro)
          This is a convenient method to allow for explicitely invalidating the layout cache for a specific object.
 boolean isSelectionCheckBoxVisible()
          Indicates whether the selected nodes are displayed using check boxes.
protected  boolean removeDescendantSelectedPaths(TreePath path, boolean includePath)
          Removes any paths in the selection that are descendants of path.
 void removePseudoClass(IlpObject bo, String pseudo)
          Removes a pseudoclass from the specified business object.
 void removePseudoClass(IlpRepresentationObject ro, String pseudo)
          Removes a pseudoclass from the given representation object.
 void representationObjectsAdded(AdapterEvent e)
          Called when objects have been added to the adapter.
 void representationObjectsRemoved(AdapterEvent e)
          Called when objects have been removed from the adapter.
 void setCollapseUnselectsDescendants(boolean collapseUnselectsDescendants)
          Sets the descendants of a collapsed node to be deselected or not.
 void setController(IlpGraphicController controller)
          Sets the controller, which is responsible for the interaction between the user and the view.
 void setHighlightMode(int highlightMode)
          Sets the mode used to determine whether a cell is highlighted or not.
 void setModel(TreeModel newModel)
          Sets the TreeModel that will provide the data.
 void setRepresentationObjectMapper(IlpRepresentationObjectMapper mapper)
          Sets a mapper that allows the tree view to know the correspondence between IlpRepresentationObject and IlpObject
 void setSelectionCheckBoxVisible(boolean selectionCheckBoxVisible)
          Activates or deactivates the use of check boxes to display and modify the selection status of nodes.
 void setSelectionLookAndFeel(int selectionLookAndFeel)
          Sets the way the selection is rendered to/manipulated by the end-user.
 void setStyleManager(IlpGraphicViewStyleManager config)
          Deprecated. The Style API has been replaced by the Cascading Style Sheet mechanism. Please use the method setStyleSheets or getStyleSheets instead.
 void setStyleSheetDebugMask(int mask)
          Sets the debug level while parsing the style sheets.
 void setStyleSheets(int index, String css)
          Changes one of the cascading style sheets.
 void setStyleSheets(int index, String css, int updateMask)
          Changes one of the cascading style sheets.
 void setStyleSheets(String[] css)
          Sets the cascading style sheets.
 void setStyleSheets(String[] css, int updateMask)
          Sets the cascading style sheets.
 
Methods inherited from class javax.swing.JTree
addSelectionInterval, addSelectionPath, addSelectionPaths, addSelectionRow, addSelectionRows, addTreeExpansionListener, addTreeSelectionListener, addTreeWillExpandListener, cancelEditing, clearSelection, clearToggledPaths, collapsePath, collapseRow, convertValueToText, createTreeModel, expandPath, expandRow, fireTreeCollapsed, fireTreeExpanded, fireTreeWillCollapse, fireTreeWillExpand, fireValueChanged, getAccessibleContext, getAnchorSelectionPath, getCellEditor, getCellRenderer, getClosestPathForLocation, getClosestRowForLocation, getDefaultTreeModel, getDescendantToggledPaths, getDragEnabled, getEditingPath, getExpandedDescendants, getExpandsSelectedPaths, getInvokesStopCellEditing, getLastSelectedPathComponent, getLeadSelectionPath, getLeadSelectionRow, getMaxSelectionRow, getMinSelectionRow, getModel, getNextMatch, getPathBetweenRows, getPathBounds, getPathForLocation, getPathForRow, getPreferredScrollableViewportSize, getRowBounds, getRowCount, getRowForLocation, getRowForPath, getRowHeight, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getScrollsOnExpand, getSelectionCount, getSelectionModel, getSelectionPath, getSelectionPaths, getSelectionRows, getShowsRootHandles, getToggleClickCount, getToolTipText, getTreeExpansionListeners, getTreeSelectionListeners, getTreeWillExpandListeners, getUI, getVisibleRowCount, hasBeenExpanded, isCollapsed, isCollapsed, isEditable, isEditing, isExpanded, isExpanded, isFixedRowHeight, isLargeModel, isPathEditable, isPathSelected, isRootVisible, isRowSelected, isSelectionEmpty, isVisible, makeVisible, paramString, removeDescendantToggledPaths, removeSelectionInterval, removeSelectionPath, removeSelectionPaths, removeSelectionRow, removeSelectionRows, removeTreeExpansionListener, removeTreeSelectionListener, removeTreeWillExpandListener, scrollPathToVisible, scrollRowToVisible, setAnchorSelectionPath, setCellEditor, setCellRenderer, setDragEnabled, setEditable, setExpandedState, setExpandsSelectedPaths, setInvokesStopCellEditing, setLargeModel, setLeadSelectionPath, setRootVisible, setRowHeight, setScrollsOnExpand, setSelectionInterval, setSelectionModel, setSelectionPath, setSelectionPaths, setSelectionRow, setSelectionRows, setShowsRootHandles, setToggleClickCount, setUI, setVisibleRowCount, startEditingAtPath, stopEditing, treeDidChange, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsE