Cytoscape 2.8.0 API

cytoscape.visual
Class VisualStyle

java.lang.Object
  extended by cytoscape.visual.VisualStyle
All Implemented Interfaces:
Cloneable

public class VisualStyle
extends Object
implements Cloneable

This class encapsulates a full set of visual mapping specifications for Cytoscape. Currently this is implemented by holding a reference to three appearance calculators, one for nodes, one for edges, and one for global visual attributes.


Field Summary
protected  int dupeCount
          Keep track of number of times this style has been cloned.
 
Constructor Summary
VisualStyle(String name)
          Simple constructor, creates default node/edge/global appearance calculators.
VisualStyle(String name, NodeAppearanceCalculator nac, EdgeAppearanceCalculator eac, GlobalAppearanceCalculator gac)
          Full constructor.
VisualStyle(VisualStyle toCopy)
          Copy constructor.
VisualStyle(VisualStyle toCopy, String newName)
          Copy constructor with new name.
 
Method Summary
 Vector checkConflictingCalculator(Calculator c)
          Check if contained appearance calculators are using given calculator
 Object clone()
          Perform deep copy of this VisualStyle.
 VisualPropertyDependency getDependency()
           
 int getDupeCount()
          Get how many times this style has been cloned.
 EdgeAppearanceCalculator getEdgeAppearanceCalculator()
          Get the EdgeAppearanceCalculator for this visual style.
 GlobalAppearanceCalculator getGlobalAppearanceCalculator()
          Get the GlobalAppearanceCalculator for this visual style.
 String getName()
          Returns the name of this object.
 NodeAppearanceCalculator getNodeAppearanceCalculator()
          Get the NodeAppearanceCalculator for this visual style.
 EdgeAppearanceCalculator setEdgeAppearanceCalculator(EdgeAppearanceCalculator eac)
          Set the EdgeAppearanceCalculator for this visual style.
 GlobalAppearanceCalculator setGlobalAppearanceCalculator(GlobalAppearanceCalculator gac)
          Set the GlobalAppearanceCalculator for this visual style.
 String setName(String n)
          Set the name of this visual style.
 NodeAppearanceCalculator setNodeAppearanceCalculator(NodeAppearanceCalculator nac)
          Set the NodeAppearanceCalculator for this visual style.
 String toString()
          Returns the name of this object, as returned by getName.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dupeCount

protected int dupeCount
Keep track of number of times this style has been cloned.

Constructor Detail

VisualStyle

public VisualStyle(String name)
Simple constructor, creates default node/edge/global appearance calculators.


VisualStyle

public VisualStyle(String name,
                   NodeAppearanceCalculator nac,
                   EdgeAppearanceCalculator eac,
                   GlobalAppearanceCalculator gac)
Full constructor.


VisualStyle

public VisualStyle(VisualStyle toCopy)
Copy constructor. Creates a default object if the argument is null. The name of this new object should be changed by calling setName with a new, unique name before adding it to a CalculatorCatalog.


VisualStyle

public VisualStyle(VisualStyle toCopy,
                   String newName)
Copy constructor with new name. Creates a default object if the first argument is null, otherwise copies the members of the first argument. The name of this new VisualStyle will be equal to the second argument; the caller should ensure that this is a unique name.

Throws:
NullPointerException - if the second argument is null
Method Detail

getDupeCount

public int getDupeCount()
Get how many times this style has been cloned.


checkConflictingCalculator

public Vector checkConflictingCalculator(Calculator c)
Check if contained appearance calculators are using given calculator

Parameters:
c - calculator to check conflicts for
Returns:
vector with: name of conflicting visual style (index 0), name of conflicting attributes. If size == 1, then no conflicts

clone

public Object clone()
             throws CloneNotSupportedException
Perform deep copy of this VisualStyle.

Overrides:
clone in class Object
Throws:
CloneNotSupportedException

toString

public String toString()
Returns the name of this object, as returned by getName.

Overrides:
toString in class Object

getName

public String getName()
Returns the name of this object.


setName

public String setName(String n)
Set the name of this visual style. This should be a unique name, or a collision will ocur when adding this to a CalcualtorCatalog.

Parameters:
n - the new name
Returns:
the old name

getNodeAppearanceCalculator

public NodeAppearanceCalculator getNodeAppearanceCalculator()
Get the NodeAppearanceCalculator for this visual style.


setNodeAppearanceCalculator

public NodeAppearanceCalculator setNodeAppearanceCalculator(NodeAppearanceCalculator nac)
Set the NodeAppearanceCalculator for this visual style. A default NodeAppearanceCalculator will be created and used if the argument is null.

Parameters:
nac - the new NodeAppearanceCalculator
Returns:
the old NodeAppearanceCalculator

getEdgeAppearanceCalculator

public EdgeAppearanceCalculator getEdgeAppearanceCalculator()
Get the EdgeAppearanceCalculator for this visual style.


setEdgeAppearanceCalculator

public EdgeAppearanceCalculator setEdgeAppearanceCalculator(EdgeAppearanceCalculator eac)
Set the EdgeAppearanceCalculator for this visual style. A default EdgeAppearanceCalculator will be created and used if the argument is null.

Parameters:
nac - the new EdgeAppearanceCalculator
Returns:
the old EdgeAppearanceCalculator

getGlobalAppearanceCalculator

public GlobalAppearanceCalculator getGlobalAppearanceCalculator()
Get the GlobalAppearanceCalculator for this visual style.


setGlobalAppearanceCalculator

public GlobalAppearanceCalculator setGlobalAppearanceCalculator(GlobalAppearanceCalculator gac)
Set the GlobalAppearanceCalculator for this visual style. A default GlobalAppearanceCalculator will be created and used if the argument is null.

Parameters:
nac - the new GlobalAppearanceCalculator
Returns:
the old GlobalAppearanceCalculator

getDependency

public VisualPropertyDependency getDependency()

Cytoscape 2.8.0 API

Copyright 2010 Cytoscape Consortium. All rights reserved.