Cytoscape 3.1.1 API

org.cytoscape.view.presentation.annotations
Interface ArrowAnnotation

All Superinterfaces:
Annotation

public interface ArrowAnnotation
extends 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).


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.

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>

Nested Class Summary
static class ArrowAnnotation.AnchorType
          This enum is used to indicate how the arrow is anchored to the source or target.
static class ArrowAnnotation.ArrowEnd
          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, X, Y, ZOOM
 
Method Summary
 ArrowAnnotation.AnchorType getAnchorType(ArrowAnnotation.ArrowEnd end)
          Get the anchor type for one end of the arrow
 Paint getArrowColor(ArrowAnnotation.ArrowEnd end)
          Get the color of one end of the arrow
 double getArrowSize(ArrowAnnotation.ArrowEnd end)
          Get the size of one end of the arrow
 String getArrowType(ArrowAnnotation.ArrowEnd end)
          Get the type of one end of the arrow
 Paint getLineColor()
          Set the line color for this arrow
 double getLineWidth()
          Get the line width for this arrow
 Annotation getSource()
          Return the source Annotation for this arrow.
 List<String> getSupportedArrows()
          Get the list of supported arrow shapes
 Object getTarget()
          Return the target object for this arrow.
 void setAnchorType(ArrowAnnotation.ArrowEnd end, ArrowAnnotation.AnchorType type)
          Set the anchor type for one end of the arrow
 void setArrowColor(ArrowAnnotation.ArrowEnd end, Paint color)
          Set the color of one end of the arrow
 void setArrowSize(ArrowAnnotation.ArrowEnd end, double width)
          Set the size of one end of the arrow
 void setArrowType(ArrowAnnotation.ArrowEnd end, String type)
          Set the type of one end of the arrow
 void setLineColor(Paint color)
          Set the line color for this arrow
 void setLineWidth(double width)
          Set the line width for this arrow
 void setSource(Annotation source)
          Set the source Annotation for this arrow.
 void setTarget(Annotation target)
          Set the target for this arrow assuming the target is an Annotation
 void setTarget(CyNode target)
          Set the target for this arrow assuming the target is a CyNode
 void setTarget(Point2D target)
          Set the target for this arrow assuming the target is a point on the canvas
 
Methods inherited from interface org.cytoscape.view.presentation.annotations.Annotation
addArrow, getArgMap, getArrows, getCanvasName, getNetworkView, getSpecificZoom, getZoom, isSelected, moveAnnotation, removeArrow, setCanvas, setSelected, setSpecificZoom, setZoom
 

Method Detail

getSource

Annotation getSource()
Return the source Annotation for this arrow.

Returns:
the source Annotation

setSource

void setSource(Annotation source)
Set the source Annotation for this arrow.

Parameters:
source - the Annotation for the arrow source

getTarget

Object getTarget()
Return the target object for this arrow. Currently supported targets include Annotations, CyNodes, and arbitrary points on the canvas.

Returns:
the the target. Callers should test to determine the appropriate type

setTarget

void setTarget(Annotation target)
Set the target for this arrow assuming the target is an Annotation

Parameters:
target - the target for this arrow

setTarget

void setTarget(CyNode target)
Set the target for this arrow assuming the target is a CyNode

Parameters:
target - the target for this arrow

setTarget

void setTarget(Point2D target)
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

void setLineColor(Paint color)
Set the line color for this arrow

Parameters:
color - of the line

getArrowSize

double getArrowSize(ArrowAnnotation.ArrowEnd end)
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

void setArrowSize(ArrowAnnotation.ArrowEnd end,
                  double width)
Set the size of one end of the arrow

Parameters:
end - the end of the arrow we're setting the size for
width - the arrow size

getArrowColor

Paint getArrowColor(ArrowAnnotation.ArrowEnd end)
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

void setArrowColor(ArrowAnnotation.ArrowEnd end,
                   Paint color)
Set the color of one end of the arrow

Parameters:
end - the end of the arrow we're setting the color for
color - the arrow color

getSupportedArrows

List<String> getSupportedArrows()
Get the list of supported arrow shapes

Returns:
the list of supported arrow types

getArrowType

String getArrowType(ArrowAnnotation.ArrowEnd end)
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

void setArrowType(ArrowAnnotation.ArrowEnd end,
                  String type)
Set the type of one end of the arrow

Parameters:
end - the end of the arrow we're setting the type for
width - the arrow size

getAnchorType

ArrowAnnotation.AnchorType getAnchorType(ArrowAnnotation.ArrowEnd end)
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

void setAnchorType(ArrowAnnotation.ArrowEnd end,
                   ArrowAnnotation.AnchorType type)
Set the anchor type for one end of the arrow

Parameters:
end - the end of the arrow we're setting the anchor type for
type - the anchor type for this end of the arrow

Cytoscape 3.1.1 API

Copyright 2011 Cytoscape Consortium. All rights reserved.