Package org.csstudio.opibuilder.model
Class ConnectionModel
java.lang.Object
org.csstudio.opibuilder.model.AbstractWidgetModel
org.csstudio.opibuilder.model.ConnectionModel
- All Implemented Interfaces:
IAdaptable
,IPropertySource
Model for connection.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
static enum
static enum
static enum
Type of router. -
Field Summary
Modifier and TypeFieldDescriptionstatic double
static final String
The type ID of this model.static final String
static final String
True if anti alias is enabled for the figure.static final String
static final String
static final String
static final String
static final String
Color of the line.static final String
static final String
static final String
static final String
Style of the line.static final String
Width of the line.static final String
All points of this connection except start and end anchor. null if it should be routed by router.static final String
static final String
The source widget Pathstatic final String
Source Terminalstatic final String
The source widget UIDstatic final String
The target widget Pathstatic final String
Target Terminalstatic final String
The target widget UIDFields inherited from class org.csstudio.opibuilder.model.AbstractWidgetModel
PROP_ACTIONS, PROP_BORDER_COLOR, PROP_BORDER_STYLE, PROP_BORDER_WIDTH, PROP_COLOR_BACKGROUND, PROP_COLOR_FOREGROUND, PROP_ENABLED, PROP_FONT, PROP_HEIGHT, PROP_NAME, PROP_RULES, PROP_SCALE_OPTIONS, PROP_SCRIPTS, PROP_SRC_CONNECTIONS, PROP_TGT_CONNECTIONS, PROP_TOOLTIP, PROP_VISIBLE, PROP_WIDGET_TYPE, PROP_WIDGET_UID, PROP_WIDTH, PROP_XPOS, PROP_YPOS, VERSION
-
Constructor Summary
ConstructorDescriptionConnectionModel
(DisplayModel displayModel) Construct a connection model which belongs to the displayModel. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Configure the properties of the widget.void
connect
(AbstractWidgetModel newSource, String newSourceTerminal, AbstractWidgetModel newTarget, String newTargetTerminal) Reconnect to a different source and/or target shape.void
Disconnect this connection from the shapes it is attached to.int
int
int
int
org.eclipse.draw2d.geometry.PointList
org.eclipse.draw2d.geometry.PointList
org.eclipse.draw2d.ScrollPane
Returns the source endpoint of this connection.String[]
Returns the target endpoint of this connection.String[]
final boolean
boolean
boolean
void
Reconnect this connection.void
resync()
Resync this connection with its source and target.void
setLoadedFromLinkedOpi
(boolean loadedFromLinkedOpi) void
setPoints
(org.eclipse.draw2d.geometry.PointList points) void
setScrollPane
(org.eclipse.draw2d.ScrollPane scrollPane) void
setSource
(AbstractWidgetModel source) void
setSourceTerminal
(String terminal) void
setTarget
(AbstractWidgetModel target) void
setTargetTerminal
(String terminal) Methods inherited from class org.csstudio.opibuilder.model.AbstractWidgetModel
addConnection, addProperty, addProperty, addPVProperty, configureBaseProperties, doScale, flipHorizontally, flipHorizontally, flipVertically, flipVertically, generateNewWUID, getActionsInput, getAdapter, getAllPropertyIDs, getBackgroundColor, getBorderColor, getBorderStyle, getBorderWidth, getBounds, getCastedPropertyValue, getEditableValue, getExecutionMode, getFont, getForegroundColor, getHeight, getIndex, getLocation, getName, getNestedDepth, getOriginLocation, getOriginSize, getProperty, getPropertyDescriptors, getPropertyValue, getPVMap, getRawPropertyValue, getRawTooltip, getRGBFromColorProperty, getRootDisplayModel, getRootDisplayModel, getRulesInput, getRuntimePropertyList, getScaledSize, getScaleOptions, getScriptsInput, getSize, getSourceConnections, getSWTColorFromColorProperty, getTargetConnections, getTooltip, getType, getVersion, getVersionOnFile, getWidgetType, getWidth, getWUID, getX, getY, isEnabled, isPropertySet, isVisible, processVersionDifference, removeProperty, removePVProperty, resetPropertyValue, rotate90, rotate90, scale, scaleConnections, setBackgroundColor, setBorderColor, setBorderStyle, setBorderWidth, setBounds, setBounds, setEnabled, setExecutionMode, setForegroundColor, setHeight, setLocation, setLocation, setName, setParent, setPropertyDescription, setPropertyValue, setPropertyValue, setPropertyVisible, setPropertyVisibleAndSavable, setScaleOptions, setSize, setSize, setTooltip, setVersionOnFile, setWidth, setX, setY
-
Field Details
-
ARROW_ANGLE
public static double ARROW_ANGLE -
ID
The type ID of this model.- See Also:
-
PROP_LINE_WIDTH
Width of the line.- See Also:
-
PROP_LINE_STYLE
Style of the line.- See Also:
-
PROP_LINE_COLOR
Color of the line.- See Also:
-
PROP_ROUTER
- See Also:
-
PROP_ARROW_TYPE
- See Also:
-
PROP_FILL_ARROW
- See Also:
-
PROP_ARROW_LENGTH
- See Also:
-
PROP_ANTIALIAS
True if anti alias is enabled for the figure.- See Also:
-
PROP_SRC_TERM
Source Terminal- See Also:
-
PROP_TGT_TERM
Target Terminal- See Also:
-
PROP_SRC_WUID
The source widget UID- See Also:
-
PROP_SRC_PATH
The source widget Path- See Also:
-
PROP_TGT_WUID
The target widget UID- See Also:
-
PROP_TGT_PATH
The target widget Path- See Also:
-
PATH_DELIMITER
- See Also:
-
PROP_POINTS
All points of this connection except start and end anchor. null if it should be routed by router.- See Also:
-
PROP_LINE_JUMP_ADD
- See Also:
-
PROP_LINE_JUMP_STYLE
- See Also:
-
PROP_LINE_JUMP_SIZE
- See Also:
-
PROP_IS_LOADED_FROM_LINKING_CONTAINER
- See Also:
-
-
Constructor Details
-
ConnectionModel
Construct a connection model which belongs to the displayModel. If this is a temporary connection model which doesn't belong to any display model, displayModel can be null.- Parameters:
displayModel
- the display model. Can be null.
-
-
Method Details
-
configureProperties
protected void configureProperties()Description copied from class:AbstractWidgetModel
Configure the properties of the widget. Subclass should add new properties in this method.- Specified by:
configureProperties
in classAbstractWidgetModel
-
getTypeID
- Specified by:
getTypeID
in classAbstractWidgetModel
- Returns:
- the unique typeID of the model.
-
getSource
Returns the source endpoint of this connection.- Returns:
- a non-null Shape instance
-
getTarget
Returns the target endpoint of this connection.- Returns:
- a non-null Shape instance
-
reconnect
public void reconnect()Reconnect this connection. The connection will reconnect with the shapes it was previously attached to. -
resync
public void resync()Resync this connection with its source and target. -
connect
public void connect(AbstractWidgetModel newSource, String newSourceTerminal, AbstractWidgetModel newTarget, String newTargetTerminal) Reconnect to a different source and/or target shape. The connection will disconnect from its current attachments and reconnect to the new source and target.- Parameters:
newSource
- a new source endpoint for this connection (non null)newTarget
- a new target endpoint for this connection (non null)- Throws:
IllegalArgumentException
- if any of the paramers are null or newSource == newTarget
-
disconnect
public void disconnect()Disconnect this connection from the shapes it is attached to. -
getTargetTerminal
-
getSourceTerminal
-
setSource
-
setTarget
-
setTargetTerminal
-
setSourceTerminal
-
getLineWidth
public int getLineWidth() -
getTargetPath
-
getSourcePath
-
getLineStyle
public int getLineStyle()- Returns:
- SWT line style
-
getLineColor
-
getRouterType
-
getArrowType
-
getArrowLength
public int getArrowLength() -
isFillArrow
public boolean isFillArrow() -
isAntiAlias
public final boolean isAntiAlias()- Returns:
- true if the graphics's antiAlias is on.
-
getParent
- Overrides:
getParent
in classAbstractWidgetModel
- Returns:
- the parent
-
getPoints
public org.eclipse.draw2d.geometry.PointList getPoints()- Returns:
- the points on this connection except start and end anchors, can be null.
-
setPoints
public void setPoints(org.eclipse.draw2d.geometry.PointList points) -
getOriginPoints
public org.eclipse.draw2d.geometry.PointList getOriginPoints()- Returns:
- the original points before scaling.
-
setLoadedFromLinkedOpi
public void setLoadedFromLinkedOpi(boolean loadedFromLinkedOpi) -
isLoadedFromLinkedOpi
public boolean isLoadedFromLinkedOpi()- Returns:
- true if the connection was loaded from linked opi file in LinkingContainer
-
getLineJumpAdd
-
getLineJumpSize
public int getLineJumpSize() -
getLineJumpStyle
-
getScrollPane
public org.eclipse.draw2d.ScrollPane getScrollPane()- Returns:
- the scrollPane
-
setScrollPane
public void setScrollPane(org.eclipse.draw2d.ScrollPane scrollPane) - Parameters:
scrollPane
- the scrollPane to set
-