public class TreePanel extends AbstractPanelGroup implements Serializable
Graphical interface that's a JPanel
with an inner JSplitPane
that
contains the IPanel
's grouped in a JTree
.
When user selects one of them, at the tree, that's displayed at the right pane of the split pane, and user can work with it.
AbstractPanelGroup
,
Serialized FormModifier and Type | Class and Description |
---|---|
protected class |
TreePanel.DefaultPanel
A trivial implementation of
AbstractPanel used in the
initialization of the jSplitPane attribute. |
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
ACCEPT_ACTION, accepted, APPLY_ACTION, CANCEL_ACTION, parentPanelGroup, reference, registeredPanels
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
TreePanel(Object reference)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addPanelImpl(IPanel panel)
Has the algorithms that allows adding a panel to the JTree component.
|
protected void |
addPanelSortOrdered(IPanel panel)
Has the algorithms that allows adding a panel to the JTree component, considering the position
of that panel in the group, and the group position in the JTree.
|
void |
addTreeSelectionListener(TreeSelectionListener tsl) |
IPanel |
getActivePanel()
Gets a reference to the active panel in this group.
|
protected AbstractPanel |
getDefaultPanel()
This method initializes
defaultPanel . |
int |
getDividerLocation() |
int |
getDividerSize() |
protected JSplitPane |
getJSplitPane()
This method initializes
jSplitPane . |
protected JTree |
getJTree()
This method initializes
jTree . |
int |
getPanelInGUICount()
Returns the number of panels registered in this group that are in GUI.
|
protected DefaultMutableTreeNode |
getRootNode()
This method initializes
rootNode . |
TreePath |
getSelectionPath() |
protected JScrollPane |
getTreeJScrollPane()
This method initialiazes
jScrollPane . |
protected DefaultTreeModel |
getTreeModel()
This method initializes
treeModel . |
TreeSelectionListener[] |
getTreeSelectionListeners() |
protected void |
initialize()
This method is used by each concrete implementation of
AbstractPanelGroup to
execute its particular initialization tasks. |
protected boolean |
isPanelAtBranch(IPanel panel,
DefaultMutableTreeNode node)
Returns
true if the panel is a child of the tree node as parameter. |
boolean |
isPanelInGUI(IPanel panel)
Returns
true if the panel as parameter belongs to a this group and it's loaded in the graphical user interface;
otherwise returns false . |
protected void |
loadPanel(IPanel panel)
Loads a particular panel.
|
protected void |
removePanelImpl(IPanel panel)
Has the algorithms that allows removing a panel from the JTree component.
|
void |
removeTreeSelectionListener(TreeSelectionListener tsl) |
void |
setDividerLocation(int location) |
void |
setDividerSize(int newSize) |
void |
setPanelInGUI(IPanel panel,
boolean b)
Changes the visibility of an existent panel of this group.
|
void |
stateChanged(ChangeEvent e) |
protected void |
unLoadPanel(IPanel panel)
Unloads a particular panel.
|
accept, addPanel, apply, belongsThisGroup, cancel, getPanelCount, getProperties, getReference, isAccepted, isEnabledAcceptButton, isEnabledApplyButton, isEnabledCancelButton, isEnabledCloseButton, isEnabledExitButton, isEnabledHideDetailsButton, isEnabledNoButton, isEnabledPauseButton, isEnabledRestartButton, isEnabledSaveButton, isEnabledSeeDetailsButton, isEnabledYesButton, loadPanels, removePanel, setEnabledAcceptButton, setEnabledApplyButton, setEnabledCancelButton, setEnabledCloseButton, setEnabledExitButton, setEnabledHideDetailsButton, setEnabledNoButton, setEnabledPauseButton, setEnabledRestartButton, setEnabledSaveButton, setEnabledSeeDetailsButton, setEnabledYesButton, setParentPanelGroup, updateReference, values
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, 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
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, transferFocusDownCycle, validate, validateTree
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, 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, transferFocusBackward, transferFocusUpCycle
public TreePanel(Object reference)
Default constructor.
reference
- object that is ''semantically' or 'contextually' related to the group of panelsprotected void initialize()
AbstractPanelGroup
This method is used by each concrete implementation of AbstractPanelGroup
to
execute its particular initialization tasks.
initialize
in class AbstractPanelGroup
protected JSplitPane getJSplitPane()
This method initializes jSplitPane
.
protected AbstractPanel getDefaultPanel()
This method initializes defaultPanel
.
JSplitPane
object
when this object is createdprotected JTree getJTree()
This method initializes jTree
.
protected DefaultTreeModel getTreeModel()
This method initializes treeModel
.
protected DefaultMutableTreeNode getRootNode()
This method initializes rootNode
.
protected JScrollPane getTreeJScrollPane()
This method initialiazes jScrollPane
.
protected void loadPanel(IPanel panel)
AbstractPanelGroup
Loads a particular panel. It's supposed that this panel is valid.
loadPanel
in class AbstractPanelGroup
panel
- the panel to addAbstractPanelGroup.addPanel(IPanel)
,
AbstractPanelGroup.loadPanels(IPanelGroupLoader)
protected void addPanelImpl(IPanel panel)
Has the algorithms that allows adding a panel to the JTree component.
panel
- the panel to addAbstractPanelGroup.addPanel(IPanel)
protected void addPanelSortOrdered(IPanel panel)
Has the algorithms that allows adding a panel to the JTree component, considering the position of that panel in the group, and the group position in the JTree.
panel
- the panel to addAbstractPanelGroup.addPanel(IPanel)
protected void unLoadPanel(IPanel panel)
AbstractPanelGroup
Unloads a particular panel. It's supposed that this panel is valid.
unLoadPanel
in class AbstractPanelGroup
panel
- the panel to addAbstractPanelGroup.removePanel(IPanel)
,
AbstractPanelGroup.loadPanel(IPanel)
,
AbstractPanelGroup.loadPanels(IPanelGroupLoader)
protected void removePanelImpl(IPanel panel)
Has the algorithms that allows removing a panel from the JTree component.
panel
- the panel to removeAbstractPanelGroup.removePanel(IPanel)
public TreePath getSelectionPath()
JTree.getSelectionPath()
public IPanel getActivePanel()
IPanelGroup
Gets a reference to the active panel in this group.
getActivePanel
in interface IPanelGroup
null
if there is no any activepublic void stateChanged(ChangeEvent e)
stateChanged
in interface ChangeListener
stateChanged
in class AbstractPanelGroup
public void setPanelInGUI(IPanel panel, boolean b)
IPanelGroup
Changes the visibility of an existent panel of this group. If a panel changes to invisible, then that panel won't be accessible by the user interface. But if changes to visible and was invisible before, then will appear at the same position it was in the user interface. The position is according the order of the insertion at the group. Anyway, the group will have that panel.
setPanelInGUI
in interface IPanelGroup
panel
- reference to the panel with visibility has changed.b
- the new visibility for that panel.public boolean isPanelInGUI(IPanel panel)
IPanelGroup
Returns true
if the panel as parameter belongs to a this group and it's loaded in the graphical user interface;
otherwise returns false
.
isPanelInGUI
in interface IPanelGroup
true
if the panel as parameter belongs to a this group and it's loaded in the graphical user interface;
otherwise returns false
protected boolean isPanelAtBranch(IPanel panel, DefaultMutableTreeNode node)
Returns true
if the panel is a child of the tree node as parameter.
public void addTreeSelectionListener(TreeSelectionListener tsl)
public void removeTreeSelectionListener(TreeSelectionListener tsl)
public TreeSelectionListener[] getTreeSelectionListeners()
JTree.getTreeSelectionListeners()
public int getPanelInGUICount()
IPanelGroup
Returns the number of panels registered in this group that are in GUI.
getPanelInGUICount
in interface IPanelGroup
public int getDividerLocation()
JSplitPane.getDividerLocation()
public void setDividerLocation(int location)
JSplitPane.setDividerLocation(int)
public int getDividerSize()
JSplitPane.getDividerSize()
public void setDividerSize(int newSize)
JSplitPane#setDividerSize()