public class ImageStorage extends Object implements org.cytoscape.view.presentation.customgraphics.CyCustomGraphicsFactory, org.cytoscape.view.vizmap.VisualMappingFunction<String,org.cytoscape.view.presentation.customgraphics.CyCustomGraphics<org.cytoscape.view.presentation.customgraphics.CustomGraphicLayer>>, org.cytoscape.view.vizmap.mappings.DiscreteMapping<String,org.cytoscape.view.presentation.customgraphics.CyCustomGraphics<org.cytoscape.view.presentation.customgraphics.CustomGraphicLayer>>, NodeChangedListener
ImageStorage
functions as both CyCustomGraphicsFactory
and management for images used by IDARE.
In addition it provides the mapping function between Strings and the respective IDARE images.Constructor and Description |
---|
ImageStorage(org.cytoscape.view.model.VisualProperty<org.cytoscape.view.presentation.customgraphics.CyCustomGraphics<org.cytoscape.view.presentation.customgraphics.CustomGraphicLayer>> VisualcustomGraphiVP)
Default Constructor defining the
VisualProperty that this VisualMappingFunction maps to. |
Modifier and Type | Method and Description |
---|---|
void |
addImageLayoutChangedListener(GraphicsChangedListener listener)
Add a listener that listens to changed images (and updates accordingly)
|
void |
apply(org.cytoscape.model.CyRow arg0,
org.cytoscape.view.model.View arg1) |
void |
generateGraphicsForID(String ID,
boolean Setup)
Get the Graphic for the respective ID
|
void |
generateGraphicsForIDs(Collection<String> IDs)
Generate the Graphics for the respective IDs
|
Map<String,org.cytoscape.view.presentation.customgraphics.CyCustomGraphics<org.cytoscape.view.presentation.customgraphics.CustomGraphicLayer>> |
getAll() |
BufferedImage |
getimagenodeImageForItem(String ID)
Get the BufferedImage associated with a specific ID
The Image will be generated if necessar (and possible)
|
IDARECustomGraphics |
getInstance(String input) |
IDARECustomGraphics |
getInstance(URL url) |
org.cytoscape.view.presentation.customgraphics.CyCustomGraphics<org.cytoscape.view.presentation.customgraphics.CustomGraphicLayer> |
getMappedValue(org.cytoscape.model.CyRow arg0) |
String |
getMappingColumnName() |
Class<String> |
getMappingColumnType() |
org.cytoscape.view.presentation.customgraphics.CyCustomGraphics<org.cytoscape.view.presentation.customgraphics.CustomGraphicLayer> |
getMapValue(String arg0) |
String |
getPrefix() |
Class<? extends org.cytoscape.view.presentation.customgraphics.CyCustomGraphics> |
getSupportedClass() |
org.cytoscape.view.model.VisualProperty |
getVisualProperty() |
void |
handleNodeUpdate(NodeUpdateEvent e)
Handle a
NodeUpdateEvent , that informs that certain nodes were updated. |
void |
invalidate(Collection<String> ids)
Invalidate all Images associated with the provided Strings.
|
void |
invalidate(String id)
Invalidate a specific ID (i.e.
|
org.cytoscape.view.presentation.customgraphics.CyCustomGraphics |
parseSerializableString(String string) |
<T extends org.cytoscape.view.presentation.customgraphics.CyCustomGraphics<org.cytoscape.view.presentation.customgraphics.CustomGraphicLayer>> |
putAll(Map<String,T> arg0) |
<T extends org.cytoscape.view.presentation.customgraphics.CyCustomGraphics<org.cytoscape.view.presentation.customgraphics.CustomGraphicLayer>> |
putMapValue(String arg0,
T arg1) |
void |
reset()
Reset the images available in this mapping
|
void |
setHeight(int height)
Set the height of the graphics created by this factory
|
void |
setNodeManager(NodeManager nm)
Set the
NodeManager linked to this ImageStorage |
void |
setVisualStyle(IDAREVisualStyle ids)
set the
IDAREVisualStyle linked to this ImageStorage |
void |
setWidth(int width)
Set the width of the graphics created by this factory
|
boolean |
supportsMime(String mimeType) |
void |
updateStyle()
Update all views using the visualstyle set for this Storage
|
public ImageStorage(org.cytoscape.view.model.VisualProperty<org.cytoscape.view.presentation.customgraphics.CyCustomGraphics<org.cytoscape.view.presentation.customgraphics.CustomGraphicLayer>> VisualcustomGraphiVP)
VisualProperty
that this VisualMappingFunction
maps to.VisualcustomGraphiVP
- The VisualProperty to usepublic void setVisualStyle(IDAREVisualStyle ids)
IDAREVisualStyle
linked to this ImageStorage
ids
- the IDAREVisualStyle to usepublic void setNodeManager(NodeManager nm)
NodeManager
linked to this ImageStorage
nm
- The NodeManager to usepublic void addImageLayoutChangedListener(GraphicsChangedListener listener)
listener
- the listener to addpublic void reset()
public void invalidate(String id)
id
- The id to invalidate and remove the image the associated image.public void invalidate(Collection<String> ids)
ids
- The IDs of the nodes for which to invalidate/remove the associated images.public BufferedImage getimagenodeImageForItem(String ID)
ID
- The ID of node an image is requested forpublic void generateGraphicsForIDs(Collection<String> IDs)
IDs
- - The IDs of the Nodespublic void generateGraphicsForID(String ID, boolean Setup)
ID
- - The ID of the NodeSetup
- - Whether this is an initial setup or a general updatepublic String getPrefix()
getPrefix
in interface org.cytoscape.view.presentation.customgraphics.CyCustomGraphicsFactory
public boolean supportsMime(String mimeType)
supportsMime
in interface org.cytoscape.view.presentation.customgraphics.CyCustomGraphicsFactory
public IDARECustomGraphics getInstance(URL url)
getInstance
in interface org.cytoscape.view.presentation.customgraphics.CyCustomGraphicsFactory
public IDARECustomGraphics getInstance(String input)
getInstance
in interface org.cytoscape.view.presentation.customgraphics.CyCustomGraphicsFactory
public org.cytoscape.view.presentation.customgraphics.CyCustomGraphics parseSerializableString(String string)
parseSerializableString
in interface org.cytoscape.view.presentation.customgraphics.CyCustomGraphicsFactory
public Class<? extends org.cytoscape.view.presentation.customgraphics.CyCustomGraphics> getSupportedClass()
getSupportedClass
in interface org.cytoscape.view.presentation.customgraphics.CyCustomGraphicsFactory
public void setWidth(int width)
width
- - the width to be usedpublic void setHeight(int height)
height
- - the height to be usedpublic void updateStyle()
public void apply(org.cytoscape.model.CyRow arg0, org.cytoscape.view.model.View arg1)
apply
in interface org.cytoscape.view.vizmap.VisualMappingFunction<String,org.cytoscape.view.presentation.customgraphics.CyCustomGraphics<org.cytoscape.view.presentation.customgraphics.CustomGraphicLayer>>
public org.cytoscape.view.presentation.customgraphics.CyCustomGraphics<org.cytoscape.view.presentation.customgraphics.CustomGraphicLayer> getMappedValue(org.cytoscape.model.CyRow arg0)
getMappedValue
in interface org.cytoscape.view.vizmap.VisualMappingFunction<String,org.cytoscape.view.presentation.customgraphics.CyCustomGraphics<org.cytoscape.view.presentation.customgraphics.CustomGraphicLayer>>
public String getMappingColumnName()
getMappingColumnName
in interface org.cytoscape.view.vizmap.VisualMappingFunction<String,org.cytoscape.view.presentation.customgraphics.CyCustomGraphics<org.cytoscape.view.presentation.customgraphics.CustomGraphicLayer>>
public Class<String> getMappingColumnType()
getMappingColumnType
in interface org.cytoscape.view.vizmap.VisualMappingFunction<String,org.cytoscape.view.presentation.customgraphics.CyCustomGraphics<org.cytoscape.view.presentation.customgraphics.CustomGraphicLayer>>
public org.cytoscape.view.model.VisualProperty getVisualProperty()
getVisualProperty
in interface org.cytoscape.view.vizmap.VisualMappingFunction<String,org.cytoscape.view.presentation.customgraphics.CyCustomGraphics<org.cytoscape.view.presentation.customgraphics.CustomGraphicLayer>>
public Map<String,org.cytoscape.view.presentation.customgraphics.CyCustomGraphics<org.cytoscape.view.presentation.customgraphics.CustomGraphicLayer>> getAll()
getAll
in interface org.cytoscape.view.vizmap.mappings.DiscreteMapping<String,org.cytoscape.view.presentation.customgraphics.CyCustomGraphics<org.cytoscape.view.presentation.customgraphics.CustomGraphicLayer>>
public org.cytoscape.view.presentation.customgraphics.CyCustomGraphics<org.cytoscape.view.presentation.customgraphics.CustomGraphicLayer> getMapValue(String arg0)
getMapValue
in interface org.cytoscape.view.vizmap.mappings.DiscreteMapping<String,org.cytoscape.view.presentation.customgraphics.CyCustomGraphics<org.cytoscape.view.presentation.customgraphics.CustomGraphicLayer>>
public <T extends org.cytoscape.view.presentation.customgraphics.CyCustomGraphics<org.cytoscape.view.presentation.customgraphics.CustomGraphicLayer>> void putAll(Map<String,T> arg0)
putAll
in interface org.cytoscape.view.vizmap.mappings.DiscreteMapping<String,org.cytoscape.view.presentation.customgraphics.CyCustomGraphics<org.cytoscape.view.presentation.customgraphics.CustomGraphicLayer>>
public <T extends org.cytoscape.view.presentation.customgraphics.CyCustomGraphics<org.cytoscape.view.presentation.customgraphics.CustomGraphicLayer>> void putMapValue(String arg0, T arg1)
putMapValue
in interface org.cytoscape.view.vizmap.mappings.DiscreteMapping<String,org.cytoscape.view.presentation.customgraphics.CyCustomGraphics<org.cytoscape.view.presentation.customgraphics.CustomGraphicLayer>>
public void handleNodeUpdate(NodeUpdateEvent e)
NodeChangedListener
NodeUpdateEvent
, that informs that certain nodes were updated.handleNodeUpdate
in interface NodeChangedListener
e
- The NodeUpdateEvent
to handle.Copyright © 2018. All rights reserved.