Interface ImageAnnotation
-
- All Superinterfaces:
Annotation,ShapeAnnotation
public interface ImageAnnotation extends ShapeAnnotation
This annotation positions an image on on the screen. In the current implementation, the image is always rectangular, so themethod 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-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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.cytoscape.view.presentation.annotations.ShapeAnnotation
ShapeAnnotation.ShapeType
-
-
Field Summary
Fields Modifier and Type Field Description static StringCONTRASTThis value allows the image contrast to be adjustedstatic StringLIGHTNESSThis value allows the image brighteness to be adjustedstatic StringOPACITYThe opacity of the image.static StringURLThe URL that points to the image.-
Fields inherited from interface org.cytoscape.view.presentation.annotations.Annotation
BACKGROUND, CANVAS, FOREGROUND, NAME, 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ImagegetImage()Return the image currently assigned to this annotationintgetImageBrightness()Return the brightness adjustment for this image.intgetImageContrast()Return the contrast adjustment for this imagefloatgetImageOpacity()Return the current opacity of the image.URLgetImageURL()Get theURLfor the image to be displayedvoidsetImage(Image image)Set the image to be displayed as part of this annotationvoidsetImage(URL url)Set aURLto fetch the image from.voidsetImageBrightness(int brightness)Set the brightness adjustment for the image.voidsetImageContrast(int contrast)Set the contrast adjustment for the image.voidsetImageOpacity(float opacity)Set the opacity of the image.-
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
-
Methods inherited from interface org.cytoscape.view.presentation.annotations.ShapeAnnotation
getBorderColor, getBorderOpacity, getBorderWidth, getFillColor, getFillOpacity, getShape, getShapeType, getSupportedShapes, setBorderColor, setBorderOpacity, setBorderWidth, setCustomShape, setFillColor, setFillOpacity, setShapeType, setSize
-
-
-
-
Field Detail
-
URL
static final String URL
The URL that points to the image. This is pretty much mandatory- See Also:
- Constant Field Values
-
OPACITY
static final String OPACITY
The opacity of the image.- See Also:
- Constant Field Values
-
CONTRAST
static final String CONTRAST
This value allows the image contrast to be adjusted- See Also:
- Constant Field Values
-
LIGHTNESS
static final String LIGHTNESS
This value allows the image brighteness to be adjusted- See Also:
- Constant Field Values
-
-
Method Detail
-
getImage
Image getImage()
Return the image currently assigned to this annotation- Returns:
- the current image
-
setImage
void setImage(Image image)
Set the image to be displayed as part of this annotation- Parameters:
image- the image to be displayed
-
setImage
void setImage(URL url)
Set aURLto fetch the image from.- Parameters:
url- theURLof 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
-
-