org.openbp.cockpit.modeler.figures.process
Class NodeFigure

java.lang.Object
  extended by CH.ifa.draw.standard.AbstractFigure
      extended by CH.ifa.draw.standard.CompositeFigure
          extended by org.openbp.cockpit.modeler.figures.process.NodeFigure
All Implemented Interfaces:
CH.ifa.draw.framework.Figure, CH.ifa.draw.framework.FigureChangeListener, CH.ifa.draw.standard.TextHolder, CH.ifa.draw.util.Storable, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, Expandable, ShadowDropper, UpdatableFigure, ProcessElementContainer, VisualElement, InteractionClient
Direct Known Subclasses:
FinalNodeFigure, InitialNodeFigure, MultiSocketNodeFigure

public abstract class NodeFigure
extends CH.ifa.draw.standard.CompositeFigure
implements CH.ifa.draw.framework.FigureChangeListener, ShadowDropper, Expandable, ProcessElementContainer, CH.ifa.draw.standard.TextHolder

A Node Figure is the graphical representation of a process node.

Author:
Stephan Moritz
See Also:
Serialized Form

Field Summary
protected  java.awt.Rectangle displayBox
          Since calculating the displayBox can be rather expensive, we store it here
protected  CH.ifa.draw.framework.Figure iconFigure
          Icon of the node
protected  CH.ifa.draw.framework.Figure iconOverlayFigure
          Overlay icon of the node
protected  Node node
          Node that this figure represents
protected  XFigure presentationFigure
          Graphical Representation of the node itself (e\.g\. a circle)
static java.lang.String REGION_TYPE
          Region id: Data type
static int ROTATE_CCW
          Flag for changeOrientation(int): Rotate counterclockwise
static int ROTATE_CW
          Flag for changeOrientation(int): Rotate clockwise
protected  XFigure shadowFigure
          Figure representing the shadow of this node
 
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
NodeFigure()
          Constructor.
 
Method Summary
 boolean acceptsTyping()
           
 SocketFigure addSocket(NodeSocket socket)
          Adds a figure for the given socket to the node figure.
 void basicDisplayBox(java.awt.Point newOrigin, java.awt.Point newCorner)
          Sets the position and size of the presentationFigure of this NodeFigure.
protected  void basicMoveBy(int dx, int dy)
           
 java.awt.Point center()
          Returns the center of the presentation Figure.
 void changed()
           
 void changeOrientation(int mode)
          Rotates the orientation of the node by 90 degree.
 java.lang.Object clone()
          Creates a clone of this object.
 java.awt.Rectangle compactDisplayBox()
          Returns the display box of this node without the sockets (i\.e\. the the display box of the presentation figure).
 void connect(CH.ifa.draw.framework.Figure connectedFigure)
           
 void connect(Node node, ProcessDrawing drawing)
          Connects the figure to a process object.
 CH.ifa.draw.framework.Connector connectorAt(int x, int y)
           
 boolean containsPoint(int x, int y)
           
protected  ViewDropRegion createNodeDropRegion(java.lang.String regionId, java.util.List flavors)
          Creates a drop region for this node.
 void decodeGeometry()
          Decodes enclosed geometry information by breaking it into single parameters and handing them to decodeParameter ().
protected  void decodeParameter(java.lang.String parameter)
           
protected  javax.swing.Icon determineCenterIcon()
          Initializes the icon in the center of the node.
protected  javax.swing.Icon determineCustomIcon()
           
protected  java.lang.String determineCustomIconPath()
           
 void disconnect(CH.ifa.draw.framework.Figure disconnectFigure)
           
 java.awt.Rectangle displayBox()
          The display box of this node figure consists of the display boxes of the presentation figure and all tags.
 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 draw(java.awt.Graphics g)
           
