org.openbp.cockpit.itemeditor
Class NodeItemEditorPlugin

java.lang.Object
  extended by org.openbp.jaspira.plugin.AbstractPlugin
      extended by org.openbp.jaspira.gui.plugin.AbstractVisiblePlugin
          extended by org.openbp.cockpit.itemeditor.NodeItemEditorPlugin
All Implemented Interfaces:
CH.ifa.draw.framework.DrawingEditor, CH.ifa.draw.framework.FigureSelectionListener, java.awt.event.ComponentListener, java.awt.event.FocusListener, java.awt.event.HierarchyListener, java.util.EventListener, DrawingEditorPlugin, Trackable, VisiblePlugin, Plugin

public class NodeItemEditorPlugin
extends AbstractVisiblePlugin
implements DrawingEditorPlugin, Trackable, java.awt.event.ComponentListener, java.awt.event.FocusListener

This plugin represents an editor for a single node

Author:
Stephan Moritz

Nested Class Summary
 class NodeItemEditorPlugin.Events
          Event module.
 class NodeItemEditorPlugin.InteractionEvents
          Interaction module.
 
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
protected  ProcessDrawing drawing
          Process drawing
protected  WorkspaceDrawingView workspaceView
          The (only) drawing view of this editor.
 
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
NodeItemEditorPlugin()
           
 
Method Summary
 void addTrackChangedListener(javax.swing.event.ChangeListener listener)
          The listener is registered for all properties as a WEAK listener, i. e. it may be garbage-collected if not referenced otherwise.
 void addViewChangeListener(CH.ifa.draw.framework.ViewChangeListener arg0)
           
 void cancelUndo()
          The node item editor doesn't support undo, so this method does nothing.
 boolean canCopy()
          Checks if the plugin can copy the selected data to the clipboard.
 boolean canCut()
          Checks if the plugin can cut the selected data to the clipboard.
 boolean canDelete()
          Checks if the plugin can delete the selected data.
 boolean canPaste(java.awt.datatransfer.Transferable transferable)
          Checks if the plugin can paste the data of the given transferable object.
 void centerTrackerAt(java.awt.Point p)
          Centers the trackable component at the specified point.
 void componentHidden(java.awt.event.ComponentEvent e)
           
 void componentMoved(java.awt.event.ComponentEvent e)
           
 void componentResized(java.awt.event.ComponentEvent e)
           
 void componentShown(java.awt.event.ComponentEvent e)
           
 java.awt.datatransfer.Transferable copy()
          Copies the selected data from the plugin to the clipboard.
 java.awt.datatransfer.Transferable cut()
          Cuts the selected data from the plugin to the clipboard.
 void delete()
          Deletes the selected data, if any.
 void endUndo()
          The node item editor doesn't support undo, so this method does nothing.
 void figureSelectionChanged(CH.ifa.draw.framework.DrawingView arg0)
           
 void fireTrackChangedEvent(javax.swing.event.ChangeEvent event)
          Fires an event indicating that the tracker position has changed to the registered track change listeners.
 void focusGained(java.awt.event.FocusEvent e)
           
 void focusLost(java.awt.event.FocusEvent e)
           
 java.awt.Dimension getDocumentSize()
          Returns the size of the document that is displayed in the view.
 java.lang.String getResourceCollectionContainerName()
          Gets the name of the resource component the default resource of the plugin belongs to.
 java.util.List getSubClients()
          Gets the Dnd sub clients of this plugin.
 ModelerToolSupport getToolSupport()
          Gets the the modeler tool support object holding all tools.
 CH.ifa.draw.util.UndoManager getUndoManager()
           
 java.awt.Rectangle getVisibleArea()
          Returns the area that is currently visible.
protected  void initializeComponents()
          This template method is called after internal Components (i\.e\. title bar etc\.)
 boolean isTrackSuspended()
          Returns true if the tracking has been suspended.
 boolean isUndoRecording()
          The node item editor doesn't support undo, so this method does nothing.
 void moveTrackerBy(int x, int y)
          Moves the tracker by the given distance.
 void paste(java.awt.datatransfer.Transferable transferable)
          Pastes the given data into the plugin.
 void pluginShown()
          Called after the plugin has been displayed.
 void removeTrackChangedListener(javax.swing.event.ChangeListener listener)
          Removes a change listener from the trackable object.
 void removeViewChangeListener(CH.ifa.draw.framework.ViewChangeListener arg0)
           
 void repairDamage()
          Corrects any refresh damage in the view.
 void resumeTrack()
          Resumes propagation of track change events.
 void saveNode()
          Saves the edited node.
 void setNode(Node node)
          Sets the node to edit.
 void setScaleFactor(double scaleFactor)
          Sets the scaling factor of the workspace.
 void setVisibleArea(java.awt.Rectangle r)
          Sets the area that is currently visible.
 void showStatus(java.lang.String arg0)
           
 Undoable startUndo(java.lang.String displayName)
          The node item editor doesn't support undo, so this method does nothing.
 void suspendTrack()
          Prevents track change events to be propagated.
 CH.ifa.draw.framework.Tool tool()
           
 void toolDone()
           
 CH.ifa.draw.framework.DrawingView view()
           
 CH.ifa.draw.framework.DrawingView[] views()
           
 
Methods inherited from class org.openbp.jaspira.gui.plugin.AbstractVisiblePlugin
addPluginFocusListener, applicationReady, canDrag, canPageChange, createToolbar, firePluginFocusGained, firePluginFocusLost, focusPlugin, getContentPane, getPage, getPluginComponent, getPluginFocusComponent, getPluginFromComponentHierarchy, getPluginHolder, getPluginPanel, getSizeBehavior, getToolbarType, hasCloseButton, hierarchyChanged, initializeResources, installPlugin, installPluginContent, isPluginFocused, isPluginVisible, pluginHidden, 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.plugin.VisiblePlugin
addPluginFocusListener, canDrag, createToolbar, firePluginFocusGained, firePluginFocusLost, focusPlugin, getPage, getPluginComponent, getPluginFocusComponent, getPluginHolder, getPluginPanel, getSizeBehavior, getToolbarType, hasCloseButton, isPluginFocused, isPluginVisible, pluginHidden, postPluginContainerUpdate, removePluginFocusListener, setPluginHolder, showPlugin, updatePluginContainer
 
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, installPlugin, matchesPeerGroup, matchesPeerGroups, receiveEvent, removeFromPeerGroup, removePlugin, requestClose, setParentPlugin, setPluginState, stackEvent, uninstallLastPlugin, uninstallPlugin
 

Field Detail

workspaceView

protected WorkspaceDrawingView workspaceView
The (only) drawing view of this editor.


drawing

protected ProcessDrawing drawing
Process drawing

Constructor Detail

NodeItemEditorPlugin

public NodeItemEditorPlugin()
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

setNode

public void setNode(Node node)
Sets the node to edit.

Parameters:
node - The node

saveNode

public void saveNode()
Saves the edited node.


getToolSupport

public ModelerToolSupport getToolSupport()
Gets the the modeler tool support object holding all tools.

Specified by:
getToolSupport in interface DrawingEditorPlugin

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
See Also:
AbstractVisiblePlugin.initializeComponents()

pluginShown

public void pluginShown()
Description copied from class: AbstractVisiblePlugin
Called after the plugin has been displayed.

Specified by:
pluginShown in interface VisiblePlugin
Overrides:
pluginShown in class AbstractVisiblePlugin
See Also:
AbstractVisiblePlugin.pluginShown()

componentResized

public void componentResized(java.awt.event.ComponentEvent e)
Specified by:
componentResized in interface java.awt.event.ComponentListener
See Also:
ComponentListener.componentResized(ComponentEvent)

componentHidden

public void componentHidden(java.awt.event.ComponentEvent e)
Specified by:
componentHidden in interface java.awt.event.ComponentListener
See Also:
ComponentListener.componentHidden(ComponentEvent)

componentShown

public void componentShown(java.awt.event.ComponentEvent e)
Specified by:
componentShown in interface java.awt.event.ComponentListener
See Also:
ComponentListener.componentShown(ComponentEvent)

componentMoved

public void componentMoved(java.awt.event.ComponentEvent e)
Specified by:
componentMoved in interface java.awt.event.ComponentListener
See Also:
ComponentListener.componentMoved(ComponentEvent)

figureSelectionChanged

public void figureSelectionChanged(CH.ifa.draw.framework.DrawingView arg0)
Specified by:
figureSelectionChanged in interface CH.ifa.draw.framework.DrawingEditor
Specified by:
figureSelectionChanged in interface CH.ifa.draw.framework.FigureSelectionListener
See Also:
FigureSelectionListener.figureSelectionChanged(DrawingView)

getUndoManager

