Cytoscape 2.2 (c) 2004 ISB, MSKCC, UCSD

cytoscape.visual
Class VisualMappingManager

java.lang.Object
  extended bycytoscape.visual.SubjectBase
      extended bycytoscape.visual.VisualMappingManager

public class VisualMappingManager
extends cytoscape.visual.SubjectBase

Top-level class for controlling the visual appearance of nodes and edges according to data attributes, as well as some global visual attributes. This class holds a reference to a NetworkView that displays the network, a CalculatorCatalog that holds the set of known visual styles and calculators, and a current VisualStyle that is used to determine the values of the visual attributes. A Logger is also supplied to report errors.

Note that a null VisualStyle is not allowed; this class always provides at least a default object.

The key methods are the apply* methods. These methods first recalculate the visual appearances by delegating to the calculators contained in the current visual style. The usual return value of these methods is an Appearance object that contains the visual attribute values; these values are then applied to the network by calling the appropriate set methods in the graph view API.


Constructor Summary
VisualMappingManager(CyNetworkView networkView)
           
 
Method Summary
 void applyAppearances()
          Recalculates and reapplies all of the node, edge, and global visual attributes.
 void applyEdgeAppearances()
          Recalculates and reapplies all of the edge appearances.
 void applyEdgeAppearances(CyNetwork network, CyNetworkView network_view)
          Recalculates and reapplies all of the edge appearances.
 void applyGlobalAppearances()
          Recalculates and reapplies the global visual attributes.
 void applyGlobalAppearances(CyNetwork network, CyNetworkView network_view)
          Recalculates and reapplies the global visual attributes.
 void applyNodeAppearances()
          Recalculates and reapplies all of the node appearances.
 void applyNodeAppearances(CyNetwork network, CyNetworkView network_view)
          Recalculates and reapplies all of the node appearances.
 cytoscape.visual.CalculatorCatalog getCalculatorCatalog()
           
 CyNetwork getNetwork()
           
 CyNetworkView getNetworkView()
           
 VisualStyle getVisualStyle()
           
 void loadCalculatorCatalog()
          Attempts to load a CalculatorCatalog object, using the information from the CytoscapeConfig object.
 void setNetworkView(CyNetworkView new_view)
           
 VisualStyle setVisualStyle(String name)
          Sets a new visual style.
 VisualStyle setVisualStyle(VisualStyle vs)
          Sets a new visual style, and returns the old style.
 void vizmapEdge(EdgeView edgeView, CyNetworkView network_view)
           
 void vizmapNode(NodeView nodeView, CyNetworkView network_view)
           
 
Methods inherited from class cytoscape.visual.SubjectBase
addChangeListener, fireStateChanged, removeChangeListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VisualMappingManager

public VisualMappingManager(CyNetworkView networkView)
Method Detail

loadCalculatorCatalog

public void loadCalculatorCatalog()
Attempts to load a CalculatorCatalog object, using the information from the CytoscapeConfig object. Does nothing if a catalog has already been loaded.

See Also:
CalculatorCatalog, CalculatorCatalogFactory

setNetworkView

public void setNetworkView(CyNetworkView new_view)

getNetworkView

public CyNetworkView getNetworkView()

getNetwork

public CyNetwork getNetwork()

getCalculatorCatalog

public cytoscape.visual.CalculatorCatalog getCalculatorCatalog()

getVisualStyle

public VisualStyle getVisualStyle()

setVisualStyle

public VisualStyle setVisualStyle(VisualStyle vs)
Sets a new visual style, and returns the old style. Also fires an event to attached listeners. If the argument is null, no change is made, an error message is passed to the logger, and null is returned.


setVisualStyle

public VisualStyle setVisualStyle(String name)
Sets a new visual style. Attempts to get the style with the given name from the catalog and pass that to setVisualStyle(VisualStyle). The return value is the old style. If no visual style with the given name is found, no change is made, an error message is passed to the logger, and null is returned.


applyNodeAppearances

public void applyNodeAppearances()
Recalculates and reapplies all of the node appearances. The visual attributes are calculated by delegating to the NodeAppearanceCalculator member of the current visual style.


applyNodeAppearances

public void applyNodeAppearances(CyNetwork network,
                                 CyNetworkView network_view)
Recalculates and reapplies all of the node appearances. The visual attributes are calculated by delegating to the NodeAppearanceCalculator member of the current visual style.


applyEdgeAppearances

public void applyEdgeAppearances()
Recalculates and reapplies all of the edge appearances. The visual attributes are calculated by delegating to the EdgeAppearanceCalculator member of the current visual style.


applyEdgeAppearances

public void applyEdgeAppearances(CyNetwork network,
                                 CyNetworkView network_view)
Recalculates and reapplies all of the edge appearances. The visual attributes are calculated by delegating to the EdgeAppearanceCalculator member of the current visual style.


applyGlobalAppearances

public void applyGlobalAppearances()
Recalculates and reapplies the global visual attributes. The recalculation is done by delegating to the GlobalAppearanceCalculator member of the current visual style.


applyGlobalAppearances

public void applyGlobalAppearances(CyNetwork network,
                                   CyNetworkView network_view)
Recalculates and reapplies the global visual attributes. The recalculation is done by delegating to the GlobalAppearanceCalculator member of the current visual style.

Parameters:
network - the network to apply to
network_view - the view to apply to

applyAppearances

public void applyAppearances()
Recalculates and reapplies all of the node, edge, and global visual attributes. This method delegates to, in order, applyNodeAppearances, applyEdgeAppearances, and applyGlobalAppearances.


vizmapNode

public void vizmapNode(NodeView nodeView,
                       CyNetworkView network_view)

vizmapEdge

public void vizmapEdge(EdgeView edgeView,
                       CyNetworkView network_view)

www.cytoscape.org