cytoscape.visual
Class NodeAppearanceCalculator

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

public class NodeAppearanceCalculator
extends Object
implements Cloneable

This class calculates the appearance of a Node. It holds a default value and a (possibly null) calculator for each visual attribute.


Field Summary
static String nodeBorderColorBypass
           
static String nodeFillColorBypass
           
static String nodeFontBypass
           
static String nodeHeightBypass
           
static String nodeLabelBypass
           
static String nodeLabelColorBypass
           
static String nodeLineTypeBypass
           
static String nodeShapeBypass
           
static String nodeToolTipBypass
           
static String nodeWidthBypass
           
 
Constructor Summary
NodeAppearanceCalculator()
           
NodeAppearanceCalculator(NodeAppearanceCalculator toCopy)
          Copy constructor.
NodeAppearanceCalculator(String name, Properties nacProps, String baseKey, CalculatorCatalog catalog)
          Creates a new NodeAppearanceCalculator and immediately customizes it by calling applyProperties with the supplied arguments.
 
Method Summary
 void applyProperties(String name, Properties nacProps, String baseKey, CalculatorCatalog catalog)
          This method customizes this object by searching the supplied properties object for keys identifying default values and calculators.
 void calculateNodeAppearance(NodeAppearance appr, giny.model.Node node, CyNetwork network)
          Using the rules defined by the default values and calculators in this object, compute an appearance for the requested Node in the supplied CyNetwork.
 NodeAppearance calculateNodeAppearance(giny.model.Node node, CyNetwork network)
          Using the rules defined by the default values and calculators in this object, compute an appearance for the requested Node in the supplied CyNetwork.
 Color calculateNodeBorderColor(giny.model.Node node, CyNetwork network)
           
 Color calculateNodeFillColor(giny.model.Node node, CyNetwork network)
           
 Font calculateNodeFont(giny.model.Node node, CyNetwork network)
           
 double calculateNodeHeight(giny.model.Node node, CyNetwork network)
           
 String calculateNodeLabel(giny.model.Node node, CyNetwork network)
           
 Color calculateNodeLabelColor(giny.model.Node node, CyNetwork network)
           
 LineType calculateNodeLineType(giny.model.Node node, CyNetwork network)
           
 byte calculateNodeShape(giny.model.Node node, CyNetwork network)
           
 String calculateNodeToolTip(giny.model.Node node, CyNetwork network)
           
 double calculateNodeWidth(giny.model.Node node, CyNetwork network)
           
 Object clone()
          Make shallow copy of this object
 Color getDefaultNodeBorderColor()
           
 Color getDefaultNodeFillColor()
           
 Font getDefaultNodeFont()
           
 Font getDefaultNodeFontFace()
           
 float getDefaultNodeFontSize()
           
 double getDefaultNodeHeight()
           
 String getDefaultNodeLabel()
           
 Color getDefaultNodeLabelColor()
           
 LineType getDefaultNodeLineType()
           
 byte getDefaultNodeShape()
           
 String getDefaultNodeToolTip()
           
 double getDefaultNodeWidth()
           
 String getDescription()
          Returns a text description of the current default values and calculator names.
 NodeColorCalculator getNodeBorderColorCalculator()
           
 NodeColorCalculator getNodeFillColorCalculator()
           
 NodeFontFaceCalculator getNodeFontFaceCalculator()
           
 NodeFontSizeCalculator getNodeFontSizeCalculator()
           
 NodeSizeCalculator getNodeHeightCalculator()
           
 NodeLabelCalculator getNodeLabelCalculator()
           
 NodeLabelColorCalculator getNodeLabelColorCalculator()
           
 NodeLineTypeCalculator getNodeLineTypeCalculator()
           
 NodeShapeCalculator getNodeShapeCalculator()
           
 boolean getNodeSizeLocked()
           
 NodeToolTipCalculator getNodeToolTipCalculator()
           
 NodeSizeCalculator getNodeWidthCalculator()
           
 Properties getProperties(String baseKey)
           
 boolean isValidShape(byte shape)
          Since node shapes are specified by byte identifiers in yFiles, this method checks to make sure that a supplied byte really matches one of the known identifiers.
 void setDefaultNodeBorderColor(Color c)
           
 void setDefaultNodeFillColor(Color c)
           
 void setDefaultNodeFont(Font f)
           
 void setDefaultNodeFontFace(Font f)
           
 void setDefaultNodeFontSize(float f)
           
 void setDefaultNodeHeight(double d)
           
 void setDefaultNodeLabel(String s)
           
 void setDefaultNodeLabelColor(Color c)
           
 void setDefaultNodeLineType(LineType lt)
           
 void setDefaultNodeShape(byte s)
           
 void setDefaultNodeToolTip(String s)
           
 void setDefaultNodeWidth(double d)
           
 void setNodeBorderColorCalculator(NodeColorCalculator c)
           
 void setNodeFillColorCalculator(NodeColorCalculator c)
           
 void setNodeFontFaceCalculator(NodeFontFaceCalculator c)
           
 void setNodeFontSizeCalculator(NodeFontSizeCalculator c)
           
 void setNodeHeightCalculator(NodeSizeCalculator c)
           
 void setNodeLabelCalculator(NodeLabelCalculator c)
           
 void setNodeLabelColorCalculator(NodeLabelColorCalculator c)
           
 void setNodeLineTypeCalculator(NodeLineTypeCalculator c)
           
 void setNodeShapeCalculator(NodeShapeCalculator c)
           
 void setNodeSizeLocked(boolean b)
           
 void setNodeToolTipCalculator(NodeToolTipCalculator c)
           
 void setNodeWidthCalculator(NodeSizeCalculator c)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nodeFillColorBypass

public static final String nodeFillColorBypass
See Also:
Constant Field Values

nodeBorderColorBypass

public static final String nodeBorderColorBypass
See Also:
Constant Field Values

nodeLineTypeBypass

public static final String nodeLineTypeBypass
See Also:
Constant Field Values

nodeShapeBypass

public static final String nodeShapeBypass
See Also:
Constant Field Values

nodeWidthBypass

public static final String nodeWidthBypass
See Also:
Constant Field Values

nodeHeightBypass

public static final String nodeHeightBypass
See Also:
Constant Field Values

nodeLabelBypass

public static final String nodeLabelBypass
See Also:
Constant Field Values

nodeToolTipBypass

public static final String nodeToolTipBypass
See Also:
Constant Field Values

nodeFontBypass

public static final String nodeFontBypass
See Also:
Constant Field Values

nodeLabelColorBypass

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

NodeAppearanceCalculator

public NodeAppearanceCalculator()

NodeAppearanceCalculator

public NodeAppearanceCalculator(String name,
                                Properties nacProps,
                                String baseKey,
                                CalculatorCatalog catalog)
Creates a new NodeAppearanceCalculator and immediately customizes it by calling applyProperties with the supplied arguments.


NodeAppearanceCalculator

public NodeAppearanceCalculator(NodeAppearanceCalculator toCopy)
Copy constructor. Returns a default object if the argument is null.

Method Detail

clone

public Object clone()
Make shallow copy of this object

Overrides:
clone in class Object

calculateNodeAppearance

public NodeAppearance calculateNodeAppearance(giny.model.Node node,
                                              CyNetwork network)
Using the rules defined by the default values and calculators in this object, compute an appearance for the requested Node in the supplied CyNetwork. A new NodeApperance object will be created.


calculateNodeAppearance

public void calculateNodeAppearance(NodeAppearance appr,
                                    giny.model.Node node,
                                    CyNetwork network)
Using the rules defined by the default values and calculators in this object, compute an appearance for the requested Node in the supplied CyNetwork. The supplied NodeAppearance object will be changed to hold the new values.


getDefaultNodeFillColor

public Color getDefaultNodeFillColor()

setDefaultNodeFillColor

public void setDefaultNodeFillColor(Color c)

getNodeFillColorCalculator

public NodeColorCalculator getNodeFillColorCalculator()

setNodeFillColorCalculator

public void setNodeFillColorCalculator(NodeColorCalculator c)

calculateNodeFillColor

public Color calculateNodeFillColor(giny.model.Node node,
                                    CyNetwork network)

getDefaultNodeBorderColor

public Color getDefaultNodeBorderColor()

setDefaultNodeBorderColor

public void setDefaultNodeBorderColor(Color c)

getNodeBorderColorCalculator

public NodeColorCalculator getNodeBorderColorCalculator()

setNodeBorderColorCalculator

public void setNodeBorderColorCalculator(NodeColorCalculator c)

calculateNodeBorderColor

public Color calculateNodeBorderColor(giny.model.Node node,
                                      CyNetwork network)

getDefaultNodeLineType

public LineType getDefaultNodeLineType()

setDefaultNodeLineType

public void setDefaultNodeLineType(LineType lt)

getNodeLineTypeCalculator

public NodeLineTypeCalculator getNodeLineTypeCalculator()

setNodeLineTypeCalculator

public void setNodeLineTypeCalculator(NodeLineTypeCalculator c)

calculateNodeLineType

public LineType calculateNodeLineType(giny.model.Node node,
                                      CyNetwork network)

getDefaultNodeShape

public byte getDefaultNodeShape()

setDefaultNodeShape

public void setDefaultNodeShape(byte s)

getNodeShapeCalculator

public NodeShapeCalculator getNodeShapeCalculator()

setNodeShapeCalculator

public void setNodeShapeCalculator(NodeShapeCalculator c)

calculateNodeShape

public byte calculateNodeShape(giny.model.Node node,
                               CyNetwork network)

isValidShape

public boolean isValidShape(byte shape)
Since node shapes are specified by byte identifiers in yFiles, this method checks to make sure that a supplied byte really matches one of the known identifiers. An alternative would be to create a new Shape class that takes a byte in its constructor and performs the following check.


getDefaultNodeWidth

public double getDefaultNodeWidth()

setDefaultNodeWidth

public void setDefaultNodeWidth(double d)

getNodeWidthCalculator

public NodeSizeCalculator getNodeWidthCalculator()

setNodeWidthCalculator

public void setNodeWidthCalculator(NodeSizeCalculator c)

calculateNodeWidth

public double calculateNodeWidth(giny.model.Node node,
                                 CyNetwork network)

getDefaultNodeHeight

public double getDefaultNodeHeight()

setDefaultNodeHeight

public void setDefaultNodeHeight(double d)

getNodeHeightCalculator

public NodeSizeCalculator getNodeHeightCalculator()

setNodeHeightCalculator

public void setNodeHeightCalculator(NodeSizeCalculator c)

calculateNodeHeight

public double calculateNodeHeight(giny.model.Node node,
                                  CyNetwork network)

getNodeSizeLocked

public boolean getNodeSizeLocked()

setNodeSizeLocked

public void setNodeSizeLocked(boolean b)

getDefaultNodeLabel

public String getDefaultNodeLabel()

setDefaultNodeLabel

public void setDefaultNodeLabel(String s)

getNodeLabelCalculator

public NodeLabelCalculator getNodeLabelCalculator()

setNodeLabelCalculator

public void setNodeLabelCalculator(NodeLabelCalculator c)

calculateNodeLabel

public String calculateNodeLabel(giny.model.Node node,
                                 CyNetwork network)

getDefaultNodeToolTip

public String getDefaultNodeToolTip()

setDefaultNodeToolTip

public void setDefaultNodeToolTip(String s)

getNodeToolTipCalculator

public NodeToolTipCalculator getNodeToolTipCalculator()

setNodeToolTipCalculator

public void setNodeToolTipCalculator(NodeToolTipCalculator c)

calculateNodeToolTip

public String calculateNodeToolTip(giny.model.Node node,
                                   CyNetwork network)

getDefaultNodeFont

public Font getDefaultNodeFont()

setDefaultNodeFont

public void setDefaultNodeFont(Font f)

getDefaultNodeFontFace

public Font getDefaultNodeFontFace()

setDefaultNodeFontFace

public void setDefaultNodeFontFace(Font f)

getNodeFontFaceCalculator

public NodeFontFaceCalculator getNodeFontFaceCalculator()

setNodeFontFaceCalculator

public void setNodeFontFaceCalculator(NodeFontFaceCalculator c)

getDefaultNodeFontSize

public float getDefaultNodeFontSize()

setDefaultNodeFontSize

public void setDefaultNodeFontSize(float f)

getNodeFontSizeCalculator

public NodeFontSizeCalculator getNodeFontSizeCalculator()

setNodeFontSizeCalculator

public void setNodeFontSizeCalculator(NodeFontSizeCalculator c)

calculateNodeFont

public Font calculateNodeFont(giny.model.Node node,
                              CyNetwork network)

getDefaultNodeLabelColor

public Color getDefaultNodeLabelColor()

setDefaultNodeLabelColor

public void setDefaultNodeLabelColor(Color c)

getNodeLabelColorCalculator

public NodeLabelColorCalculator getNodeLabelColorCalculator()

setNodeLabelColorCalculator

public void setNodeLabelColorCalculator(NodeLabelColorCalculator c)

calculateNodeLabelColor

public Color calculateNodeLabelColor(giny.model.Node node,
                                     CyNetwork network)

getDescription

public String getDescription()
Returns a text description of the current default values and calculator names.


applyProperties

public void applyProperties(String name,
                            Properties nacProps,
                            String baseKey,
                            CalculatorCatalog catalog)
This method customizes this object by searching the supplied properties object for keys identifying default values and calculators. Recognized keys are of the form "nodeAppearanceCalculator." + name + ident, where name is a supplied argument and ident is a String indicating a default value or a calculator for a specific visual attribute. The specified calculators are aquired by name from the supplied catalog.


getProperties

public Properties getProperties(String baseKey)