Interface TextAnnotation
-
- All Superinterfaces:
Annotation
public interface TextAnnotation extends Annotation
A text annotation is a simple text string that is displayed on the network canvas. The text may be rendered using different colors and styles, but at this point, the colors and styles of the text may not be varied within the string.Module:
presentation-apiTo 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.
-
-
Field Summary
Fields Modifier and Type Field Description static StringCOLORArg string to set the text colorstatic StringFONTFAMILYArg string to set the font familystatic StringFONTSIZEArg string to set the font sizestatic StringFONTSTYLEArg string to set the font stylestatic StringTEXTArg string to set the text to display-
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 FontgetFont()Get the font being usedStringgetFontFamily()Get the font family to be used for the text displaydoublegetFontSize()Get the size of the font used to display the textintgetFontStyle()Get the font styleStringgetText()Get the text to be displayed as part of the annotationColorgetTextColor()Get the color of the text to be displayedvoidsetFont(Font font)Set the font to be used.voidsetFontFamily(String family)Set the font family to be used for the text displayvoidsetFontSize(double size)Set the size of the font used to display the textvoidsetFontStyle(int style)Set the font stylevoidsetText(String text)Set the text to be displayed as part of the annotationvoidsetTextColor(Color color)Set the color of the text to be displayed-
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
-
TEXT
static final String TEXT
Arg string to set the text to display- See Also:
- Constant Field Values
-
COLOR
static final String COLOR
Arg string to set the text color- See Also:
- Constant Field Values
-
FONTFAMILY
static final String FONTFAMILY
Arg string to set the font family- See Also:
- Constant Field Values
-
FONTSIZE
static final String FONTSIZE
Arg string to set the font size- See Also:
- Constant Field Values
-
FONTSTYLE
static final String FONTSTYLE
Arg string to set the font style- See Also:
- Constant Field Values
-
-
Method Detail
-
setText
void setText(String text)
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
void setTextColor(Color color)
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
void setFontFamily(String family)
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
void setFont(Font font)
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
-
-