|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
jcreek.cke.browser.Visualizer
This class implements that main window of the application. There is typically only one of these in each session. It acts as a window listener for the internal windows it creates, notifying the document group when windows are closed and when they are activated.
Nested Class Summary | |
protected class |
Visualizer.ActionChangedListener
Watches for changes in actions and deals with them by changing the corresponding menu items or toolbar buttons. |
Nested classes inherited from class javax.swing.JFrame |
javax.swing.JFrame.AccessibleJFrame |
Nested classes inherited from class java.awt.Frame |
java.awt.Frame.AccessibleAWTFrame |
Nested classes inherited from class java.awt.Window |
java.awt.Window.AccessibleAWTWindow |
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 | |
static java.lang.String |
accelSuffix
Suffix added to command strings to find accelerator. |
protected javax.swing.JPanel |
content
|
protected int |
divLocation
|
protected javax.swing.JDesktopPane |
dtp
Holds all the internal windows within the main window. |
protected EntityList |
findEnt
|
protected FrameProperty |
frameProperty
|
protected FrameView |
fView
|
static java.lang.String |
imageSuffix
Suffix added to command strings to find images. |
protected boolean |
isPropVisible
|
static java.lang.String |
labelSuffix
Suffix added to command strings to find labels. |
static java.lang.String |
memSuffix
Suffix added to command strings to find mnemonics. |
protected jcreek.cke.browser.MousePositionIndicator |
mpi
Indicates the position of the mouse over a canvas. |
protected PropertyControl |
pc
|
protected java.lang.String |
propKey
|
protected javax.swing.JPanel |
propPane
|
protected javax.swing.JInternalFrame |
propWin
|
protected StatusBar |
sb
Common Area to hold Standard components or display Status Messages |
protected SideBar |
sideBar
|
protected javax.swing.JScrollPane |
sPane
|
protected javax.swing.JSplitPane |
splitter
|
static java.lang.String |
tipSuffix
Suffix added to command strings to find tooltips. |
static java.lang.String |
titleSuffix
Suffix added to command strings to find title. |
protected jcreek.cke.browser.ToolManager |
toolMan
Our window's tool manager. |
javax.swing.JInternalFrame |
toolWin
|
protected TreeView |
treeView
Holds a tree view of all the available views It allows to switch between the different views |
protected jcreek.cke.browser.ViewMenu |
viewMenu
|
protected jcreek.cke.browser.WindowMenu |
winMenu
Holds the names of the internal windows. |
Fields inherited from class javax.swing.JFrame |
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Frame |
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.WindowConstants |
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
Visualizer(java.lang.String title)
Creates a new Visualizer object and puts up the main window. |
Method Summary | |
void |
activateWin(CreekDocument doc)
|
void |
centerComponent(java.awt.Component c)
Takes a component and centers it within the main window. |
void |
closePropertyWindow()
|
void |
closeWindow()
Closes the current window. |
void |
closeWindow(javax.swing.JInternalFrame fr)
|
protected javax.swing.JMenuItem |
createCheckBoxMenuItem(java.lang.String cmd)
|
protected javax.swing.JMenu |
createMenu(java.lang.String key)
Create a menu for the app. |
protected javax.swing.JMenuBar |
createMenubar()
Create the menubar for the app. |
protected javax.swing.JMenuItem |
createMenuItem(java.lang.String cmd)
This is the hook through which all menu items are created. |
protected void |
createProps()
|
protected javax.swing.JRadioButtonMenuItem |
createRadioButtonMenuItem(java.lang.String cmd)
|
protected javax.swing.JToolBar |
createToolbar()
Create the toolbar. |
protected javax.swing.JButton |
createToolbarButton(java.lang.String key)
Create a button to go inside of the toolbar. |
void |
detach()
Remove ourselves (and all our components) from any lists we might be one. |
void |
displayPropertyWindow(Entity selEntity)
|
protected javax.swing.JInternalFrame |
findSelected()
Finds the selected frame and returns a reference to it. |
CreekTool |
getCurrentTool()
Returns the currently selected graph tool for this window. |
protected CreekDocument |
getDocument(javax.swing.JInternalFrame fr)
Retrieves the document attached to the given frame. |
CreekDocument[] |
getDocuments()
Retrieves all the open documents attached to this main window. |
static Visualizer |
getFrame(java.awt.Component child)
Find the hosting frame for this component. |
FrameView |
getFrameView()
|
static javax.swing.JInternalFrame |
getInternalFrame(java.awt.Component child)
|
PropertyControl |
getPropertyControl()
|
java.awt.Container |
getPropertyWindow()
|
CreekDocument |
getSelContext()
|
javax.swing.JInternalFrame |
getWin(CreekDocument doc)
Retrieves the InternalFrame attached to the given document. |
void |
internalFrameActivated(javax.swing.event.InternalFrameEvent e)
Use this notification to tell the document group which view is currently active. |
void |
internalFrameClosed(javax.swing.event.InternalFrameEvent e)
We ignore this event. |
void |
internalFrameClosing(javax.swing.event.InternalFrameEvent e)
Use this opportunity to save the document associated with this window. |
void |
internalFrameDeactivated(javax.swing.event.InternalFrameEvent e)
Use this notification to tell the document group that there's no current document. |
void |
internalFrameDeiconified(javax.swing.event.InternalFrameEvent e)
We ignore this event. |
void |
internalFrameIconified(javax.swing.event.InternalFrameEvent e)
We ignore this event. |
void |
internalFrameOpened(javax.swing.event.InternalFrameEvent e)
We ignore this event. |
boolean |
isShowing(java.lang.String key)
|
void |
newEntityWindow(java.lang.String title)
|
void |
newFrameWin(java.lang.String title)
|
void |
newToolWindow(java.lang.String title)
|
void |
newViewWindow(java.lang.String title)
|
ConceptView |
newWindow(java.lang.String title)
Create a new internal window and set its title to the passed argument. |
void |
registerWindow(javax.swing.JInternalFrame frame)
|
void |
renameWindow(java.lang.String name)
Renames the currently selected window to the given name. |
void |
show(java.lang.String key)
|
void |
windowActivated(java.awt.event.WindowEvent e)
Invoked when the window is set to be the user's active window, which means the window (or one of its subcomponents) will receive keyboard events. |
void |
windowClosed(java.awt.event.WindowEvent e)
Invoked when a window has been closed. |
void |
windowClosing(java.awt.event.WindowEvent e)
Invoked when a window is in the process of being closed. |
void |
windowDeactivated(java.awt.event.WindowEvent e)
Invoked when a window is de-activated. |
void |
windowDeiconified(java.awt.event.WindowEvent e)
Invoked when a window is de-iconified. |
void |
windowIconified(java.awt.event.WindowEvent e)
Invoked when a window is iconified. |
void |
windowOpened(java.awt.event.WindowEvent e)
Invoked when a window has been opened. |
Methods inherited from class javax.swing.JFrame |
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
Methods inherited from class java.awt.Frame |
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
Methods inherited from class java.awt.Window |
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, show, toBack, toFront |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
getFont, postEvent |
Field Detail |
protected StatusBar sb
protected PropertyControl pc
protected javax.swing.JInternalFrame propWin
protected jcreek.cke.browser.MousePositionIndicator mpi
protected javax.swing.JDesktopPane dtp
protected EntityList findEnt
protected TreeView treeView
protected FrameView fView
public javax.swing.JInternalFrame toolWin
protected jcreek.cke.browser.WindowMenu winMenu
protected jcreek.cke.browser.ViewMenu viewMenu
protected jcreek.cke.browser.ToolManager toolMan
public static java.lang.String imageSuffix
public static java.lang.String labelSuffix
public static java.lang.String tipSuffix
public static java.lang.String memSuffix
public static java.lang.String accelSuffix
public static java.lang.String titleSuffix
protected javax.swing.JScrollPane sPane
protected javax.swing.JSplitPane splitter
protected javax.swing.JPanel propPane
protected javax.swing.JPanel content
protected SideBar sideBar
protected int divLocation
protected boolean isPropVisible
protected java.lang.String propKey
protected FrameProperty frameProperty
Constructor Detail |
public Visualizer(java.lang.String title)
title
- title for the main windowMethod Detail |
public void centerComponent(java.awt.Component c)
c
- component to be centeredpublic void closeWindow()
public void closeWindow(javax.swing.JInternalFrame fr)
protected javax.swing.JMenu createMenu(java.lang.String key)
key
- menu key in resource bundle
protected javax.swing.JMenuBar createMenubar()
protected javax.swing.JMenuItem createMenuItem(java.lang.String cmd)
cmd
string it finds
the menu item label and image (if any) in the resource
bundle.
cmd
- action command string for this menu item;
used to get the label and image
createMenu(java.lang.String)
protected javax.swing.JMenuItem createCheckBoxMenuItem(java.lang.String cmd)
protected javax.swing.JRadioButtonMenuItem createRadioButtonMenuItem(java.lang.String cmd)
protected javax.swing.JToolBar createToolbar()
protected javax.swing.JButton createToolbarButton(java.lang.String key)
key
- key in resource bundle for tool
public void detach()
protected javax.swing.JInternalFrame findSelected()
NOTE: We use this instead of simply tracking the active window via the internal frame listener because renameWindow() might be called just after a new window is created and that new window is not set active yet because the listener hasn't yet been notified.
public CreekTool getCurrentTool()
protected CreekDocument getDocument(javax.swing.JInternalFrame fr)
fr
- internal frame
public javax.swing.JInternalFrame getWin(CreekDocument doc)
doc
- CreekDocument attached to the frame
public void activateWin(CreekDocument doc)
public CreekDocument[] getDocuments()
public static Visualizer getFrame(java.awt.Component child)
child
- component to find parent frame for
public static javax.swing.JInternalFrame getInternalFrame(java.awt.Component child)
public void internalFrameActivated(javax.swing.event.InternalFrameEvent e)
internalFrameActivated
in interface javax.swing.event.InternalFrameListener
e
- internal frame eventpublic void internalFrameClosed(javax.swing.event.InternalFrameEvent e)
internalFrameClosed
in interface javax.swing.event.InternalFrameListener
e
- internal frame eventpublic void internalFrameClosing(javax.swing.event.InternalFrameEvent e)
internalFrameClosing
in interface javax.swing.event.InternalFrameListener
e
- internal frame eventpublic void internalFrameDeactivated(javax.swing.event.InternalFrameEvent e)
internalFrameDeactivated
in interface javax.swing.event.InternalFrameListener
e
- internal frame eventpublic void internalFrameDeiconified(javax.swing.event.InternalFrameEvent e)
internalFrameDeiconified
in interface javax.swing.event.InternalFrameListener
e
- internal frame eventpublic void internalFrameIconified(javax.swing.event.InternalFrameEvent e)
internalFrameIconified
in interface javax.swing.event.InternalFrameListener
e
- internal frame eventpublic void internalFrameOpened(javax.swing.event.InternalFrameEvent e)
internalFrameOpened
in interface javax.swing.event.InternalFrameListener
e
- internal frame eventpublic ConceptView newWindow(java.lang.String title)
title
- title to give new internal window
public java.awt.Container getPropertyWindow()
public void registerWindow(javax.swing.JInternalFrame frame)
public PropertyControl getPropertyControl()
public FrameView getFrameView()
public void displayPropertyWindow(Entity selEntity)
public void closePropertyWindow()
public void newViewWindow(java.lang.String title)
public CreekDocument getSelContext()
public void newEntityWindow(java.lang.String title)
public void newToolWindow(java.lang.String title)
public void newFrameWin(java.lang.String title)
public void renameWindow(java.lang.String name)
name
- new name to give to current windowpublic void windowActivated(java.awt.event.WindowEvent e)
We use this event to make sure that our selected internal frame's document is set as the current document. Otherwise unpredictable bad things could happen (with having multiple current documents, there could be two graph tools attached to the same document).
windowActivated
in interface java.awt.event.WindowListener
e
- window eventpublic void windowClosed(java.awt.event.WindowEvent e)
windowClosed
in interface java.awt.event.WindowListener
e
- window eventpublic void windowClosing(java.awt.event.WindowEvent e)
windowClosing
in interface java.awt.event.WindowListener
e
- window eventpublic void windowDeactivated(java.awt.event.WindowEvent e)
We use this event to deactivate the tool manager which avoids a serious problem. If there are multiple tool managers active then they will register multiple tools with the current document, which leads to havoc.
windowDeactivated
in interface java.awt.event.WindowListener
e
- window eventpublic void windowDeiconified(java.awt.event.WindowEvent e)
windowDeiconified
in interface java.awt.event.WindowListener
e
- window eventpublic void windowIconified(java.awt.event.WindowEvent e)
windowIconified
in interface java.awt.event.WindowListener
e
- window eventpublic void windowOpened(java.awt.event.WindowEvent e)
windowOpened
in interface java.awt.event.WindowListener
e
- window eventprotected void createProps()
public boolean isShowing(java.lang.String key)
public void show(java.lang.String key)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |