public class MapPNode
extends edu.umd.cs.piccolo.PNode
SOMViewer
application. This class makes use of the Piccolo framework and is the top PNode
for all
map-level visualisations. The class holds several other PNodes as children:
GeneralUnitPNode
- units
currentVisualizationImage
backgroundImage
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 |
---|
MapPNode(JFrame parentFrame,
GrowingSOM gsom,
GrowingLayer growingLayer,
CommonSOMViewerStateData state)
Constructor for a already loaded GrowingLayer - can be used for visualize sublayers of a ghsom!
|
MapPNode(JFrame parentFrame,
SOMLibFormatInputReader inputReader,
CommonSOMViewerStateData state,
boolean inizializeVis)
Constructor if input files have already been read.
|
MapPNode(JFrame parentFrame,
String weightVectorFileName,
String unitDescriptionFileName,
String mapDescriptionFileName,
CommonSOMViewerStateData state)
Default constructors - reading of input files not yet done.
|
Modifier and Type | Method and Description |
---|---|
void |
buildTree(ClusteringTree tree)
Rebuilds a clustering from the given tree.
|
void |
buildTree(TreeBuilder builder)
Creates new
TreeBuilder . |
boolean |
changePalette(Palette palette) |
void |
clearHistogramOverlayVisualization()
Removes temporary histogram based visualization
|
void |
clearInputCorrections() |
void |
clearInputCorrections(InputCorrections.CreationType type) |
private void |
createDataImages() |
void |
createInputCorrectionArrows() |
void |
createLabel()
Adds a manual label to the map.
|
ArrayList<edu.umd.cs.piccolo.PNode> |
getAllClusterLabels() |
BufferedImage |
getBackgroundImage() |
private int |
getBackgroundImageHeight() |
private int |
getBackgroundImageWidth() |
Color[] |
getClassLegendColors() |
String[] |
getClassLegendNames() |
ClusteringTree |
getClusteringTree() |
TreeBuilder |
getClusteringTreeBuilder() |
ArrayList<edu.umd.cs.piccolo.PNode>[] |
getClusterLabelsByLevel() |
ClusteringTree |
getCurrentClusteringTree() |
BackgroundImageVisualizer |
getCurrentVisualization() |
GeneralUnitPNode |
getGeneralUnitPNodeAtPos(double x,
double y) |
GeneralUnitPNode |
getGeneralUnitPNodeAtPos(float x,
float y) |
GeneralUnitPNode |
getGeneralUnitPNodeAtPos(Point2D p) |
GrowingSOM |
getGsom() |
double |
getHeight()
Return the map height in pixels, i.e.
|
edu.umd.cs.piccolo.PNode |
getInputCorrectionsPNode() |
SharedSOMVisualisationData |
getInputObjects() |
edu.umd.cs.piccolo.PNode |
getManualLabels() |
JFrame |
getParentFrame() |
private Point |
getPointLocation(String name)
Calculates the absolute position of an input on the
MapPNode . |
private int |
getScaledBackgroundImageHeight() |
private int |
getScaledBackgroundImageHeight(BackgroundImageVisualizer visualization) |
private int |
getScaledBackgroundImageWidth() |
private int |
getScaledBackgroundImageWidth(BackgroundImageVisualizer visualization) |
Point[] |
getStarCoords(Unit unit,
int unitSize) |
CommonSOMViewerStateData |
getState() |
ThematicClassMapVisualizer |
getThematicClassMapVisualizer()
Deprecated.
use
Visualizations instead |
GeneralUnitPNode |
getUnit(int x,
int y)
Return the GeneralUnitPNode at the unit index x/y.
|
GeneralUnitPNode |
getUnit(Unit u)
Return the GeneralUnitPNode at the unit index x/y.
|
int |
getUnitHeight()
Return the unit height in pixels.
|
edu.umd.cs.piccolo.PNode |
getUnitsNode() |
int |
getUnitWidth()
Return the unit width in pixles.
|
private BufferedImage |
getVisualisation()
Gets the visualisation variant from the current
currentVisualization obtaining the values from
currentVisualizationVariant , getScaledBackgroundImageWidth() and
getScaledBackgroundImageHeight() . |
BackgroundImageVisualizer[] |
getVisualizations()
Deprecated.
use
Visualizations.singleton instead |
double |
getWidth()
Return the map width in pixels, i.e.
|
boolean |
hasDataImages() |
private void |
init(JFrame parentFrame,
SOMLibFormatInputReader inputReader,
CommonSOMViewerStateData state,
GrowingLayer growingLayer,
boolean inizializeVis) |
private void |
initCurrentVisualisation() |
private Point[][] |
initInputLocations(Unit unit)
Computes the locations of each input vector within a specific unit
|
boolean |
isBackgroundImageVisible() |
void |
reInitLabels() |
void |
reInitUnitDetails() |
void |
reInitUnitPNodes(int detailLevel) |
boolean |
reloadPaletteAfterEditing(Palette palette)
Reloads the given palette after it has been edited with the
PaletteEditor , i.e. |
void |
resetArrows()
Resets the list of arrows originating from a unit for each unit on the map.
|
boolean |
reversePalette() |
void |
setBackgroundImage(BufferedImage background) |
void |
setBackgroundImageVisibility(boolean visible) |
boolean |
setBounds(double x,
double y,
double width,
double height) |
void |
setClassColor(int index,
Color color) |
void |
setClassColors(Color[] colors) |
void |
setClusteringElements(SortedMap<Integer,ClusterElementsStorage> elements)
Replaces currentClusteringElements with elements and makes sure the correct stuff is displayed.
|
boolean |
setInitialVisualizationOnStartup(BackgroundImageVisualizer vis,
int variant)
Method to be used for setting the initial visualisation on startup - does not actually create the image, just
sets the
currentVisualization and currentVisualizationVariant . |
void |
setInputCorrectionsVisible(boolean visible) |
void |
setLinkageVisibilityMode(boolean visible) |
void |
setNoVisualization() |
void |
setShowOnlySelectedClasses(boolean selectedClassesOnly) |
boolean |
setVisualization(BackgroundImageVisualizer vis,
int variant) |
boolean |
setVisualization(int vis,
int variant) |
void |
showClusters(int count)
Display the specified number of clusters
|
void |
showClusters(int count,
boolean sticky)
Display the specified number of Clusters.
|
void |
showHistogramOverlayVisualization(int[][] hist,
int vis_index)
Creates a histogram based visualization, which is *temporarily* placed over the current visualization
|
void |
updateClassInfo(SOMLibClassInformation classInfo) |
void |
updateClassSelection(int[] indices) |
void |
updateClassVisibility() |
void |
updateDataImagesVisibility() |
void |
updateDetailsAfterMoving() |
void |
updatePointLocations() |
void |
updateVisualization() |
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, getIntegerAttribute, getInverseTransform, getListenerList, getLocalToGlobalTransform, getOccluded, getOffset, getPaint, getPaintInvalid, getParent, getPickable, getPropertyChangeParentMask, getRoot, getRotation, getScale, getTransform, getTransformReference, getTransparency, getUnionOfChildrenBounds, getVisible, 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, 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
private static final long serialVersionUID
public static final int DEFAULT_UNIT_HEIGHT
public static final int DEFAULT_UNIT_WIDTH
public static final Font DEFAULT_TOOLTIP_FONT
public static final Font DEFAULT_TOOLTIP_FONT_UNITINFO
private GrowingSOM gsom
private SOMLibClassInformation classInfo
private SOMLibDataInformation dataInfo
private GeneralUnitPNode[][] units
private int UNIT_WIDTH
private int UNIT_HEIGHT
@Deprecated private BackgroundImageVisualizer[] visualizations
Visualizations
insteadprivate BackgroundImageVisualizer currentVisualization
private int currentVisualizationVariant
private edu.umd.cs.piccolo.nodes.PImage backgroundImage
protected edu.umd.cs.piccolo.nodes.PImage currentVisualizationImage
private AbstractMatrixVisualizer overlayVis
private int overlayVis_index
private edu.umd.cs.piccolo.nodes.PImage overlayVisualizationImage
private SortedMap<Integer,ClusterElementsStorage> currentClusteringElements
private ClusteringTree currentClusteringTree
private edu.umd.cs.piccolo.PNode manualLabels
private edu.umd.cs.piccolo.PNode unitsNode
private edu.umd.cs.piccolo.PNode inputCorrectionsPNode
private edu.umd.cs.piccolo.PNode imageDataNode
private SharedSOMVisualisationData inputObjects
private JFrame parentFrame
private CommonSOMViewerStateData state
private BufferedImage originalBackgroundImage
private boolean backgroundImageVisible
private edu.umd.cs.piccolo.nodes.PPath inputLinkagePath
private TreeBuilder clusteringTreeBuilder
public MapPNode(JFrame parentFrame, String weightVectorFileName, String unitDescriptionFileName, String mapDescriptionFileName, CommonSOMViewerStateData state) throws FileNotFoundException, SOMLibFileFormatException
public MapPNode(JFrame parentFrame, SOMLibFormatInputReader inputReader, CommonSOMViewerStateData state, boolean inizializeVis)
public MapPNode(JFrame parentFrame, GrowingSOM gsom, GrowingLayer growingLayer, CommonSOMViewerStateData state)
private void init(JFrame parentFrame, SOMLibFormatInputReader inputReader, CommonSOMViewerStateData state, GrowingLayer growingLayer, boolean inizializeVis)
private void createDataImages()
public void createInputCorrectionArrows()
public void updateDetailsAfterMoving()
private Point getPointLocation(String name)
MapPNode
.private Point[][] initInputLocations(Unit unit)
@Deprecated public BackgroundImageVisualizer[] getVisualizations()
Visualizations.singleton
instead@Deprecated public ThematicClassMapVisualizer getThematicClassMapVisualizer()
Visualizations
insteadpublic BackgroundImageVisualizer getCurrentVisualization()
public void setNoVisualization()
public void updateVisualization()
private void initCurrentVisualisation()
public void showHistogramOverlayVisualization(int[][] hist, int vis_index)
hist
- int[][] with histogram data, e.g. unit countsvis_index
- visualization variant index (0 = flat, 1 = smoothed)public void clearHistogramOverlayVisualization()
public boolean reversePalette() throws SOMToolboxException
SOMToolboxException
public boolean reloadPaletteAfterEditing(Palette palette) throws SOMToolboxException
PaletteEditor
, i.e. basically invalidates the
cache for all visualisations and then calls changePalette(Palette)
SOMToolboxException
public boolean changePalette(Palette palette) throws SOMToolboxException
SOMToolboxException
public void showClusters(int count)
public void showClusters(int count, boolean sticky)
sticky
- should this level ov clustering stay visible when other levels of clustering are displayed.public void buildTree(TreeBuilder builder) throws ClusteringAbortedException
TreeBuilder
. if the builder is null, the current clustering is removed.ClusteringAbortedException
public void buildTree(ClusteringTree tree)
public ClusteringTree getCurrentClusteringTree()
public void setClusteringElements(SortedMap<Integer,ClusterElementsStorage> elements)
public void createLabel()
public edu.umd.cs.piccolo.PNode getManualLabels()
public ArrayList<edu.umd.cs.piccolo.PNode> getAllClusterLabels()
public ArrayList<edu.umd.cs.piccolo.PNode>[] getClusterLabelsByLevel()
public ClusteringTree getClusteringTree()
private int getScaledBackgroundImageWidth()
private int getScaledBackgroundImageWidth(BackgroundImageVisualizer visualization)
private int getScaledBackgroundImageHeight()
private int getScaledBackgroundImageHeight(BackgroundImageVisualizer visualization)
private int getBackgroundImageWidth()
private int getBackgroundImageHeight()
public boolean setVisualization(int vis, int variant) throws SOMToolboxException
SOMToolboxException
public boolean setInitialVisualizationOnStartup(BackgroundImageVisualizer vis, int variant) throws SOMToolboxException
currentVisualization
and currentVisualizationVariant
.SOMToolboxException
private BufferedImage getVisualisation() throws SOMToolboxException
currentVisualization
obtaining the values from
currentVisualizationVariant
, getScaledBackgroundImageWidth()
and
getScaledBackgroundImageHeight()
.SOMToolboxException
public boolean setVisualization(BackgroundImageVisualizer vis, int variant) throws SOMToolboxException
SOMToolboxException
public GeneralUnitPNode getUnit(int x, int y)
public GeneralUnitPNode getUnit(Unit u)
public int getUnitWidth()
public int getUnitHeight()
public double getWidth()
getWidth
in class edu.umd.cs.piccolo.PNode
public double getHeight()
getHeight
in class edu.umd.cs.piccolo.PNode
public boolean setBounds(double x, double y, double width, double height)
setBounds
in class edu.umd.cs.piccolo.PNode
public void setLinkageVisibilityMode(boolean visible)
public void reInitUnitDetails()
public Color[] getClassLegendColors()
public void setClassColor(int index, Color color)
public void setClassColors(Color[] colors)
public String[] getClassLegendNames()
public void setShowOnlySelectedClasses(boolean selectedClassesOnly)
public void updateClassSelection(int[] indices)
public void updateDataImagesVisibility()
public boolean hasDataImages()
public void updatePointLocations()
public SharedSOMVisualisationData getInputObjects()
public void updateClassInfo(SOMLibClassInformation classInfo)
public void updateClassVisibility()
public GrowingSOM getGsom()
public void setBackgroundImage(BufferedImage background)
public void setBackgroundImageVisibility(boolean visible)
public void reInitLabels()
public BufferedImage getBackgroundImage()
public boolean isBackgroundImageVisible()
public CommonSOMViewerStateData getState()
public JFrame getParentFrame()
public void resetArrows()
public void reInitUnitPNodes(int detailLevel)
public edu.umd.cs.piccolo.PNode getInputCorrectionsPNode()
public void setInputCorrectionsVisible(boolean visible)
public void clearInputCorrections()
public void clearInputCorrections(InputCorrections.CreationType type)
public TreeBuilder getClusteringTreeBuilder()
public GeneralUnitPNode getGeneralUnitPNodeAtPos(Point2D p)
public GeneralUnitPNode getGeneralUnitPNodeAtPos(double x, double y)
public GeneralUnitPNode getGeneralUnitPNodeAtPos(float x, float y)
public edu.umd.cs.piccolo.PNode getUnitsNode()