JBframe by OOIT.com

com.ooit.jbframe
Class JBDefaultFrame

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--com.ooit.jbframe.JBDefaultFrame

public class JBDefaultFrame
extends javax.swing.JPanel
implements javax.swing.event.TreeSelectionListener, JBFrame

OOIT.com's JBFrame reference implementation.

Things which are still planned:

Please, check out the OOIT.com JBFrame site for updates.

This class can be used as a regular Swing component. It does not include a top level component.

See Also:
Serialized Form

Inner Class Summary
 class JBDefaultFrame.ExitAction
          Exit action for closing the application.
 
Inner classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
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
 
Constructor Summary
JBDefaultFrame()
          Initialize Framework with no constructor.
 
Method Summary
 void addNode(JBAdapter adapter)
          Add an adapter node.
static JBDefaultFrame getInstance()
          Singleton access.
 javax.swing.JMenuBar getMenuBar()
           
 javax.swing.JTree getNavigatorTree()
          Get the navigator tree.
 javax.swing.JToolBar getToolbar()
           
 void gotoNode(JBAdapter newAdapter)
          Sets the component identified by the subject to front.
static void initTreeIcons()
          Init function for setting nice tree icons.
 void removeAllNodes()
          All adapters are discarded and the discard action events are sent.
 void removeNode(JBAdapter adapter)
          Remove an adapter node from the JBFrame.
 void setMenuBar(javax.swing.JMenuBar menubar)
          Setting the default menu bar.
 void setToolbar(javax.swing.JToolBar toolbar)
           
 void valueChanged(javax.swing.event.TreeSelectionEvent ae)
          Value change listener for the tree.
 void writeStatusMessage(java.lang.String message)
          Write a message to the status bar
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, paramString, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, processComponentKeyEvent, processFocusEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setCursor, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JBDefaultFrame

public JBDefaultFrame()
Initialize Framework with no constructor. Usually the Singleton access getInstance() is used. But using multi JBDefaultFrame objects is ok.
Method Detail

getInstance

public static JBDefaultFrame getInstance()
Singleton access.

gotoNode

public void gotoNode(JBAdapter newAdapter)
Sets the component identified by the subject to front.
Specified by:
gotoNode in interface JBFrame
Parameters:
subject - the subject under which the component is known.

addNode

public void addNode(JBAdapter adapter)
Add an adapter node.
Specified by:
addNode in interface JBFrame
Parameters:
adapter - the adapter node to add.

removeNode

public void removeNode(JBAdapter adapter)
Description copied from interface: JBFrame
Remove an adapter node from the JBFrame.
Specified by:
removeNode in interface JBFrame
Tags copied from interface: JBFrame
Parameters:
adapter - the adapter node to be removed.

setToolbar

public void setToolbar(javax.swing.JToolBar toolbar)

getToolbar

public javax.swing.JToolBar getToolbar()
Returns:
the default toolbar from the frame.

writeStatusMessage

public void writeStatusMessage(java.lang.String message)
Description copied from interface: JBFrame
Write a message to the status bar
Specified by:
writeStatusMessage in interface JBFrame

getMenuBar

public javax.swing.JMenuBar getMenuBar()
Returns:
the main menu bar.

setMenuBar

public void setMenuBar(javax.swing.JMenuBar menubar)
Setting the default menu bar. The additional menus of the adapter will be added to the menu bar.
Returns:
the main menu bar.

valueChanged

public void valueChanged(javax.swing.event.TreeSelectionEvent ae)
Value change listener for the tree.
Specified by:
valueChanged in interface javax.swing.event.TreeSelectionListener

removeAllNodes

public void removeAllNodes()
All adapters are discarded and the discard action events are sent.

The order of the removal is bottom up. That means, the children are always remove before their parents.


getNavigatorTree

public javax.swing.JTree getNavigatorTree()
Get the navigator tree.
Returns:
the navigator tree.

initTreeIcons

public static void initTreeIcons()
Init function for setting nice tree icons.

This method has to be called before any initialisation of a JBFrame.


JBframe by OOIT.com