Interface ArrowAnnotation
- All Superinterfaces:
Annotation
This is the interface for an arrow annotation. In general, an arrow connects
to a source (an existing annotation) and is drawn to a target, which is either
another annotation, a
CyNode
or a point on the canvas. The end of the
arrow will move with its source annotation or its target (unless it's target is a
point).Module: presentation-api
To use this in your app, include the following dependency in your POM:
<dependency> <groupId>org.cytoscape</groupId> <artifactId>presentation-api</artifactId> </dependency>
Cytoscape Backwards Compatibility (API Interface): We expect that this interface will be used but not implemented by developers using this interface. As such, we reserve the right to add methods to the interface as part of minor version upgrades. We will not remove methods for any changes other than major version upgrades.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
This enum is used to indicate how the arrow is anchored to the source or target.static enum
This enum is used to indicate which end of the arrow the operation is referring to. -
Field Summary
Fields inherited from interface org.cytoscape.view.presentation.annotations.Annotation
BACKGROUND, CANVAS, FOREGROUND, NAME, ROTATION, X, Y, Z, ZOOM
-
Method Summary
Modifier and TypeMethodDescriptionGet the anchor type for one end of the arrowGet the color of one end of the arrowdouble
Get the size of one end of the arrowGet the type of one end of the arrowSet the line color for this arrowdouble
Get the line width for this arrowReturn the sourceAnnotation
for this arrow.Get the list of supported arrow shapesReturn the target object for this arrow.void
Set the anchor type for one end of the arrowvoid
setArrowColor
(ArrowAnnotation.ArrowEnd end, Paint color) Set the color of one end of the arrowvoid
setArrowSize
(ArrowAnnotation.ArrowEnd end, double width) Set the size of one end of the arrowvoid
setArrowType
(ArrowAnnotation.ArrowEnd end, String type) Set the type of one end of the arrowvoid
setLineColor
(Paint color) Set the line color for this arrowvoid
setLineWidth
(double width) Set the line width for this arrowvoid
setSource
(Annotation source) Set the sourceAnnotation
for this arrow.void
Set the target for this arrow assuming the target is a point on the canvasvoid
Deprecated.void
setTarget
(View<? extends CyIdentifiable> target) Set the target for this arrow assuming the target is aView
object.void
setTarget
(Annotation target) Set the target for this arrow assuming the target is anAnnotation
Methods inherited from interface org.cytoscape.view.presentation.annotations.Annotation
addArrow, getArgMap, getArrows, getBounds, getCanvasName, getName, getNetworkView, getRotatedBounds, getRotation, getSpecificZoom, getUUID, getX, getY, getZ, getZoom, isSelected, moveAnnotation, removeAnnotation, removeArrow, setCanvas, setName, setRotation, setSelected, setSpecificZoom, setZ, setZoom, update
-
Method Details
-
getSource
Annotation getSource()Return the sourceAnnotation
for this arrow.- Returns:
- the source
Annotation
-
setSource
Set the sourceAnnotation
for this arrow.- Parameters:
source
- theAnnotation
for the arrow source
-
getTarget
Object getTarget()Return the target object for this arrow. Currently supported targets includeAnnotation
s,CyNode
View
s, and arbitrary points on the canvas.- Returns:
- the the target. Callers should test to determine the appropriate type
-
setTarget
Set the target for this arrow assuming the target is anAnnotation
- Parameters:
target
- the target for this arrow
-
setTarget
Deprecated.UsesetTarget(View)
instead.Set the target for this arrow assuming the target is aCyNode
- Parameters:
target
- the target for this arrow
-
setTarget
Set the target for this arrow assuming the target is aView
object. OnlyCyNode
views are supported currently.- Parameters:
target
- the target node view for this arrow
-
setTarget
Set the target for this arrow assuming the target is a point on the canvas- Parameters:
target
- the target for this arrow
-
getLineWidth
double getLineWidth()Get the line width for this arrow- Returns:
- line width as a double
-
setLineWidth
void setLineWidth(double width) Set the line width for this arrow- Parameters:
width
- of the line as a double
-
getLineColor
Paint getLineColor()Set the line color for this arrow- Returns:
- color of the line
-
setLineColor
Set the line color for this arrow- Parameters:
color
- of the line
-
getArrowSize
Get the size of one end of the arrow- Parameters:
end
- the end of the arrow we're getting the size for- Returns:
- the arrow size
-
setArrowSize
Set the size of one end of the arrow- Parameters:
end
- the end of the arrow we're setting the size forwidth
- the arrow size
-
getArrowColor
Get the color of one end of the arrow- Parameters:
end
- the end of the arrow we're getting the color for- Returns:
- the arrow color
-
setArrowColor
Set the color of one end of the arrow- Parameters:
end
- the end of the arrow we're setting the color forcolor
- the arrow color
-
getSupportedArrows
Get the list of supported arrow shapes- Returns:
- the list of supported arrow types
-
getArrowType
Get the type of one end of the arrow- Parameters:
end
- the end of the arrow we're getting the size for- Returns:
- the arrow type as a string.
-
setArrowType
Set the type of one end of the arrow- Parameters:
end
- the end of the arrow we're setting the type forwidth
- the arrow size
-
getAnchorType
Get the anchor type for one end of the arrow- Parameters:
end
- the end of the arrow we're getting the anchor type for- Returns:
- the anchor type
-
setAnchorType
Set the anchor type for one end of the arrow- Parameters:
end
- the end of the arrow we're setting the anchor type fortype
- the anchor type for this end of the arrow
-
setTarget(View)
instead.