org.argouml.ui
Class ProjectBrowser

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Frame
                          |
                          +--javax.swing.JFrame
                                |
                                +--org.argouml.ui.ProjectBrowser
All Implemented Interfaces:
javax.accessibility.Accessible, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, javax.swing.RootPaneContainer, java.io.Serializable, TargetListener, javax.swing.WindowConstants

public class ProjectBrowser
extends javax.swing.JFrame
implements java.beans.PropertyChangeListener, TargetListener

The main window of the ArgoUML application.

See Also:
Serialized Form

Nested Class Summary
(package private)  class ProjectBrowser.WindowCloser
           
 
Field Summary
protected  java.lang.String _appName
           
protected  DetailsPane _eastPane
           
protected  MultiEditorPane _editorPane
           
private  GenericArgoMenuBar _menuBar
           
private  NavigatorPane _navPane
          The navigator pane containing the modelstructure
protected  DetailsPane _northEastPane
           
protected  DetailsPane _northPane
           
protected  DetailsPane _northWestPane
           
protected  DetailsPane _southEastPane
           
protected  DetailsPane _southPane
           
protected  javax.swing.JPanel _southWestPane
           
private  SplashScreen _splash
          The splash screen shown at startup
private static boolean _Splash
           
protected  StatusBar _statusBar
          partially implemented.
private  java.lang.Object _target
          The target the user has selected
private static java.lang.String _Title
           
private  ToDoPane _todoPane
          The todopane (lower left corner of screen)
protected  javax.swing.JPanel _westPane
           
protected  BorderSplitPane _workarea
           
private static java.lang.String BUNDLE
           
protected static Logger cat
           
static int DEFAULT_COMPONENTHEIGHT
           
static int DEFAULT_COMPONENTWIDTH
           
 java.awt.Font defaultFont
          this needs work so that users can set the font size through a gui preference window
private  java.util.Map detailsPanesByCompassPoint
           
private static ProjectBrowser TheInstance
          Member attribute to contain the singleton.
 
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(java.lang.String appName, boolean doSplash)
           
 
Method Summary
protected  java.awt.Component createPanels(boolean doSplash)
          Creates the panels in the working area
 ArgoDiagram getActiveDiagram()
          Deprecated. As of ArgoUml version 0.13.5,replaced by Project.getActiveDiagram()
 java.lang.String getAppName()
           
 java.lang.Object getDetailsTarget()
          Deprecated. As of ArgoUml version 0.13.5,replaced by TargetManager.getInstance().getTarget()
 MultiEditorPane getEditorPane()
           
static ProjectBrowser getInstance()
          Singleton retrieval method for the projectbrowser.
 javax.swing.JMenuBar getJMenuBar()
           
 java.util.Locale getLocale()
           
 javax.swing.JPanel getNamedTab(java.lang.String tabName)
          Find the tabpage with the given label
 NavigatorPane getNavigatorPane()
          Deprecated. 0.15.3 use NavigatorPane.getInstance() instead
 SplashScreen getSplashScreen()
          Deprecated. 0.15 use SplashScreen.getInstance() instead
 StatusBar getStatusBar()
           
 TabSpawnable getTab(java.lang.Class tabClass)
          Get the tab page instance of the given class
 TabProps getTabProps()
          Get the tab page containing the properties
 java.lang.Object getTarget()
          Deprecated. As of ArgoUml version 0.13.5,replaced by TargetManager.getInstance().getTarget()
 ToDoPane getTodoPane()
          Returns the todopane.
 void jumpToDiagramShowing(VectorSet dms)
          get a list of offenders and display the according diagram, aka implement a method which jumps to the offender.
