de.upb.swtpra05.group03.plugin
Class OrderTree

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JTree
                  extended byde.upb.swtpra05.group03.plugin.OrderTree
All Implemented Interfaces:
javax.accessibility.Accessible, javax.swing.event.ChangeListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.Scrollable, java.io.Serializable, javax.swing.event.TreeExpansionListener

class OrderTree
extends javax.swing.JTree
implements javax.swing.event.TreeExpansionListener, javax.swing.event.ChangeListener

The OrderTree is part of the OrderPanel and displays one specific order in a tree structure

Version:
$Revision: 1.3 $

Nested Class Summary
 
Nested classes inherited from class javax.swing.JTree
javax.swing.JTree.AccessibleJTree, javax.swing.JTree.DynamicUtilTreeNode, javax.swing.JTree.EmptySelectionModel, javax.swing.JTree.TreeModelHandler, javax.swing.JTree.TreeSelectionRedirector
 
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
(package private) static int defaultHeight
          No comment provided by developer, please add a comment to improve documentation.
private  int orderID
          No comment provided by developer, please add a comment to improve documentation.
private  javax.swing.tree.DefaultTreeCellRenderer renderer
          No comment provided by developer, please add a comment to improve documentation.
private  javax.swing.tree.DefaultMutableTreeNode root
          No comment provided by developer, please add a comment to improve documentation.
(package private) static int savedWidth
          No comment provided by developer, please add a comment to improve documentation.
private  javax.swing.tree.DefaultTreeModel treeModel
          No comment provided by developer, please add a comment to improve documentation.
private  javax.swing.tree.DefaultMutableTreeNode[] treeNodeArray
          No comment provided by developer, please add a comment to improve documentation.
(package private) static int[] TREENODEINFO
          Specifies which info of extendedOrder in which order will be displayed on the OrderTree -1 error, should not happen 0 id 1 startStationID 2 startStation 3 destinationStationID 4 destinationStation 5 penalty 6 profit 7 duration 8 destinationTimeLimit 9 numberOfPassengers 10 paymentMethod 11 NegotiationState as int 12 NegotiationState as string 13 ExecutionState as int 14 ExecutionState as string 15 BillingState as int 16 BillingState as string 99 Billingmethod + BillingState as string 100 id + major state (i.e. only the significant state gets displayed) 101 id + ExecutionState as string 102 id + major state + start to destination
 
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, 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.Container
 
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
(package private) OrderTree(ExtendedOrder eO)
          Constructor for class OrderTree, set a FlowLayout and the preferred and maximum size, builds the complete tree and sets the alignment
 
Method Summary
 int getID()
          Get the ID of the displayed order
static int getMaximizedHeight()
          Gets the maximized height
 void nodeChanged()
          This method is called to update the values in the tree
 void stateChanged(javax.swing.event.ChangeEvent e)
          This component sets its own preferred and maximized size if the overlaying component gets resized.
 void treeCollapsed(javax.swing.event.TreeExpansionEvent e)
          This component sets its own preferred and maximized size depending on the ExpansionState of the tree.
 void treeExpanded(javax.swing.event.TreeExpansionEvent e)
          This component sets its own preferred and maximized size depending on the ExpansionState of the tree.
 
Methods inherited from class javax.swing.JTree
addSelectionInterval, addSelectionPath, addSelectionPaths, addSelectionRow, addSelectionRows, addTreeExpansionListener, addTreeSelectionListener, addTreeWillExpandListener, cancelEditing, clearSelection, clearToggledPaths, collapsePath, collapseRow, convertValueToText, createTreeModel, createTreeModelListener, 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, getUIClassID, getVisibleRowCount, hasBeenExpanded, isCollapsed, isCollapsed, isEditable, isEditing, isExpanded, isExpanded, isFixedRowHeight, isLargeModel, isPathEditable, isPathSelected, isRootVisible, isRowSelected, isSelectionEmpty, isVisible, makeVisible, paramString, removeDescendantSelectedPaths, removeDescendantToggledPaths, removeSelectionInterval, removeSelectionPath, removeSelectionPaths, removeSelectionRow, removeSelectionRows, removeTreeExpansionListener, removeTreeSelectionListener, removeTreeWillExpandListener, scrollPathToVisible, scrollRowToVisible, setAnchorSelectionPath, setCellEditor, setCellRenderer, setDragEnabled, setEditable, setExpandedState, setExpandsSelectedPaths, setInvokesStopCellEditing, setLargeModel, setLeadSelectionPath, setModel, 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, 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, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, 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, addImpl, 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, 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, addMouseListener, addMouseMotionListener, 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, removeMouseListener, removeMouseMotionListener, 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
 

Field Detail

orderID

private int orderID
No comment provided by developer, please add a comment to improve documentation.


TREENODEINFO

static final int[] TREENODEINFO
Specifies which info of extendedOrder in which order will be displayed on the OrderTree -1 error, should not happen 0 id 1 startStationID 2 startStation 3 destinationStationID 4 destinationStation 5 penalty 6 profit 7 duration 8 destinationTimeLimit 9 numberOfPassengers 10 paymentMethod 11 NegotiationState as int 12 NegotiationState as string 13 ExecutionState as int 14 ExecutionState as string 15 BillingState as int 16 BillingState as string 99 Billingmethod + BillingState as string 100 id + major state (i.e. only the significant state gets displayed) 101 id + ExecutionState as string 102 id + major state + start to destination


defaultHeight

static int defaultHeight
No comment provided by developer, please add a comment to improve documentation.


savedWidth

static int savedWidth
No comment provided by developer, please add a comment to improve documentation.


treeModel

private javax.swing.tree.DefaultTreeModel treeModel
No comment provided by developer, please add a comment to improve documentation.


root

private javax.swing.tree.DefaultMutableTreeNode root
No comment provided by developer, please add a comment to improve documentation.


treeNodeArray

private javax.swing.tree.DefaultMutableTreeNode[] treeNodeArray
No comment provided by developer, please add a comment to improve documentation.


renderer

private javax.swing.tree.DefaultTreeCellRenderer renderer
No comment provided by developer, please add a comment to improve documentation.

Constructor Detail

OrderTree

OrderTree(ExtendedOrder eO)
Constructor for class OrderTree, set a FlowLayout and the preferred and maximum size, builds the complete tree and sets the alignment

Parameters:
eO - an ExtendedOrder object containing the order to display
Method Detail

getMaximizedHeight

public static int getMaximizedHeight()
Gets the maximized height

Returns:
The maximized height

treeExpanded

public void treeExpanded(javax.swing.event.TreeExpansionEvent e)
This component sets its own preferred and maximized size depending on the ExpansionState of the tree. This method get called if an event occured.

Specified by:
treeExpanded in interface javax.swing.event.TreeExpansionListener
Parameters:
e - The TreeExpansionEvent

treeCollapsed

public void treeCollapsed(javax.swing.event.TreeExpansionEvent e)
This component sets its own preferred and maximized size depending on the ExpansionState of the tree. This method get called if an event occured.

Specified by:
treeCollapsed in interface javax.swing.event.TreeExpansionListener
Parameters:
e - The TreeExpansionEvent

getID

public int getID()
Get the ID of the displayed order

Returns:
The OrderID as an integer

nodeChanged

public void nodeChanged()
This method is called to update the values in the tree


stateChanged

public void stateChanged(javax.swing.event.ChangeEvent e)
This component sets its own preferred and maximized size if the overlaying component gets resized. This method get called if such an event occures.

Specified by:
stateChanged in interface javax.swing.event.ChangeListener
Parameters:
e - The ChangeEvent