org.openbp.cockpit.modeler.figures.spline
Class PolySplineConnection

java.lang.Object
  extended by CH.ifa.draw.standard.AbstractFigure
      extended by org.openbp.cockpit.modeler.figures.spline.PolySplineFigure
          extended by org.openbp.cockpit.modeler.figures.spline.PolySplineConnection
All Implemented Interfaces:
CH.ifa.draw.framework.ConnectionFigure, 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, VisualElement, InteractionClient
Direct Known Subclasses:
FlowConnection, ParamConnection

public abstract class PolySplineConnection
extends PolySplineFigure
implements CH.ifa.draw.framework.ConnectionFigure, VisualElement, UpdatableFigure

A spline connection is a standard implementation of the connection figure interface.

Author:
Stephan Moritz
See Also:
Serialized Form

Field Summary
static java.lang.String DECO_ANIMATION
          Decoration key for the spline animation (used with Double objects)
protected  MoveableTitleFigure label
          Label of this connection
static java.lang.Double NAN
           
 
Fields inherited from class org.openbp.cockpit.modeler.figures.spline.PolySplineFigure
drawDecorations, LEFT_CONTROLPOINT, RIGHT_CONTROLPOINT, segments
 
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
PolySplineConnection()
          Constructor.
PolySplineConnection(ProcessDrawing drawing)
          Constructor.
 
Method Summary
protected  void addEndConnectorChangeListener()
          Adds ourself as figure change listener to the end figure we are connected to.
protected  void addStartConnectorChangeListener()
          Adds ourself as figure change listener to the start figure we are connected to.
protected  void basicMoveBy(int dx, int dy)
          Ensures that a connection is updated if the connection was moved.
 boolean canConnect(CH.ifa.draw.framework.Figure startFigure, CH.ifa.draw.framework.Figure endFigure)
          Tests whether two figures can be connected.
abstract  boolean canConnectFigures(CH.ifa.draw.framework.Figure startFigure, CH.ifa.draw.framework.Figure endFigure, int flags)
          Tests whether two figures can be connected.
 CH.ifa.draw.framework.Locator connectedTextLocator(CH.ifa.draw.framework.Figure figure)
           
 void connectEnd(CH.ifa.draw.framework.Connector endConnector)
          Calls handleConnect(CH.ifa.draw.framework.Figure, CH.ifa.draw.framework.Figure).
abstract  boolean connectsSame(CH.ifa.draw.framework.ConnectionFigure other)
          Tests whether a connection connects the same figures as another connection figure.
 void connectStart(CH.ifa.draw.framework.Connector startConnector)
          Calls handleDisconnect(CH.ifa.draw.framework.Figure, CH.ifa.draw.framework.Figure) if a connection can be established.
protected  java.awt.geom.Point2D constrainCtrlPoint(int index, int side, java.awt.geom.Point2D ctrl)
           
 boolean containsPoint(int x, int y)
          Returns true if the given point is near to the spline.
 void decode(java.lang.String geometry, java.lang.String errName)
           
protected  boolean decodeParameter(java.lang.String parameter, java.lang.String errName)
           
 void disconnectEnd()
          Disconnects the end figure.
 void disconnectStart()
          Disconnects the start figure.
 java.awt.Rectangle displayBox()
          The display box equals the bounds of the spline enlarged by 30 pixels vertically and horizontally.
 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.
protected  void drawDecorations(java.awt.Graphics g)
          Draws the start, end and animation decorations of the spline.
protected  void drawSpline(java.awt.Graphics2D g2)
          Draws the label in addition to the spline.
protected  java.lang.String encode()
           
 CH.ifa.draw.framework.Figure endFigure()
          Gets the end figure of the connection.
 java.awt.Point endPoint()
          Gets the end point of the connection.
 void endPoint(int x, int y)
          Sets the end point of the connection.
 void figureChanged(CH.ifa.draw.framework.FigureChangeEvent e)
           
 void figureInvalidated(CH.ifa.draw.framework.FigureChangeEvent e)
           
 void figureRemoved(CH.ifa.draw.framework.FigureChangeEvent e)
           
 void figureRequestRemove(CH.ifa.draw.framework.FigureChangeEvent e)
           
 void figureRequestUpdate(CH.ifa.draw.framework.FigureChangeEvent 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.
 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.
 CH.ifa.draw.framework.Connector getEndConnector()
          Gets end connector.
 double getEndFactor()
          Gets the factor used to calculate the actual postion of the control point of the spline's end point.
 java.util.List getImportersAt(java.awt.Point p)
          Returns all importers which will be accepted at the given point by this client.
 MoveableTitleFigure getLabel()
          Gets the label of this connection.
 VisualElement getParentElement()
          Gets parent element of this element, if any.
 CH.ifa.draw.framework.Figure getPresentationFigure()
          Gets the presentation figure of this element.
 CH.ifa.draw.framework.Connector getStartConnector()
          Gets the start connector.
 double getStartFactor()
          Gets the factor used to calculate the actual postion of the control point of the spline's start point.
 java.util.List getSubClients()
          Returns subordinate clients of this client.
protected  void handleConnect(CH.ifa.draw.framework.Figure startFigure, CH.ifa.draw.framework.Figure endFigure)
          Handles the connection of a connection.
protected  void handleDisconnect(CH.ifa.draw.framework.Figure startFigure, CH.ifa.draw.framework.Figure endFigure)
          Handles the disconnection of a connection.
 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.
 boolean isMinimized()
          Checks if the connection is minimized.
 boolean isVisible()
          Gets the flag if the element is currently visible.
 void layoutAndAdjustConnection()
          Performs a layout of the connection, adjusting connection start/end point directions.
 void layoutConnection()
          Performs a layout of the connection.
 void read(CH.ifa.draw.util.StorableInput dr)
           
 void release()
           
protected  void removeEndConnectorChangeListener()
          Removes ourself as figure change listener from the end figure we are connected to.
protected  void removeStartConnectorChangeListener()
          Removes ourself as figure change listener from the start figure we are connected to.
 void setDrawing(ProcessDrawing drawing)
          Sets the drawing the element is a part of.
protected  void setEndConnector(CH.ifa.draw.framework.Connector endConnector)
          Sets the end connector.
 void setEndFactor(double endFactor)
          Sets the factor used to calculate the actual postion of the control point of the spline's end point.
 void setPointAt(java.awt.Point p, int i)
           
protected  void setStartConnector(CH.ifa.draw.framework.Connector startConnector)
          Sets the start connector.
 void setStartFactor(double startFactor)
          Sets the factor used to calculate the actual postion of the control point of the spline's start point.
 void setVisible(boolean visible)
          Sets the flag if the element is currently visible.
protected  boolean shouldReverse(CH.ifa.draw.framework.Figure startFigure, CH.ifa.draw.framework.Figure endFigure)
          Checks if connection should be reversed.
 CH.ifa.draw.framework.Figure startFigure()
          Gets the start figure of the connection.
 java.awt.Point startPoint()
          Gets the start point of the connection.
 void startPoint(int x, int y)
          Sets the start point of the connection.
 void updateConnection()
           
 void updateFigure()
          Synchronizes this figure with its provider, i\.e\. the object that is represented by the figure.
 void updatePresentationFigure()
          Updates (reinitializes) the presentation figure.
 void write(CH.ifa.draw.util.StorableOutput dw)
           
 
Methods inherited from class org.openbp.cockpit.modeler.figures.spline.PolySplineFigure
adjustOpposite, basicDisplayBox, basicSetCtrlPoint, canConnect, clearShapeCache, connectorAt, draw, findSegment, getAnimationDecoration, getAttribute, getCtrlPointAt, getEndDecoration, getFrameColor, getPointAt, getPointOnCurve, getSplineBounds, getStartDecoration, getStroke, isEmpty, joinSegments, pointAt, pointCount, rebuildShapeCache, removePoint, segmentAt, setAnimationDecoration, setAttribute, setCtrlPointAt, setDrawDecorations, setEndDecoration, setFrameColor, setPointAt, setStartDecoration, setStroke, splitSegment
 
Methods inherited from class CH.ifa.draw.standard.AbstractFigure
addFigureChangeListener, addToContainer, center, changed, clone, connectionInsets, connectorVisibility, decompose, displayBox, displayBox, figures, findFigureInside, getZValue, includes, invalidate, listener, moveBy, removeFigureChangeListener, removeFromContainer, 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.ConnectionFigure
joinSegments, pointAt, pointCount, splitSegment
 
Methods inherited from interface CH.ifa.draw.framework.Figure
addFigureChangeListener, addToContainer, basicDisplayBox, canConnect, center, changed, clone, connectionInsets, connectorAt, connectorVisibility, decompose, displayBox, displayBox, draw, figures, findFigureInside, getAttribute, getZValue, includes, invalidate, isEmpty, listener, moveBy, removeFigureChangeListener, removeFromContainer, setAttribute, setZValue, size, willChange
 

Field Detail

NAN

public static final java.lang.Double NAN

DECO_ANIMATION

public static final java.lang.String DECO_ANIMATION
Decoration key for the spline animation (used with Double objects)

See Also:
Constant Field Values

label

protected MoveableTitleFigure label
Label of this connection

Constructor Detail

PolySplineConnection

public PolySplineConnection(ProcessDrawing drawing)
Constructor.

Parameters:
drawing - Process drawing that owns the figure

PolySplineConnection

public PolySplineConnection()
Constructor.

Method Detail

canConnectFigures

public abstract boolean canConnectFigures(CH.ifa.draw.framework.Figure startFigure,
                                          CH.ifa.draw.framework.Figure endFigure,
                                          int flags)
Tests whether two figures can be connected.

Parameters:
startFigure - Proposed start figure
endFigure - Proposed end figure
flags - App-specific flags that may define constraints for the connection check

canConnect

public boolean canConnect(CH.ifa.draw.framework.Figure startFigure,
                          CH.ifa.draw.framework.Figure endFigure)
Tests whether two figures can be connected.

Specified by:
canConnect in interface CH.ifa.draw.framework.ConnectionFigure
Parameters:
startFigure - Proposed start figure
endFigure - Proposed end figure

connectStart

public void connectStart(CH.ifa.draw.framework.Connector startConnector)
Calls handleDisconnect(CH.ifa.draw.framework.Figure, CH.ifa.draw.framework.Figure) if a connection can be established.

Specified by:
connectStart in interface CH.ifa.draw.framework.ConnectionFigure

connectEnd

public void connectEnd(CH.ifa.draw.framework.Connector endConnector)
Calls handleConnect(CH.ifa.draw.framework.Figure, CH.ifa.draw.framework.Figure).

Specified by:
connectEnd in interface CH.ifa.draw.framework.ConnectionFigure

disconnectStart

public void disconnectStart()
Disconnects the start figure. Calls handleDisconnect(CH.ifa.draw.framework.Figure, CH.ifa.draw.framework.Figure).

Specified by:
disconnectStart in interface CH.ifa.draw.framework.ConnectionFigure

disconnectEnd

public void disconnectEnd()
Disconnects the end figure. Calls handleDisconnect(CH.ifa.draw.framework.Figure, CH.ifa.draw.framework.Figure).

Specified by:
disconnectEnd in interface CH.ifa.draw.framework.ConnectionFigure

connectsSame

public abstract boolean connectsSame(CH.ifa.draw.framework.ConnectionFigure other)
Tests whether a connection connects the same figures as another connection figure.

Specified by:
connectsSame in interface CH.ifa.draw.framework.ConnectionFigure
Parameters:
other - Connection to check on equality with this figure
Returns:
true: If the start and end figures of this connection and the other connection match.
false: If the start or end figure is different.

updateConnection

public void updateConnection()
Specified by:
updateConnection in interface CH.ifa.draw.framework.ConnectionFigure

setStartConnector

protected void setStartConnector(CH.ifa.draw.framework.Connector startConnector)
Sets the start connector.

Parameters:
startConnector - Start connector

getStartConnector

public CH.ifa.draw.framework.Connector getStartConnector()
Gets the start connector.

Specified by:
getStartConnector in interface CH.ifa.draw.framework.ConnectionFigure
Returns:
The connector or null if not connected

setEndConnector

protected void setEndConnector(CH.ifa.draw.framework.Connector endConnector)
Sets the end connector.

Parameters:
endConnector - End connector

getEndConnector

public CH.ifa.draw.framework.Connector getEndConnector()
Gets end connector.

Specified by:
getEndConnector in interface CH.ifa.draw.framework.ConnectionFigure
Returns:
The connector or null if not connected

startPoint

public void startPoint(int x,
                       int y)
Sets the start point of the connection.

Specified by:
startPoint in interface CH.ifa.draw.framework.ConnectionFigure

startPoint

public java.awt.Point startPoint()
Gets the start point of the connection.

Specified by:
startPoint in interface CH.ifa.draw.framework.ConnectionFigure

endPoint

public void endPoint(int x,
                     int y)
Sets the end point of the connection.

Specified by:
endPoint in interface CH.ifa.draw.framework.ConnectionFigure

endPoint

public java.awt.Point endPoint()
Gets the end point of the connection.

Specified by:
endPoint in interface CH.ifa.draw.framework.ConnectionFigure

startFigure

public CH.ifa.draw.framework.Figure startFigure()
Gets the start figure of the connection.

Specified by:
startFigure in interface CH.ifa.draw.framework.ConnectionFigure
Returns:
The start figure or null if not connected

endFigure

public CH.ifa.draw.framework.Figure endFigure()
Gets the end figure of the connection.

Specified by:
endFigure in interface CH.ifa.draw.framework.ConnectionFigure
Returns:
The end figure or null if not connected

constrainCtrlPoint

protected java.awt.geom.Point2D constrainCtrlPoint(int index,
                                                   int side,
                                                   java.awt.geom.Point2D ctrl)
Overrides:
constrainCtrlPoint in class PolySplineFigure

basicMoveBy

protected void basicMoveBy(int dx,
                           int dy)
Ensures that a connection is updated if the connection was moved.

Overrides:
basicMoveBy in class PolySplineFigure

displayBox

public java.awt.Rectangle displayBox()
Description copied from class: PolySplineFigure
The display box equals the bounds of the spline enlarged by 30 pixels vertically and horizontally.

Specified by:
displayBox in interface CH.ifa.draw.framework.Figure
Overrides:
displayBox in class PolySplineFigure

drawSpline

protected void drawSpline(java.awt.Graphics2D g2)
Draws the label in addition to the spline. Performs drawing only if the connection is not minimized or under the cursor.

Overrides:
drawSpline in class PolySplineFigure
Parameters:
g2 - Graphics to draw to

drawDecorations

protected void drawDecorations(java.awt.Graphics g)
Draws the start, end and animation decorations of the spline.

Overrides:
drawDecorations in class PolySplineFigure
Parameters:
g - Graphics to draw to

containsPoint

public boolean containsPoint(int x,
                             int y)
Description copied from class: PolySplineFigure
Returns true if the given point is near to the spline.

Specified by:
containsPoint in interface CH.ifa.draw.framework.Figure
Overrides:
containsPoint in class PolySplineFigure

handles

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

setPointAt

public void setPointAt(java.awt.Point p,
                       int i)
Specified by:
setPointAt in interface CH.ifa.draw.framework.ConnectionFigure

connectedTextLocator

public CH.ifa.draw.framework.Locator connectedTextLocator(CH.ifa.draw.framework.Figure figure)
Specified by:
connectedTextLocator in interface CH.ifa.draw.framework.Figure
Overrides:
connectedTextLocator 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.AbstractFigure

shouldReverse

protected boolean shouldReverse(CH.ifa.draw.framework.Figure startFigure,
                                CH.ifa.draw.framework.Figure endFigure)
Checks if connection should be reversed.

Parameters:
startFigure - Proposed start figure
endFigure - Proposed end figure
Returns:
The default implementation always returns false

handleConnect

protected void handleConnect(CH.ifa.draw.framework.Figure startFigure,
                             CH.ifa.draw.framework.Figure endFigure)
Handles the connection of a connection. Does nothing by default.

Parameters:
startFigure - Figure to connnect to
endFigure - Figure to connnect to

handleDisconnect

protected void handleDisconnect(CH.ifa.draw.framework.Figure startFigure,
                                CH.ifa.draw.framework.Figure endFigure)
Handles the disconnection of a connection. Does nothing by default.

Parameters:
startFigure - Figure to disconnect from
endFigure - Figure to disconnect from

addStartConnectorChangeListener

protected void addStartConnectorChangeListener()
Adds ourself as figure change listener to the start figure we are connected to. Does nothing by default.


removeStartConnectorChangeListener

protected void removeStartConnectorChangeListener()
Removes ourself as figure change listener from the start figure we are connected to. Does nothing by default.


addEndConnectorChangeListener

protected void addEndConnectorChangeListener()
Adds ourself as figure change listener to the end figure we are connected to. Does nothing by default.


removeEndConnectorChangeListener

protected void removeEndConnectorChangeListener()
Removes ourself as figure change listener from the end figure we are connected to. Does nothing by default.


getStartFactor

public double getStartFactor()
Gets the factor used to calculate the actual postion of the control point of the spline's start point.


setStartFactor

public void setStartFactor(double startFactor)
Sets the factor used to calculate the actual postion of the control point of the spline's start point.


getEndFactor

public double getEndFactor()
Gets the factor used to calculate the actual postion of the control point of the spline's end point.


setEndFactor

public void setEndFactor(double endFactor)
Sets the factor used to calculate the actual postion of the control point of the spline's end point.


getLabel

public MoveableTitleFigure getLabel()
Gets the label of this connection.


isMinimized

public boolean isMinimized()
Checks if the connection is minimized.


layoutConnection

public void layoutConnection()
Performs a layout of the connection. This is called when the connection itself changes. By default the start and end points of the connection are recalculated.


layoutAndAdjustConnection

public void layoutAndAdjustConnection()
Performs a layout of the connection, adjusting connection start/end point directions. The method tries to ensure that the connection does not cross its start/end point figures by adjusting the direction the connection will take from its start or end point. By default, this method just calls the layoutConnection() method.


figureChanged

public void figureChanged(CH.ifa.draw.framework.FigureChangeEvent e)
Specified by:
figureChanged in interface CH.ifa.draw.framework.FigureChangeListener

figureRemoved

public void figureRemoved(CH.ifa.draw.framework.FigureChangeEvent e)
Specified by:
figureRemoved in interface CH.ifa.draw.framework.FigureChangeListener

figureRequestRemove

public void figureRequestRemove(CH.ifa.draw.framework.FigureChangeEvent e)
Specified by:
figureRequestRemove in interface CH.ifa.draw.framework.FigureChangeListener

figureInvalidated

public void figureInvalidated(CH.ifa.draw.framework.FigureChangeEvent e)
Specified by:
figureInvalidated in interface CH.ifa.draw.framework.FigureChangeListener

figureRequestUpdate

public void figureRequestUpdate(CH.ifa.draw.framework.FigureChangeEvent e)
Specified by:
figureRequestUpdate in interface CH.ifa.draw.framework.FigureChangeListener

decode

public void decode(java.lang.String geometry,
                   java.lang.String errName)

decodeParameter

protected boolean decodeParameter(java.lang.String parameter,
                                  java.lang.String errName)

encode

protected java.lang.String encode()

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

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

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

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

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

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.

write

public void write(CH.ifa.draw.util.StorableOutput dw)
Specified by:
write in interface CH.ifa.draw.util.Storable
Overrides:
write in class PolySplineFigure

read

public void read(CH.ifa.draw.util.StorableInput dr)
          throws java.io.IOException
Specified by:
read in interface CH.ifa.draw.util.Storable
Overrides:
read in class PolySplineFigure
Throws:
java.io.IOException


Copyright © 2011. All Rights Reserved.