|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectCH.ifa.draw.standard.AbstractFigure
org.openbp.cockpit.modeler.figures.spline.PolySplineFigure
org.openbp.cockpit.modeler.figures.spline.PolySplineConnection
public abstract class PolySplineConnection
A spline connection is a standard implementation of the connection figure interface.
| 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 |
|---|
public static final java.lang.Double NAN
public static final java.lang.String DECO_ANIMATION
protected MoveableTitleFigure label
| Constructor Detail |
|---|
public PolySplineConnection(ProcessDrawing drawing)
drawing - Process drawing that owns the figurepublic PolySplineConnection()
| Method Detail |
|---|
public abstract boolean canConnectFigures(CH.ifa.draw.framework.Figure startFigure,
CH.ifa.draw.framework.Figure endFigure,
int flags)
startFigure - Proposed start figureendFigure - Proposed end figureflags - App-specific flags that may define constraints for the connection check
public boolean canConnect(CH.ifa.draw.framework.Figure startFigure,
CH.ifa.draw.framework.Figure endFigure)
canConnect in interface CH.ifa.draw.framework.ConnectionFigurestartFigure - Proposed start figureendFigure - Proposed end figurepublic void connectStart(CH.ifa.draw.framework.Connector startConnector)
handleDisconnect(CH.ifa.draw.framework.Figure, CH.ifa.draw.framework.Figure) if a connection can be established.
connectStart in interface CH.ifa.draw.framework.ConnectionFigurepublic void connectEnd(CH.ifa.draw.framework.Connector endConnector)
handleConnect(CH.ifa.draw.framework.Figure, CH.ifa.draw.framework.Figure).
connectEnd in interface CH.ifa.draw.framework.ConnectionFigurepublic void disconnectStart()
handleDisconnect(CH.ifa.draw.framework.Figure, CH.ifa.draw.framework.Figure).
disconnectStart in interface CH.ifa.draw.framework.ConnectionFigurepublic void disconnectEnd()
handleDisconnect(CH.ifa.draw.framework.Figure, CH.ifa.draw.framework.Figure).
disconnectEnd in interface CH.ifa.draw.framework.ConnectionFigurepublic abstract boolean connectsSame(CH.ifa.draw.framework.ConnectionFigure other)
connectsSame in interface CH.ifa.draw.framework.ConnectionFigureother - Connection to check on equality with this figure
public void updateConnection()
updateConnection in interface CH.ifa.draw.framework.ConnectionFigureprotected void setStartConnector(CH.ifa.draw.framework.Connector startConnector)
startConnector - Start connectorpublic CH.ifa.draw.framework.Connector getStartConnector()
getStartConnector in interface CH.ifa.draw.framework.ConnectionFigureprotected void setEndConnector(CH.ifa.draw.framework.Connector endConnector)
endConnector - End connectorpublic CH.ifa.draw.framework.Connector getEndConnector()
getEndConnector in interface CH.ifa.draw.framework.ConnectionFigure
public void startPoint(int x,
int y)
startPoint in interface CH.ifa.draw.framework.ConnectionFigurepublic java.awt.Point startPoint()
startPoint in interface CH.ifa.draw.framework.ConnectionFigure
public void endPoint(int x,
int y)
endPoint in interface CH.ifa.draw.framework.ConnectionFigurepublic java.awt.Point endPoint()
endPoint in interface CH.ifa.draw.framework.ConnectionFigurepublic CH.ifa.draw.framework.Figure startFigure()
startFigure in interface CH.ifa.draw.framework.ConnectionFigurepublic CH.ifa.draw.framework.Figure endFigure()
endFigure in interface CH.ifa.draw.framework.ConnectionFigure
protected java.awt.geom.Point2D constrainCtrlPoint(int index,
int side,
java.awt.geom.Point2D ctrl)
constrainCtrlPoint in class PolySplineFigure
protected void basicMoveBy(int dx,
int dy)
basicMoveBy in class PolySplineFigurepublic java.awt.Rectangle displayBox()
PolySplineFigure
displayBox in interface CH.ifa.draw.framework.FiguredisplayBox in class PolySplineFigureprotected void drawSpline(java.awt.Graphics2D g2)
drawSpline in class PolySplineFigureg2 - Graphics to draw toprotected void drawDecorations(java.awt.Graphics g)
drawDecorations in class PolySplineFigureg - Graphics to draw to
public boolean containsPoint(int x,
int y)
PolySplineFigure
containsPoint in interface CH.ifa.draw.framework.FigurecontainsPoint in class PolySplineFigurepublic java.util.Vector handles()
handles in interface CH.ifa.draw.framework.Figurehandles in class PolySplineFigure
public void setPointAt(java.awt.Point p,
int i)
setPointAt in interface CH.ifa.draw.framework.ConnectionFigurepublic CH.ifa.draw.framework.Locator connectedTextLocator(CH.ifa.draw.framework.Figure figure)
connectedTextLocator in interface CH.ifa.draw.framework.FigureconnectedTextLocator in class CH.ifa.draw.standard.AbstractFigurepublic void release()
release in interface CH.ifa.draw.framework.Figurerelease in class CH.ifa.draw.standard.AbstractFigure
protected boolean shouldReverse(CH.ifa.draw.framework.Figure startFigure,
CH.ifa.draw.framework.Figure endFigure)
startFigure - Proposed start figureendFigure - Proposed end figure
protected void handleConnect(CH.ifa.draw.framework.Figure startFigure,
CH.ifa.draw.framework.Figure endFigure)
startFigure - Figure to connnect toendFigure - Figure to connnect to
protected void handleDisconnect(CH.ifa.draw.framework.Figure startFigure,
CH.ifa.draw.framework.Figure endFigure)
startFigure - Figure to disconnect fromendFigure - Figure to disconnect fromprotected void addStartConnectorChangeListener()
protected void removeStartConnectorChangeListener()
protected void addEndConnectorChangeListener()
protected void removeEndConnectorChangeListener()
public double getStartFactor()
public void setStartFactor(double startFactor)
public double getEndFactor()
public void setEndFactor(double endFactor)
public MoveableTitleFigure getLabel()
public boolean isMinimized()
public void layoutConnection()
public void layoutAndAdjustConnection()
layoutConnection() method.
public void figureChanged(CH.ifa.draw.framework.FigureChangeEvent e)
figureChanged in interface CH.ifa.draw.framework.FigureChangeListenerpublic void figureRemoved(CH.ifa.draw.framework.FigureChangeEvent e)
figureRemoved in interface CH.ifa.draw.framework.FigureChangeListenerpublic void figureRequestRemove(CH.ifa.draw.framework.FigureChangeEvent e)
figureRequestRemove in interface CH.ifa.draw.framework.FigureChangeListenerpublic void figureInvalidated(CH.ifa.draw.framework.FigureChangeEvent e)
figureInvalidated in interface CH.ifa.draw.framework.FigureChangeListenerpublic void figureRequestUpdate(CH.ifa.draw.framework.FigureChangeEvent e)
figureRequestUpdate in interface CH.ifa.draw.framework.FigureChangeListener
public void decode(java.lang.String geometry,
java.lang.String errName)
protected boolean decodeParameter(java.lang.String parameter,
java.lang.String errName)
protected java.lang.String encode()
public void setDrawing(ProcessDrawing drawing)
VisualElement
setDrawing in interface VisualElementpublic ProcessDrawing getDrawing()
VisualElement
getDrawing in interface VisualElementpublic VisualElement getParentElement()
VisualElement
getParentElement in interface VisualElementpublic CH.ifa.draw.framework.Figure getPresentationFigure()
VisualElement
getPresentationFigure in interface VisualElementpublic void updatePresentationFigure()
VisualElement
updatePresentationFigure in interface VisualElementpublic boolean isVisible()
VisualElement
isVisible in interface VisualElementpublic void setVisible(boolean visible)
VisualElement
setVisible in interface VisualElementpublic boolean handleEvent(VisualElementEvent event)
VisualElement
handleEvent in interface VisualElementevent - Event that desribes the event
public void updateFigure()
UpdatableFigure
updateFigure in interface UpdatableFigure
public void dragActionTriggered(java.lang.Object regionId,
java.awt.Point p)
InteractionClient
dragActionTriggered in interface InteractionClientregionId - Id of the region to import into (see BasicDropRegion.getId)p - Current mouse position in screen coordinatespublic void dragEnded(java.awt.datatransfer.Transferable transferable)
InteractionClient
dragEnded in interface InteractionClienttransferable - Transferable that has been draggedpublic void dragStarted(java.awt.datatransfer.Transferable transferable)
InteractionClient
dragStarted in interface InteractionClienttransferable - Transferable to be dragged
public java.util.List getAllDropRegions(java.util.List flavors,
java.awt.datatransfer.Transferable data,
java.awt.event.MouseEvent mouseEvent)
InteractionClient
getAllDropRegions in interface InteractionClientflavors - List of data flavors to checkdata - Transferable to importmouseEvent - Mouse event that initiated the drag action
DragAwareRegion object or null if the drop client
or one of its sub clients cannot satisfy at least one of the supplied data flavors
public java.util.List getDropRegions(java.util.List flavors,
java.awt.datatransfer.Transferable data,
java.awt.event.MouseEvent mouseEvent)
InteractionClient
getDropRegions in interface InteractionClientflavors - List of data flavors to checkdata - Transferable to be importedmouseEvent - Mouse event that initiated the drag action
DragAwareRegion object or null if the drop client
cannot satisfy at least one of the supplied data flavors.public java.util.List getImportersAt(java.awt.Point p)
InteractionClient
getImportersAt in interface InteractionClientp - Current mouse position in screen coordinates
Importer objects or nullpublic java.util.List getAllImportersAt(java.awt.Point p)
InteractionClient
getAllImportersAt in interface InteractionClientp - Current mouse position in screen coordinates
Importer objects or nullpublic java.util.List getSubClients()
InteractionClient
getSubClients in interface InteractionClientInteractionClient objects or null if this drop client doesn't have sub drop clients
public boolean importData(java.lang.Object regionId,
java.awt.datatransfer.Transferable data,
java.awt.Point p)
InteractionClient
importData in interface InteractionClientregionId - Id of the region to import into (see BasicDropRegion.getId)data - Transferable to importp - Drop point in glass coordinates
public void write(CH.ifa.draw.util.StorableOutput dw)
write in interface CH.ifa.draw.util.Storablewrite in class PolySplineFigure
public void read(CH.ifa.draw.util.StorableInput dr)
throws java.io.IOException
read in interface CH.ifa.draw.util.Storableread in class PolySplineFigurejava.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||