|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectccvisu.Cluster
public class Cluster
A class with a list of nodes that compute some informations on them
Field Summary | |
---|---|
private float |
averageRadius
|
private boolean |
changed
true if needs to recompute radius, center,... |
private java.awt.Color |
color
color of the cluster |
static int |
CONTAINS
used as mode for the method addPattern |
static int |
ENDS
used as mode for the method addPattern |
static int |
EQUALS
used as mode for the method addPattern |
private static GraphData |
graph
pointer to the data |
private static java.lang.String[] |
indexToCltName
contain the name of node's cluster |
boolean |
info
used to know if the circle and cross should be drawn |
private java.lang.String |
name
name of the cluster |
private java.util.Vector<java.lang.Integer> |
nodes
list of int representing the index of nodes in the GraphData |
static int |
STARTS
used as mode for the method addPattern |
boolean |
visible
used to know if the cluster should be drawn |
private static WriterDataGraphicsDISP |
writer
|
private float |
x
x-coordinate of the barycenter |
private float |
y
y-coordinate of the barycenter |
private float |
z
z-coordinate of the barycenter |
Constructor Summary | |
---|---|
Cluster(java.lang.String name)
Contructor |
|
Cluster(java.lang.String name,
java.awt.Color color)
Constructor |
Method Summary | |
---|---|
void |
addNode(GraphVertex vertex)
add the given node to the cluster |
void |
addNodeByIndex_WO_COLOR(int index)
add the node that corresponds to the index-th node in graph(GraphData) without changing his color function used only to assign to default cluster at begining |
void |
addNodeByIndex(int index)
add the node that corresponds to the index-th node in graph(GraphData) |
void |
addPattern(java.lang.String pattern,
int mode)
adds nodes to a cluster in function of a given pattern |
private void |
compute()
compute the informations provided by the cluster |
void |
filter(java.lang.String pattern,
int mode,
boolean keep)
|
float |
getAverageRadius()
|
java.awt.Color |
getColor()
|
java.lang.String |
getName()
|
GraphVertex |
getNode(int i)
return the i-th element of the Cluster this method's purpose is to easily iterate on each node of the cluster |
float |
getX()
return the x-coordinate of the barycenter |
float |
getY()
return the y-coordinate of the barycenter |
float |
getZ()
return the z-coordinate of the barycenter |
void |
graphchanged()
tells the cluster to recompute its informations |
static void |
init(WriterDataGraphicsDISP writer,
GraphData graph)
initialize Data common to all clusters |
java.util.Iterator |
Iterator()
return an iterator on the index of the cluster's nodes |
void |
removeNode(GraphVertex vertex)
remove from cluster the given node |
void |
removeNodeByIndex(int index)
remove the node that corresponds to the index-th node in graph(GraphData) |
void |
setColor(java.awt.Color color)
|
void |
setName(java.lang.String name)
|
int |
size()
return the size of the cluster |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int EQUALS
public static final int CONTAINS
public static final int STARTS
public static final int ENDS
private static java.lang.String[] indexToCltName
private java.lang.String name
private java.util.Vector<java.lang.Integer> nodes
private java.awt.Color color
private float x
private float y
private float z
private float averageRadius
private static GraphData graph
private static WriterDataGraphicsDISP writer
public boolean visible
public boolean info
private boolean changed
Constructor Detail |
---|
public Cluster(java.lang.String name)
name
- the cluster's namepublic Cluster(java.lang.String name, java.awt.Color color)
name
- the cluster's namecolor
- the cluster's colorMethod Detail |
---|
public void addNode(GraphVertex vertex)
vertex
- public void addNodeByIndex(int index)
index
- public void addNodeByIndex_WO_COLOR(int index)
index
- public void removeNode(GraphVertex vertex)
vertex
- public void removeNodeByIndex(int index)
index
- public java.util.Iterator Iterator()
public void addPattern(java.lang.String pattern, int mode)
pattern
- mode
- the way of using the pattern.public void filter(java.lang.String pattern, int mode, boolean keep)
public GraphVertex getNode(int i)
i
- index
public java.awt.Color getColor()
public void setColor(java.awt.Color color)
color
- color to define.public java.lang.String getName()
public void setName(java.lang.String name)
name
- name to define.public float getAverageRadius()
public float getX()
public float getY()
public float getZ()
public int size()
private void compute()
public static void init(WriterDataGraphicsDISP writer, GraphData graph)
writer
- graph
- public void graphchanged()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |