Cytoscape 2.6.2 (c) 2006,2007 ISB, MSKCC, UCSD

cytoscape.visual
Class VisualMappingManager

java.lang.Object
  extended by cytoscape.visual.SubjectBase
      extended by cytoscape.visual.VisualMappingManager

public class VisualMappingManager
extends 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)
          Creates a new VisualMappingManager object.
 
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.
 CalculatorCatalog getCalculatorCatalog()
          DOCUMENT ME!
 CyNetwork getNetwork()
          DOCUMENT ME!
 CyNetworkView getNetworkView()
          DOCUMENT ME!
 VisualStyle getVisualStyle()
          DOCUMENT ME!
 void loadCalculatorCatalog()
          Attempts to load a CalculatorCatalog object, using the information from the CytoscapeConfig object.
 void loadCalculatorCatalog(String vizmapLocation)
          DOCUMENT ME!
 void setNetworkView(CyNetworkView new_view)
          DOCUMENT ME!
 VisualStyle setVisualStyle(String newVSName)
          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)
          DOCUMENT ME!
 void vizmapNode(NodeView nodeView, CyNetworkView network_view)
          DOCUMENT ME!
 
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)
Creates a new VisualMappingManager object.

Parameters:
networkView - DOCUMENT ME!
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

loadCalculatorCatalog

public void loadCalculatorCatalog(String vizmapLocation)
DOCUMENT ME!

Parameters:
vizmapLocation - DOCUMENT ME!

setNetworkView

public void setNetworkView(CyNetworkView new_view)
DOCUMENT ME!

Parameters:
new_view - DOCUMENT ME!

getNetworkView

public CyNetworkView getNetworkView()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getNetwork

public CyNetwork getNetwork()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getCalculatorCatalog

public CalculatorCatalog getCalculatorCatalog()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getVisualStyle

public VisualStyle getVisualStyle()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setVisualStyle

public VisualStyle setVisualStyle(VisualStyle vs)
Sets a new visual style, and returns the old style. Also fires an event to attached listeners only if the visual style changes. If the argument is null, the previous visual style is simply returned.


setVisualStyle

public VisualStyle setVisualStyle(String newVSName)
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)
DOCUMENT ME!

Parameters:
nodeView - DOCUMENT ME!
network_view - DOCUMENT ME!

vizmapEdge

public void vizmapEdge(EdgeView edgeView,
                       CyNetworkView network_view)
DOCUMENT ME!

Parameters:
edgeView - DOCUMENT ME!
network_view - DOCUMENT ME!

www.cytoscape.org