org.openbp.cockpit.modeler.drawing
Class ProcessDrawing

java.lang.Object
  extended by CH.ifa.draw.standard.AbstractFigure
      extended by CH.ifa.draw.standard.CompositeFigure
          extended by CH.ifa.draw.standard.StandardDrawing
              extended by org.openbp.cockpit.modeler.drawing.ProcessDrawing
All Implemented Interfaces:
CH.ifa.draw.framework.Drawing, CH.ifa.draw.framework.Figure, CH.ifa.draw.framework.FigureChangeListener, CH.ifa.draw.util.Storable, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, UpdatableFigure, ProcessElementContainer, VisualElement, Modifiable, InteractionClient

public class ProcessDrawing
extends CH.ifa.draw.standard.StandardDrawing
implements ProcessElementContainer, Modifiable

A ProcessDrawing is the graphical representation of a OpenBP process. (i.e. a JHotDraw StandardDrawing with Process related elements).

Author:
Stephan Moritz
See Also:
Serialized Form

Field Summary
 
Fields inherited from class CH.ifa.draw.standard.CompositeFigure
_nHighestZ, _nLowestZ, fFigures
 
Fields inherited from interface org.openbp.cockpit.modeler.figures.VisualElement
VISUAL_DISPLAY_ALL, VISUAL_DND_PARTICIPANT, VISUAL_VISIBLE
 
Fields inherited from interface CH.ifa.draw.framework.Figure
POPUP_MENU
 
Constructor Summary
ProcessDrawing(ProcessItem process, DrawingEditorPlugin editor)
          Constructor.
 
Method Summary
 CH.ifa.draw.framework.Figure add(CH.ifa.draw.framework.Figure figure)
           
 void bringToFront(CH.ifa.draw.framework.Figure f)
          Brings the given figure to front.
 void clearModified()
          Clears the modified flag of the process and updates the save button accordingly.
 FlowConnection createFlowConnection(ControlLink link)
          Creates a new flow connection based on the given control link.
 NodeFigure createNodeFigure(Node node)
          Creates a new node figure based on the given node.
 ParamConnection createParamConnection(DataLink link)
          Creates a new parameter connection based on the given data link.
 TextElementFigure createTextElementFigure(TextElement textElement)
          Creates a text element figure based on the given text element.
 void decodeGeometry()
          Encodes the geometry of this process.
protected  void decodeProcessGeometry(java.lang.String geometry)
          Decodes the swim lane geometry of the process.
 java.awt.Rectangle displayBox()
           
 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 encodeGeometry()
          Encodes the geometry of this process, i\.e\. causes all figures to encode their geometry.
protected  java.lang.String encodeProcessGeometry()
          Encodes the swim lane geometry of the process.
 CH.ifa.draw.framework.Figure findFigure(int x, int y)
          If the user clicks a flow access (e\.g\. to create a new flow connection), it often happens that he selects an already existing link to the flow access point.
 ProcessElementContainer findProcessElementContainer(int x, int y)
          Finds the process element container at the given position.
 ProcessElementContainer findProcessElementContainerInside(int x, int y)
          Finds the process element container inside the element at the given position.
 VisualElement findVisualElement(int x, int y)
          Gets the visual element that is a child of this element and matches the given coordinates.
 VisualElement findVisualElementInside(int x, int y)
          Gets the visual element that is a child of this element and matches the given coordinates (recursively).
 java.awt.Point getActualOrigin()
          Returns the upper left corner of the used part of the drawing.
 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.Iterator getAllFigures()
          Gets all top level figures of this drawing.
 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.
 java.lang.String getDescription()
           
 java.lang.String getDescriptionText()
           
 java.lang.String getDisplayName()
           
 java.lang.String getDisplayText()
           
 ProcessDrawing getDrawing()
          Gets the drawing the element is a part of.
 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.
 DrawingEditorPlugin getEditor()
          Gets the editor that edits this drawing.
 ProcessElementContainer getFigureByQualifier(ModelQualifier qualifier)
          Gets a process element container by the model qualifier of the corrresponding process element.
