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.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
Nested Classes Modifier and Type Interface Description static class
ShapeAnnotation.ShapeType
-
Field Summary
Fields Modifier and Type Field Description static String
CUSTOMSHAPE
A flag that this is a "custom" shapestatic String
EDGECOLOR
The color of the borderstatic String
EDGEOPACITY
The opacity of the borderstatic String
EDGETHICKNESS
The thickness of the borderstatic String
FILLCOLOR
The fill color of the shapestatic String
FILLOPACITY
The opacity of the shape fillstatic String
HEIGHT
The height of the shapestatic String
SHAPETYPE
The shape typestatic String
WIDTH
The width of the shape-
Fields inherited from interface org.cytoscape.view.presentation.annotations.Annotation
BACKGROUND, CANVAS, FOREGROUND, NAME, X, Y, Z, ZOOM
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Paint
getBorderColor()
Get the border (stroke) color.double
getBorderOpacity()
Get the border (stroke) opacity.double
getBorderWidth()
Get the border (stroke) width.Paint
getFillColor()
Get the fill color.double
getFillOpacity()
Return the fill opacity, a value between 0.0 (fully transparent) and 100.0 (fully opaque).Shape
getShape()
Get the current shape as aShape
objectString
getShapeType()
Get the current shape type as a StringList<String>
getSupportedShapes()
Get the list of supported shapes.void
setBorderColor(Paint border)
Set the border (stroke) color.void
setBorderOpacity(double opacity)
Set the border (stroke) opacity.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
setFillOpacity(double opacity)
Set the fill opacity, a value between 0.0 (fully transparent) and 100.0 (fully opaque).void
setShapeType(String type)
Set the current shape typevoid
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, getName, getNetworkView, getSpecificZoom, getUUID, getZoom, isSelected, moveAnnotation, removeAnnotation, removeArrow, setCanvas, setName, setSelected, setSpecificZoom, setZoom, update
-
-
-
-
Field Detail
-
WIDTH
static final String WIDTH
The width of the shape- See Also:
- Constant Field Values
-
HEIGHT
static final String HEIGHT
The height of the shape- See Also:
- Constant Field Values
-
EDGECOLOR
static final String EDGECOLOR
The color of the border- See Also:
- Constant Field Values
-
EDGETHICKNESS
static final String EDGETHICKNESS
The thickness of the border- See Also:
- Constant Field Values
-
EDGEOPACITY
static final String EDGEOPACITY
The opacity of the border- See Also:
- Constant Field Values
-
FILLCOLOR
static final String FILLCOLOR
The fill color of the shape- See Also:
- Constant Field Values
-
FILLOPACITY
static final String FILLOPACITY
The opacity of the shape fill- See Also:
- Constant Field Values
-
SHAPETYPE
static final String SHAPETYPE
The shape type- See Also:
- Constant Field Values
-
CUSTOMSHAPE
static final String CUSTOMSHAPE
A flag that this is a "custom" shape- See Also:
- Constant Field Values
-
-
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 widthheight
- 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
-
getBorderOpacity
double getBorderOpacity()
Get the border (stroke) opacity.- Returns:
- the border opacity
-
getFillColor
Paint getFillColor()
Get the fill color.- Returns:
- the fill color
-
getFillOpacity
double getFillOpacity()
Return the fill opacity, a value between 0.0 (fully transparent) and 100.0 (fully opaque).
-
setBorderColor
void setBorderColor(Paint border)
Set the border (stroke) color.- Parameters:
border
- the border color
-
setBorderOpacity
void setBorderOpacity(double opacity)
Set the border (stroke) opacity.- Parameters:
opacity
- the border opacity
-
setFillColor
void setFillColor(Paint fill)
Set the fill color.- Parameters:
fill
- the fill color
-
setFillOpacity
void setFillOpacity(double opacity)
Set the fill opacity, a value between 0.0 (fully transparent) and 100.0 (fully opaque).
-
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
-
-