org.openbp.cockpit.plugins.variables
Class VariablesPlugin

java.lang.Object
  extended by org.openbp.jaspira.plugin.AbstractPlugin
      extended by org.openbp.jaspira.gui.plugin.AbstractVisiblePlugin
          extended by org.openbp.cockpit.plugins.variables.VariablesPlugin
All Implemented Interfaces:
java.awt.event.FocusListener, java.awt.event.HierarchyListener, java.util.EventListener, DragOrigin, InteractionClient, VisiblePlugin, Plugin, PropertyBrowserListener, SaveStrategy

public class VariablesPlugin
extends AbstractVisiblePlugin
implements SaveStrategy, PropertyBrowserListener, InteractionClient, DragOrigin, java.awt.event.FocusListener

This plugin displays the variables used by a process in a tree table. It supports drag and drop between the tree table and the workspace (i. e. node socket parameters).

Author:
Heiko Erhardt

Nested Class Summary
 class VariablesPlugin.Events
          Event handler module.
 class VariablesPlugin.SaveEvents
          Event module that manages the save operation.
 
Nested classes/interfaces inherited from class org.openbp.jaspira.gui.plugin.AbstractVisiblePlugin
AbstractVisiblePlugin.StandardVisiblePluginEvents
 
Nested classes/interfaces inherited from class org.openbp.jaspira.plugin.AbstractPlugin
AbstractPlugin.StandardPluginEvents
 
Field Summary
 
Fields inherited from class org.openbp.jaspira.plugin.AbstractPlugin
PROPERTY_CONDITION, PROPERTY_DESCRIPTION, PROPERTY_ICON, PROPERTY_NAME, PROPERTY_SEQUENCE, PROPERTY_TITLE, PROPERTY_VENDOR, PROPERTY_VERSION
 
Fields inherited from interface org.openbp.jaspira.gui.plugin.VisiblePlugin
GER, GEU, SIZE_VARIABLE_BOTH, SIZE_VARIABLE_HEIGHT, SIZE_VARIABLE_NONE, SIZE_VARIABLE_WIDTH, TOOLBAR_DYNAMIC, TOOLBAR_EVENTS, TOOLBAR_NONE
 
Fields inherited from interface org.openbp.jaspira.plugin.Plugin
ID_DELIMETER, LEVEL_APPLICATION, LEVEL_FRAME, LEVEL_PAGE, LEVEL_PLUGIN
 
Constructor Summary
VariablesPlugin()
           
 
Method Summary
 void addParam(java.lang.String name, DataTypeItem type)
          Adds a parameter to the variable list of the currently selected process.
 void dragActionTriggered(java.lang.Object regionId, java.awt.Point p)
          Called to signal additional actions, such as hovering for a certain time over the region.
 void dragEnded(java.awt.datatransfer.Transferable transferable)
          called when a dragging has ended.
 void dragStarted(java.awt.datatransfer.Transferable transferable)
          Called when a dragging has been started.
 void dropAccepted(java.awt.datatransfer.Transferable t)
          Is called when the drop has been accepted.
 void dropCanceled(java.awt.datatransfer.Transferable t)
          Is called when the drop has been Canceled.
 void dropPerformed(java.awt.datatransfer.Transferable t)
          Is called when the drop has been performed.
 boolean executeSave(PropertyBrowser editor)
          This method is called by the property browser when the list of variables needs to be saved.
 void focusGained(java.awt.event.FocusEvent e)
           
 void focusLost(java.awt.event.FocusEvent e)
           
 java.util.List getAllDropRegions(java.util.List flavors, java.awt.datatransfer.Transferable data, java.awt.event.MouseEvent mouseEvent)
          Returns a list of all regions of this client AND possible sub clients.
 java.util.List getAllImportersAt(java.awt.Point p)
          Returns all importers which will be accepted at the given point by this client or one of its sub clients.
 MultiIcon getDragImage()
          Returns the icon that is udes to display the transferable.
 java.util.List getDropRegions(java.util.List flavors, java.awt.datatransfer.Transferable data, java.awt.event.MouseEvent mouseEvent)
          Returns a list of drop regions of this client that are compatible with the provided data flavors.
 java.util.List getImportersAt(java.awt.Point p)
          Returns all importers which will be accepted at the given point by this client.
 java.lang.String getResourceCollectionContainerName()
          Gets the name of the resource component the default resource of the plugin belongs to.
 java.awt.datatransfer.Transferable getTranferableAt(java.awt.Point p)
          Returns the
 void handlePropertyBrowserEvent(PropertyBrowserEvent e)
          Handles an edit event.
 boolean importData(java.lang.Object regionId, java.awt.datatransfer.Transferable data, java.awt.Point p)
          Imports the given transferable into the given region.
protected  void initializeComponents()
          This template method is called after internal Components (i\.e\. title bar etc\.)
protected  void refresh()
          Refreshes the inspector view.
 void showParams()
          Shows the variables of the currently selected process.
 
Methods inherited from class org.openbp.jaspira.gui.plugin.AbstractVisiblePlugin
addPluginFocusListener, applicationReady, canCopy, canCut, canDelete, canDrag, canPageChange, canPaste, copy, createToolbar, cut, delete, firePluginFocusGained, firePluginFocusLost, focusPlugin, getContentPane, getPage, getPluginComponent, getPluginFocusComponent, getPluginFromComponentHierarchy, getPluginHolder, getPluginPanel, getSizeBehavior, getSubClients, getToolbarType, hasCloseButton, hierarchyChanged, initializeResources, installPlugin, installPluginContent, isPluginFocused, isPluginVisible, paste, pluginHidden, pluginShown, postPluginContainerUpdate, removePluginFocusListener, setPluginHolder, showPlugin, stackEvent, uninstallPlugin, updatePluginContainer
 
Methods inherited from class org.openbp.jaspira.plugin.AbstractPlugin
addActionKeySequence, addPlugin, addToPeerGroup, canClose, closeCanceled, containsStackedEvent, fireEvent, fireEvent, fireEvent, getAction, getChildPlugins, getClassName, getCondition, getDescendantPlugins, getDescription, getEventActionNames, getEventModules, getExternalActions, getExternalEventModuleClasses, getExternalOptionModuleClasses, getIcon, getIcon, getLevel, getName, getOptionModules, getParentPlugin, getPeerGroup, getPeerGroupNames, getPeerGroups, getPluginResourceCollection, getPluginState, getSubTitle, getTitle, getUniqueId, getVendor, getVersion, handleEvent, handleKeySequence, inheritEvent, initializeFromPluginProfile, initializePlugin, installFirstPlugin, matchesPeerGroup, matchesPeerGroups, passDown, pluginInstalled, pluginUninstalled, preClose, receiveEvent, removeFromPeerGroup, removePlugin, removeStackedEvent, requestClose, setDescription, setIcon, setName, setParentPlugin, setPluginState, setResourceCollection, setTitle, toString, uninstallLastPlugin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.openbp.jaspira.gui.interaction.InteractionClient
getSubClients
 
Methods inherited from interface org.openbp.jaspira.gui.interaction.DragOrigin
canDrag
 
Methods inherited from interface org.openbp.jaspira.plugin.Plugin
addPlugin, addToPeerGroup, canClose, containsStackedEvent, fireEvent, fireEvent, fireEvent, getAction, getChildPlugins, getClassName, getCondition, getDescendantPlugins, getDescription, getEventActionNames, getIcon, getLevel, getName, getParentPlugin, getPeerGroup, getPeerGroupNames, getPeerGroups, getPluginResourceCollection, getPluginState, getSubTitle, getTitle, getUniqueId, getVendor, getVersion, handleEvent, inheritEvent, initializePlugin, installFirstPlugin, matchesPeerGroup, matchesPeerGroups, receiveEvent, removeFromPeerGroup, removePlugin, requestClose, setParentPlugin, setPluginState, uninstallLastPlugin
 

Constructor Detail

VariablesPlugin

public VariablesPlugin()
Method Detail

getResourceCollectionContainerName

public java.lang.String getResourceCollectionContainerName()
Description copied from class: AbstractPlugin
Gets the name of the resource component the default resource of the plugin belongs to.

Specified by:
getResourceCollectionContainerName in class AbstractPlugin
Returns:
The container name

initializeComponents

protected void initializeComponents()
Description copied from class: AbstractVisiblePlugin
This template method is called after internal Components (i\.e\. title bar etc\.) have been initialized. It shoud be used to initialize plugin specific components.

Specified by:
initializeComponents in class AbstractVisiblePlugin

refresh

protected void refresh()
Refreshes the inspector view.


handlePropertyBrowserEvent

public void handlePropertyBrowserEvent(PropertyBrowserEvent e)
Description copied from interface: PropertyBrowserListener
Handles an edit event.

Specified by:
handlePropertyBrowserEvent in interface PropertyBrowserListener
Parameters:
e - Event

focusGained

public void focusGained(java.awt.event.FocusEvent e)
Specified by:
focusGained in interface java.awt.event.FocusListener
See Also:
FocusListener.focusGained(java.awt.event.FocusEvent)

focusLost

public void focusLost(java.awt.event.FocusEvent e)
Specified by:
focusLost in interface java.awt.event.FocusListener
See Also:
FocusListener.focusLost(java.awt.event.FocusEvent)

executeSave

public boolean executeSave(PropertyBrowser editor)
This method is called by the property browser when the list of variables needs to be saved.

Specified by:
executeSave in interface SaveStrategy
Parameters:
editor - Property browser
Returns:
true: Save successful. The wizard will continue to the next page.
false: Save failed. The page will remain active.

showParams

public void showParams()
Shows the variables of the currently selected process.


addParam

public void addParam(java.lang.String name,
                     DataTypeItem type)
Adds a parameter to the variable list of the currently selected process.

Parameters:
name - Parameter name or null to create one
type - Data type of the parameter

dragActionTriggered

