Cytoscape 2.8.0 API

cytoscape.visual.customgraphic
Class CustomGraphicsManager

java.lang.Object
  extended by cytoscape.visual.SubjectBase
      extended by cytoscape.visual.customgraphic.CustomGraphicsManager
All Implemented Interfaces:
PropertyChangeListener, EventListener

public class CustomGraphicsManager
extends SubjectBase
implements PropertyChangeListener


Field Summary
static String METADATA_FILE
           
 
Fields inherited from class cytoscape.visual.SubjectBase
observers
 
Constructor Summary
CustomGraphicsManager()
          Creates an image pool object and restore existing images from user resource directory.
 
Method Summary
 void addGraphics(CyCustomGraphics graphics, URL source)
          Add a custom graphics to current session.
 Collection<CyCustomGraphics> getAll()
          Get a collection of all Custom Graphics in current session.
 CyCustomGraphics getByID(Long id)
          Get a Custom Graphics by integer ID.
 CyCustomGraphics getBySourceURL(URL sourceURL)
          Get Custom Graphics by source URL.
 SortedSet<Long> getIDSet()
           
 Properties getMetadata()
          Convert current list of custom graphics into Property object.
 Boolean isUsedInCurrentSession(CyCustomGraphics graphics)
           
 void propertyChange(PropertyChangeEvent evt)
          Save images to local disk when exiting from Cytoscape.
 void removeAll()
          Remove all custom graphics from memory.
 void removeGraphics(Long id)
          Remove graphics from current session (memory).
 void restoreImages()
          Restore images from .cytoscape/images dir.
 void setUsedInCurrentSession(CyCustomGraphics graphics, Boolean isUsed)
           
 
Methods inherited from class cytoscape.visual.SubjectBase
addChangeListener, fireStateChanged, removeChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

METADATA_FILE

public static final String METADATA_FILE
See Also:
Constant Field Values
Constructor Detail

CustomGraphicsManager

public CustomGraphicsManager()
Creates an image pool object and restore existing images from user resource directory.

Method Detail

restoreImages

public void restoreImages()
Restore images from .cytoscape/images dir.


addGraphics

public void addGraphics(CyCustomGraphics graphics,
                        URL source)
Add a custom graphics to current session.

Parameters:
hash - : Hasn code of image object
graphics - : Actual custom graphics object
source - : Source URL of graphics (if exists. Can be null)

removeGraphics

public void removeGraphics(Long id)
Remove graphics from current session (memory).

Parameters:
id - : ID of graphics (hash code)

getByID

public CyCustomGraphics getByID(Long id)
Get a Custom Graphics by integer ID.

Parameters:
hash - Hash code of Custom Graphics object
Returns:
Custom Graphics if exists. Otherwise, null.

getBySourceURL

public CyCustomGraphics getBySourceURL(URL sourceURL)
Get Custom Graphics by source URL. Images without source cannot be retreved by this method.

Parameters:
sourceURL -
Returns:

getAll

public Collection<CyCustomGraphics> getAll()
Get a collection of all Custom Graphics in current session.

Returns:

removeAll

public void removeAll()
Remove all custom graphics from memory.


getMetadata

public Properties getMetadata()
Convert current list of custom graphics into Property object.

Returns:

propertyChange

public void propertyChange(PropertyChangeEvent evt)
Save images to local disk when exiting from Cytoscape.

Specified by:
propertyChange in interface PropertyChangeListener

getIDSet

public SortedSet<Long> getIDSet()

isUsedInCurrentSession

public Boolean isUsedInCurrentSession(CyCustomGraphics graphics)

setUsedInCurrentSession

public void setUsedInCurrentSession(CyCustomGraphics graphics,
                                    Boolean isUsed)

Cytoscape 2.8.0 API

Copyright 2010 Cytoscape Consortium. All rights reserved.