public class ClusteringTree extends edu.umd.cs.piccolo.PNode implements Serializable
Modifier and Type | Field and Description |
---|---|
private SortedMap<Integer,ClusterElementsStorage> |
allClusteringElements
contains all currently shown clustering layers
|
static Font |
defaultFont |
static float |
INITIAL_BORDER_WIDTH_MAGNIFICATION_FACTOR |
private static EditLabelEventListener |
labelListener |
private static long |
serialVersionUID |
private int |
startFontSize |
private ClusterNode |
topNode |
private int |
width |
PROPERTY_BOUNDS, PROPERTY_CHILDREN, PROPERTY_CHILDREN_PICKABLE, PROPERTY_CLIENT_PROPERTIES, PROPERTY_CODE_BOUNDS, PROPERTY_CODE_CHILDREN, PROPERTY_CODE_CHILDREN_PICKABLE, PROPERTY_CODE_CLIENT_PROPERTIES, PROPERTY_CODE_FULL_BOUNDS, PROPERTY_CODE_PAINT, PROPERTY_CODE_PARENT, PROPERTY_CODE_PICKABLE, PROPERTY_CODE_TRANSFORM, PROPERTY_CODE_TRANSPARENCY, PROPERTY_CODE_VISIBLE, PROPERTY_FULL_BOUNDS, PROPERTY_PAINT, PROPERTY_PARENT, PROPERTY_PICKABLE, PROPERTY_TRANSFORM, PROPERTY_TRANSPARENCY, PROPERTY_VISIBLE, SCENE_GRAPH_DELEGATE
NO_SUCH_PAGE, PAGE_EXISTS
Constructor and Description |
---|
ClusteringTree(ClusterNode top,
int width)
Initializes the tree with the given top Node.
|
Modifier and Type | Method and Description |
---|---|
void |
addEditLabelEventListenerToAll()
Adds the EditLabelEventLister to all Labels.
|
private void |
clearClusteringElements()
Create a new allClusteringElements containing only the sticky layers from the previous version.
|
void |
dumpAllClusteringElements()
give some advanced debug output
|
ClusterNode |
findClusterOf(GeneralUnitPNode unitPNode,
int level)
Find the
ClusterNode that contains the given GeneralUnitPNode at the given level. |
ClusterNode |
findNode(ClusterNode start,
int lvl) |
ClusterNode |
findNode(int lvl) |
private void |
getAllChildrenUntil(int level,
ClusterNode start,
ArrayList<ClusterNode> store)
Searches the clusters that are less or equal lvl and stores their children (ClusterNodes) which are > lvl.
|
SortedMap<Integer,ClusterElementsStorage> |
getAllClusteringElements() |
int[][] |
getClusterAssignment(int level,
int xSize,
int ySize) |
SortedMap<Integer,ClusterElementsStorage> |
getClusteringInto(int l)
Returns the borders and the Labels of the clustering into l clusters and all other currently painted cluster's
borders and labels
|
SortedMap<Integer,ClusterElementsStorage> |
getClusteringInto(int l,
boolean sticky)
Recreates the ClusterElementsStorageNode for layer l.
|
ArrayList<ClusterNode> |
getNodesAtLevel(int level) |
Color[] |
getPalette()
Gest the current palette from the state.
|
void |
printTree(ClusterNode start,
int x) |
void |
recolorTree()
Changes the colors of the tree according to the currently chosen palette.
|
private void |
recolorTree(Color[] col,
ClusterNode n)
Function for recursion in recolorTree()
|
private void |
resizeLabelsAndBorders(float borderWidthFactor)
Resizes all labels so that labels of a lower layer are 1/3 smaller than the one above.
|
private void |
resizeLabelsAndBorders(TreeSet<Integer> ts,
int fontSize,
float borderWidth) |
addActivity, addAttribute, addChild, addChild, addChildren, addClientProperty, addInputEventListener, addPropertyChangeListener, addPropertyChangeListener, animateToBounds, animateToColor, animateToPositionScaleRotation, animateToTransform, animateToTransparency, animateTransformToBounds, centerBoundsOnPoint, centerFullBoundsOnPoint, clone, computeFullBounds, endResizeBounds, findIntersectingNodes, fireChildPropertyChange, firePropertyChange, fullIntersects, fullPaint, fullPick, getAllNodes, getAllNodes, getAttribute, getAttribute, getBooleanAttribute, getBounds, getBoundsChanged, getBoundsReference, getBoundsVolatile, getChild, getChildBoundsInvalid, getChildBoundsVolatile, getChildPaintInvalid, getChildrenCount, getChildrenIterator, getChildrenPickable, getChildrenReference, getClientProperties, getClientProperty, getClientPropertyKeysEnumeration, getClientPropertyKeysIterator, getDoubleAttribute, getFullBounds, getFullBoundsInvalid, getFullBoundsReference, getGlobalBounds, getGlobalFullBounds, getGlobalRotation, getGlobalScale, getGlobalToLocalTransform, getGlobalTranslation, getHeight, getIntegerAttribute, getInverseTransform, getListenerList, getLocalToGlobalTransform, getOccluded, getOffset, getPaint, getPaintInvalid, getParent, getPickable, getPropertyChangeParentMask, getRoot, getRotation, getScale, getTransform, getTransformReference, getTransparency, getUnionOfChildrenBounds, getVisible, getWidth, getX, getXOffset, getY, getYOffset, globalToLocal, globalToLocal, globalToLocal, indexOfChild, internalUpdateBounds, intersects, invalidateFullBounds, invalidateLayout, invalidatePaint, isAncestorOf, isDescendentOf, isDescendentOfRoot, isOpaque, layoutChildren, lerp, localToGlobal, localToGlobal, localToGlobal, localToParent, localToParent, localToParent, moveInBackOf, moveInFrontOf, moveToBack, moveToFront, offset, paint, paintAfterChildren, paramString, parentBoundsChanged, parentToLocal, parentToLocal, parentToLocal, pick, pickAfterChildren, position, print, print, removeAllChildren, removeChild, removeChild, removeChildren, removeFromParent, removeInputEventListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaintFrom, reparent, replaceWith, resetBounds, rotate, rotateAboutPoint, rotateAboutPoint, rotateInPlace, scale, scaleAboutPoint, scaleAboutPoint, setBounds, setBounds, setBoundsChanged, setChildBoundsInvalid, setChildBoundsVolatile, setChildPaintInvalid, setChildrenPickable, setFullBoundsInvalid, setGlobalRotation, setGlobalScale, setGlobalTranslation, setHeight, setOccluded, setOffset, setOffset, setPaint, setPaintInvalid, setParent, setPickable, setPropertyChangeParentMask, setRotation, setScale, setTransform, setTransparency, setVisible, setWidth, setX, setY, signalBoundsChanged, startResizeBounds, toImage, toImage, toImage, toString, transformBy, translate, validateFullBounds, validateFullPaint
public static final float INITIAL_BORDER_WIDTH_MAGNIFICATION_FACTOR
private static final long serialVersionUID
private ClusterNode topNode
private SortedMap<Integer,ClusterElementsStorage> allClusteringElements
private static final EditLabelEventListener labelListener
private int startFontSize
private int width
public static final Font defaultFont
ClusteringTree(ClusterNode top, int width)
top
- the top Clusterwidth
- the width of the map in Units. The width is needed for initializing the Font size.public ClusterNode findNode(int lvl)
public ClusterNode findNode(ClusterNode start, int lvl)
public SortedMap<Integer,ClusterElementsStorage> getClusteringInto(int l)
l
- the number of clustersprivate void clearClusteringElements()
public SortedMap<Integer,ClusterElementsStorage> getClusteringInto(int l, boolean sticky)
l
- the number of clusterssticky
- should this clustering stay visiblepublic void dumpAllClusteringElements()
private void resizeLabelsAndBorders(TreeSet<Integer> ts, int fontSize, float borderWidth)
private void resizeLabelsAndBorders(float borderWidthFactor)
public SortedMap<Integer,ClusterElementsStorage> getAllClusteringElements()
private void getAllChildrenUntil(int level, ClusterNode start, ArrayList<ClusterNode> store)
level
- the level.start
- the top ClusterNodestore
- a ArrayList to store the resultspublic ClusterNode findClusterOf(GeneralUnitPNode unitPNode, int level)
ClusterNode
that contains the given GeneralUnitPNode
at the given level.public void printTree(ClusterNode start, int x)
public void addEditLabelEventListenerToAll()
public void recolorTree()
private void recolorTree(Color[] col, ClusterNode n)
col
- Color[] contaning the Palettepublic Color[] getPalette()
public int[][] getClusterAssignment(int level, int xSize, int ySize)
public ArrayList<ClusterNode> getNodesAtLevel(int level)