|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JLayeredPane | +--javax.swing.JDesktopPane | +--TreeJDesktop
The JDesktop class intended for a tree structure. Within this class, the panels for the trees are constructed as are the JPanel panes to hold them and the internal frames and tabbed pane.
The desktop listens for OptionEvents specific to a chosen tree, and calls that required command for the selected panel (whether it is tabbed pane or a selected window). Also, the desktop listens for events affecting all trees. The only events that bypass the desktop are those based upon clicking upon the tree.
Nested Class Summary |
Nested classes inherited from class javax.swing.JDesktopPane |
javax.swing.JDesktopPane.AccessibleJDesktopPane |
Nested classes inherited from class javax.swing.JLayeredPane |
javax.swing.JLayeredPane.AccessibleJLayeredPane |
Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary |
Fields inherited from class javax.swing.JDesktopPane |
LIVE_DRAG_MODE, OUTLINE_DRAG_MODE |
Fields inherited from class javax.swing.JLayeredPane |
DEFAULT_LAYER, DRAG_LAYER, FRAME_CONTENT_LAYER, LAYER_PROPERTY, MODAL_LAYER, PALETTE_LAYER, POPUP_LAYER |
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 | |
TreeJDesktop()
Sole Constructor, which constructs all of the tree panels and sets up all of the listening. |
Method Summary | |
void |
addMouseListener(java.awt.event.MouseListener l)
Adds the specified mouse listener to receive mouse events from this component. |
void |
addMouseMotionListener(java.awt.event.MouseMotionListener l)
Adds the specified mouse motion listener to receive mouse motion events from this component. |
void |
addOptionListener(OptionListener l)
Adds an OptionEventListener according to the OptionEventListener interface and the OptionEvent . |
void |
addTreeMessageListener(TreeMessageListener l)
Adds an TreeMessageListener from the TREE, according to the TreeMessageListener interface and the TreeMessageEvent . |
protected void |
constructMessage()
Constructs the message for the creating of a tree with random elements. |
javax.swing.Icon |
getIcon(java.lang.String imageName)
Gets the icon from the resource (JAR file). |
javax.swing.JPanel |
getSelectedPanel()
Gets the currently selected panel, whether it is the panel selected of the windows or whether it is the selected tabbed pane. |
void |
initialize()
Original intialization. |
boolean |
isWindows()
Gets if the desktop is set up in windows format or tabbed pabe format. |
void |
makeRandomTree(java.lang.String startKey,
java.lang.String endKey,
int size,
boolean duplicates)
Constructs a random Tree for every tree currently in the desktop. |
void |
makeTabbedPane()
Makes a tabbedPane. |
void |
makeWindows()
Makes the windows for the Desktop. |
protected void |
messageAction(java.lang.String msg,
java.lang.Object msgObj)
Calls all of the treeListeners of the Tree and passes the tree message information information regarding the status of the Tree. |
protected void |
optionEvent(OptionEvent e)
Sends an optionEvent to all listeners of the current OptionEvents. |
protected void |
optionEvent(OptionEvent e,
OptionListener l)
Sends an optionEvent to all listeners of the current OptionEvents. |
void |
optionEventPerformed(OptionEvent e)
Option event listener. |
void |
removeMouseListener(java.awt.event.MouseListener l)
Removes the specified mouse listener so that it no longer receives mouse events from this component. |
void |
removeMouseMotionListener(java.awt.event.MouseMotionListener l)
Removes the specified mouse motion listener so that it no longer receives mouse motion events from this component. |
void |
removeOptionListener(TreeMessageListener l)
Removes an OptionEventListener according to the OptionEventListener interface and the OptionEvent . |
void |
removeTreeMessageListener(TreeMessageListener l)
Removes an TreeMessageListener from the TREE, according to the TreeMessageListener interface and the TreeMessageEvent . |
void |
setSelectedFrame(javax.swing.JInternalFrame f)
Overides the desktop method, to add functionality, by passing information about the changed frame by tree message. |
protected void |
setWindows(boolean windows)
Sets whether the desktop is set as windows or tabbed pane. |
void |
stateChanged(javax.swing.event.ChangeEvent e)
Implements Change Listener. |
void |
treeMessageEventPerformed(TreeMessageEvent e)
Listens to tree message events. |
Methods inherited from class javax.swing.JDesktopPane |
getAccessibleContext, getAllFrames, getAllFramesInLayer, getDesktopManager, getDragMode, getSelectedFrame, getUI, getUIClassID, isOpaque, paramString, setDesktopManager, setDragMode, setUI, updateUI |
Methods inherited from class javax.swing.JLayeredPane |
addImpl, getComponentCountInLayer, getComponentsInLayer, getComponentToLayer, getIndexOf, getLayer, getLayer, getLayeredPaneAbove, getObjectForLayer, getPosition, highestLayer, insertIndexForLayer, isOptimizedDrawingEnabled, lowestLayer, moveToBack, moveToFront, paint, putLayer, remove, setLayer, setLayer, setPosition |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseWheelListener, 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 |
Constructor Detail |
public TreeJDesktop()
Method Detail |
public void initialize()
public void makeWindows()
public void makeTabbedPane()
public boolean isWindows()
public javax.swing.JPanel getSelectedPanel()
protected void setWindows(boolean windows)
windows
- boolean true if the format is as windows.public void addOptionListener(OptionListener l)
OptionEvent
.
l
- the listener added recieves the OptionEvents occuring.public void removeOptionListener(TreeMessageListener l)
OptionEvent
.
l
- the listener removed from recieving the OptionEvents occuring.protected void optionEvent(OptionEvent e)
e
- the option event to be passed on.protected void optionEvent(OptionEvent e, OptionListener l)
e
- the option event to be passed on.l
- the specific optionListener to recieve the event.public void addTreeMessageListener(TreeMessageListener l)
TreeMessageEvent
.
l
- the listener added recieves the TreeMessageEvents occuring.public void removeTreeMessageListener(TreeMessageListener l)
TreeMessageEvent
.
l
- the listener removed from recieving the TreeMessageEvents occuring.protected void messageAction(java.lang.String msg, java.lang.Object msgObj)
public void addMouseListener(java.awt.event.MouseListener l)
addMouseListener
in class java.awt.Component
l
- the mouse listener.public void removeMouseListener(java.awt.event.MouseListener l)
removeMouseListener
in class java.awt.Component
l
- the mouse listener.public void addMouseMotionListener(java.awt.event.MouseMotionListener l)
addMouseMotionListener
in class java.awt.Component
l
- the mouse motion listener.public void removeMouseMotionListener(java.awt.event.MouseMotionListener l)
removeMouseMotionListener
in class java.awt.Component
l
- the mouse motion listener.public void treeMessageEventPerformed(TreeMessageEvent e)
treeMessageEventPerformed
in interface TreeMessageListener
e
- TreeMessageEvent that contains information about the tree.public void makeRandomTree(java.lang.String startKey, java.lang.String endKey, int size, boolean duplicates)
startKey
- the starting key for the random tree.endKey
- the ending key for the random tree.size
- the size of the random tree created.duplicates
- true if duplicates are allowed in the list.protected void constructMessage()
public javax.swing.Icon getIcon(java.lang.String imageName)
public void optionEventPerformed(OptionEvent e)
optionEventPerformed
in interface OptionListener
e
- OptionEvent passed with information about the event.public void stateChanged(javax.swing.event.ChangeEvent e)
stateChanged
in interface javax.swing.event.ChangeListener
e
- ChangeEvent passed when the state changes.public void setSelectedFrame(javax.swing.JInternalFrame f)
setSelectedFrame
in class javax.swing.JDesktopPane
f
- JInternalFrame that is selected.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |