|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectCH.ifa.draw.standard.AbstractFigure
CH.ifa.draw.standard.CompositeFigure
org.openbp.cockpit.modeler.figures.process.NodeFigure
public abstract class NodeFigure
A Node Figure is the graphical representation of a process node.
| 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)
|
ProcessElementContainer |
findProcessElementContainer(int x,
int y)
Gets the direct child element at the given coordinates. |
ProcessElementContainer |
findProcessElementContainerInside(int x,
int y)
Gets the innermost child at the given coordinates. |
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). |
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 |
|---|
public static final int ROTATE_CW
changeOrientation(int): Rotate clockwise
public static final int ROTATE_CCW
changeOrientation(int): Rotate counterclockwise
public static final java.lang.String REGION_TYPE
protected Node node
protected XFigure presentationFigure
protected CH.ifa.draw.framework.Figure iconFigure
protected CH.ifa.draw.framework.Figure iconOverlayFigure
protected XFigure shadowFigure
protected java.awt.Rectangle displayBox
| Constructor Detail |
|---|
public NodeFigure()
| Method Detail |
|---|
public java.lang.Object clone()
clone in interface CH.ifa.draw.framework.Figureclone in class CH.ifa.draw.standard.AbstractFigure
public void connect(Node node,
ProcessDrawing drawing)
node - Node to refer todrawing - Process drawing that owns the figurepublic java.lang.String toString()
toString in class java.lang.Objectprotected void initialize()
protected void initPresentationFigure()
protected void initTextFigure(java.lang.String textPosition)
textPosition - Text position ("c"/"s"/"n"/"e"/"w")protected void initIcon()
protected javax.swing.Icon determineCustomIcon()
protected java.lang.String determineCustomIconPath()
protected javax.swing.Icon determineCenterIcon()
protected void initSockets()
protected void initShadow()
public SocketFigure addSocket(NodeSocket socket)
socket - Socket to add
protected void layoutUnarrangedSockets()
protected void layoutSockets(java.util.List socketsToLayout,
java.lang.String orientation)
socketsToLayout - List of sockets to layout (contains SocketFigure objects)orientation - Orientation of the sockets ("e"/"n"/"w"/"s")public boolean isVerticallyOriented()
public void flipOrientation()
public void changeOrientation(int mode)
mode - Rotation mode (ROTATE_CW/ROTATE_CCW)public Node getNode()
public SocketFigure getSocket(NodeSocket socket)
socket - Socket to search
public SocketFigure getConnectableSocket(boolean isEntry)
isEntry - true: Get an entry socketprotected void removeConnections()
public void decodeGeometry()
protected void decodeParameter(java.lang.String parameter)
public void encodeGeometry()
public java.awt.Rectangle displayBox()
displayBox in interface CH.ifa.draw.framework.FiguredisplayBox in class CH.ifa.draw.standard.AbstractFigureAbstractFigure.displayBox()
public void basicDisplayBox(java.awt.Point newOrigin,
java.awt.Point newCorner)
basicDisplayBox in interface CH.ifa.draw.framework.FigurebasicDisplayBox in class CH.ifa.draw.standard.AbstractFigureAbstractFigure.basicDisplayBox(Point newOrigin, Point newCorner)
protected void basicMoveBy(int dx,
int dy)
basicMoveBy in class CH.ifa.draw.standard.CompositeFigureCompositeFigure.basicMoveBy(int dx, int dy)public java.util.Vector handles()
handles in interface CH.ifa.draw.framework.Figurehandles in class CH.ifa.draw.standard.AbstractFigureAbstractFigure.handles()public void draw(java.awt.Graphics g)
draw in interface CH.ifa.draw.framework.Figuredraw in class CH.ifa.draw.standard.CompositeFigureCompositeFigure.draw(Graphics g)protected boolean isPresentationFigureVisible()
protected void drawSelectionMarker(java.awt.Graphics g)
public void changed()
changed in interface CH.ifa.draw.framework.Figurechanged in class CH.ifa.draw.standard.AbstractFigure()
public CH.ifa.draw.framework.Connector connectorAt(int x,
int y)
connectorAt in interface CH.ifa.draw.framework.FigureconnectorAt in class CH.ifa.draw.standard.AbstractFigureAbstractFigure.connectorAt(int x, int y)
public java.awt.Rectangle placeAdjacent(java.awt.Rectangle rect,
double angle)
rect - The rectangle to adjustangle - The direction in which the rectangle should be placed
public boolean containsPoint(int x,
int y)
containsPoint in interface CH.ifa.draw.framework.FigurecontainsPoint in class CH.ifa.draw.standard.AbstractFigureAbstractFigure.containsPoint(int x, int y)
public CH.ifa.draw.framework.Figure findFigure(int x,
int y)
findFigure in class CH.ifa.draw.standard.CompositeFigureCompositeFigure.findFigure(int x, int y)
public CH.ifa.draw.framework.Figure findFigureInside(int x,
int y)
findFigureInside in interface CH.ifa.draw.framework.FigurefindFigureInside in class CH.ifa.draw.standard.CompositeFigureCompositeFigure.findFigureInside(int x, int y)public java.awt.Point center()
center in interface CH.ifa.draw.framework.Figurecenter in class CH.ifa.draw.standard.AbstractFigurepublic void release()
release in interface CH.ifa.draw.framework.Figurerelease in class CH.ifa.draw.standard.CompositeFigureFigure.release()
public void translateChildren(int dx,
int dy)
public void setIconFigure(CH.ifa.draw.framework.Figure iconFigure)
public void setIconOverlayFigure(CH.ifa.draw.framework.Figure iconOverlayFigure)
public CH.ifa.draw.framework.Figure getShadow()
ShadowDropper
getShadow in interface ShadowDropperShadowDropper.getShadow()
public void setSize(int w,
int h)
protected void positionOverlayFigure(java.awt.Rectangle box,
java.awt.Rectangle iconRect,
java.awt.Rectangle textRect)
box - Display box of the node figureiconRect - Icon recttextRect - Text rectpublic java.awt.Rectangle compactDisplayBox()
compactDisplayBox in interface ExpandableExpandable.compactDisplayBox()public void setFillColor(java.awt.Color color)
public java.awt.Color getFillColor()
public ProcessObject getProcessElement()
ProcessElementContainer
getProcessElement in interface ProcessElementContainerProcessElementContainer.getProcessElement()public ProcessObject getReferredProcessElement()
ProcessElementContainerProcessElementContainer.getProcessElement(), however this
might be different also for example for sockets of initial/final nodes sockets, which will return
their parent node.
getReferredProcessElement in interface ProcessElementContainerProcessElementContainer.getReferredProcessElement()public CH.ifa.draw.framework.Figure selectionOnDelete()
selectionOnDelete in interface ProcessElementContainerProcessElementContainer.selectionOnDelete()
public ProcessElementContainer findProcessElementContainer(int x,
int y)
ProcessElementContainer
findProcessElementContainer in interface ProcessElementContainerx - Document coordinatey - Document coordinate
VisualElement.findVisualElement(int, int)
public ProcessElementContainer findProcessElementContainerInside(int x,
int y)
ProcessElementContainer
findProcessElementContainerInside in interface ProcessElementContainerx - Document coordinatey - Document coordinate
VisualElement.findVisualElementInside(int, int)public java.awt.Rectangle textDisplayBox()
textDisplayBox in interface CH.ifa.draw.standard.TextHolderpublic java.lang.String getText()
getText in interface CH.ifa.draw.standard.TextHolderpublic void setText(java.lang.String newText)
setText in interface CH.ifa.draw.standard.TextHolderpublic boolean acceptsTyping()
acceptsTyping in interface CH.ifa.draw.standard.TextHolderpublic int overlayColumns()
overlayColumns in interface CH.ifa.draw.standard.TextHolderpublic void connect(CH.ifa.draw.framework.Figure connectedFigure)
connect in interface CH.ifa.draw.standard.TextHolderpublic void disconnect(CH.ifa.draw.framework.Figure disconnectFigure)
disconnect in interface CH.ifa.draw.standard.TextHolderpublic java.awt.Font getFont()
getFont in interface CH.ifa.draw.standard.TextHolderpublic void setDrawing(ProcessDrawing drawing)
VisualElement
setDrawing in interface VisualElementVisualElement.setDrawing(ProcessDrawing)public ProcessDrawing getDrawing()
VisualElement
getDrawing in interface VisualElementVisualElement.getDrawing()public VisualElement getParentElement()
VisualElement
getParentElement in interface VisualElementVisualElement.getParentElement()public CH.ifa.draw.framework.Figure getPresentationFigure()
VisualElement
getPresentationFigure in interface VisualElementVisualElement.getPresentationFigure()public void updatePresentationFigure()
VisualElement
updatePresentationFigure in interface VisualElementVisualElement.updatePresentationFigure()public boolean isVisible()
VisualElement
isVisible in interface VisualElementVisualElement.isVisible()public void setVisible(boolean visible)
VisualElement
setVisible in interface VisualElementVisualElement.setVisible(boolean)public boolean isCreatedFromScratch()
public void setCreatedFromScratch(boolean createdFromScratch)
public boolean handleEvent(VisualElementEvent event)
VisualElement
handleEvent in interface VisualElementevent - Event that desribes the event
VisualElement.handleEvent(VisualElementEvent event)
public VisualElement findVisualElement(int x,
int y)
VisualElement
findVisualElement in interface VisualElementx - World coordinates of the point to searchy - World coordinates of the point to search
VisualElement.findVisualElement(int, int)
public VisualElement findVisualElementInside(int x,
int y)
VisualElement
findVisualElementInside in interface VisualElementx - World coordinates of the point to searchy - World coordinates of the point to search
VisualElement.findVisualElementInside(int, int)public void updateFigure()
updateFigure in interface UpdatableFigureUpdatableFigure.updateFigure()
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 coordinatesInteractionClient.dragActionTriggered(Object, Point)public void dragStarted(java.awt.datatransfer.Transferable transferable)
InteractionClient
dragStarted in interface InteractionClienttransferable - Transferable to be draggedInteractionClient.dragStarted(Transferable)public void dragEnded(java.awt.datatransfer.Transferable transferable)
InteractionClient
dragEnded in interface InteractionClienttransferable - Transferable that has been draggedInteractionClient.dragEnded(Transferable)
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 flavorsInteractionClient.getAllDropRegions(List, Transferable, MouseEvent)
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.InteractionClient.getDropRegions(List, Transferable, MouseEvent)public java.util.List getImportersAt(java.awt.Point p)
InteractionClient
getImportersAt in interface InteractionClientp - Current mouse position in screen coordinates
Importer objects or nullInteractionClient.getImportersAt(Point)public java.util.List getAllImportersAt(java.awt.Point p)
InteractionClient
getAllImportersAt in interface InteractionClientp - Current mouse position in screen coordinates
Importer objects or nullInteractionClient.getAllImportersAt(Point)public java.util.List getSubClients()
InteractionClient
getSubClients in interface InteractionClientInteractionClient objects or null if this drop client doesn't have sub drop clientsInteractionClient.getSubClients()
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
InteractionClient.importData(Object, Transferable, Point)
protected ViewDropRegion createNodeDropRegion(java.lang.String regionId,
java.util.List flavors)
regionId - Region idflavors - Supported data flavors
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||