public CH.ifa.draw.util.UndoManager getUndoManager()
Specified by:
getUndoManager in interface CH.ifa.draw.framework.DrawingEditor
See Also:
DrawingEditor.getUndoManager()

addViewChangeListener

public void addViewChangeListener(CH.ifa.draw.framework.ViewChangeListener arg0)
Specified by:
addViewChangeListener in interface CH.ifa.draw.framework.DrawingEditor
See Also:
DrawingEditor.addViewChangeListener(ViewChangeListener)

removeViewChangeListener

public void removeViewChangeListener(CH.ifa.draw.framework.ViewChangeListener arg0)
Specified by:
removeViewChangeListener in interface CH.ifa.draw.framework.DrawingEditor
See Also:
DrawingEditor.removeViewChangeListener(ViewChangeListener)

showStatus

public void showStatus(java.lang.String arg0)
Specified by:
showStatus in interface CH.ifa.draw.framework.DrawingEditor
See Also:
DrawingEditor.showStatus(String)

tool

public CH.ifa.draw.framework.Tool tool()
Specified by:
tool in interface CH.ifa.draw.framework.DrawingEditor
See Also:
DrawingEditor.tool()

toolDone

public void toolDone()
Specified by:
toolDone in interface CH.ifa.draw.framework.DrawingEditor
See Also:
DrawingEditor.toolDone()

view

public CH.ifa.draw.framework.DrawingView view()
Specified by:
view in interface CH.ifa.draw.framework.DrawingEditor
See Also:
DrawingEditor.view()

views

public CH.ifa.draw.framework.DrawingView[] views()
Specified by:
views in interface CH.ifa.draw.framework.DrawingEditor
See Also:
DrawingEditor.views()

repairDamage

public void repairDamage()
Description copied from interface: DrawingEditorPlugin
Corrects any refresh damage in the view.

Specified by:
repairDamage in interface DrawingEditorPlugin

getSubClients

public java.util.List getSubClients()
Description copied from class: AbstractPlugin
Gets the Dnd sub clients of this plugin.

Specified by:
getSubClients in interface VisiblePlugin
Overrides:
getSubClients in class AbstractVisiblePlugin
Returns:
A list containing this object if it is a InteractionClient or null otherwise

canCopy

public boolean canCopy()
Description copied from interface: VisiblePlugin
Checks if the plugin can copy the selected data to the clipboard.

Specified by:
canCopy in interface VisiblePlugin
Overrides:
canCopy in class AbstractVisiblePlugin
Returns:
true if the plugin can provide clipboard data.

canDelete

public boolean canDelete()
Description copied from interface: VisiblePlugin
Checks if the plugin can delete the selected data.

Specified by:
canDelete in interface VisiblePlugin
Overrides:
canDelete in class AbstractVisiblePlugin
Returns:
If the data can be deleted.

canCut

public boolean canCut()
Description copied from interface: VisiblePlugin
Checks if the plugin can cut the selected data to the clipboard.

Specified by:
canCut in interface VisiblePlugin
Overrides:
canCut in class AbstractVisiblePlugin
Returns:
true if the plugin can provide clipboard data that can be deleted.

canPaste

public boolean canPaste(java.awt.datatransfer.Transferable transferable)
Description copied from interface: VisiblePlugin
Checks if the plugin can paste the data of the given transferable object.

Specified by:
canPaste in interface VisiblePlugin
Overrides:
canPaste in class AbstractVisiblePlugin
Returns:
true if the plugin accepts the given transferable.

copy

public java.awt.datatransfer.Transferable copy()
Description copied from interface: VisiblePlugin
Copies the selected data from the plugin to the clipboard.

Specified by:
copy in interface VisiblePlugin
Overrides:
copy in class AbstractVisiblePlugin
Returns:
The copied data

cut

public java.awt.datatransfer.Transferable cut()
Description copied from interface: VisiblePlugin
Cuts the selected data from the plugin to the clipboard.

Specified by:
cut in interface VisiblePlugin
Overrides:
cut in class AbstractVisiblePlugin
Returns:
The copied data

delete

public void delete()
Description copied from interface: VisiblePlugin
Deletes the selected data, if any.

Specified by:
delete in interface VisiblePlugin
Overrides:
delete in class AbstractVisiblePlugin

paste

public void paste(java.awt.datatransfer.Transferable transferable)
Description copied from interface: VisiblePlugin
Pastes the given data into the plugin.

Specified by:
paste in interface VisiblePlugin
Overrides:
paste in class AbstractVisiblePlugin
Parameters:
transferable - Content to paste

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)

