|
||||||||||
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.JPanel net.clackrouter.gui.ClackDocument
public class ClackDocument
A ClackDocument represents a single router instance in Clack.
A router instance is what is placed in a tab, and includes all different views that can be zoomed between (ie: Network View, Router View, Hierarchical View) and manages which one of these views is currently displayed.
The document also deals with a lot of the listening required on the graph.
This class is a modified version of the GPDocument class from JGraphpad.
Nested Class Summary |
---|
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 Rule |
columnRule
The column rule for the graph |
protected javax.swing.JScrollPane |
currentScroll
the scrollpane containg the current view |
protected ClackView |
currentView
|
protected boolean |
enableTooltips
|
protected javax.swing.Action |
fitAction
Action used for fitting the size |
protected GraphUndoManager |
graphUndoManager
The graphUndoManager manager for the joint graph. |
protected boolean |
inTopoRouteTableViewMode
flag telling whether this document is currently visible (ie: is the selected tab) |
protected ClackFramework |
mFramework
A reference to the top level component |
protected Rule |
rowRule
The row rule for the graph |
protected GPStatusBar |
statusbar
|
protected ClackTab |
tab
a reference to the tab holding this document |
protected TopologyView |
topologyView
the topology view for this router |
protected UndoHandler |
undoHandler
The graphUndoManager handler for the current document. |
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.print.Printable |
---|
NO_SUCH_PAGE, PAGE_EXISTS |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
ClackDocument(ClackFramework graphpad,
int topology)
Constructor for ClackDocument. |
Method Summary | |
---|---|
void |
addRouter(Router router)
|
void |
componentHidden(java.awt.event.ComponentEvent e)
|
void |
componentMoved(java.awt.event.ComponentEvent e)
|
void |
componentResized(java.awt.event.ComponentEvent e)
|
void |
componentShown(java.awt.event.ComponentEvent e)
|
ConnectivityTestWindow |
getConnectivityTestWin()
|
JGraph |
getCurrentGraph()
Returns the graph associated with the ClackView that the document is currently displaying |
Router |
getCurrentRouter()
|
RouterGraph |
getCurrentRouterGraph()
|
RouterView |
getCurrentRouterView()
|
protected java.lang.String |
getDocumentTitle()
|
ClackFramework |
getFramework()
Returns the graphpad. |
ClackTab |
getGPTab()
|
GraphUndoManager |
getGraphUndoManager()
Returns the graphUndoManager. |
Router |
getRouter(java.lang.String name)
|
RouterGraph |
getRouterGraph(java.lang.String name)
|
RouterView |
getRouterView(java.lang.String name)
|
int |
getTopology()
|
TopologyView |
getTopologyView()
|
void |
gpgraphWindowResized(int newWidth,
int newHeight)
this is a hack to take care of the bug when the router window and scrollbar would not properly resize after resizing the outer window. |
void |
graphChanged(GraphModelEvent e)
Important method that responds to removals of components or wires from the graph by informing the underlying router and components |
boolean |
inTopoRouteTableViewMode()
|
boolean |
isClackVisible()
|
boolean |
isEnableTooltips()
|
int |
print(java.awt.Graphics g,
java.awt.print.PageFormat pF,
int page)
Prints the router graph |
void |
propertyChange(java.beans.PropertyChangeEvent evt)
|
void |
pushNewView(ClackView newView)
Used to implement zoom in using the zoomStack. |
void |
redrawTopoView()
|
protected void |
registerListeners(JGraph graph)
|
void |
setConnectivityTestWin(ConnectivityTestWindow win)
|
protected void |
setDocumentTitle(java.lang.String s)
|
void |
setEnableTooltips(boolean enableTooltips,
RouterGraph graph)
Sets the enableTooltips. |
void |
setIsClackVisible(boolean b)
|
void |
setModified(boolean modified)
|
void |
setResizeAction(javax.swing.AbstractAction e)
|
void |
setSelectionAttributes(java.util.Map map)
Sets the attributes of the selected cells. |
void |
setTab(ClackTab tab)
|
void |
toogleTopoRouteTableViewMode()
|
protected void |
unregisterListeners(JGraph graph)
|
protected void |
update()
update this graphpad and tab title |
void |
update(java.util.Observable obs,
java.lang.Object arg)
|
void |
updatePageFormat()
not from Printable interface, but related |
protected void |
updateTabTitle()
|
void |
valueChanged(GraphSelectionEvent e)
|
void |
zoomIn()
Handles zoom in behavior for any view in this document. |
void |
zoomIntoRouter(java.lang.String router_name)
|
void |
zoomOut()
Implements zoom out based on the contents of the zoomStack. |
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 |
---|
protected boolean enableTooltips
protected ClackFramework mFramework
protected Rule columnRule
protected Rule rowRule
protected GraphUndoManager graphUndoManager
#graph
protected UndoHandler undoHandler
protected javax.swing.Action fitAction
protected GPStatusBar statusbar
protected ClackTab tab
protected javax.swing.JScrollPane currentScroll
protected TopologyView topologyView
protected ClackView currentView
protected boolean inTopoRouteTableViewMode
Constructor Detail |
---|
public ClackDocument(ClackFramework graphpad, int topology)
Method Detail |
---|
public int getTopology()
public void addRouter(Router router)
public void zoomIntoRouter(java.lang.String router_name)
public void zoomIn()
If the current view is the topology, we simply zoom into the router view corresponding to the router zoomed in on
Otherwise, we get the current graph and using the CompDoubleClickHandler
to
fine the right behavior for zooming into this component
public JGraph getCurrentGraph()
ClackView
that the document is currently displaying
public void pushNewView(ClackView newView)
Pushes the current view onto the stack and displays the specified view in the document.
newView
- public void zoomOut()
Pops the last view off of the stack and puts it as the current view for this document
protected void registerListeners(JGraph graph)
protected void unregisterListeners(JGraph graph)
public void setModified(boolean modified)
protected java.lang.String getDocumentTitle()
protected void setDocumentTitle(java.lang.String s)
public void setSelectionAttributes(java.util.Map map)
public void gpgraphWindowResized(int newWidth, int newHeight)
this is a hack to take care of the bug when the router window and scrollbar would not properly resize after resizing the outer window.
unfortunately this does not work in Java 1.5
public void setResizeAction(javax.swing.AbstractAction e)
public void componentHidden(java.awt.event.ComponentEvent e)
componentHidden
in interface java.awt.event.ComponentListener
public void componentMoved(java.awt.event.ComponentEvent e)
componentMoved
in interface java.awt.event.ComponentListener
public void componentResized(java.awt.event.ComponentEvent e)
componentResized
in interface java.awt.event.ComponentListener
public void componentShown(java.awt.event.ComponentEvent e)
componentShown
in interface java.awt.event.ComponentListener
public void updatePageFormat()
public int print(java.awt.Graphics g, java.awt.print.PageFormat pF, int page)
print
in interface java.awt.print.Printable
public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
public void valueChanged(GraphSelectionEvent e)
public void update(java.util.Observable obs, java.lang.Object arg)
update
in interface java.util.Observer
public void graphChanged(GraphModelEvent e)
protected void update()
public GraphUndoManager getGraphUndoManager()
public ClackFramework getFramework()
public boolean isEnableTooltips()
public void setEnableTooltips(boolean enableTooltips, RouterGraph graph)
enableTooltips
- The enableTooltips to setpublic void setIsClackVisible(boolean b)
public boolean isClackVisible()
public TopologyView getTopologyView()
public RouterView getCurrentRouterView()
public Router getCurrentRouter()
public RouterGraph getCurrentRouterGraph()
public Router getRouter(java.lang.String name)
public RouterGraph getRouterGraph(java.lang.String name)
public RouterView getRouterView(java.lang.String name)
public ClackTab getGPTab()
public void setTab(ClackTab tab)
public boolean inTopoRouteTableViewMode()
public void toogleTopoRouteTableViewMode()
public void redrawTopoView()
public ConnectivityTestWindow getConnectivityTestWin()
public void setConnectivityTestWin(ConnectivityTestWindow win)
protected void updateTabTitle()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |