Interface BoundedTextAnnotation
- All Superinterfaces:
Annotation
,ShapeAnnotation
The BoundedText annotation is a ShapeAnnotation that also implements
Text. The provided text is positioned in the center of the shape
provided by the shape annotation.
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/interfaces inherited from interface org.cytoscape.view.presentation.annotations.ShapeAnnotation
ShapeAnnotation.ShapeType
-
Field Summary
Fields inherited from interface org.cytoscape.view.presentation.annotations.Annotation
BACKGROUND, CANVAS, FOREGROUND, NAME, ROTATION, X, Y, Z, ZOOM
Fields inherited from interface org.cytoscape.view.presentation.annotations.ShapeAnnotation
CUSTOMSHAPE, EDGECOLOR, EDGEOPACITY, EDGETHICKNESS, FILLCOLOR, FILLOPACITY, HEIGHT, SHAPETYPE, WIDTH
-
Method Summary
Modifier and TypeMethodDescriptionvoid
This method causes the shape to be resized to fit the provided text.getFont()
Get the font being usedGet the font family to be used for the text displaydouble
Get the size of the font used to display the textint
Get the font stylegetText()
Get the text to be displayed as part of the annotationGet the color of the text to be displayedvoid
Set the font to be used.void
setFontFamily
(String family) Set the font family to be used for the text displayvoid
setFontSize
(double size) Set the size of the font used to display the textvoid
setFontStyle
(int style) Set the font stylevoid
Set the text to be displayed as part of the annotationvoid
setTextColor
(Color color) Set the color of the text to be displayedMethods 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
Methods inherited from interface org.cytoscape.view.presentation.annotations.ShapeAnnotation
getBorderColor, getBorderOpacity, getBorderWidth, getFillColor, getFillOpacity, getShape, getShapeType, getSupportedShapes, setBorderColor, setBorderOpacity, setBorderWidth, setCustomShape, setCustomShape, setFillColor, setFillOpacity, setShapeType, setSize
-
Method Details
-
fitShapeToText
void fitShapeToText()This method causes the shape to be resized to fit the provided text. -
setText
Set the text to be displayed as part of the annotation- Parameters:
text
- the text annotation
-
getText
String getText()Get the text to be displayed as part of the annotation- Returns:
- the text annotation
-
setTextColor
Set the color of the text to be displayed- Parameters:
color
- the text color
-
getTextColor
Color getTextColor()Get the color of the text to be displayed- Returns:
- the text annotation
-
setFontSize
void setFontSize(double size) Set the size of the font used to display the text- Parameters:
size
- the size of the font
-
getFontSize
double getFontSize()Get the size of the font used to display the text- Returns:
- the font size
-
setFontStyle
void setFontStyle(int style) Set the font style- Parameters:
style
- the font style
-
getFontStyle
int getFontStyle()Get the font style- Returns:
- the font style
-
setFontFamily
Set the font family to be used for the text display- Parameters:
family
- the font family to use
-
getFontFamily
String getFontFamily()Get the font family to be used for the text display- Returns:
- the font family to use
-
getFont
Font getFont()Get the font being used- Returns:
- the font being used
-
setFont
Set the font to be used. Note that this will override the existing settings for font style, size, and family- Parameters:
font
- the text font to use
-