getDocumentSize

public java.awt.Dimension getDocumentSize()
Description copied from interface: Trackable
Returns the size of the document that is displayed in the view.

Specified by:
getDocumentSize in interface Trackable
See Also:
Trackable.getDocumentSize()

getVisibleArea

public java.awt.Rectangle getVisibleArea()
Description copied from interface: Trackable
Returns the area that is currently visible. For a scroll pane, this would be the view rectangle of the viewport of the scroll pane.

Specified by:
getVisibleArea in interface Trackable
Returns:
Rectangle in document coordinates
See Also:
Trackable.getVisibleArea()

setVisibleArea

public void setVisibleArea(java.awt.Rectangle r)
Description copied from interface: Trackable
Sets the area that is currently visible.

Specified by:
setVisibleArea in interface Trackable
Parameters:
r - Rectangle in document coordinates
See Also:
Trackable.setVisibleArea(Rectangle)

centerTrackerAt

public void centerTrackerAt(java.awt.Point p)
Description copied from interface: Trackable
Centers the trackable component at the specified point.

Specified by:
centerTrackerAt in interface Trackable
Parameters:
p - Point in document coordinates
See Also:
Trackable.centerTrackerAt(Point)

moveTrackerBy

public void moveTrackerBy(int x,
                          int y)
Description copied from interface: Trackable
Moves the tracker by the given distance.

Specified by:
moveTrackerBy in interface Trackable
Parameters:
x - Hor. distance in document coordinates
y - Vert. distance in document coordinates
See Also:
Trackable.moveTrackerBy(int, int)

addTrackChangedListener

public void addTrackChangedListener(javax.swing.event.ChangeListener listener)
The listener is registered for all properties as a WEAK listener, i. e. it may be garbage-collected if not referenced otherwise.
ATTENTION: Never add an automatic class (i. e new FocusListener () { ... }) or an inner class that is not referenced otherwise as a weak listener to the list. These objects will be cleared by the garbage collector during the next gc run!

Specified by:
addTrackChangedListener in interface Trackable
See Also:
Trackable.addTrackChangedListener(ChangeListener)

removeTrackChangedListener

public void removeTrackChangedListener(javax.swing.event.ChangeListener listener)
Description copied from interface: Trackable
Removes a change listener from the trackable object.

Specified by:
removeTrackChangedListener in interface Trackable
See Also:
Trackable.removeTrackChangedListener(ChangeListener)

fireTrackChangedEvent

public void fireTrackChangedEvent(javax.swing.event.ChangeEvent event)
Description copied from interface: Trackable
Fires an event indicating that the tracker position has changed to the registered track change listeners.

Specified by:
fireTrackChangedEvent in interface Trackable
Parameters:
event - Event to fire
See Also:
Trackable.fireTrackChangedEvent(ChangeEvent)

suspendTrack

public void suspendTrack()
Prevents track change events to be propagated.

Specified by:
suspendTrack in interface Trackable

resumeTrack

public void resumeTrack()
Resumes propagation of track change events.

Specified by:
resumeTrack in interface Trackable

isTrackSuspended

public boolean isTrackSuspended()
Returns true if the tracking has been suspended.

Specified by:
isTrackSuspended in interface Trackable

setScaleFactor

public void setScaleFactor(double scaleFactor)
Sets the scaling factor of the workspace.


startUndo

public Undoable startUndo(java.lang.String displayName)
The node item editor doesn't support undo, so this method does nothing.

Specified by:
startUndo in interface DrawingEditorPlugin
Parameters:
displayName - Display name or null
This text will appear after the 'undo: ' text in the edit menu.
Returns:
Always null
See Also:
DrawingEditorPlugin.startUndo(String displayName)

endUndo

public void endUndo()
The node item editor doesn't support undo, so this method does nothing.

Specified by:
endUndo in interface DrawingEditorPlugin
See Also:
DrawingEditorPlugin.endUndo()

cancelUndo

public void cancelUndo()
The node item editor doesn't support undo, so this method does nothing.

Specified by:
cancelUndo in interface DrawingEditorPlugin
See Also:
DrawingEditorPlugin.cancelUndo()

isUndoRecording

public boolean isUndoRecording()
The node item editor doesn't support undo, so this method does nothing.

Specified by:
isUndoRecording in interface DrawingEditorPlugin
Returns:
Always false
See Also:
DrawingEditorPlugin.isUndoRecording()


Copyright © 2011. All Rights Reserved.