Interface ImageAnnotation
- All Superinterfaces:
Annotation
,ShapeAnnotation
This annotation positions an image on on the screen.
In the current implementation, the image is always rectangular,
so the
method will always
return a list with a single value: "Rectangle". In the future,
this might be expanded to support clipping to a shape.
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
Modifier and TypeFieldDescriptionstatic final String
This value allows the image contrast to be adjustedstatic final String
This value allows the image brighteness to be adjustedstatic final String
The opacity of the image.static final String
The URL that points to the image.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 TypeMethodDescriptiongetImage()
Return the image currently assigned to this annotation.int
Return the brightness adjustment for this image.int
Return the contrast adjustment for this image.float
Return the current opacity of the image.Get theURL
for the image to be displayed.default String
getSVG()
Return the SVG text currently assigned to this annotation.void
Set the image to be displayed as part of this annotation.void
Set aURL
to fetch the image from.void
setImageBrightness
(int brightness) Set the brightness adjustment for the image.void
setImageContrast
(int contrast) Set the contrast adjustment for the image.void
setImageOpacity
(float opacity) Set the opacity of the image.default void
Set the SVG image to be displayed as part of this annotation.Methods 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
-
Field Details
-
URL
The URL that points to the image. This is pretty much mandatory- See Also:
-
OPACITY
The opacity of the image.- See Also:
-
CONTRAST
This value allows the image contrast to be adjusted- See Also:
-
LIGHTNESS
This value allows the image brighteness to be adjusted- See Also:
-
-
Method Details
-
getImage
Image getImage()Return the image currently assigned to this annotation.- Returns:
- the current image
-
setImage
Set the image to be displayed as part of this annotation.- Parameters:
image
- the image to be displayed
-
getSVG
Return the SVG text currently assigned to this annotation.- Returns:
- the current SVG image as XML text or null if the current image is not an SVG
-
setSVG
Set the SVG image to be displayed as part of this annotation.- Parameters:
image
- the SVG text to be parsed and displayed
-
getImageURL
URL getImageURL()Get theURL
for the image to be displayed.- Parameters:
the
- image url
-
setImage
Set aURL
to fetch the image from.- Parameters:
url
- theURL
of the image to be displayed
-
setImageOpacity
void setImageOpacity(float opacity) Set the opacity of the image. Opacity is a float value between 0.0 and 1.0 where 1.0 is completely opaque and 0.0 is completely transparent.- Parameters:
opacity
- the opacity of the image
-
getImageOpacity
float getImageOpacity()Return the current opacity of the image.- Returns:
- the image opacity
-
setImageBrightness
void setImageBrightness(int brightness) Set the brightness adjustment for the image. Brightness is a percentage value from -100 to 100.- Parameters:
brightness
- the brightness adjustment for the image
-
getImageBrightness
int getImageBrightness()Return the brightness adjustment for this image.- Returns:
- the brightness adjustment
-
setImageContrast
void setImageContrast(int contrast) Set the contrast adjustment for the image. Contrast is a non-linear adjustment with values from -100 to 100.- Parameters:
contrast
- the contrast adjustment for the image
-
getImageContrast
int getImageContrast()Return the contrast adjustment for this image.- Returns:
- contrast adjustment
-