p3j.gui.panels.projections
Class ProjectionTreePanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by p3j.gui.panels.AbstractNavigationPanel
                      extended by p3j.gui.panels.projections.ProjectionTreePanel
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, IProjectionTree
Direct Known Subclasses:
ResultTreePanel

public class ProjectionTreePanel
extends AbstractNavigationPanel
implements IProjectionTree

Panel that displays a JTree in a ScrollPane and initializes them properly. Created: August 23, 2008

Author:
Christina Bohk, Roland Ewald
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
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.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ProjectionTreePanel(ProjectionModel proj, JPanel content)
          The Constructor.
 
Method Summary
protected  void addAssumptionsSubTree(ParameterInstanceNode root, Set set, ParameterInstance instance)
          Adds sub tree for ParameterAssignment entities.
protected  void addGenerationSubTree(SetNode root, List<ParameterInstance> instances)
          Adds sub-tree for a generation.
protected  void addInstancesSubTree(PopulationNode root, Set set, List<ParameterInstance> instances)
          Adds sub tree for ParameterInstance entities.
protected  void addPopulationsSubTree(ProjectionTreeNode<?> root, Set set, List<ParameterInstance> instances)
          Adds sub tree for populations.
protected  SetNode addSetSubTree(SetTypeNode root, Set set, SetType setType)
          Adds sub tree for Set.
protected  void addSetTypeSubTree(DefaultMutableTreeNode root, SetType setType)
          Adds sub tree for SetType.
 void cleanTree()
          Cleans the tree from unnecessary leaves.
protected  void cleanTree(ProjectionTreeNode<?> node)
          Recursively cleans up the tree.
 SetNode createNewSetStructure(SetTypeNode stNode, Set set)
          Creates all substructures for displaying a set.
protected  void initTree()
          Initializes projection tree.
 void nodeAdded(ParameterInstanceNode node, int index)
          Notifies tree that the given node as a new child at the given index.
 void recursiveRefresh(ProjectionTreeNode<?> node)
          Recursively refreshes the node names of node in the sub-tree below the given node.
 void refreshNode(ProjectionTreeNode<?> node)
          Refresh a single node in the tree.
 void refreshNodeSubStructure(ProjectionTreeNode<?> node)
          Refreshed the sub-structures of the node in the tree.
 void removeNode(ProjectionTreeNode<?> node)
          Removes given node.
 void removeNodes(ProjectionTreeNode<?> node, Collection<? extends Object> repRemovObjects)
          Removes all nodes that represent the objects given in the collection.
 void selectNode(ProjectionTreeNode<?> node)
          Selects a given node.
 void totalRefresh()
          Totally refreshes the projection tree.
 
Methods inherited from class p3j.gui.panels.AbstractNavigationPanel
getContentPanel, getProjectionModel, getScrollPane, getTree, getTreeModel, setProjection, setScrollPane, setTree, setTreeModel
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, 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, getBaseline, getBaselineResizeBehavior, 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, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface p3j.gui.panels.projections.IProjectionTree
getTree, getTreeModel
 

Constructor Detail

ProjectionTreePanel

public ProjectionTreePanel(ProjectionModel proj,
                           JPanel content)
The Constructor.

Parameters:
proj - the projection model
content - the content pane (to display editing panels)
Method Detail

initTree

protected void initTree()
Initializes projection tree.

Specified by:
initTree in class AbstractNavigationPanel

addSetTypeSubTree

protected void addSetTypeSubTree(DefaultMutableTreeNode root,
                                 SetType setType)
Adds sub tree for SetType.

Parameters:
root - the root of this sub tree
setType - the Settype to be represented

addSetSubTree

protected SetNode addSetSubTree(SetTypeNode root,
                                Set set,
                                SetType setType)
Adds sub tree for Set.

Parameters:
root - the root of this sub tree
set - the set to be represented
setType - the Settype of this set
Returns:
the set node at the top of the subtree

addGenerationSubTree

protected void addGenerationSubTree(SetNode root,
                                    List<ParameterInstance> instances)
Adds sub-tree for a generation. A generation is the set of all instances that define parameters for a specific generation.

