|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.tuwien.ifs.somtoolbox.visualization.clustering.ClusterNode
public class ClusterNode
Class containing one node in the cluster tree.
Field Summary | |
---|---|
private BorderPNode |
border
|
private Color |
borderColor
|
private double |
centroidX
|
private double |
centroidY
|
private ClusterNode |
child1
|
private ClusterNode |
child2
|
private ColoredClusterPNode |
colorNode
|
private double |
factorValue
|
private double |
height
|
static Color |
INTIAL_BORDER_COLOUR
|
private boolean |
labelContainsValues
|
private edu.umd.cs.piccolo.PNode |
labelNode
|
private ClusterLabel[] |
labels
|
private int |
level
|
private double[] |
mean
|
private double |
mergeCost
|
(package private) int |
numberOfInputs
|
private static long |
serialVersionUID
|
private GeneralUnitPNode[] |
unitNodes
|
private double |
width
|
private double |
x
|
private double |
y
|
Constructor Summary | |
---|---|
ClusterNode(ClusterNode n1,
ClusterNode n2,
int level)
Connects two ClusterNodes to one cluster |
|
ClusterNode(ClusterNode n1,
ClusterNode n2,
int level,
double mergeCost)
|
|
ClusterNode(GeneralUnitPNode leaf,
int level)
Creates an initial ClusterNode with only one Node inside. |
Method Summary | |
---|---|
private void |
calcLabel(double factorValue,
double factorQe,
double factorNumber,
boolean withValue)
Calculates and sets new Labels with the given parameters. |
boolean |
containsAllNodes(Collection<GeneralUnitPNode> nodes)
|
boolean |
containsNode(GeneralUnitPNode node)
|
edu.umd.cs.piccolo.PNode |
getBorder()
|
edu.umd.cs.piccolo.PNode |
getBorder(Color borderColor)
|
Point2D.Double |
getCentroid()
|
ClusterNode |
getChild1()
returns the first child cluster |
ClusterNode |
getChild2()
returns the second child cluster |
ColoredClusterPNode |
getColoredCluster()
|
double |
getFactorValue()
|
double |
getHeight()
get/set Height/Width/X/Y: used for the bounding rectangle of the cluster. |
edu.umd.cs.piccolo.PNode |
getLabelNode()
|
ClusterLabel[] |
getLabels()
returns current label or null in case label is not set |
ClusterLabel[] |
getLabels(double fValue,
boolean withValue)
calculates and sets the current labels in case label is not set yet or the values have changed and returns it |
int |
getLevel()
in which level of the clustering tree is this node (1 = top node) |
double[] |
getMeanVector()
Returns the mean vector of the cluster's weight vectors. |
double |
getMergeCost()
|
GeneralUnitPNode[] |
getNodes()
Returns all the GeneralUnitPNode s contained in this cluster |
int |
getNumberOfInputs()
Returns the number of input vectors inside this cluster |
double |
getWidth()
get/set Height/Width/X/Y: used for the bounding rectangle of the cluster. |
boolean |
getWithValue()
Does the Label of this Cluster contain a value |
double |
getX()
get/set Height/Width/X/Y: used for the bounding rectangle of the cluster. |
double |
getY()
get/set Height/Width/X/Y: used for the bounding rectangle of the cluster. |
private BorderPNode |
makeBorder()
Returns a border for this cluster |
void |
setBorderColor(Color c)
Changes the colour of the cluster borders |
void |
setFactorValue(double d)
Set the factor for the value in calculation of the labels - beween 0 and 1. |
void |
setHeight(double height)
get/set Height/Width/X/Y: used for the bounding rectangle of the cluster. |
void |
setLabelNode(edu.umd.cs.piccolo.PNode n)
|
void |
setPaint(Paint newPaint)
Sets the color of the cluster. |
void |
setWidth(double width)
get/set Height/Width/X/Y: used for the bounding rectangle of the cluster. |
void |
setWithValue(boolean b)
Should the label contain a value in the text. |
void |
setX(double x)
get/set Height/Width/X/Y: used for the bounding rectangle of the cluster. |
void |
setY(double y)
get/set Height/Width/X/Y: used for the bounding rectangle of the cluster. |
private void |
writeLabelInfos(GeneralUnitPNode node)
Sets this.label and this.numberOfInputs for this cluster. |
private static void |
xorBorderLine(ArrayList<Rectangle2D> lines,
double x1,
double y1,
double x2,
double y2)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Color INTIAL_BORDER_COLOUR
private Color borderColor
private static final long serialVersionUID
private GeneralUnitPNode[] unitNodes
private BorderPNode border
private ColoredClusterPNode colorNode
private edu.umd.cs.piccolo.PNode labelNode
private int level
private ClusterNode child1
private ClusterNode child2
private boolean labelContainsValues
private double factorValue
private ClusterLabel[] labels
private double mergeCost
int numberOfInputs
private double centroidX
private double centroidY
private double[] mean
private double x
private double y
private double width
private double height
Constructor Detail |
---|
public ClusterNode(ClusterNode n1, ClusterNode n2, int level)
level
- The level of the new cluster.public ClusterNode(ClusterNode n1, ClusterNode n2, int level, double mergeCost)
public ClusterNode(GeneralUnitPNode leaf, int level)
leaf
- the GeneralUnitPNode to be put in the clusterlevel
- a number >= the number of total units.Method Detail |
---|
public double[] getMeanVector()
public Point2D.Double getCentroid()
public void setLabelNode(edu.umd.cs.piccolo.PNode n)
public edu.umd.cs.piccolo.PNode getLabelNode()
private void writeLabelInfos(GeneralUnitPNode node)
node
- the GeneralUnitPNode inside this "Cluster"private void calcLabel(double factorValue, double factorQe, double factorNumber, boolean withValue)
factorValue
- A double value between 0 and 1 to determine how much the mean value should influence the
label.factorQe
- A double value between 0 and 1 to determine how much the qe value should influence the label.factorNumber
- Currently unused. Should determine the influence of the number of input vectors of the
clusters.withValue
- set to true if you want a label with valuespublic ClusterLabel[] getLabels()
public ClusterLabel[] getLabels(double fValue, boolean withValue)
public int getNumberOfInputs()
public double getFactorValue()
public boolean getWithValue()
public void setFactorValue(double d)
d
- the factor for the valuepublic void setWithValue(boolean b)
public ClusterNode getChild1()
public ClusterNode getChild2()
public int getLevel()
public GeneralUnitPNode[] getNodes()
GeneralUnitPNode
s contained in this cluster
public boolean containsNode(GeneralUnitPNode node)
public boolean containsAllNodes(Collection<GeneralUnitPNode> nodes)
private BorderPNode makeBorder()
public edu.umd.cs.piccolo.PNode getBorder(Color borderColor)
public edu.umd.cs.piccolo.PNode getBorder()
private static void xorBorderLine(ArrayList<Rectangle2D> lines, double x1, double y1, double x2, double y2)
public void setPaint(Paint newPaint)
newPaint
- The new color of the clusterpublic ColoredClusterPNode getColoredCluster()
public double getHeight()
public void setHeight(double height)
public double getWidth()
public void setWidth(double width)
public double getX()
public void setX(double x)
public double getY()
public void setY(double y)
public void setBorderColor(Color c)
public double getMergeCost()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |