Poseidon for UMLTM
  UMLdoc
 PREV  CLASSIFIER    NEXT  CLASSIFIER     FRAMES    NO FRAMES      
SUMMARY:   INNER | ATTR | ASSOC | CONSTR | METHOD     DETAIL:   INNER | ATTR | ASSOC | CONSTR | METHOD     DIAGRAMS:   COLLAB | SEQ | STATE | ACTIV

com.gentleware.poseidon.openapi

Class PoseidonUIConnector

com.gentleware.poseidon.openapi.PoseidonUIConnector

public final class PoseidonUIConnector


A facade class for manipulating the UI of Poseidon.


 Attribute Summary
private static final boolean  activeTool
 
arrow_up
 

 Association Summary
private JFrame  _applicationWindow
The top level window that will be the parent of modal dialogs. 
arrow_up
 

 Constructor Summary
private   PoseidonUIConnector()
 
arrow_up
 

 Method Summary
public static void   addContextMenuItem(Class elementClass, Class newAction)
 
public static void   addContextMenuItem(Class elementClass, JComponent item)
 
public static void   addDetailsTab(ProjectType projectType, XTab newTab)
Adds a tab to the details pane. 
public static void   addDiagramToolBarAction(Class diagramActionClass, SimpleTypeInfo diagramType)
Adds the specified action class for the given diagram type. 
public static void   addDiagramToolBarAction(Class diagramActionClass, SimpleTypeInfo diagramType, int index)
Adds the specified action class for the given diagram type. 
public static void   addDiagramToolBarSeparator(SimpleTypeInfo diagramType)
Adds a separator to the current end of the toolbar. 
public static void   addExitListener(VetoableChangeListener listener)
 
public static boolean   addMenuItem(Class action, String menuName)
Adds a menu item to Poseidon. 
public static boolean   addMenuItem(Class action, String menuName, int index)
Inserts a menu item at the given index into the menu given by menuName  
public static void   addMenuSeparator(String menu)
Adds a separator line to the end of the given menu. 
public static void   addMouseMotionInDiagramListener(MouseMotionInDiagramListener listener)
 
public static void   addMultiPerspectiveTab(XTab tab)
Adds a new tab to the lower left area. 
public static void   addSettingsTab(SettingsTabPanel tab, ResourceId settingsType)
Adds a tab to the Edit->Settings window. 
public static boolean   addSubMenu(String resourceBundleName, String resourceKeyName, String menuName)
Inserts a submenu in the given menu. 
public static boolean   addSubMenu(JMenu subMenu, String menuName)
Inserts a submenu in the given menu. 
public static boolean   addSubMenuAfter(String resource, String name, String menuName, String after)
Inserts a submenu in the given menu before another menuItem. 
public static boolean   addSubMenuBefore(String resource, String name, String menuName, String before)
Inserts a submenu in the given menu before another menuItem. 
public static void   addTargetListener(TargetListener listener)
Add a listener to selection changes in the current project. 
public static void   addToolbarEntry(Class action)
Adds a button to the main toolbar. 
public static void   addToolbarEntryAfterAnother(Class newAction, Class previous)
Adds a button to the main toolbar right after the putton of the previous action. 
public static void   addToolbarSeparator()
 
public static void   addToolbarSeparatorAfterAnother(Class action)
 
public static boolean   addTopLevelMenu(String resource, String menuName)
 
public static JFrame   getApplicationWindow()
Returns the main window. 
public static Diagram   getCurrentDiagram()
This method is not at all the same as getTarget().getDiagram(). 
public static DiagramPanel   getCurrentDiagramPanel()
 
public static Component   getDetailsTab(String tabName)
Gets a tab by its name. 
public static Target   getEmptyTarget()
 
public static ProjectPanel   getPanel()
 
private static ProjectPanelManager   getPanelManager()
Finds a PanelManager instance for the current project. 
public static Target   getTarget()
 
public static JToolBar   getToolBar()
 
public static void   insertDetailsTab(ProjectType projectType, int pos, XTab newTab)
Inserts a details tab at the given position. 
public static boolean   insertMenuItem(Class action, String menuName, String anchor)
Inserts a menu item after the menu item given in 'anchor'. 
public static boolean   insertMenuItem(Class action, String menuName, String anchor, boolean after)
 
public static boolean   insertMenuItem(Class action, String menuName, String anchor, boolean after, ProjectType projectType)
 
public static boolean   insertTopLevelMenu(String resource, String menuName, String anchor, boolean after)
 
public static boolean   isActiveTool()
Is Poseidon currently selected by the user, or has another tool the focus?  
public static boolean   isTabEnabled(String tabName)
Checks if a tab in the details pane (lower right), given by its name, is enabled. 
public static void   removeContextMenuItem(Class elementClass, Class action)
 
public static void   removeContextMenuItem(Class elementClass, JComponent item)
 
public static void   removeDetailsTab(XTab oldTab)
 
public static void   removeDetailsTab(String oldTabName)
 
public static void   removeDiagramToolBarAction(Class diagramActionClass, SimpleTypeInfo diagramType)
Removes the specified action class for the given diagram type. 
public static void   removeDiagramToolBarSeparator(SimpleTypeInfo diagramType)
Removes the last separator from the toolbar. 
public static void   removeExitListener(VetoableChangeListener listener)
 
public static boolean   removeMenuItem(String itemName, String menuName)
Removes the given menu item. 
public static void   removeMouseMotionInDiagramListener(MouseMotionInDiagramListener listener)
 
public static void   removeMultiPerspectiveTab(XTab tab)
Removes a tab from the lower left area. 
public static void   removeSettingsTab(SettingsTabPanel tab)
Removes a tab from the Edit->Settings window. 
public static void   removeTargetListener(TargetListener listener)
 
public static void   removeToolbarEntry(Class action)
Removes a toolbar button. 
public static boolean   removeTopLevelMenu(String itemName)
 
public static void   selectDetailsTab(String tabName)
 
public static void   setActiveTool(boolean activeTool)
The tool may be set to inactive because the focus went to another application. 
public static void   setApplicationWindow(JFrame applicationWindow)
Sets the JFrame that will be the parent of all future modal dialogs. 
public static void   setDefaultStateIcon(Icon icon, String tooltip)
Sets the default values for the state icon and its tooltip. 
public static void   setProgressMaximum(int maximum)
Sets the maximum vaue for the progress bar. 
public static void   setProgressValue(int value)
Set the progress bar on the lower right to the given value. 
public static void   setSelectedItem(Object source, RefObject selectedObject)
All panes of Poseidon try to show the given object. 
public static void   showStateIcon(Icon icon, String tooltip)
Shows a message in the state text area of the main window (lower right corner). 
public static void   showStatus(String message)
Shows a message in the status bar of the main window. 
public static void   showUrl(String url)
Tries to open a browser and show the given url. 
arrow_up
 

Tagged Values
static false
 

 Attribute Detail

activeTool

private static boolean activeTool

arrow_up
 Association Detail

_applicationWindow

private JFrame _applicationWindow

The top level window that will be the parent of modal dialogs.  
arrow_up
 Constructor Detail

PoseidonUIConnector

private PoseidonUIConnector PoseidonUIConnector()

Returns:
arrow_up
 Method Detail

addContextMenuItem

public static void addContextMenuItem(Class elementClass, Class newAction)

Parameters:
elementClass - Defines for which class of element the action should be displayed.
newAction - The action to display.
Since:
2.0
arrow_up


addContextMenuItem

public static void addContextMenuItem(Class elementClass, JComponent item)

Parameters:
elementClass - Defines for which class of element the action should be displayed.
item - Any element, such as a sub-menu. must have a name (!item.setName().equals(""))
Since:
2.0
arrow_up


addDetailsTab

public static void addDetailsTab(ProjectType projectType, XTab newTab)


Adds a tab to the details pane. The details pane is the area on the lower right. The common tabs are Properties, style, Tagged Values, and so on. Technically, the details pane is a JTabbedPane where you can add and remove your own tabs.

You should use this way of displaying your plugin if it is useful for all or most of the objects in the project. You can disable your tab if it is not applicable to the current target of Poseidon.

Register your panel by project type. These days, this will be UmlProject.class. For other projects like the future Uml2Project, there is the option of only registering to one or to all project types.  

Parameters:
projectType -
newTab -
Since:
2.0
arrow_up


addDiagramToolBarAction

public static void addDiagramToolBarAction(Class diagramActionClass, SimpleTypeInfo diagramType)


Adds the specified action class for the given diagram type.  
Parameters:
diagramActionClass - action class to add, must be derived from DiagramAction providing a constructor accepting a Project and a DiagramPanel as parameter.
diagramType - diagram type to add action class
Since:
2.0
arrow_up


addDiagramToolBarAction

public static void addDiagramToolBarAction(Class diagramActionClass, SimpleTypeInfo diagramType, int index)


Adds the specified action class for the given diagram type.  
Parameters:
diagramActionClass - action class to add, must be derived from DiagramAction providing a constructor accepting a Project and a DiagramPanel as parameter.
diagramType - diagram type to add action class
index - index to place the action
Since:
2.2
arrow_up


addDiagramToolBarSeparator

public static void addDiagramToolBarSeparator(SimpleTypeInfo diagramType)


Adds a separator to the current end of the toolbar.  
Parameters:
diagramType - diagram type to add separator
Since:
2.0
arrow_up


addExitListener

public static void addExitListener(VetoableChangeListener listener)

Parameters:
listener -
arrow_up


addMenuItem

public static boolean addMenuItem(Class action, String menuName)


Adds a menu item to Poseidon.

The standard menus of Poseidon (that is, the alternatives for the parameter menuName) are File, Edit, View, Create Diagram, Arrange, Generation, Critique, Help. All but the CE edition also have the menu Plugins.

To set up a menu item, define the action with the correct internationalized name. In your resource bundle, you have an entry for <itemName>, and another for <itemName>_mnemonic.

 

Parameters:
action - What is to be done. It is recommended to use a subclass of XAbstractAction.
menuName - The menu title where the menuItem is to be added (before internationalization).
Returns:
True if the insertion worked.
See also:
com.gentleware.poseidon.openapi.PoseidonResourceConnector#localize(com.gentleware.services.swingx.ResourceId)
arrow_up


addMenuItem

public static boolean addMenuItem(Class action, String menuName, int index)


Inserts a menu item at the given index into the menu given by menuName  
Parameters:
action -
menuName -
index -
Returns:
Since:
2.1.4
arrow_up


addMenuSeparator

public static void addMenuSeparator(String menu)


Adds a separator line to the end of the given menu.  
Parameters:
menu - The menu name (before internationalization).
arrow_up


addMouseMotionInDiagramListener

public static void addMouseMotionInDiagramListener(MouseMotionInDiagramListener listener)

Parameters:
listener -
Since:
2.2
arrow_up


addMultiPerspectiveTab

public static void addMultiPerspectiveTab(XTab tab)


Adds a new tab to the lower left area.  
Parameters:
tab -
arrow_up


addSettingsTab

public static void addSettingsTab(SettingsTabPanel tab, ResourceId settingsType)


Adds a tab to the Edit->Settings window.  
Parameters:
tab -
settingsType -
See also:
org.argouml.ui.SettingsTabPanel
arrow_up


addSubMenu

public static boolean addSubMenu(String resourceBundleName, String resourceKeyName, String menuName)

Deprecated.
needs ResourceId

Inserts a submenu in the given menu.  
Parameters:
resourceBundleName -
resourceKeyName -
menuName -
Returns:
arrow_up


addSubMenu

public static boolean addSubMenu(JMenu subMenu, String menuName)


Inserts a submenu in the given menu.  
Parameters:
subMenu - the new submenu.
menuName - The name of the menu where the subMenu is inserted (before internationalization).
Returns:
True if the insertion worked.
Since:
2.0
arrow_up


addSubMenuAfter

public static boolean addSubMenuAfter(String resource, String name, String menuName, String after)

Deprecated.
needs ResourceId

Inserts a submenu in the given menu before another menuItem.  
Parameters:
resource -
name -
menuName -
after -
Returns:
arrow_up


addSubMenuBefore

public static boolean addSubMenuBefore(String resource, String name, String menuName, String before)

Deprecated.
needs ResourceId

Inserts a submenu in the given menu before another menuItem.  
Parameters:
resource -
name -
menuName -
before -
Returns:
arrow_up


addTargetListener

public static void addTargetListener(TargetListener listener)


Add a listener to selection changes in the current project.
Note  
Parameters:
listener -
Since:
2.0
arrow_up


addToolbarEntry

public static void addToolbarEntry(Class action)


Adds a button to the main toolbar.  
Parameters:
action - Contains the UI and action information on the button.
arrow_up


addToolbarEntryAfterAnother

public static void addToolbarEntryAfterAnother(Class newAction, Class previous)


Adds a button to the main toolbar right after the putton of the previous action. If the 'previous' action does not exist, the button is appended.  
Parameters:
newAction - The action that is to be inserted.
previous - The action after which the new action should be located.
arrow_up


addToolbarSeparator

public static void addToolbarSeparator()

arrow_up


addToolbarSeparatorAfterAnother

public static void addToolbarSeparatorAfterAnother(Class action)

Parameters:
action -
arrow_up


addTopLevelMenu

public static boolean addTopLevelMenu(String resource, String menuName)

Parameters:
resource -
menuName -
Returns:
arrow_up


getApplicationWindow

public static JFrame getApplicationWindow()


Returns the main window. This is needed for modal dialogs, and for dialogs that want to position themselves relatively to the main window (eg, Print dialog). These take the root JFrame and use its bounds.
Poseidon can run as component in a foreign JFrame to foster application integration with other tools. In this case, the controlling application must set the application Window, or Poseidon's dialogs will fail to appear all over the place. If the owning application has not set the frame, such as when it is an Eclipse application that does not know about JFrames, a dummy JFrame with bounds 0,0,1,1 is returned.  
Returns:
The application window that was set at startup, null if Poseidon is started headless on its own.
arrow_up


getCurrentDiagram

public static Diagram getCurrentDiagram()


This method is not at all the same as getTarget().getDiagram(). Poseidon always displays a diagram. So this method will never be null. getTarget().getDiagram() is only not null if the user selected a diagram explicitly, eg, by clicking on it in the tree or clicking on an empty area in the drawing area.  
Returns:
the displayed diagram, or null (should really not happen! if it does, something is wrong).
arrow_up


getCurrentDiagramPanel

public static DiagramPanel getCurrentDiagramPanel()

Returns:
the tab that contains the current diagram, or null.
arrow_up


getDetailsTab

public static Component getDetailsTab(String tabName)


Gets a tab by its name. Beware: This component is not valid across different projects. The name is the string that was set at the tab with the method setName(), not setTitle() .  
Parameters:
tabName -
Returns:
arrow_up


getEmptyTarget

public static Target getEmptyTarget()

Returns:
the empty target. Useful for comparision or to unselect all items.
Since:
2.0
arrow_up


getPanel

public static ProjectPanel getPanel()

Returns:
The component that represents the current project in the UI.
arrow_up


getPanelManager

private static ProjectPanelManager getPanelManager()


Finds a PanelManager instance for the current project. todo Should address the panel managers by project type. Currently, only UMLPanelManagers can be modified. todo Differentiate between application-wide modifications and project type-wide modifications of menus etc  
Returns:
A UMLPanelManager.
arrow_up


getTarget

public static Target getTarget()

Returns:
the selected object (set by setSelectedElement), or null.
arrow_up


getToolBar

public static JToolBar getToolBar()

Returns:
arrow_up


insertDetailsTab

public static void insertDetailsTab(ProjectType projectType, int pos, XTab newTab)


Inserts a details tab at the given position.  
Parameters:
projectType -
pos -
newTab -
Since:
2.0
arrow_up


insertMenuItem

public static boolean insertMenuItem(Class action, String menuName, String anchor)


Inserts a menu item after the menu item given in 'anchor'.  
Parameters:
action -
menuName -
anchor -
Returns:
True if the insertion worked.
arrow_up


insertMenuItem

public static boolean insertMenuItem(Class action, String menuName, String anchor, boolean after)

Parameters:
action -
menuName -
anchor -
after -
Returns:
arrow_up


insertMenuItem

public static boolean insertMenuItem(Class action, String menuName, String anchor, boolean after, ProjectType projectType)

Parameters:
action -
menuName -
anchor -
after -
projectType -
Returns:
arrow_up


insertTopLevelMenu

public static boolean insertTopLevelMenu(String resource, String menuName, String anchor, boolean after)

Parameters:
resource -
menuName -
anchor -
after -
Returns:
arrow_up


isActiveTool

public static boolean isActiveTool()


Is Poseidon currently selected by the user, or has another tool the focus?  
Returns:
arrow_up


isTabEnabled

public static boolean isTabEnabled(String tabName)


Checks if a tab in the details pane (lower right), given by its name, is enabled.  
Parameters:
tabName - The resource key of the name of the tab.
Returns:
arrow_up


removeContextMenuItem

public static void removeContextMenuItem(Class elementClass, Class action)

Parameters:
elementClass -
action -
Since:
2.0
arrow_up


removeContextMenuItem

public static void removeContextMenuItem(Class elementClass, JComponent item)

Parameters:
elementClass -
item -
Since:
2.0
arrow_up


removeDetailsTab

public static void removeDetailsTab(XTab oldTab)

Parameters:
oldTab -
arrow_up


removeDetailsTab

public static void removeDetailsTab(String oldTabName)

Parameters:
oldTabName -
arrow_up


removeDiagramToolBarAction

public static void removeDiagramToolBarAction(Class diagramActionClass, SimpleTypeInfo diagramType)


Removes the specified action class for the given diagram type.  
Parameters:
diagramActionClass - action class to add, must be derived from DiagramAction providing a constructor accepting a Project and a DiagramPanel as parameter.
diagramType - diagram type to add action class
Since:
2.0
arrow_up


removeDiagramToolBarSeparator

public static void removeDiagramToolBarSeparator(SimpleTypeInfo diagramType)


Removes the last separator from the toolbar.  
Parameters:
diagramType - diagram type to remove separator
Since:
2.0
arrow_up


removeExitListener

public static void removeExitListener(VetoableChangeListener listener)

Parameters:
listener -
arrow_up


removeMenuItem

public static boolean removeMenuItem(String itemName, String menuName)


Removes the given menu item. Should be called when a plugin is disabled.  
Parameters:
itemName - The name of the entry to be removed (after internationalization). NOTE: If an action was added via its class (addMenuItem(MyAction.class), you HAVE TO use removeMenuItem(MyAction.class.getName()) here
menuName - The name of the menu (before internationalization).
Returns:
arrow_up


removeMouseMotionInDiagramListener

public static void removeMouseMotionInDiagramListener(MouseMotionInDiagramListener listener)

Parameters:
listener -
arrow_up


removeMultiPerspectiveTab

public static void removeMultiPerspectiveTab(XTab tab)


Removes a tab from the lower left area.  
Parameters:
tab -
arrow_up


removeSettingsTab

public static void removeSettingsTab(SettingsTabPanel tab)


Removes a tab from the Edit->Settings window.

Should be called when a plugin is turned off.  

Parameters:
tab -
arrow_up


removeTargetListener

public static void removeTargetListener(TargetListener listener)

Parameters:
listener -
Since:
2.0
arrow_up


removeToolbarEntry

public static void removeToolbarEntry(Class action)


Removes a toolbar button. Should be called when a plugin is disabled.  
Parameters:
action -
arrow_up


removeTopLevelMenu

public static boolean removeTopLevelMenu(String itemName)

Parameters:
itemName -
Returns:
arrow_up


selectDetailsTab

public static void selectDetailsTab(String tabName)

Parameters:
tabName -
arrow_up


setActiveTool

public static void setActiveTool(boolean activeTool)


The tool may be set to inactive because the focus went to another application. In this case, Poseidon may or may not show itself differently, such as showing the current selection in grey instead of blue or whatever.

events that update the UI.  

Parameters:
activeTool - The new state of Poseidon.
Since:
2.0
arrow_up


setApplicationWindow

public static void setApplicationWindow(JFrame applicationWindow)


Sets the JFrame that will be the parent of all future modal dialogs. Use with extreme caution and only if you know what you are doing.  
Parameters:
applicationWindow -
arrow_up


setDefaultStateIcon

public static void setDefaultStateIcon(Icon icon, String tooltip)


Sets the default values for the state icon and its tooltip. This icon will be displayed as long as no other icon is set for the status bar.  
Parameters:
icon - The default icon.
tooltip - The tooltip for the default icon.
Since:
2.4
arrow_up


setProgressMaximum

public static void setProgressMaximum(int maximum)


Sets the maximum vaue for the progress bar. Relative to this number, all setProgressValue calls are interpreted.  
Parameters:
maximum - The new maximum value. Default at startup of Poseidon is 100.
Since:
2.2
arrow_up


setProgressValue

public static void setProgressValue(int value)


Set the progress bar on the lower right to the given value. As the default maximum of the progress bar is 100, the value can be interpreted as percentage.  
Parameters:
value - the progress bar value.
Since:
2.2
arrow_up


setSelectedItem

public static void setSelectedItem(Object source, RefObject selectedObject)


All panes of Poseidon try to show the given object. This means that the next getTarget will return a target containing at least the given element.  
Parameters:
source -
selectedObject -
arrow_up


showStateIcon

public static void showStateIcon(Icon icon, String tooltip)


Shows a message in the state text area of the main window (lower right corner). Localization has to be done by the caller of this operation. Prefix and message will be separated by a whitespace.  
Parameters:
icon - First part of the message to display.
tooltip - Last part of the message to display.
Since:
2.2.1
arrow_up


showStatus

public static void showStatus(String message)


Shows a message in the status bar of the main window.  
Parameters:
message -
arrow_up


showUrl

public static void showUrl(String url)


Tries to open a browser and show the given url.  
Parameters:
url - The url to display, including protocol.
Since:
2.2.1
arrow_up
Created  2004 - 10 - 21

    Poseidon for UMLTM
  UMLdoc
 PREV  CLASSIFIER    NEXT  CLASSIFIER     FRAMES    NO FRAMES      
SUMMARY:   INNER | ATTR | ASSOC | CONSTR | METHOD     DETAIL:   INNER | ATTR | ASSOC | CONSTR | METHOD     DIAGRAMS:   COLLAB | SEQ | STATE | ACTIV

Generated with Poseidon for UMLTM.
Poseidon is a registered trademark of Gentleware AG in Germany, USA and other countries. Copyright 2003-2004 Gentleware AG, Schanzenstr. 70, 20357 Hamburg, Germany. All Rights Reserved.

UML is a trademark or registered trademark of Object Management Group, Inc. in the U.S. and other countries.