org.argouml.ui
Class ProjectBrowser

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Window
              extended byjava.awt.Frame
                  extended byjavax.swing.JFrame
                      extended byorg.argouml.ui.ProjectBrowser
All Implemented Interfaces:
Accessible, EventListener, ImageObserver, org.tigris.gef.ui.IStatusBar, MenuContainer, PropertyChangeListener, RootPaneContainer, Serializable, TargetListener, WindowConstants

public class ProjectBrowser
extends JFrame
implements org.tigris.gef.ui.IStatusBar, PropertyChangeListener, TargetListener

The main window of the ArgoUML application.

See Also:
Serialized Form

Nested Class Summary
(package private)  class ProjectBrowser.WindowCloser
           
 
Nested classes inherited from class javax.swing.JFrame
JFrame.AccessibleJFrame
 
Nested classes inherited from class java.awt.Frame
Frame.AccessibleAWTFrame
 
Nested classes inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
private  String appName
           
static int DEFAULT_COMPONENTHEIGHT
          Default height: DEFAULT_COMPONENTHEIGHT
static int DEFAULT_COMPONENTWIDTH
          Default width: DEFAULT_COMPONENTWIDTH
private  Font defaultFont
          this needs work so that users can set the font size through a gui preference window
private  Map detailsPanesByCompassPoint
           
private  DetailsPane eastPane
           
private  MultiEditorPane editorPane
           
private  NavigatorPane explorerPane
          The explorer (formerly called navigator) pane containing the modelstructure.
private  GenericArgoMenuBar menuBar
           
private  DetailsPane northEastPane
           
private  DetailsPane northPane
           
private  DetailsPane northWestPane
           
private static boolean showSplashScreen
           
private  DetailsPane southEastPane
           
private  DetailsPane southPane
           
private  JPanel southWestPane
           
private  SplashScreen splashScreen
          The splash screen shown at startup
private  StatusBar statusBar
          Partially implemented.
private static ProjectBrowser theInstance
          Member attribute to contain the singleton.
private  ToDoPane todoPane
          The todopane (lower left corner of screen)
private  JPanel westPane
           
private  org.tigris.swidgets.BorderSplitPane workAreaPane
           
 
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.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 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
private ProjectBrowser()
          For testing purposes.
private ProjectBrowser(String applicationName, boolean doSplash)
          The constructor.
 
Method Summary
protected  Component createPanels(boolean doSplash)
          Creates the panels in the working area
 String getAppName()
           
 Font getDefaultFont()
           
 MultiEditorPane getEditorPane()
           
static ProjectBrowser getInstance()
          Singleton retrieval method for the projectbrowser.
 JMenuBar getJMenuBar()
           
 Locale getLocale()
           
 JPanel getNamedTab(String tabName)
          Find the tabpage with the given label
 StatusBar getStatusBar()
           
 TabSpawnable getTab(Class tabClass)
          Get the tab page instance of the given class
 TabProps getTabProps()
          Get the tab page containing the properties
 Object getTarget()
          Deprecated. As of ArgoUml version 0.13.5,replaced by TargetManager.getInstance().getTarget()
 ToDoPane getTodoPane()
          Returns the todopane.
 void jumpToDiagramShowing(org.tigris.gef.util.VectorSet dms)
          get a list of offenders and display the according diagram, aka implement a method which jumps to the offender.
private  DetailsPane makeDetailsPane(String compassPoint, org.tigris.swidgets.Orientation orientation)
          Build a new details pane for the given compass point
 void moduleDisabled(ArgoModuleEvent event)
           
 void moduleEnabled(ArgoModuleEvent event)
           
 void moduleUnloaded(ArgoModuleEvent event)
           
 void navigateTo(Object element)
          Called by a user interface element when a request to navigate to a model element has been received.
 void open(Object element)
          Called by a user interface element when a request to open a model element in a new window has been recieved.
 void propertyChange(PropertyChangeEvent evt)
           
private  void restorePanelSizes()
          Set the size of each panel to that last saved in the configuration file
 void saveScreenConfiguration()
          Save the positions of the screen splitters, sizes and postion of main window in the properties file
 void selectTabNamed(String tabName)
          Find the tabpage with the given label and make it the front tab
 void setAppName(String n)
           
