net.clackrouter.gui
Class ClackFramework

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 net.clackrouter.gui.ClackFramework
All Implemented Interfaces:
java.awt.event.ComponentListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class ClackFramework
extends javax.swing.JPanel
implements java.awt.event.ComponentListener

Core Clack class, which implements the main Clack panel. Based on GPGraphad.

A ClackGraphpad is created by the ClackFramework object and contains the menus, as well as the tabbed pane that contains ClackTabs.

See Also:
Serialized Form

Nested Class Summary
protected  class ClackFramework.AppCloser
          To shutdown when run as an application.
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  java.applet.Applet applet
           
static javax.swing.ImageIcon applicationIcon
           
protected static java.lang.String appTitle
           
protected  ClackBarFactory barFactory
           
protected  RouterGraphHelper clackGraphHelper
           
protected  javax.swing.ActionMap currentActionMap
           
protected  javax.swing.ActionMap defaultActionMap
           
protected  javax.swing.Action[] defaultActions
          Actions defined by the ClackGraphpad class This is much reduced from the huge number of actions available in JGraphpad
protected  java.util.Hashtable doc2tab
           
protected static int entrySize
           
protected  ErrorConsole errorConsole
           
protected static GPGraphTools graphTools
           
protected  boolean isSimpleGraph
           
protected  GPLogConsole logger
           
protected static javax.swing.ImageIcon logoIcon
           
 javax.swing.JPanel mainPanel
           
protected  ApplicationManager mAppManager
           
protected  ClackMarqueeHandler marqueeHandler
           
protected  boolean mDebug
           
protected  java.util.Hashtable<java.lang.Integer,ClackDocument> mDocMap
           
protected  javax.swing.JMenuBar menubar
           
protected  TimeManager mTimeManager
           
static java.lang.String PARAM_STRING
           
protected  GPTabbedPane tabbedPane
           
protected  javax.swing.JPanel toolBarInnerPanel
           
protected  javax.swing.JPanel toolBarMainPanel
           
protected  boolean toolBarsVisible
           
protected  TopologyManager topologyManager
           
 
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
ClackFramework(java.applet.Applet applet)
          Creates a new instance with the parsed parameters and parent applet.
 
Method Summary
 void addAdditionalComponent(java.lang.String menuName, java.lang.String fullClassName)
           
 void addClackApplication(java.lang.String cmd, java.lang.String classname)
           
 void addClackTab(ClackTab t)
          Adds a new ClackTab to the ClackGraphpad
 void addTabbedPaneContainerListener(java.awt.event.ContainerListener listener)
           
 void componentHidden(java.awt.event.ComponentEvent e)
           
 void componentMoved(java.awt.event.ComponentEvent e)
           
 void componentResized(java.awt.event.ComponentEvent e)
          Attempts to update the doc based on a resize of the entire frame.
 void componentShown(java.awt.event.ComponentEvent e)
           
protected  javax.swing.JFrame createFrame()
          Creates a frame for this Graphpad panel
 void error(java.lang.String message)
          Show a dialog with the given error message.
 void exit(boolean full_exit)
          Called on exit by FileExit action
 void fillDefaultActionMap()
           
 ClackDocument[] getAllDocuments()
          Returns all of the documents.
 ClackTab[] getAllTabs()
           
static javax.swing.ImageIcon getApplicationIcon()
          Returns the applicationIcon.
 ApplicationManager getApplicationManager()
           
 ClackBarFactory getBarFactory()
          Returns the barFactory.
 RouterGraphHelper getClackGraphHelper()
           
 javax.swing.ActionMap getCurrentActionMap()
          Returns the current Action Map
 ClackDocument getCurrentDocument()
          Returns the currently selected document.
 RouterGraph getCurrentRouterGraph()
          Returns the current graph, that is, the one in the current document.
 ClackTab getCurrentTab()
          Returns the currently active and visible ClackTab.
 ClackDocument getDocumentForTopology(int topo)
          adds a new document in a ClackTab
 AbstractActionDefault getEditRedoAction()
          Returns the redoAction.
 AbstractActionDefault getEditUndoAction()
          Returns the undoAction.
 ErrorConsole getErrorConsole()
           
 java.awt.Frame getFrame()
          Find the hosting frame, for the file-chooser dialog.
 GPLogConsole getLogConsole()
           
 ClackMarqueeHandler getMarqueeHandler()
          Returns the marqueeHandler.
 javax.swing.JMenuBar getMenubar()
           
 TimeManager getTimeManager()
           
 TopologyManager getTopologyManager()
           
 void initializeAndShow()
           
 boolean isApplet()
          Adds a new Document based on the GraphModelProvider.
 boolean isDebug()
           
 boolean isSimpleGraph()
           
 boolean isToolBarsVisible()
           
 void removeClackTab(ClackTab t)
           
 void removeDocument(ClackDocument doc)
          Remove a ClackDocument
 void removeTabbedPaneContainerListener(java.awt.event.ContainerListener listener)
           
static void setApplicationIcon(javax.swing.ImageIcon applicationIcon)
          Sets the applicationIcon.
 void setBarFactory(ClackBarFactory barFactory)
          Sets the barFactory.
 void setDebug(boolean b)
           
 void setIsSimpleGraph(boolean b)
           
protected  void setMe4Actions()
           
 void setParentActionMap(javax.swing.ActionMap map)
           
 void setToolBarsVisible(boolean state)
           
 void update()
           
 
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, 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, 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
 

Field Detail

PARAM_STRING

public static final java.lang.String PARAM_STRING
See Also:
Constant Field Values

applicationIcon

public static javax.swing.ImageIcon applicationIcon

logoIcon

protected static javax.swing.ImageIcon logoIcon

appTitle

protected static java.lang.String appTitle

entrySize

protected static int entrySize

applet

protected java.applet.Applet applet

toolBarsVisible

protected boolean toolBarsVisible

graphTools

protected static GPGraphTools graphTools

logger

protected GPLogConsole logger

tabbedPane

protected GPTabbedPane tabbedPane

doc2tab

protected java.util.Hashtable doc2tab

barFactory

protected ClackBarFactory barFactory

toolBarMainPanel

protected javax.swing.JPanel toolBarMainPanel

toolBarInnerPanel

protected javax.swing.JPanel toolBarInnerPanel

menubar

protected javax.swing.JMenuBar menubar

defaultActionMap

protected javax.swing.ActionMap defaultActionMap

mainPanel

public javax.swing.JPanel mainPanel

currentActionMap

protected javax.swing.ActionMap currentActionMap

marqueeHandler

protected ClackMarqueeHandler marqueeHandler

isSimpleGraph

protected boolean isSimpleGraph

clackGraphHelper

protected RouterGraphHelper clackGraphHelper

topologyManager

protected TopologyManager topologyManager

errorConsole

protected ErrorConsole errorConsole

mAppManager

protected ApplicationManager mAppManager

mTimeManager

protected TimeManager mTimeManager

mDocMap

protected java.util.Hashtable<java.lang.Integer,ClackDocument> mDocMap

mDebug

protected boolean mDebug

defaultActions

protected javax.swing.Action[] defaultActions
Actions defined by the ClackGraphpad class This is much reduced from the huge number of actions available in JGraphpad

Constructor Detail

ClackFramework

public ClackFramework(java.applet.Applet applet)
Creates a new instance with the parsed parameters and parent applet.

Method Detail

addAdditionalComponent

public void addAdditionalComponent(java.lang.String menuName,
                                   java.lang.String fullClassName)

initializeAndShow

public void initializeAndShow()

createFrame

protected javax.swing.JFrame createFrame()
Creates a frame for this Graphpad panel


getClackGraphHelper

public RouterGraphHelper getClackGraphHelper()

getTopologyManager

public TopologyManager getTopologyManager()

isSimpleGraph

public boolean isSimpleGraph()

setIsSimpleGraph

public void setIsSimpleGraph(boolean b)

addClackApplication

public void addClackApplication(java.lang.String cmd,
                                java.lang.String classname)

fillDefaultActionMap

public void fillDefaultActionMap()

setMe4Actions

protected void setMe4Actions()

getCurrentActionMap

public javax.swing.ActionMap getCurrentActionMap()
Returns the current Action Map


getFrame

public java.awt.Frame getFrame()
Find the hosting frame, for the file-chooser dialog.


getMenubar

public javax.swing.JMenuBar getMenubar()

getApplicationManager

public ApplicationManager getApplicationManager()

error

public void error(java.lang.String message)
Show a dialog with the given error message.


getCurrentRouterGraph

public RouterGraph getCurrentRouterGraph()
Returns the current graph, that is, the one in the current document.

Returns:
GPGraph

getCurrentTab

public ClackTab getCurrentTab()
Returns the currently active and visible ClackTab.

Returns:
ClackTab

getCurrentDocument

public ClackDocument getCurrentDocument()
Returns the currently selected document. If no one is selected, then the first one will be select.

Returns:
ClackDocument

getAllDocuments

public ClackDocument[] getAllDocuments()
Returns all of the documents.

Returns:
ClackDocument[] or null if no documents

componentHidden

public void componentHidden(java.awt.event.ComponentEvent e)
Specified by:
componentHidden in interface java.awt.event.ComponentListener

componentMoved

public void componentMoved(java.awt.event.ComponentEvent e)
Specified by:
componentMoved in interface java.awt.event.ComponentListener

componentResized

public void componentResized(java.awt.event.ComponentEvent e)
Attempts to update the doc based on a resize of the entire frame. TODO: This doesn't work in Java 1.5, find out why

Specified by:
componentResized in interface java.awt.event.ComponentListener

componentShown

public void componentShown(java.awt.event.ComponentEvent e)
Specified by:
componentShown in interface java.awt.event.ComponentListener

getEditUndoAction

public AbstractActionDefault getEditUndoAction()
Returns the undoAction.

Returns:
UndoAction

getEditRedoAction

public AbstractActionDefault getEditRedoAction()
Returns the redoAction.

Returns:
RedoAction

getLogConsole

public GPLogConsole getLogConsole()

isToolBarsVisible

public boolean isToolBarsVisible()

setToolBarsVisible

public void setToolBarsVisible(boolean state)

addClackTab

public void addClackTab(ClackTab t)
Adds a new ClackTab to the ClackGraphpad


removeClackTab

public void removeClackTab(ClackTab t)

exit

public void exit(boolean full_exit)
Called on exit by FileExit action


isApplet

public boolean isApplet()
Adds a new Document based on the GraphModelProvider.


getDocumentForTopology

public ClackDocument getDocumentForTopology(int topo)
adds a new document in a ClackTab


removeDocument

public void removeDocument(ClackDocument doc)
Remove a ClackDocument


update

public void update()

getBarFactory

public ClackBarFactory getBarFactory()
Returns the barFactory.

Returns:
GPBarFactory

setBarFactory

public void setBarFactory(ClackBarFactory barFactory)
Sets the barFactory.

Parameters:
barFactory - The barFactory to set

getErrorConsole

public ErrorConsole getErrorConsole()

getAllTabs

public ClackTab[] getAllTabs()

setParentActionMap

public void setParentActionMap(javax.swing.ActionMap map)

getApplicationIcon

public static javax.swing.ImageIcon getApplicationIcon()
Returns the applicationIcon.

Returns:
ImageIcon

setApplicationIcon

public static void setApplicationIcon(javax.swing.ImageIcon applicationIcon)
Sets the applicationIcon.

Parameters:
applicationIcon - The applicationIcon to set

getMarqueeHandler

public ClackMarqueeHandler getMarqueeHandler()
Returns the marqueeHandler.

Returns:
GPMarqueeHandler

getTimeManager

public TimeManager getTimeManager()

addTabbedPaneContainerListener

public void addTabbedPaneContainerListener(java.awt.event.ContainerListener listener)

removeTabbedPaneContainerListener

public void removeTabbedPaneContainerListener(java.awt.event.ContainerListener listener)

isDebug

public boolean isDebug()

setDebug

public void setDebug(boolean b)