Interface AnnotationFactory<T extends Annotation>

public interface AnnotationFactory<T extends Annotation>
An interface describing a factory used to create Annotations. 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:


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 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").
      A unique id for this AnnotationFactory.
    • getName

      String getName()
      A short name to be displayed to the user.
      The name of this AnnotationFactory.
    • getIcon

      Icon getIcon()
      An icon that represents this AnnotationFactory.
      If null, Cytoscape may provide a default or random icon for this search provider.
    • getType

      Class<T> getType()
    • createAnnotation

      T createAnnotation(Class<? extends T> type, CyNetworkView view, Map<String,String> argMap)
      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 using AnnotationManager#addAnnotation() method.
      type - the class of annotation you want to create
      view - the CyNetworkView the new annotation will belong to
      argMap - 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.
      the new annotation