static void setSplash(boolean splash)
           
 void setSplashScreen(SplashScreen ss)
          Sets the splashscreen.
 void setTarget(Object o)
          Deprecated. As of ArgoUml version 0.13.5,replaced by TargetManager.getInstance().setTarget(Object) Only still used in tests.
 void setTitle(String title)
           
 void setToDoItem(Object o)
          Select the tab page containing the todo item TODO: should introduce an instance variable to go straight to the correct tab instead of trying all
 void setVisible(boolean b)
           
 void showStatus(String s)
           
 void targetAdded(TargetEvent e)
          Fired when a target is added to the list of targets.
 void targetRemoved(TargetEvent e)
          Fired when a target is removed from the list of targets
 void targetSet(TargetEvent e)
          Fired when a total new set of targets is set
protected  void updateTitle()
          Updates the window title to contain the latest values for project name, active diagram, and save status.
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, 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, 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, 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, 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

DEFAULT_COMPONENTWIDTH

public static final int DEFAULT_COMPONENTWIDTH
Default width: DEFAULT_COMPONENTWIDTH

See Also:
Constant Field Values

DEFAULT_COMPONENTHEIGHT

public static final int DEFAULT_COMPONENTHEIGHT
Default height: DEFAULT_COMPONENTHEIGHT

See Also:
Constant Field Values

theInstance

private static ProjectBrowser theInstance
Member attribute to contain the singleton.


showSplashScreen

private static boolean showSplashScreen

appName

private String appName

editorPane

private MultiEditorPane editorPane

northEastPane

private DetailsPane northEastPane

northPane

private DetailsPane northPane

northWestPane

private DetailsPane northWestPane

westPane

private JPanel westPane

eastPane

private DetailsPane eastPane

southEastPane

private DetailsPane southEastPane

southWestPane

private JPanel southWestPane

southPane

private DetailsPane southPane

detailsPanesByCompassPoint

private Map detailsPanesByCompassPoint

menuBar

private GenericArgoMenuBar menuBar

statusBar

private StatusBar statusBar
Partially implemented. Needs work to display import of source and saving of zargo.


defaultFont

private Font defaultFont
this needs work so that users can set the font size through a gui preference window


workAreaPane

private org.tigris.swidgets.BorderSplitPane workAreaPane

splashScreen

private SplashScreen splashScreen
The splash screen shown at startup


explorerPane

private NavigatorPane explorerPane
The explorer (formerly called navigator) pane containing the modelstructure.


todoPane

private ToDoPane todoPane
The todopane (lower left corner of screen)

Constructor Detail

ProjectBrowser

private ProjectBrowser()
For testing purposes. In tests this constructor can be called so TheInstance is filled.


ProjectBrowser

private ProjectBrowser(String applicationName,
                       boolean doSplash)
The constructor.

Parameters:
applicationName - the title of the frame
doSplash - determines if we have to show the splash screen at startup
Method Detail

getLocale

public Locale getLocale()
See Also:
Component.getLocale()

createPanels

protected Component createPanels(boolean doSplash)
Creates the panels in the working area

Parameters:
doSplash - true if we show the splashscreen during startup
Returns:
Component the area between the menu and the statusbar. It contains the workarea at centre and the toolbar position north, south, east or west.

restorePanelSizes

private void restorePanelSizes()
Set the size of each panel to that last saved in the configuration file


setTitle

public void setTitle(String title)
See Also:
Frame.setTitle(java.lang.String)

updateTitle

protected void updateTitle()
Updates the window title to contain the latest values for project name, active diagram, and save status.


getAppName

public String getAppName()
Returns:
the application name as shown in the titlebar

setAppName

public void setAppName(String n)
Parameters:
n - the application name as shown in the titlebar

setTarget

public void setTarget(Object o)
Deprecated. As of ArgoUml version 0.13.5,replaced by TargetManager.getInstance().setTarget(Object) Only still used in tests.

The method used by the NavigatorPane, MultiEditor and DetailsPane to set the target of the application.

the target is either a Model Element (usually selected in the Navigation pane or Properties panel) or a Fig (selected in a diagram).

The concept of a selection transaction is used to prevent a change of target in one view creating a call back to this method, which would then change the target in all views again...

Parameters:
o - the target

getTarget

public Object getTarget()
Deprecated. As of ArgoUml version 0.13.5,replaced by TargetManager.getInstance().getTarget()

return the current target in the editor pane

Returns:
the target object

setToDoItem

public void setToDoItem(Object o)
Select the tab page containing the todo item TODO: should introduce an instance variable to go straight to the correct tab instead of trying all

Parameters:
o - the todo item to select

getTabProps

public TabProps getTabProps()
Get the tab page containing the properties