public void dragActionTriggered(java.lang.Object regionId,
                                java.awt.Point p)
Description copied from interface: InteractionClient
Called to signal additional actions, such as hovering for a certain time over the region.

Specified by:
dragActionTriggered in interface InteractionClient
Parameters:
regionId - Id of the region to import into (see BasicDropRegion.getId)
p - Current mouse position in screen coordinates
See Also:
InteractionClient.dragActionTriggered(Object, Point)

dragEnded

public void dragEnded(java.awt.datatransfer.Transferable transferable)
Description copied from interface: InteractionClient
called when a dragging has ended.

Specified by:
dragEnded in interface InteractionClient
Parameters:
transferable - Transferable that has been dragged
See Also:
InteractionClient.dragEnded(Transferable)

dragStarted

public void dragStarted(java.awt.datatransfer.Transferable transferable)
Description copied from interface: InteractionClient
Called when a dragging has been started.

Specified by:
dragStarted in interface InteractionClient
Parameters:
transferable - Transferable to be dragged
See Also:
InteractionClient.dragStarted(Transferable)

getAllDropRegions

public java.util.List getAllDropRegions(java.util.List flavors,
                                        java.awt.datatransfer.Transferable data,
                                        java.awt.event.MouseEvent mouseEvent)
Description copied from interface: InteractionClient
Returns a list of all regions of this client AND possible sub clients.

Specified by:
getAllDropRegions in interface InteractionClient
Parameters:
flavors - List of data flavors to check
data - Transferable to import
mouseEvent - Mouse event that initiated the drag action
Returns:
A list of DragAwareRegion object or null if the drop client or one of its sub clients cannot satisfy at least one of the supplied data flavors
See Also:
InteractionClient.getAllDropRegions(List, Transferable, MouseEvent)

getDropRegions

public java.util.List getDropRegions(java.util.List flavors,
                                     java.awt.datatransfer.Transferable data,
                                     java.awt.event.MouseEvent mouseEvent)
Description copied from interface: InteractionClient
Returns a list of drop regions of this client that are compatible with the provided data flavors.

Specified by:
getDropRegions in interface InteractionClient
Parameters:
flavors - List of data flavors to check
data - Transferable to be imported
mouseEvent - Mouse event that initiated the drag action
Returns:
A list of DragAwareRegion object or null if the drop client cannot satisfy at least one of the supplied data flavors.
The list will contain only regions that belong directly to this drop client.
See Also:
InteractionClient.getDropRegions(List, Transferable, MouseEvent)

getImportersAt

public java.util.List getImportersAt(java.awt.Point p)
Description copied from interface: InteractionClient
Returns all importers which will be accepted at the given point by this client.

Specified by:
getImportersAt in interface InteractionClient
Parameters:
p - Current mouse position in screen coordinates
Returns:
A list of Importer objects or null
See Also:
InteractionClient.getImportersAt(Point)

getAllImportersAt

public java.util.List getAllImportersAt(java.awt.Point p)
Description copied from interface: InteractionClient
Returns all importers which will be accepted at the given point by this client or one of its sub clients.

Specified by:
getAllImportersAt in interface InteractionClient
Parameters:
p - Current mouse position in screen coordinates
Returns:
A list of Importer objects or null
See Also:
InteractionClient.getAllImportersAt(Point)

importData

public boolean importData(java.lang.Object regionId,
                          java.awt.datatransfer.Transferable data,
                          java.awt.Point p)
Description copied from interface: InteractionClient
Imports the given transferable into the given region.

Specified by:
importData in interface InteractionClient
Parameters:
regionId - Id of the region to import into (see BasicDropRegion.getId)
data - Transferable to import
p - Drop point in glass coordinates
Returns:
true The data was successfully imported.
false An error occured while importing the data.
See Also:
InteractionClient.importData(Object, Transferable, Point)

dropAccepted

public void dropAccepted(java.awt.datatransfer.Transferable t)
Is called when the drop has been accepted. Does nothing.

Specified by:
dropAccepted in interface DragOrigin
Parameters:
t - Dragged transferable

dropCanceled

public void dropCanceled(java.awt.datatransfer.Transferable t)
Is called when the drop has been Canceled. Does nothing.

Specified by:
dropCanceled in interface DragOrigin
Parameters:
t - Dragged transferable

dropPerformed

public void dropPerformed(java.awt.datatransfer.Transferable t)
Is called when the drop has been performed. Does nothing.

Specified by:
dropPerformed in interface DragOrigin
Parameters:
t - Dragged transferable

getTranferableAt

public java.awt.datatransfer.Transferable getTranferableAt(java.awt.Point p)
Returns the

Specified by:
getTranferableAt in interface DragOrigin
Parameters:
p - The location at which the drag started in component local coordinates
Returns:
The Transferable to drag

getDragImage

public MultiIcon getDragImage()
Returns the icon that is udes to display the transferable.

Specified by:
getDragImage in interface DragOrigin
Returns:
The image or null if no special drag image is to be constructed


Copyright © 2011. All Rights Reserved.