Cytoscape 3.1.1 API

org.cytoscape.view.presentation.annotations
Interface ShapeAnnotation

All Superinterfaces:
Annotation
All Known Subinterfaces:
BoundedTextAnnotation, ImageAnnotation

public interface ShapeAnnotation
extends Annotation

A Shape annotation supports annotations that can be drawn and filled on the graphics canvas. Shape annotations can also be resized and have separate colors for border and fill.


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
 
Fields inherited from interface org.cytoscape.view.presentation.annotations.Annotation
BACKGROUND, CANVAS, FOREGROUND, X, Y, ZOOM
 
Method Summary
 Paint getBorderColor()
          Get the border (stroke) color.
 double getBorderWidth()
          Get the border (stroke) width.
 Paint getFillColor()
          Get the fill color.
 Shape getShape()
          Get the current shape as a Shape object
 String getShapeType()
          Get the current shape type as a String
 List<String> getSupportedShapes()
          Get the list of supported shapes.
 void setBorderColor(Paint border)
          Set the border (stroke) color.
 void setBorderWidth(double width)
          Set the border (stroke) width.
 void setCustomShape(Shape shape)
          Set a custom shape to be drawn.
 void setFillColor(Paint fill)
          Set the fill color.
 void setShapeType(String type)
          Set the current shape type
 void setSize(double width, double height)
          Set the size of the shape.
 
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

getSupportedShapes

List<String> getSupportedShapes()
Get the list of supported shapes. If a shape is not supported, asking for it will result in nothing being displayed on the canvas. This returns a string to facilitate the future addition of new shapes.

Returns:
list of supported shapes.

setSize

void setSize(double width,
             double height)
Set the size of the shape.

Parameters:
width - the shape width
height - the shape height

getShapeType

String getShapeType()
Get the current shape type as a String

Returns:
the current shape type

setShapeType

void setShapeType(String type)
Set the current shape type

Parameters:
type - the shape type

getBorderWidth

double getBorderWidth()
Get the border (stroke) width.

Returns:
the border width

setBorderWidth

void setBorderWidth(double width)
Set the border (stroke) width.

Parameters:
width - the border width

getBorderColor

Paint getBorderColor()
Get the border (stroke) color.

Returns:
the border color

getFillColor

Paint getFillColor()
Get the fill color.

Returns:
the fill color

setBorderColor

void setBorderColor(Paint border)
Set the border (stroke) color.

Parameters:
border - the border color

setFillColor

void setFillColor(Paint fill)
Set the fill color.

Parameters:
fill - the fill color

setCustomShape

void setCustomShape(Shape shape)
Set a custom shape to be drawn. This is optional functionality that will only be funcional when "Custom" is in the list of supported shapes. If custom shapes are supported, setting this parameter will force the shape type to "Custom". If they are not supported, this method is implemented, but ignored.

Parameters:
shape - the custom shape to be drawn

getShape

Shape getShape()
Get the current shape as a Shape object

Returns:
the current shape

Cytoscape 3.1.1 API

Copyright 2011 Cytoscape Consortium. All rights reserved.