Parameters:
root - the root of this sub tree
instances - the list of parameter instances of this generation

addPopulationsSubTree

protected void addPopulationsSubTree(ProjectionTreeNode<?> root,
                                     Set set,
                                     List<ParameterInstance> instances)
Adds sub tree for populations.

Parameters:
root - the root of this sub tree
set - the set containing the assumptions for the instances
instances - list of instances

addInstancesSubTree

protected void addInstancesSubTree(PopulationNode root,
                                   Set set,
                                   List<ParameterInstance> instances)
Adds sub tree for ParameterInstance entities.

Parameters:
root - the root of the sub tree
set - the set containing the assumptions for the instances
instances - the instances that will be nodes

addAssumptionsSubTree

protected void addAssumptionsSubTree(ParameterInstanceNode root,
                                     Set set,
                                     ParameterInstance instance)
Adds sub tree for ParameterAssignment entities.

Parameters:
root - the root node for this sub tree
set - the set in which the assignments are defined
instance - the instance to which the assignments belong

refreshNode

public void refreshNode(ProjectionTreeNode<?> node)
Description copied from interface: IProjectionTree
Refresh a single node in the tree.

Specified by:
refreshNode in interface IProjectionTree
Parameters:
node - the node to be refreshed

refreshNodeSubStructure

public void refreshNodeSubStructure(ProjectionTreeNode<?> node)
Description copied from interface: IProjectionTree
Refreshed the sub-structures of the node in the tree.

Specified by:
refreshNodeSubStructure in interface IProjectionTree
Parameters:
node - the node of which the sub-structures shall be refreshed

nodeAdded

public void nodeAdded(ParameterInstanceNode node,
                      int index)
Description copied from interface: IProjectionTree
Notifies tree that the given node as a new child at the given index.

Specified by:
nodeAdded in interface IProjectionTree
Parameters:
node - node with new child
index - index of the new child

selectNode

public void selectNode(ProjectionTreeNode<?> node)
Description copied from interface: IProjectionTree
Selects a given node.

Specified by:
selectNode in interface IProjectionTree
Parameters:
node - the node to be selected

recursiveRefresh

public void recursiveRefresh(ProjectionTreeNode<?> node)
Description copied from interface: IProjectionTree
Recursively refreshes the node names of node in the sub-tree below the given node.

Specified by:
recursiveRefresh in interface IProjectionTree
Parameters:
node - the node of which the subtree shall be refreshed

removeNode

public void removeNode(ProjectionTreeNode<?> node)
Description copied from interface: IProjectionTree
Removes given node.

Specified by:
removeNode in interface IProjectionTree
Parameters:
node - the node to be removed

removeNodes

public void removeNodes(ProjectionTreeNode<?> node,
                        Collection<? extends Object> repRemovObjects)
Description copied from interface: IProjectionTree
Removes all nodes that represent the objects given in the collection.

Specified by:
removeNodes in interface IProjectionTree
Parameters:
node - the node from which to start looking
repRemovObjects - collection of the represented object of the nodes to be removed

cleanTree

public void cleanTree()
Description copied from interface: IProjectionTree
Cleans the tree from unnecessary leaves. This could be an empty generation etc.

Specified by:
cleanTree in interface IProjectionTree

cleanTree

protected void cleanTree(ProjectionTreeNode<?> node)
Recursively cleans up the tree.

Parameters:
node - the current node

createNewSetStructure

public SetNode createNewSetStructure(SetTypeNode stNode,
                                     Set set)
Description copied from interface: IProjectionTree
Creates all substructures for displaying a set.

Specified by:
createNewSetStructure in interface IProjectionTree
Parameters:
stNode - the Settype node the set belongs to
set - the set for which the structure shall be created
Returns:
the set node at the top of the subtree

totalRefresh

public void totalRefresh()
Description copied from interface: IProjectionTree
Totally refreshes the projection tree. All nodes beneath the ProjectionNode are re-created and re-initialized.

Specified by:
totalRefresh in interface IProjectionTree


Copyright © 2012. All Rights Reserved.