Interface AnnotationFactory<T extends Annotation>
public interface AnnotationFactory<T extends Annotation>
An interface describing a factory used to create
Annotation
s. This factory will be provided
as a service through OSGi.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.
-
Method Summary
Modifier and TypeMethodDescriptioncreateAnnotation(Class<? extends T> type, CyNetworkView view, Map<String,String> argMap)
Create an annotation.getIcon()
An icon that represents this AnnotationFactory.getId()
Returns the unique id of the AnnotationFactory implementation.getName()
A short name to be displayed to the user.getType()
-
Method Details
-
getId
String getId()Returns the unique id of the AnnotationFactory implementation. Always use namespaces to make sure it is unique (e.g. "org.myCompany.myApp.AnnotationXxxxx").- Returns:
- A unique id for this AnnotationFactory.
-
getName
String getName()A short name to be displayed to the user.- Returns:
- The name of this AnnotationFactory.
-
getIcon
Icon getIcon()An icon that represents this AnnotationFactory.- Returns:
- If null, Cytoscape may provide a default or random icon for this search provider.
-
getType
-
createAnnotation
Create an annotation. This method takes the type of annotation to create and a list of arguments to use to actually create the annotation. This list may be null if the caller does not wish to pre-initialize annotations. Creating an annotation does not add the annotation to the view. In order to make the annotation visible, it must be added usingAnnotationManager#addAnnotation()
method.- Parameters:
type
- the class of annotation you want to createview
- theCyNetworkView
the new annotation will belong toargMap
- the arguments to use to initialize the annotation. See the descriptions for each annotation type to see the list of keys for the arg map.- Returns:
- the new annotation
-