protected  void drawSelectionMarker(java.awt.Graphics g)
           
 void encodeGeometry()
           
 CH.ifa.draw.framework.Figure findFigure(int x, int y)
           
 CH.ifa.draw.framework.Figure findFigureInside(int x, int y)
           
 void flipOrientation()
          Mirrors all tags at the vertical axis.
 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.
 SocketFigure getConnectableSocket(boolean isEntry)
          Returns the a socket figure of this node we can connect to
 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.
 java.awt.Color getFillColor()
           
 java.awt.Font getFont()
           
 java.util.List getImportersAt(java.awt.Point p)
          Returns all importers which will be accepted at the given point by this client.
 Node getNode()
           
 VisualElement getParentElement()
          Gets parent element of this element, if any.
 CH.ifa.draw.framework.Figure getPresentationFigure()
          Gets the presentation figure of this element.
 ProcessObject getProcessElement()
          Returns the contained process element.
 ProcessObject getReferredProcessElement()
          Returns the process element this figure refers to.
 CH.ifa.draw.framework.Figure getShadow()
          Returns the shadow figure of this object.
 SocketFigure getSocket(NodeSocket socket)
          Returns the socket figure for a given node socket.
 java.util.List getSubClients()
          Returns subordinate clients of this client.
 java.lang.String getText()
           
 boolean handleEvent(VisualElementEvent event)
          Handler method that is called for handling events.
 java.util.Vector handles()
           
 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 initialize()
          Initializes the NodeFigure by calling various init-functions.
protected  void initIcon()
          Initializes the icons of the figure.
protected  void initPresentationFigure()
          Initializes the presentation figure and its shadow.
protected  void initShadow()
          Creates the shadow figure of this tag figure.
protected  void initSockets()
          Sets up the sockets of the node.
protected  void initTextFigure(java.lang.String textPosition)
          Sets up the name tag of this node.
 boolean isCreatedFromScratch()
          Gets the flag that denotes that this figure has been created by the user using the toolbox and is not based on an item.
protected  boolean isPresentationFigureVisible()
          Checks if the presentation figure of the process figure should be drawn.
 boolean isVerticallyOriented()
          Checks if the node figure is vertically or horizontally oriented.
 boolean isVisible()
          Gets the flag if the element is currently visible.
protected  void layoutSockets(java.util.List socketsToLayout, java.lang.String orientation)
          Layouts sockets.
protected  void layoutUnarrangedSockets()
          Layouts any unarranged sockets.
 int overlayColumns()
           
 java.awt.Rectangle placeAdjacent(java.awt.Rectangle rect, double angle)
          Places the given rectangle so that its center is in the given direction and it exactly touches the node, without crossing any lines.
protected  void positionOverlayFigure(java.awt.Rectangle box, java.awt.Rectangle iconRect, java.awt.Rectangle textRect)
          Positions the overlay figure, if any, according to the positions of the display box, the figure icon and the figure text.
 void release()
           
protected  void removeConnections()
          Removes all connections from/to this figure.
 CH.ifa.draw.framework.Figure selectionOnDelete()
          No object should be selected on deletion.
 void setCreatedFromScratch(boolean createdFromScratch)
          Sets the flag that denotes that this figure has been created by the user using the toolbox and is not based on an item.
 void setDrawing(ProcessDrawing drawing)
          Sets the drawing the element is a part of.
 void setFillColor(java.awt.Color color)
           
 void setIconFigure(CH.ifa.draw.framework.Figure iconFigure)
           
 void setIconOverlayFigure(CH.ifa.draw.framework.Figure iconOverlayFigure)
           
 void setSize(int w, int h)
           
 void setText(java.lang.String newText)
           
 void setVisible(boolean visible)
          Sets the flag if the element is currently visible.
 java.awt.Rectangle textDisplayBox()
           
 java.lang.String toString()
          Returns a string representation of this object.
 void translateChildren(int dx, int dy)
           
 void updateFigure()
          In addition to synchronization all children, synchronizes the presentation figure if applicable.
 void updatePresentationFigure()
          Updates (reinitializes) the presentation figure.
 
Methods inherited from class CH.ifa.draw.standard.CompositeFigure
add, addAll, addAll, bringToFront, draw, figureAt, figureChanged, figureCount, figureInvalidated, figureRemoved, figureRequestRemove, figureRequestUpdate, figures, figures, figuresReverse, findFigure, findFigure, findFigureInsideWithout, findFigureWithout, getFigureFromLayer, getLayer, includes, init, orphan, orphanAll, orphanAll, read, remove, removeAll, removeAll, removeAll, replace, sendToBack, sendToLayer, write
 
Methods inherited from class CH.ifa.draw.standard.AbstractFigure
addFigureChangeListener, addToContainer, canConnect, connectedTextLocator, connectionInsets, connectorVisibility, 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, wait, wait, wait
 
Methods inherited from interface CH.ifa.draw.framework.FigureChangeListener
figureChanged, figureInvalidated, figureRemoved, figureRequestRemove, figureRequestUpdate
 
Methods inherited from interface CH.ifa.draw.framework.Figure
addFigureChangeListener, addToContainer, canConnect, connectedTextLocator, connectionInsets, connectorVisibility, decompose, displayBox, displayBox, figures, getAttribute, getZValue, includes, invalidate, isEmpty, listener, moveBy, removeFigureChangeListener, removeFromContainer, setAttribute, setZValue, size, willChange
 
Methods inherited from interface CH.ifa.draw.util.Storable
read, write
 

Field Detail

ROTATE_CW

public static final int ROTATE_CW
Flag for changeOrientation(int): Rotate clockwise

See Also:
Constant Field Values

ROTATE_CCW

public static final int ROTATE_CCW
Flag for changeOrientation(int): Rotate counterclockwise

See Also:
Constant Field Values

REGION_TYPE

public static final java.lang.String REGION_TYPE
Region id: Data type

See Also:
Constant Field Values

node

protected Node node
Node that this figure represents


presentationFigure

protected XFigure presentationFigure
Graphical Representation of the node itself (e\.g\. a circle)


iconFigure

protected CH.ifa.draw.framework.Figure iconFigure
Icon of the node


iconOverlayFigure

protected CH.ifa.draw.framework.Figure iconOverlayFigure
Overlay icon of the node


shadowFigure

protected XFigure shadowFigure
Figure representing the shadow of this node


displayBox

protected java.awt.Rectangle displayBox
Since calculating the displayBox can be rather expensive, we store it here

Constructor Detail

NodeFigure

public NodeFigure()
Constructor.

Method Detail

clone

public java.lang.Object clone()
Creates a clone of this object.

Specified by:
clone in interface CH.ifa.draw.framework.Figure
Overrides:
clone in class CH.ifa.draw.standard.AbstractFigure

connect

public void connect(Node node,
                    ProcessDrawing drawing)
Connects the figure to a process object.

Parameters:
node - Node to refer to
drawing - Process drawing that owns the figure

toString

public java.lang.String toString()
Returns a string representation of this object.

Overrides:
toString in class java.lang.Object

initialize

protected void initialize()
Initializes the NodeFigure by calling various init-functions. if you overwrite this, be sure to call super.initialize (). Generally it makes more sense to overwrite the sub-init functions.


initPresentationFigure

protected void initPresentationFigure()
Initializes the presentation figure and its shadow.


initTextFigure

protected void initTextFigure(java.lang.String textPosition)
Sets up the name tag of this node. Standard implementation is a QuarterTag with the displayText of the node.

Parameters:
textPosition - Text position ("c"/"s"/"n"/"e"/"w")

initIcon

protected void initIcon()
Initializes the icons of the figure.


determineCustomIcon

protected javax.swing.Icon determineCustomIcon()

determineCustomIconPath

protected java.lang.String determineCustomIconPath()

determineCenterIcon

protected javax.swing.Icon determineCenterIcon()
Initializes the icon in the center of the node.


initSockets

protected void initSockets()
Sets up the sockets of the node. Standard implementation is an EntrySocketTag per EntrySocket and an ExitSocketTag per ExitSocket. You should not need to overwrite this.


initShadow

protected void initShadow()
Creates the shadow figure of this tag figure.


addSocket

public SocketFigure addSocket(NodeSocket socket)
Adds a figure for the given socket to the node figure.

Parameters:
socket - Socket to add
Returns:
The new socket figure

layoutUnarrangedSockets

protected void layoutUnarrangedSockets()
Layouts any unarranged sockets. Arranges all sockets evenly on their respective side.


layoutSockets

protected void layoutSockets(java.util.List socketsToLayout,
                             java.lang.String orientation)
Layouts sockets.

Parameters:
socketsToLayout - List of sockets to layout (contains SocketFigure objects)
orientation - Orientation of the sockets ("e"/"n"/"w"/"s")

isVerticallyOriented

public boolean isVerticallyOriented()
Checks if the node figure is vertically or horizontally oriented.

Returns:
true: The node's orientation is top-down.
false: The node's orientation is left-right.

flipOrientation

public void flipOrientation()
Mirrors all tags at the vertical axis. (I.e. swaps left and right).


changeOrientation

public void changeOrientation(int mode)
Rotates the orientation of the node by 90 degree.

Parameters:
mode - Rotation mode (ROTATE_CW/ROTATE_CCW)

getNode

public Node getNode()

getSocket

public SocketFigure getSocket(NodeSocket socket)
Returns the socket figure for a given node socket.

Parameters:
socket - Socket to search
Returns:
The socket figure or null if not found

getConnectableSocket

public SocketFigure getConnectableSocket(boolean isEntry)
Returns the a socket figure of this node we can connect to

Parameters:
isEntry - true: Get an entry socket
false: Get an exit socket
Returns:
The point figure or null

removeConnections

protected void removeConnections()
Removes all connections from/to this figure.


decodeGeometry

public void decodeGeometry()
Decodes enclosed geometry information by breaking it into single parameters and handing them to decodeParameter ().


decodeParameter

protected void decodeParameter(java.lang.String parameter)

encodeGeometry

public void encodeGeometry()

displayBox

public java.awt.Rectangle displayBox()
The display box of this node figure consists of the display boxes of the presentation figure and all tags.

Specified by:
displayBox in interface CH.ifa.draw.framework.Figure
Specified by:
displayBox in class CH.ifa.draw.standard.AbstractFigure

basicDisplayBox

public void basicDisplayBox(java.awt.Point newOrigin,
                            java.awt.Point newCorner)
Sets the position and size of the presentationFigure of this NodeFigure. The origin is set to the center of the given coordinates, while the size is set to the lower of width and heigth.

Specified by:
basicDisplayBox in interface CH.ifa.draw.framework.Figure
Specified by:
basicDisplayBox in class CH.ifa.draw.standard.AbstractFigure

basicMoveBy

protected void basicMoveBy(int dx,
                           int dy)
Overrides:
basicMoveBy in class CH.ifa.draw.standard.CompositeFigure

handles

public java.util.Vector handles()
Specified by:
handles in interface CH.ifa.draw.framework.Figure
Specified by:
handles in class CH.ifa.draw.standard.AbstractFigure

draw

public void draw(java.awt.Graphics g)
Specified by:
draw in interface CH.ifa.draw.framework.Figure
Overrides:
draw in class CH.ifa.draw.standard.CompositeFigure

isPresentationFigureVisible

protected boolean isPresentationFigureVisible()
Checks if the presentation figure of the process figure should be drawn.


drawSelectionMarker

protected void drawSelectionMarker(java.awt.Graphics g)

changed

public void changed()
Specified by:
changed in interface CH.ifa.draw.framework.Figure
Overrides:
changed in class CH.ifa.draw.standard.AbstractFigure

connectorAt

public CH.ifa.draw.framework.Connector connectorAt(int x,
                                                   int y)
Specified by:
connectorAt in interface CH.ifa.draw.framework.Figure
Overrides:
connectorAt in class CH.ifa.draw.standard.AbstractFigure

placeAdjacent

public java.awt.Rectangle placeAdjacent(java.awt.Rectangle rect,
                                        double angle)
Places the given rectangle so that its center is in the given direction and it exactly touches the node, without crossing any lines.

Parameters:
rect - The rectangle to adjust
angle - The direction in which the rectangle should be placed
Returns:
The translated rectangle

containsPoint

public boolean containsPoint(int x,
                             int y)
Specified by:
containsPoint in interface CH.ifa.draw.framework.Figure
Overrides:
containsPoint in class CH.ifa.draw.standard.AbstractFigure

findFigure

public CH.ifa.draw.framework.Figure findFigure(int x,
                                               int y)
Overrides:
findFigure in class CH.ifa.draw.standard.CompositeFigure

findFigureInside

public CH.ifa.draw.framework.Figure findFigureInside(int x,
                                                     int y)
Specified by:
findFigureInside in interface CH.ifa.draw.framework.Figure
Overrides:
findFigureInside in class CH.ifa.draw.standard.CompositeFigure

center

public java.awt.Point center()
Returns the center of the presentation Figure.

Specified by:
center in interface CH.ifa.draw.framework.Figure
Overrides:
center in class CH.ifa.draw.standard.AbstractFigure

release

public void release()
Specified by:
release in interface CH.ifa.draw.framework.Figure
Overrides:
release in class CH.ifa.draw.standard.CompositeFigure

translateChildren

public void translateChildren(int dx,
                              int dy)

setIconFigure

public void setIconFigure(CH.ifa.draw.framework.Figure iconFigure)

setIconOverlayFigure

public void setIconOverlayFigure(CH.ifa.draw.framework.Figure iconOverlayFigure)

getShadow

public CH.ifa.draw.framework.Figure getShadow()
Description copied from interface: ShadowDropper
Returns the shadow figure of this object.

Specified by:
getShadow in interface ShadowDropper
Returns:
The shadow figure or null if this object does not have a shadow

setSize

public void setSize(int w,
                    int h)

positionOverlayFigure

protected void positionOverlayFigure(java.awt.Rectangle box,
                                     java.awt.Rectangle iconRect,
                                     java.awt.Rectangle textRect)
Positions the overlay figure, if any, according to the positions of the display box, the figure icon and the figure text.

Parameters:
box - Display box of the node figure
iconRect - Icon rect
textRect - Text rect

compactDisplayBox

public java.awt.Rectangle compactDisplayBox()
Returns the display box of this node without the sockets (i\.e\. the the display box of the presentation figure).

Specified by:
compactDisplayBox in interface Expandable

setFillColor

public void setFillColor(java.awt.Color color)

getFillColor

public java.awt.Color getFillColor()

getProcessElement

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

Specified by:
getProcessElement in interface ProcessElementContainer

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

selectionOnDelete

public CH.ifa.draw.framework.Figure selectionOnDelete()
No object should be selected on deletion.

Specified by:
selectionOnDelete in interface ProcessElementContainer
Returns:
Next figure to be selected or null

textDisplayBox

public java.awt.Rectangle textDisplayBox()
Specified by:
textDisplayBox in interface CH.ifa.draw.standard.TextHolder

getText

public java.lang.String getText()
Specified by:
getText in interface CH.ifa.draw.standard.TextHolder

setText

public void setText(java.lang.String newText)
Specified by:
setText in interface CH.ifa.draw.standard.TextHolder

acceptsTyping

public boolean acceptsTyping()
Specified by:
acceptsTyping in interface CH.ifa.draw.standard.TextHolder

overlayColumns

public int overlayColumns()
Specified by:
overlayColumns in interface CH.ifa.draw.standard.TextHolder

connect

public void connect(CH.ifa.draw.framework.Figure connectedFigure)
Specified by:
connect in interface CH.ifa.draw.standard.TextHolder

disconnect

public void disconnect(CH.ifa.draw.framework.Figure disconnectFigure)
Specified by:
disconnect in interface CH.ifa.draw.standard.TextHolder

getFont

public java.awt.Font getFont()
Specified by:
getFont in interface CH.ifa.draw.standard.TextHolder

setDrawing

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

Specified by:
setDrawing in interface VisualElement

getDrawing

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

Specified by:
getDrawing in interface VisualElement

getParentElement

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

Specified by:
getParentElement in interface VisualElement

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

updatePresentationFigure

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

Specified by:
updatePresentationFigure in interface VisualElement

isVisible

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

Specified by:
isVisible in interface VisualElement

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

isCreatedFromScratch

public boolean isCreatedFromScratch()
Gets the flag that denotes that this figure has been created by the user using the toolbox and is not based on an item.


setCreatedFromScratch

public void setCreatedFromScratch(boolean createdFromScratch)
Sets the flag that denotes that this figure has been created by the user using the toolbox and is not based on an item.


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.

updateFigure

public void updateFigure()
In addition to synchronization all children, synchronizes the presentation figure if applicable.

Specified by:
updateFigure in interface UpdatableFigure

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

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

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

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

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.

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

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

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

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.

createNodeDropRegion

protected ViewDropRegion createNodeDropRegion(java.lang.String regionId,
                                              java.util.List flavors)
Creates a drop region for this node.

Parameters:
regionId - Region id
flavors - Supported data flavors
Returns:
The new region


Copyright © 2011. All Rights Reserved.