Returns:
the TabProps tabpage

getTab

public TabSpawnable getTab(Class tabClass)
Get the tab page instance of the given class

Parameters:
tabClass - the given class
Returns:
the tabpage

getStatusBar

public StatusBar getStatusBar()
Returns:
the status bar

getJMenuBar

public JMenuBar getJMenuBar()
See Also:
JFrame.getJMenuBar()

getEditorPane

public MultiEditorPane getEditorPane()
Returns:
the editor pane

selectTabNamed

public void selectTabNamed(String tabName)
Find the tabpage with the given label and make it the front tab

Parameters:
tabName - The tabpage label

getNamedTab

public JPanel getNamedTab(String tabName)
Find the tabpage with the given label

Parameters:
tabName - The tabpage label
Returns:
the tabpage

jumpToDiagramShowing

public void jumpToDiagramShowing(org.tigris.gef.util.VectorSet dms)
get a list of offenders and display the according diagram, aka implement a method which jumps to the offender. TODO: this probably needs a lot of work, as the code looks as if it can only jump to diagram offenders

Parameters:
dms - vector of offenders
See Also:
ToDoPane

setVisible

public void setVisible(boolean b)
See Also:
Component.setVisible(boolean)

showStatus

public void showStatus(String s)
Specified by:
showStatus in interface org.tigris.gef.ui.IStatusBar
See Also:
IStatusBar.showStatus(java.lang.String)

navigateTo

public void navigateTo(Object element)
Called by a user interface element when a request to navigate to a model element has been received.

Parameters:
element - the navigation target

open

public void open(Object element)
Called by a user interface element when a request to open a model element in a new window has been recieved.

Parameters:
element - the UI element to be opened

saveScreenConfiguration

public void saveScreenConfiguration()
Save the positions of the screen splitters, sizes and postion of main window in the properties file


moduleUnloaded

public void moduleUnloaded(ArgoModuleEvent event)
Parameters:
event - the event

moduleEnabled

public void moduleEnabled(ArgoModuleEvent event)
Parameters:
event - the event

moduleDisabled

public void moduleDisabled(ArgoModuleEvent event)
Parameters:
event - the event

makeDetailsPane

private DetailsPane makeDetailsPane(String compassPoint,
                                    org.tigris.swidgets.Orientation orientation)
Build a new details pane for the given compass point

Parameters:
compassPoint - the position for which to build the pane
orientation - the required orientation of the pane.
Returns:
the details pane or null if none is required for the given compass point.

propertyChange

public void propertyChange(PropertyChangeEvent evt)
Specified by:
propertyChange in interface PropertyChangeListener
See Also:
PropertyChangeListener.propertyChange( java.beans.PropertyChangeEvent)

targetAdded

public void targetAdded(TargetEvent e)
Description copied from interface: TargetListener
Fired when a target is added to the list of targets.

Specified by:
targetAdded in interface TargetListener
Parameters:
e - The targetevent, name will be TARGET_ADDED
See Also:
TargetListener.targetAdded(org.argouml.ui.targetmanager.TargetEvent)

targetRemoved

public void targetRemoved(TargetEvent e)
Description copied from interface: TargetListener
Fired when a target is removed from the list of targets

Specified by:
targetRemoved in interface TargetListener
Parameters:
e - The targetevent, name will be TARGET_REMOVED
See Also:
TargetListener.targetRemoved(org.argouml.ui.targetmanager.TargetEvent)

targetSet

public void targetSet(TargetEvent e)
Description copied from interface: TargetListener
Fired when a total new set of targets is set

Specified by:
targetSet in interface TargetListener
Parameters:
e - The targetevent, name will be TARGET_SET
See Also:
TargetListener.targetSet(org.argouml.ui.targetmanager.TargetEvent)

getTodoPane

public ToDoPane getTodoPane()
Returns the todopane.

Returns:
ToDoPane

setSplashScreen

public void setSplashScreen(SplashScreen ss)
Sets the splashscreen. Sets the current splashscreen to invisible

Parameters:
ss - the new splashscreen

getInstance

public static ProjectBrowser getInstance()
Singleton retrieval method for the projectbrowser. Lazely instantiates the projectbrowser.

Returns:
the singleton instance of the projectbrowser

setSplash

public static void setSplash(boolean splash)
Parameters:
splash - true if we have to show the splashscreen

getDefaultFont

public Font getDefaultFont()
Returns:
Returns the defaultFont.


ArgoUML © 1996-2004 (20050222)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook