Cytoscape 3.1.1 API

org.cytoscape.view.presentation.annotations
Interface Annotation

All Known Subinterfaces:
ArrowAnnotation, BoundedTextAnnotation, GroupAnnotation, ImageAnnotation, ShapeAnnotation, TextAnnotation

public interface Annotation

This is the base interface for all Annotations. An annotation is a graphical object that is displayed on the network, but is not part of the graph model. Example annotations are shapes, text, and images that annotate the contents of the network to elucidate aspects of the network for presentation or explanatory purposes. In general, annotations are drawn either on top of the network (FOREGROUND) or behind (BACKGROUND) the network canvas. Arg map initialization parameters (for AnnotationFactory#createAnnotation()) include: ZOOM, CANVAS, X, and Y.


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>

Field Summary
static String BACKGROUND
          The background canvas
static String CANVAS
          Arg map key to initialize the canvas to draw this annotation on
static String FOREGROUND
          The foreground canvas
static String X
          Arg map key to initialize the x location for this annotation
static String Y
          Arg map key to initialize the y location for this annotation
static String ZOOM
          Arg map key to initialize the zoom value for this annotation
 
Method Summary
 void addArrow(ArrowAnnotation arrow)
          Add an arrow annotation to this annotation.
 Map<String,String> getArgMap()
          Get the argument map that is used to serialize this annotation.
 Set<ArrowAnnotation> getArrows()
          Get all arrows that are currently linked to this annotation.
 String getCanvasName()
          Return the canvas that this Annotation is on
 CyNetworkView getNetworkView()
          Return the view that this Annotation is for
 double getSpecificZoom()
          Get the specific zoom for this annotation
 double getZoom()
          Get the current zoom for this annotation
 boolean isSelected()
          Return true if this annotation is currently selected
 void moveAnnotation(Point2D location)
          Move an annotation to the specified location
 void removeArrow(ArrowAnnotation arrow)
          Remove an arrow from this annotation.
 void setCanvas(String canvas)
          Set the canvas for this annotation.
 void setSelected(boolean selected)
          Set the selected state for this annotation
 void setSpecificZoom(double zoom)
          Set the specific zoom for this annotation
 void setZoom(double zoom)
          Set the current zoom for this annotation
 

Field Detail

BACKGROUND

static final String BACKGROUND
The background canvas

See Also:
Constant Field Values

FOREGROUND

static final String FOREGROUND
The foreground canvas

See Also:
Constant Field Values

ZOOM

static final String ZOOM
Arg map key to initialize the zoom value for this annotation

See Also:
Constant Field Values

CANVAS

static final String CANVAS
Arg map key to initialize the canvas to draw this annotation on

See Also:
Constant Field Values

X

static final String X
Arg map key to initialize the x location for this annotation

See Also:
Constant Field Values

Y

static final String Y
Arg map key to initialize the y location for this annotation

See Also:
Constant Field Values
Method Detail

getNetworkView

CyNetworkView getNetworkView()
Return the view that this Annotation is for

Returns:
the network view this annotation is for

getCanvasName

String getCanvasName()
Return the canvas that this Annotation is on

Returns:
the canvas this annotation is on

setCanvas

void setCanvas(String canvas)
Set the canvas for this annotation. This must be one of BACKGROUND or FOREGROUND.

Parameters:
canvas - the canvas to move the annotation to

moveAnnotation

void moveAnnotation(Point2D location)
Move an annotation to the specified location

Parameters:
location - the location to move the annotation to

getZoom

double getZoom()
Get the current zoom for this annotation

Returns:
the current zoom value

setZoom

void setZoom(double zoom)
Set the current zoom for this annotation

Parameters:
zoom - the zoom to set

getSpecificZoom

double getSpecificZoom()
Get the specific zoom for this annotation

Returns:
the current specific zoom for this annotation

setSpecificZoom

void setSpecificZoom(double zoom)
Set the specific zoom for this annotation

Parameters:
zoom - the specific zoom for this annotation

isSelected

boolean isSelected()
Return true if this annotation is currently selected

Returns:
true if selected

setSelected

void setSelected(boolean selected)
Set the selected state for this annotation

Parameters:
selected - select if true

addArrow

void addArrow(ArrowAnnotation arrow)
Add an arrow annotation to this annotation. This will throw an IllegalArgument exception if this is an arrow annotation.

Parameters:
arrow - the arrow annotation to add

removeArrow

void removeArrow(ArrowAnnotation arrow)
Remove an arrow from this annotation.

Parameters:
arrow - the arrow annotation to remove

getArrows

Set<ArrowAnnotation> getArrows()
Get all arrows that are currently linked to this annotation.

Returns:
the set of arrows linked to this annotation

getArgMap

Map<String,String> getArgMap()
Get the argument map that is used to serialize this annotation. This is essentially the inverse of the argMap used in AnnotationFactory#createAnnotation().

Returns:
the argMap

Cytoscape 3.1.1 API

Copyright 2011 Cytoscape Consortium. All rights reserved.