public interface CyCustomGraphicsFactory<T extends CustomGraphicLayer>
CyCustomGraphics
objects.
CyCustomGraphicsFactory objects should be registered as services in
OSGi and will be used by Renderers to create the actual custom graphics
implementations. Note that the type of a CyCustomGraphicsFactory is
the type of the underlying CustomGraphicLayer
not the type
of the resulting CyCustomGraphics
object this creates. In general,
the pattern is to add to your CyActivator class:
CyCustomGraphicsFactory myCustomGraphicsFactory = new MyCustomGraphicsFactory(); registerService(bundleContext, myCustomGraphicsFactory, CyCustomGraphicsFactory.class, new Properties());
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>
Modifier and Type | Method and Description |
---|---|
CyCustomGraphics<T> |
getInstance(String input)
Get a new instance of the CyCustomGraphics.
|
CyCustomGraphics<T> |
getInstance(URL url)
Get a new instance of the CyCustomGraphics based on pulling the data
from a URL.
|
String |
getPrefix()
Return the prefix to identify this custom graphics factory.
|
Class<? extends CyCustomGraphics> |
getSupportedClass()
Return the class that this factory creates.
|
CyCustomGraphics<T> |
parseSerializableString(String string)
Create a new CyCustomGraphics object by parsing the string
resulting from the toSerializableString() method.
|
boolean |
supportsMime(String mimeType)
Given a mime type, return true if this CyCustomGraphicsFactory can
utilize this type of data.
|
String getPrefix()
boolean supportsMime(String mimeType)
mimeType
- the mime type stringCyCustomGraphics<T> getInstance(URL url)
CyCustomGraphics
type doesn't support
URLs, this should always return null.url
- the url that points to the CyCustomGraphics dataCyCustomGraphics<T> getInstance(String input)
CyCustomGraphics
instance. Note that the prefix defined
above will get removed from the string before this method is called.input
- a possible input string that may be used to create the
instance. Not all implementations will use this.CyCustomGraphics<T> parseSerializableString(String string)
Class<? extends CyCustomGraphics> getSupportedClass()
Copyright 2011-2015 Cytoscape Consortium. All rights reserved.