protected  java.util.List getFigureList()
          Gets all top level figures of this drawing.
protected  java.util.List getFlowConnectionList()
          Gets the flow connections of this drawing.
 java.util.Iterator getFlowConnections()
          Gets the flow connections of this drawing.
 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 getName()
           
protected  java.util.List getNodeFigureList()
          Gets the node figures of this drawing.
 java.util.Iterator getNodeFigures()
          Gets the node figures of this drawing.
protected  java.util.List getParamConnectionList()
          Gets the parameter connections of this drawing.
 java.util.Iterator getParamConnections()
          Gets the parameter connections of this drawing.
 VisualElement getParentElement()
          Gets parent element of this element, if any.
 CH.ifa.draw.framework.Figure getPresentationFigure()
          Gets the presentation figure of this element.
 ProcessItem getProcess()
          Gets the process represented by this drawing.
 ProcessObject getProcessElement()
          Returns the contained process element.
 Skin getProcessSkin()
          Gets the process skin.
 ProcessObject getReferredProcessElement()
          Returns the process element this figure refers to.
 java.util.List getSubClients()
          Returns subordinate clients of this client.
 WorkspaceDrawingView getView()
          Gets the (only) drawing view of this editor.
 boolean handleEvent(VisualElementEvent event)
          Handler method that is called for handling events.
 boolean importData(java.lang.Object regionId, java.awt.datatransfer.Transferable data, java.awt.Point p)
          Imports the given transferable into the given region.
 boolean isDisplayAll()
           
 boolean isModified()
          Gets the modified flag for usage by editors.
 boolean isReadOnly()
          Gets the status variable: The process is readonly.
 boolean isVisible()
          Gets the flag if the element is currently visible.
 void layoutAllConnections()
          Recalculate the layout of all connections.
 void normalize()
          Normalizes the drawing, i\.e\. moves it so that its top left corner lies at 50,50.
protected  void recalculateZOrders()
          Reorders the figures of the drawing according to their preferred z-order.
 CH.ifa.draw.framework.Figure remove(CH.ifa.draw.framework.Figure figure)
           
 void removeAndUpdate(CH.ifa.draw.framework.Figure figure)
          Removes a figure from the drawing.
 CH.ifa.draw.framework.Figure selectionOnDelete()
          Returns the figure that should be selected after this figure has been deleted.
 void setDescription(java.lang.String string)
           
 void setDisplayAll(boolean visible)
           
 void setDisplayName(java.lang.String string)
           
 void setDrawing(ProcessDrawing processDrawing)
          Sets the drawing the element is a part of.
 void setEditor(DrawingEditorPlugin editor)
          Sets the editor of this drawing.
 void setModified()
          Sets the modified flag of the process and updates the save button accordingly.
 void setName(java.lang.String string)
           
 void setProcess(ProcessItem process)
          Sets the process represented by this drawing.
 void setProcessSkin(Skin processSkin)
          Sets the process skin.
 void setReadOnly(boolean readOnly)
          Sets the status variable: The process is readonly.
 void setTagState(int stateUpdate)
          Sets the tag state of all tags of the nodes of this drawing.
 void setVisible(boolean visible)
          Sets the flag if the element is currently visible.
 void updateFigure()
          Synchronizes this figure with its provider, i\.e\. the object that is represented by the figure.
 void updateModificationState()
          Updates the status of the save button according to the modification state of the process.
 void updatePresentationFigure()
          Updates (reinitializes) the presentation figure.
 
Methods inherited from class CH.ifa.draw.standard.StandardDrawing
addDrawingChangeListener, basicDisplayBox, drawingChangeListeners, figureInvalidated, figureRequestRemove, figureRequestUpdate, getTitle, handles, lock, removeDrawingChangeListener, setTitle, unlock
 
Methods inherited from class CH.ifa.draw.standard.CompositeFigure
addAll, addAll, basicMoveBy, draw, draw, figureAt, figureChanged, figureCount, figureRemoved, figures, figures, figuresReverse, findFigure, findFigure, findFigureInside, findFigureInsideWithout, findFigureWithout, getFigureFromLayer, getLayer, includes, init, orphan, orphanAll, orphanAll, read, release, removeAll, removeAll, removeAll, replace, sendToBack, sendToLayer, write
 
Methods inherited from class CH.ifa.draw.standard.AbstractFigure
addFigureChangeListener, addToContainer, canConnect, center, changed, clone, connectedTextLocator, connectionInsets, connectorAt, connectorVisibility, containsPoint, decompose, displayBox, displayBox, getAttribute, getZValue, invalidate, isEmpty, listener, moveBy, removeFigureChangeListener, removeFromContainer, setAttribute, setZValue, size, willChange
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface CH.ifa.draw.framework.Figure
addFigureChangeListener, addToContainer, basicDisplayBox, canConnect, center, changed, clone, connectedTextLocator, connectionInsets, connectorAt, connectorVisibility, containsPoint, decompose, displayBox, displayBox, draw, figures, findFigureInside, getAttribute, getZValue, handles, includes, invalidate, isEmpty, listener, moveBy, release, removeFigureChangeListener, removeFromContainer, setAttribute, setZValue, size, willChange
 
Methods inherited from interface CH.ifa.draw.util.Storable
read, write
 
Methods inherited from interface CH.ifa.draw.framework.Drawing
addAll, addAll, draw, draw, figures, figures, figuresReverse, findFigure, findFigure, findFigureInside, findFigureInsideWithout, findFigureWithout, getFigureFromLayer, getLayer, includes, init, orphan, orphanAll, orphanAll, release, removeAll, removeAll, replace, sendToBack, sendToLayer
 
Methods inherited from interface CH.ifa.draw.framework.FigureChangeListener
figureChanged, figureRemoved
 

Constructor Detail

ProcessDrawing

public ProcessDrawing(ProcessItem process,
                      DrawingEditorPlugin editor)
Constructor.

Parameters:
process - The process this drawing represents
editor - Editor that edits this drawing
Method Detail

getProcess

public ProcessItem getProcess()
Gets the process represented by this drawing.


setProcess

public void setProcess(ProcessItem process)
Sets the process represented by this drawing.

Parameters:
process - Process to represent or null to clear. In the latter case, the method will remove all references of the current process to drawing objects (figures) from the current process, if any.
So call setProces (null) after you closing the modeler associated with this drawing.

getProcessSkin

public Skin getProcessSkin()
Gets the process skin.


setProcessSkin

public void setProcessSkin(Skin processSkin)
Sets the process skin.


getEditor

public DrawingEditorPlugin getEditor()
Gets the editor that edits this drawing.


setEditor

public void setEditor(DrawingEditorPlugin editor)
Sets the editor of this drawing.


getView

public WorkspaceDrawingView getView()
Gets the (only) drawing view of this editor.


isReadOnly

public boolean isReadOnly()
Gets the status variable: The process is readonly.


setReadOnly

public void setReadOnly(boolean readOnly)
Sets the status variable: The process is readonly.


getAllFigures

public java.util.Iterator getAllFigures()
Gets all top level figures of this drawing.

Returns:
An iterator of Figure objects

getFigureList

protected java.util.List getFigureList()
Gets all top level figures of this drawing.

Returns:
A list of Figure objects

getNodeFigures

public java.util.Iterator getNodeFigures()
Gets the node figures of this drawing.

Returns:
An iterator of NodeFigure objects

getNodeFigureList

protected java.util.List getNodeFigureList()
Gets the node figures of this drawing.

Returns:
A list of NodeFigure objects

getParamConnections

public java.util.Iterator getParamConnections()
Gets the parameter connections of this drawing.

Returns:
An iterator of ParamConnection objects

getParamConnectionList

protected java.util.List getParamConnectionList()
Gets the parameter connections of this drawing.

Returns:
A list of ParamConnection objects

getFlowConnections

public java.util.Iterator getFlowConnections()
Gets the flow connections of this drawing.

Returns:
An iterator of FlowConnection objects

getFlowConnectionList

protected java.util.List getFlowConnectionList()
Gets the flow connections of this drawing.

Returns:
A list of FlowConnection objects

add

public CH.ifa.draw.framework.Figure add(CH.ifa.draw.framework.Figure figure)
Specified by:
add in interface CH.ifa.draw.framework.Drawing
Overrides:
add in class CH.ifa.draw.standard.CompositeFigure
See Also:
CompositeFigure.add(Figure)

setTagState

public void setTagState(int stateUpdate)
Sets the tag state of all tags of the nodes of this drawing.

Parameters:
stateUpdate - State to add to the current state

layoutAllConnections

public void layoutAllConnections()
Recalculate the layout of all connections.


remove

public CH.ifa.draw.framework.Figure remove(CH.ifa.draw.framework.Figure figure)
Specified by:
remove in interface CH.ifa.draw.framework.Drawing
Overrides:
remove in class CH.ifa.draw.standard.StandardDrawing
See Also:
StandardDrawing.remove(Figure figure)

removeAndUpdate

public void removeAndUpdate(CH.ifa.draw.framework.Figure figure)
Removes a figure from the drawing. Resets the propertybrowser beforehand.

Parameters:
figure - Figure to be removed

findFigure

public CH.ifa.draw.framework.Figure findFigure(int x,
                                               int y)
If the user clicks a flow access (e\.g\. to create a new flow connection), it often happens that he selects an already existing link to the flow access point. This is due to the fact that the links appear on top of the nodes. In order to prevent this, we override this method and use figures() instead of the original figuresReverse() for enumerating the figures.

Specified by:
findFigure in interface CH.ifa.draw.framework.Drawing
Overrides:
findFigure in class CH.ifa.draw.standard.CompositeFigure
See Also:
CompositeFigure.findFigure(int, int)

getFigureByQualifier

public ProcessElementContainer getFigureByQualifier(ModelQualifier qualifier)
Gets a process element container by the model qualifier of the corrresponding process element.

Parameters:
qualifier - Model qualifier of the element
Returns:
The element or null if not found

bringToFront

public void bringToFront(CH.ifa.draw.framework.Figure f)
Brings the given figure to front. Will also bring the parent figure element to the front if its a node figure. The method will keep the required z-order of the element types (see recalculateZOrders()).

Specified by:
bringToFront in interface CH.ifa.draw.framework.Drawing
Overrides:
bringToFront in class CH.ifa.draw.standard.CompositeFigure

recalculateZOrders

protected void recalculateZOrders()
Reorders the figures of the drawing according to their preferred z-order. The z-order is important for the figure selection mechanisms to work. The selection will be determined using reverse z-order. This may seem odd, however, there is a discrepancy between visibility and selection. For example, data links should appear above the nodes they connect. However, when clicking a node parameter, the parameter should have a higher selection precedence than the link, which overlaps the parameter a little. An easy solution was to use reverse z-ordering selection. This works quite fine because the elements of a drawing are usually not stacked. Sometime, we may implement a more accurate solution. The z-order is as follows: Text figures are always positioned to the front (i. e. have the highest z-value). This ensures visibility and also allows easy selection of other figures. Splines follow next. They also should appear above nodes, but node elements need to have selection precedence. Nodes appear last in the z-order.


displayBox

public java.awt.Rectangle displayBox()
Specified by:
displayBox in interface CH.ifa.draw.framework.Figure
Overrides:
displayBox in class CH.ifa.draw.standard.StandardDrawing
See Also:
StandardDrawing.displayBox()

getActualOrigin

public java.awt.Point getActualOrigin()
Returns the upper left corner of the used part of the drawing.

Returns:
The origin

normalize

public void normalize()
Normalizes the drawing, i\.e\. moves it so that its top left corner lies at 50,50.


encodeGeometry

public void encodeGeometry()
Encodes the geometry of this process, i\.e\. causes all figures to encode their geometry.


decodeGeometry

public void decodeGeometry()
Encodes the geometry of this process. Creates figures from the geometry information of the process and adds them to the drawing.


encodeProcessGeometry

protected java.lang.String encodeProcessGeometry()
Encodes the swim lane geometry of the process.

Returns:
Geometry string containing "|" and ":" separated tokens

decodeProcessGeometry

protected void decodeProcessGeometry(java.lang.String geometry)
Decodes the swim lane geometry of the process.

Parameters:
geometry - Geometry string to decode or null

createNodeFigure

public NodeFigure createNodeFigure(Node node)
Creates a new node figure based on the given node.

Parameters:
node - The node
Returns:
The new figure or null on error

createTextElementFigure

public TextElementFigure createTextElementFigure(TextElement textElement)
Creates a text element figure based on the given text element.

Parameters:
textElement - The text element
Returns:
The new figure or null on error

createFlowConnection

public FlowConnection createFlowConnection(ControlLink link)
Creates a new flow connection based on the given control link.

Parameters:
link - The control link
Returns:
The new figure or null on error

createParamConnection

public ParamConnection createParamConnection(DataLink link)
Creates a new parameter connection based on the given data link.

Parameters:
link - The data link
Returns:
The new figure or null on error

getProcessElement

public ProcessObject getProcessElement()
Description copied from interface: ProcessElementContainer
Returns the contained process element.

Specified by:
getProcessElement in interface ProcessElementContainer
See Also:
ProcessElementContainer.getProcessElement()

getReferredProcessElement

public ProcessObject getReferredProcessElement()
Description copied from interface: ProcessElementContainer
Returns the process element this figure refers to. The returned element will be used for property browser and tool tip display. This is usually the same as returned by ProcessElementContainer.getProcessElement(), however this might be different also for example for sockets of initial/final nodes sockets, which will return their parent node.

Specified by:
getReferredProcessElement in interface ProcessElementContainer
See Also:
ProcessElementContainer.getReferredProcessElement()

selectionOnDelete

public CH.ifa.draw.framework.Figure selectionOnDelete()
Description copied from interface: ProcessElementContainer
Returns the figure that should be selected after this figure has been deleted.

Specified by:
selectionOnDelete in interface ProcessElementContainer
Returns:
Next figure to be selected or null
See Also:
ProcessElementContainer.selectionOnDelete()

findProcessElementContainer

public ProcessElementContainer findProcessElementContainer(int x,
                                                           int y)
Finds the process element container at the given position.

Specified by:
findProcessElementContainer in interface ProcessElementContainer
Parameters:
x - Position in process coordinates
y - Position in process coordinates
Returns:
The element or null

findProcessElementContainerInside

public ProcessElementContainer findProcessElementContainerInside(int x,
                                                                 int y)
Finds the process element container inside the element at the given position.

Specified by:
findProcessElementContainerInside in interface ProcessElementContainer
Parameters:
x - Position in process coordinates
y - Position in process coordinates
Returns:
The element or null

getDrawing

public ProcessDrawing getDrawing()
Description copied from interface: VisualElement
Gets the drawing the element is a part of.

Specified by:
getDrawing in interface VisualElement
See Also:
VisualElement.getDrawing()

setDrawing

public void setDrawing(ProcessDrawing processDrawing)
Description copied from interface: VisualElement
Sets the drawing the element is a part of.

Specified by:
setDrawing in interface VisualElement
See Also:
VisualElement.setDrawing(ProcessDrawing)

getParentElement

public VisualElement getParentElement()
Description copied from interface: VisualElement
Gets parent element of this element, if any.

Specified by:
getParentElement in interface VisualElement
See Also:
VisualElement.getParentElement()

getPresentationFigure

public CH.ifa.draw.framework.Figure getPresentationFigure()
Description copied from interface: VisualElement
Gets the presentation figure of this element.

Specified by:
getPresentationFigure in interface VisualElement
Returns:
The presentation figure
Note that this can be the visual element itself if it does not have a separate presentation figure
See Also:
VisualElement.getPresentationFigure()

updatePresentationFigure

public void updatePresentationFigure()
Description copied from interface: VisualElement
Updates (reinitializes) the presentation figure.

Specified by:
updatePresentationFigure in interface VisualElement
See Also:
VisualElement.updatePresentationFigure()

isVisible

public boolean isVisible()
Description copied from interface: VisualElement
Gets the flag if the element is currently visible.

Specified by:
isVisible in interface VisualElement
See Also:
VisualElement.isVisible()

setVisible

public void setVisible(boolean visible)
Description copied from interface: VisualElement
Sets the flag if the element is currently visible.

Specified by:
setVisible in interface VisualElement
See Also:
VisualElement.setVisible(boolean visible)

handleEvent

public boolean handleEvent(VisualElementEvent event)
Description copied from interface: VisualElement
Handler method that is called for handling events. Events can be cursor events, selection events etc.

Specified by:
handleEvent in interface VisualElement
Parameters:
event - Event that desribes the event
Returns:
true: The event was handled by the element.
false: No special handling, perform the default handling.
See Also:
VisualElement.handleEvent(VisualElementEvent event)

findVisualElement

public VisualElement findVisualElement(int x,
                                       int y)
Description copied from interface: VisualElement
Gets the visual element that is a child of this element and matches the given coordinates.

Specified by:
findVisualElement in interface VisualElement
Parameters:
x - World coordinates of the point to search
y - World coordinates of the point to search
Returns:
The element or null if no child element is located at the given position
See Also:
VisualElement.findVisualElement(int, int)

findVisualElementInside

public VisualElement findVisualElementInside(int x,
                                             int y)
Description copied from interface: VisualElement
Gets the visual element that is a child of this element and matches the given coordinates (recursively).

Specified by:
findVisualElementInside in interface VisualElement
Parameters:
x - World coordinates of the point to search
y - World coordinates of the point to search
Returns:
The element or null if no child element is located at the given position
See Also:
VisualElement.findVisualElementInside(int, int)

isDisplayAll

public boolean isDisplayAll()

setDisplayAll

public void setDisplayAll(boolean visible)

updateFigure

public void updateFigure()
Description copied from interface: UpdatableFigure
Synchronizes this figure with its provider, i\.e\. the object that is represented by the figure. Updates the figure according to the current properties of the provider.

Specified by:
updateFigure in interface UpdatableFigure
See Also:
UpdatableFigure.updateFigure()

getName

public java.lang.String getName()

setName

public void setName(java.lang.String string)

getDescription

public java.lang.String getDescription()

setDescription

public void setDescription(java.lang.String string)

getDisplayName

public java.lang.String getDisplayName()

setDisplayName

public void setDisplayName(java.lang.String string)

getDisplayText

public java.lang.String getDisplayText()

getDescriptionText

public java.lang.String getDescriptionText()

isModified

public boolean isModified()
Gets the modified flag for usage by editors.

Specified by:
isModified in interface Modifiable

setModified

public void setModified()
Sets the modified flag of the process and updates the save button accordingly.

Specified by:
setModified in interface Modifiable

clearModified

public void clearModified()
Clears the modified flag of the process and updates the save button accordingly.

Specified by:
clearModified in interface Modifiable

updateModificationState

public void updateModificationState()
Updates the status of the save button according to the modification state of the process.


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)

getSubClients

public java.util.List getSubClients()
Description copied from interface: InteractionClient
Returns subordinate clients of this client.

Specified by:
getSubClients in interface InteractionClient
Returns:
A list of InteractionClient objects or null if this drop client doesn't have sub drop clients
See Also:
InteractionClient.getSubClients()

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)


Copyright © 2011. All Rights Reserved.