private  DetailsPane makeDetailsPane(java.lang.String compassPoint, 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(java.lang.Object element)
          Called by a user interface element when a request to navigate to a model element has been received.
 void open(java.lang.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(java.beans.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(java.lang.String tabName)
          Find the tabpage with the given label and make it the front tab
 void setActiveDiagram(ArgoDiagram ad)
          Deprecated. As of ArgoUml version 0.13.5,replaced by Project.setActiveDiagram(ArgoDiagram)
 void setAppName(java.lang.String n)
           
static void setSplash(boolean splash)
           
 void setSplashScreen(SplashScreen splash)
          Sets the splashscreen.
 void setTarget(java.lang.Object o)
          Deprecated. As of ArgoUml version 0.13.5,replaced by TargetManager.getInstance().setTarget(Object)
 void setTitle(java.lang.String title)
           
 void setToDoItem(java.lang.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(java.lang.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

cat

protected static Logger cat

BUNDLE

private static final java.lang.String BUNDLE
See Also:
Constant Field Values

DEFAULT_COMPONENTWIDTH

public static final int DEFAULT_COMPONENTWIDTH
See Also:
Constant Field Values

DEFAULT_COMPONENTHEIGHT

public static final int DEFAULT_COMPONENTHEIGHT
See Also:
Constant Field Values

TheInstance

private static ProjectBrowser TheInstance
Member attribute to contain the singleton.


_Title

private static java.lang.String _Title

_Splash

private static boolean _Splash

_appName

protected java.lang.String _appName

_editorPane

protected MultiEditorPane _editorPane

_northEastPane

protected DetailsPane _northEastPane

_northPane

protected DetailsPane _northPane

_northWestPane

protected DetailsPane _northWestPane

_westPane

protected javax.swing.JPanel _westPane

_eastPane

protected DetailsPane _eastPane

_southEastPane

protected DetailsPane _southEastPane

_southWestPane

protected javax.swing.JPanel _southWestPane

_southPane

protected DetailsPane _southPane

detailsPanesByCompassPoint

private java.util.Map detailsPanesByCompassPoint

_menuBar

private GenericArgoMenuBar _menuBar

_statusBar

protected StatusBar _statusBar
partially implemented. needs work to display import of source and saving of zargo


defaultFont

public java.awt.Font defaultFont
this needs work so that users can set the font size through a gui preference window


_workarea

protected BorderSplitPane _workarea

_splash

private SplashScreen _splash
The splash screen shown at startup


_navPane

private NavigatorPane _navPane
The navigator pane containing the modelstructure


_todoPane

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


_target

private java.lang.Object _target
The target the user has selected

Constructor Detail

ProjectBrowser

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


ProjectBrowser

private ProjectBrowser(java.lang.String appName,
                       boolean doSplash)
Method Detail

getLocale

public java.util.Locale getLocale()
Overrides:
getLocale in class java.awt.Window

createPanels

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

Returns:
Component

restorePanelSizes

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


setTitle

public void setTitle(java.lang.String title)
Overrides:
setTitle in class java.awt.Frame

updateTitle

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


getAppName

public java.lang.String getAppName()

setAppName

public void setAppName(java.lang.String n)

setTarget

public void setTarget(java.lang.Object o)
Deprecated. As of ArgoUml version 0.13.5,replaced by TargetManager.getInstance().setTarget(Object)

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...


getTarget

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

return the current target in the editor pane


setActiveDiagram

public void setActiveDiagram(ArgoDiagram ad)
Deprecated. As of ArgoUml version 0.13.5,replaced by Project.setActiveDiagram(ArgoDiagram)

Set the diagram on which the user is currently working. When importing sources this should call the name of the folder from which the classes were imported. It should also default the model name as well. setTarget(java.lang.Object).


getActiveDiagram

public ArgoDiagram getActiveDiagram()
Deprecated. As of ArgoUml version 0.13.5,replaced by Project.getActiveDiagram()

Return the diagram, the user is currently working on.


setToDoItem

public void setToDoItem(java.lang.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


getDetailsTarget

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

Gets the target of the detailspane. This is exactly the same as the target of the TargetManager.

Returns:
the target

getTabProps

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

Returns:
the TabProps tabpage

getTab

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

Returns:
the tabpage

getStatusBar

public StatusBar getStatusBar()

getJMenuBar

public javax.swing.JMenuBar getJMenuBar()
Overrides:
getJMenuBar in class javax.swing.JFrame

getEditorPane

public MultiEditorPane getEditorPane()

selectTabNamed

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

Parameters:
tabName - The tabpage label

getNamedTab

public javax.swing.JPanel getNamedTab(java.lang.String tabName)
Find the tabpage with the given label

Parameters:
tabName - The tabpage label
Returns:
the tabpage

jumpToDiagramShowing

public void jumpToDiagramShowing(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)
Overrides:
setVisible in class java.awt.Component

showStatus

public void showStatus(java.lang.String s)

navigateTo

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


open

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


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)

moduleEnabled

public void moduleEnabled(ArgoModuleEvent event)

moduleDisabled

public void moduleDisabled(ArgoModuleEvent event)

makeDetailsPane

private DetailsPane makeDetailsPane(java.lang.String compassPoint,
                                    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(java.beans.PropertyChangeEvent evt)
Specified by:
propertyChange in interface java.beans.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

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

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

getTodoPane

public ToDoPane getTodoPane()
Returns the todopane.

Returns:
ToDoPane

getNavigatorPane

public NavigatorPane getNavigatorPane()
Deprecated. 0.15.3 use NavigatorPane.getInstance() instead

Returns the navigatorpane.

Returns:
NavigatorPane The navigatorpane

getSplashScreen

public SplashScreen getSplashScreen()
Deprecated. 0.15 use SplashScreen.getInstance() instead

Returns the splashscreen shown at startup.

Returns:
SplashScreen

setSplashScreen

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

Parameters:
splash -

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)


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