Class StyleManager

java.lang.Object
org.cy3sbml.styles.StyleManager
All Implemented Interfaces:
org.cytoscape.event.CyListener, org.cytoscape.session.events.SessionLoadedListener

public class StyleManager extends Object implements org.cytoscape.session.events.SessionLoadedListener
Loads the visual styles of cy3sbml and their layout styles, at start and after a session is loaded.
  • Constructor Summary

    Constructors
    Constructor
    Description
    StyleManager(org.cytoscape.task.read.LoadVizmapFileTaskFactory loadVizmapFileTaskFactory, org.cytoscape.view.vizmap.VisualMappingManager vmm, String[] styles, LayoutStyleFactory layoutStyleFactory)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.cytoscape.view.vizmap.VisualStyle
    getVisualStyleByName(org.cytoscape.view.vizmap.VisualMappingManager vmm, String styleName)
    Get the visual style by name.
    void
    handleEvent(org.cytoscape.session.events.SessionLoadedEvent e)
    Loads the styles missing in the loaded session.
    void
    Load the visual styles of the app and add the layout style of every style (#71), if they do not exist yet (e.g. from a session).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • StyleManager

      public StyleManager(org.cytoscape.task.read.LoadVizmapFileTaskFactory loadVizmapFileTaskFactory, org.cytoscape.view.vizmap.VisualMappingManager vmm, String[] styles, LayoutStyleFactory layoutStyleFactory)
      Parameters:
      styles - names of the styles, loaded from the resources
      layoutStyleFactory - creates the layout style of every style
  • Method Details

    • loadStyles

      public void loadStyles()
      Load the visual styles of the app and add the layout style of every style (#71), if they do not exist yet (e.g. from a session).
    • getVisualStyleByName

      public static org.cytoscape.view.vizmap.VisualStyle getVisualStyleByName(org.cytoscape.view.vizmap.VisualMappingManager vmm, String styleName)
      Get the visual style by name. If no style for given styleName exists, the default style is returned.

      This is a fix until the function is implemented on the vmm https://code.cytoscape.org/redmine/issues/2174

    • handleEvent

      public void handleEvent(org.cytoscape.session.events.SessionLoadedEvent e)
      Loads the styles missing in the loaded session.
      Specified by:
      handleEvent in interface org.cytoscape.session.events.SessionLoadedListener