public class GeneralUnitPNode
extends edu.umd.cs.piccolo.PNode
PNode
for all unit-level visualisations. This PNode has one of the four child nodes, depending on the current zoom level of
the SOMViewer
application - DETAIL_LEVEL_NO
,
DETAIL_LEVEL_LOW
, DETAIL_LEVEL_MEDIUM
and
DETAIL_LEVEL_HIGH
. Each of the four different PNodes represents four different levels of
information details displayed. Each those detail nodes has potentially other child nodes:
PieChartPNode
PNode
for holding the Labels, which are PText
objectsPNode
for holding the data item names, which are PText
objectsPNode
for holding the quality measure value, which is a PText
objectModifier and Type | Field and Description |
---|---|
private java.util.ArrayList<ArrowPNode> |
arrowsFromThisUnit |
private java.awt.geom.Rectangle2D |
border |
private java.awt.Color |
borderColor |
private java.awt.BasicStroke |
borderStroke |
private SOMLibClassInformation |
classInfo |
private boolean |
classInfoSelectionChanged |
private int |
currentDetailLevel |
private double |
currentScale |
static int |
DATA_DISPLAY_VARIANT_INPUTOBJECT |
static int |
DATA_DISPLAY_VARIANT_INPUTOBJECTSHIFTED |
static int |
DATA_DISPLAY_VARIANT_TEXT |
static int |
DATA_DISPLAY_VARIANTS |
private edu.umd.cs.piccolo.PNode[] |
dataCountDetail |
private edu.umd.cs.piccolo.PNode[][][] |
dataDetail
Data input nodes for different levels, length of
NUMBER_OF_DETAIL_LEVELS , contains a PText at
DATA_DISPLAY_VARIANT_TEXT , and InputPNode s at DATA_DISPLAY_VARIANT_INPUTOBJECT and
DATA_DISPLAY_VARIANT_INPUTOBJECTSHIFTED . |
private SOMLibDataInformation |
dataInfo |
static int |
DETAIL_LEVEL_HIGH |
static int |
DETAIL_LEVEL_LOW |
static int |
DETAIL_LEVEL_MEDIUM |
static int |
DETAIL_LEVEL_NO |
static java.lang.String[] |
detailLevelNames
Names for the different zoom/scale levels, corresponding to
DETAIL_LEVEL_NO , DETAIL_LEVEL_LOW ,
.. |
private edu.umd.cs.piccolo.PNode[] |
detailNodes
Nodes for details at different levels
|
private boolean |
drawBorder |
private static int[] |
FONT_SIZE_DATA |
private static int[] |
FONT_SIZE_LABELS |
private double |
height |
private edu.umd.cs.piccolo.PNode[] |
labelDetailNodes
Label nodes for different levels
|
private java.awt.Point[][] |
locations |
private static int[] |
MAX_LABEL_LENGTH |
private static int[] |
NUMBER_OF_COLUMNS |
static int |
NUMBER_OF_DETAIL_LEVELS |
private static int[] |
NUMBER_OF_LABELS |
private double |
oldScale |
private PieChartPNode[] |
pieChartDetailNodes
PieChart nodes for different levels
|
private edu.umd.cs.piccolo.nodes.PPath |
queryResultMarker |
private boolean |
selected |
private int[] |
selectedClassIndices |
private edu.umd.cs.piccolo.nodes.PPath |
selectionMarker |
private static long |
serialVersionUID |
private boolean |
showOnlySelectedClasses |
private CommonSOMViewerStateData |
state |
private Unit |
u |
private double |
width |
private double |
X |
private double |
Y |
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
Constructor and Description |
---|
GeneralUnitPNode(int x,
int y,
double width,
double height)
Constructor for mnemonic (sparse) SOMs.
|
GeneralUnitPNode(Unit u,
CommonSOMViewerStateData state,
SOMLibClassInformation classInfo,
SOMLibDataInformation dataInfo,
double width,
double height) |
GeneralUnitPNode(Unit u,
CommonSOMViewerStateData state,
SOMLibClassInformation classInfo,
SOMLibDataInformation dataInfo,
java.awt.Point[][] locations,
double width,
double height) |
GeneralUnitPNode(Unit u,
GeneralUnitPNode clone) |
Modifier and Type | Method and Description |
---|---|
void |
addArrow(ArrowPNode arrow) |
private void |
addDataChildren() |
private void |
detailChanged()
Updates child nodes to display upon change in detail level
|
java.util.ArrayList<ArrowPNode> |
getArrows() |
java.awt.Color |
getClassLegendColorFast(int index)
This implementation does not check for the pie charts (
pieChartDetailNodes to be initialised and should
therefore be only used if it is for sure != null. |
PieChartPNode |
getClassPieChart(int width,
int height) |
int |
getDataInputVariant() |
Label[] |
getLabels(java.lang.String type) |
java.awt.Point[] |
getLocations() |
java.lang.String[] |
getMappedDataNames() |
MapPNode |
getMapPNode() |
java.awt.Point |
getPostion() |
int[] |
getSelectedClassIndices() |
boolean |
getShowOnlySelectedClasses() |
Unit |
getUnit()
Returns the associtated SOM unit for this node
|
boolean |
hasPieCharts() |
void |
initClassPieCharts(Unit u,
SOMLibClassInformation classInfo,
double width,
double height) |
private edu.umd.cs.piccolo.PNode[] |
initData(int threshold,
int fontSize,
double yInOffset,
int detailLevel,
int variant)
Initializes textual details
|
private void |
initDetails()
Initializes the details node.
|
private void |
initDetails(int level) |
private edu.umd.cs.piccolo.PNode |
initLabels(int numLabels,
int numCol,
int fontSize,
int length)
Initializes text labels for this node.
|
private void |
initPNodeProperties(double width,
double height)
Initializes common properties for unit PNodes and empty PNodes
|
boolean |
isSelected() |
protected void |
paint(edu.umd.cs.piccolo.util.PPaintContext paintContext) |
void |
reInitUnitDetails() |
void |
reInitUnitDetails(int detailLevel) |
private void |
removeDetailNodes()
remove currently added detail levels.
|
void |
removeQueryHit() |
void |
resetArrows() |
void |
setArrows(java.util.ArrayList<ArrowPNode> arrows) |
boolean |
setBounds(double x,
double y,
double width,
double height) |
void |
setClassColor(int index,
java.awt.Color color) |
void |
setClassColors(java.awt.Color[] colors) |
void |
setQueryHit() |
void |
setSelected(boolean sel) |
void |
setShowOnlySelectedClasses(boolean showOnlySelectedClasses) |
java.lang.String |
toString() |
void |
updateClassPieCharts()
Updates the class pie chart visibility.
|
void |
updateClassSelection(int[] indices) |
void |
updateDetailsAfterMoving()
Updates the units displayed info by removing & re-creating them.
|
private java.lang.Object |
writeReplace() |
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, 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, 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, transformBy, translate, validateFullBounds, validateFullPaint
private static final long serialVersionUID
public static final int DETAIL_LEVEL_NO
public static final int DETAIL_LEVEL_LOW
public static final int DETAIL_LEVEL_MEDIUM
public static final int DETAIL_LEVEL_HIGH
public static final int NUMBER_OF_DETAIL_LEVELS
public static final java.lang.String[] detailLevelNames
DETAIL_LEVEL_NO
, DETAIL_LEVEL_LOW
,
..public static final int DATA_DISPLAY_VARIANT_INPUTOBJECT
public static final int DATA_DISPLAY_VARIANT_INPUTOBJECTSHIFTED
public static final int DATA_DISPLAY_VARIANT_TEXT
public static final int DATA_DISPLAY_VARIANTS
private static int[] NUMBER_OF_LABELS
private static int[] NUMBER_OF_COLUMNS
private static int[] FONT_SIZE_LABELS
private static int[] MAX_LABEL_LENGTH
private static int[] FONT_SIZE_DATA
private int currentDetailLevel
private Unit u
private double X
private double Y
private double width
private double height
private boolean drawBorder
private java.awt.geom.Rectangle2D border
private final java.awt.Color borderColor
private final java.awt.BasicStroke borderStroke
private int[] selectedClassIndices
private boolean showOnlySelectedClasses
private boolean selected
private edu.umd.cs.piccolo.nodes.PPath selectionMarker
private java.util.ArrayList<ArrowPNode> arrowsFromThisUnit
private double oldScale
private double currentScale
private edu.umd.cs.piccolo.PNode[] detailNodes
private edu.umd.cs.piccolo.PNode[][][] dataDetail
NUMBER_OF_DETAIL_LEVELS
, contains a PText
at
DATA_DISPLAY_VARIANT_TEXT
, and InputPNode
s at DATA_DISPLAY_VARIANT_INPUTOBJECT
and
DATA_DISPLAY_VARIANT_INPUTOBJECTSHIFTED
.private edu.umd.cs.piccolo.PNode[] dataCountDetail
private edu.umd.cs.piccolo.PNode[] labelDetailNodes
private PieChartPNode[] pieChartDetailNodes
private SOMLibClassInformation classInfo
private SOMLibDataInformation dataInfo
private boolean classInfoSelectionChanged
private edu.umd.cs.piccolo.nodes.PPath queryResultMarker
private java.awt.Point[][] locations
private CommonSOMViewerStateData state
public GeneralUnitPNode(int x, int y, double width, double height)
public GeneralUnitPNode(Unit u, CommonSOMViewerStateData state, SOMLibClassInformation classInfo, SOMLibDataInformation dataInfo, double width, double height)
public GeneralUnitPNode(Unit u, CommonSOMViewerStateData state, SOMLibClassInformation classInfo, SOMLibDataInformation dataInfo, java.awt.Point[][] locations, double width, double height)
public GeneralUnitPNode(Unit u, GeneralUnitPNode clone)
private void addDataChildren()
public void reInitUnitDetails()
public void reInitUnitDetails(int detailLevel)
private void removeDetailNodes()
private void initPNodeProperties(double width, double height)
public void initClassPieCharts(Unit u, SOMLibClassInformation classInfo, double width, double height)
private edu.umd.cs.piccolo.PNode initLabels(int numLabels, int numCol, int fontSize, int length)
numLabels
- Number of labels to be shown. If '-1' the limit is set to the number of labels in unit
description file.numCol
- Number of table columns. Setting to '1' means row table.fontSize
- Font size to use for drawing labelslength
- Maximum label length, longer labels will be trunkatedpublic MapPNode getMapPNode()
private edu.umd.cs.piccolo.PNode[] initData(int threshold, int fontSize, double yInOffset, int detailLevel, int variant)
threshold
- Displays description of mapped inputs below certain threshold (count), otherwise a count is
displayed.fontSize
- Text sizeyInOffset
- Positional offsetprivate void initDetails()
DETAIL_LEVEL_HIGH
, quality measure info is added for DETAIL_LEVEL_HIGH
.private void initDetails(int level)
public void updateDetailsAfterMoving()
protected void paint(edu.umd.cs.piccolo.util.PPaintContext paintContext)
paint
in class edu.umd.cs.piccolo.PNode
PNode.paint(edu.umd.cs.piccolo.util.PPaintContext)
public boolean setBounds(double x, double y, double width, double height)
setBounds
in class edu.umd.cs.piccolo.PNode
PNode.setBounds(double, double, double, double)
public void updateClassPieCharts()
public int getDataInputVariant()
private void detailChanged()
public boolean hasPieCharts()
public java.awt.Color getClassLegendColorFast(int index)
pieChartDetailNodes
to be initialised and should
therefore be only used if it is for sure != null.public void setClassColor(int index, java.awt.Color color)
public void setClassColors(java.awt.Color[] colors)
public void updateClassSelection(int[] indices)
public java.lang.String[] getMappedDataNames()
public boolean isSelected()
public void setSelected(boolean sel)
public Label[] getLabels(java.lang.String type)
public void setQueryHit()
public void removeQueryHit()
public Unit getUnit()
public PieChartPNode getClassPieChart(int width, int height)
private java.lang.Object writeReplace() throws java.io.ObjectStreamException
java.io.ObjectStreamException
public java.util.ArrayList<ArrowPNode> getArrows()
public void setArrows(java.util.ArrayList<ArrowPNode> arrows)
public void addArrow(ArrowPNode arrow)
public void resetArrows()
public java.awt.Point[] getLocations()
public java.awt.Point getPostion()
public boolean getShowOnlySelectedClasses()
public void setShowOnlySelectedClasses(boolean showOnlySelectedClasses)
public java.lang.String toString()
toString
in class edu.umd.cs.piccolo.PNode
public int[] getSelectedClassIndices()