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

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
              extended by org.openbp.cockpit.modeler.figures.process.MultiSocketNodeFigure
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, Colorizable, Expandable, ShadowDropper, UpdatableFigure, ProcessElementContainer, VisualElement, InteractionClient
Direct Known Subclasses:
PlaceholderNodeFigure, PrimitiveNodeFigure

public class MultiSocketNodeFigure
extends NodeFigure
implements Colorizable

A Node Figure is the graphical representation of a multi socket node.

Author:
Stephan Moritz
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.openbp.cockpit.modeler.figures.process.NodeFigure
displayBox, iconFigure, iconOverlayFigure, node, presentationFigure, REGION_TYPE, ROTATE_CCW, ROTATE_CW, shadowFigure
 
Fields inherited from class CH.ifa.draw.standard.CompositeFigure
_nHighestZ, _nLowestZ, fFigures
 
Fields inherited from interface CH.ifa.draw.framework.Figure
POPUP_MENU
 
Fields inherited from interface org.openbp.cockpit.modeler.figures.VisualElement
VISUAL_DISPLAY_ALL, VISUAL_DND_PARTICIPANT, VISUAL_VISIBLE
 
Constructor Summary
MultiSocketNodeFigure()
          Constructor.
 
Method Summary
protected  javax.swing.Icon determineCenterIcon()
          Initializes the icon in the center of the node.
 java.awt.Color getDefaultFillColor()
          Returns the default color of the underlying activity node.
protected  java.lang.String getDropRegionIdForFlavor(java.util.List flavors, java.awt.datatransfer.Transferable data, java.awt.event.MouseEvent mouseEvent)
          Determines if none of the flavors in the list is accepted by DnD actions.
 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.util.List getImportersAt(java.awt.Point p)
          Returns all importers which will be accepted at the given point by this client.
 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 initIcon()
          Initializes the icons of the figure.
protected  void initOverlayIcon()
          Initializes the overlay icon in the lower right corner of the node.
protected  void initTextFigure(java.lang.String textPosition)
          Sets up the name tag of this node.
 void removeSocket(SocketFigure socketFigure)
          Removes the socket from this node.
 
Methods inherited from class org.openbp.cockpit.modeler.figures.process.NodeFigure
acceptsTyping, addSocket, basicDisplayBox, basicMoveBy, center, changed, changeOrientation, clone, compactDisplayBox, connect, connect, connectorAt, containsPoint, createNodeDropRegion, decodeGeometry, decodeParameter, determineCustomIcon, determineCustomIconPath, disconnect, displayBox, dragActionTriggered, dragEnded, dragStarted, draw, drawSelectionMarker, encodeGeometry, findFigure, findFigureInside, flipOrientation, getAllDropRegions, getAllImportersAt, getConnectableSocket, getDrawing, getFillColor, getFont, getNode, getParentElement, getPresentationFigure, getProcessElement, getReferredProcessElement, getShadow, getSocket, getSubClients, getText, handleEvent, handles, initialize, initPresentationFigure, initShadow, initSockets, isCreatedFromScratch, isPresentationFigureVisible, isVerticallyOriented, isVisible, layoutSockets, layoutUnarrangedSockets, overlayColumns, placeAdjacent, positionOverlayFigure, release, removeConnections, selectionOnDelete, setCreatedFromScratch, setDrawing, setFillColor, setIconFigure, setIconOverlayFigure, setSize, setText, setVisible, textDisplayBox, toString, translateChildren, updateFigure, updatePresentationFigure
 
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 org.openbp.cockpit.modeler.figures.generic.Colorizable
getFillColor, setFillColor
 
Methods inherited from interface CH.ifa.draw.framework.Figure
addFigureChangeListener, addToContainer, basicDisplayBox, canConnect, center, changed, clone, connectedTextLocator, connectionInsets, connectorAt, connectorVisibility, containsPoint, decompose, displayBox, displayBox, displayBox, draw, figures, findFigureInside, getAttribute, getZValue, handles, includes, invalidate, isEmpty, listener, moveBy, release, removeFigureChangeListener, removeFromContainer, setAttribute, setZValue, size, willChange
 
Methods inherited from interface CH.ifa.draw.util.Storable
read, write
 
Methods inherited from interface CH.ifa.draw.framework.FigureChangeListener
figureChanged, figureInvalidated, figureRemoved, figureRequestRemove, figureRequestUpdate
 

Constructor Detail

MultiSocketNodeFigure

public MultiSocketNodeFigure()
Constructor.

Method Detail

initIcon

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

Overrides:
initIcon in class NodeFigure

determineCenterIcon

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

Overrides:
determineCenterIcon in class NodeFigure

initOverlayIcon

protected void initOverlayIcon()
Initializes the overlay icon in the lower right corner of the node.


initTextFigure

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

Overrides:
initTextFigure in class NodeFigure
Parameters:
textPosition - Text position ("c"/"s"/"n"/"e"/"w")

removeSocket

public void removeSocket(SocketFigure socketFigure)
Removes the socket from this node.

Parameters:
socketFigure - Socket to remove

getDefaultFillColor

public java.awt.Color getDefaultFillColor()
Returns the default color of the underlying activity node.

Specified by:
getDefaultFillColor in interface Colorizable
Returns:
Default fill color or null for no fill color

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
Overrides:
getDropRegions in class NodeFigure
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.

getDropRegionIdForFlavor

protected java.lang.String getDropRegionIdForFlavor(java.util.List flavors,
                                                    java.awt.datatransfer.Transferable data,
                                                    java.awt.event.MouseEvent mouseEvent)
Determines if none of the flavors in the list is accepted by DnD actions.

Parameters:
flavors - Flavors to check
data - Transferred object
mouseEvent - Mouse event of the DnD drop action
Returns:
The region id that should be used for the accepted flavor or null if the flavor is not accepted

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
Overrides:
importData in class NodeFigure
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.

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
Overrides:
getImportersAt in class NodeFigure
Parameters:
p - Current mouse position in screen coordinates
Returns:
A list of Importer objects or null


Copyright © 2011. All Rights Reserved.