comirva.visu
Class VisuPane

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Canvas
          extended by comirva.visu.epsgraphics.EpsCanvas
              extended by comirva.visu.VisuPane
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class VisuPane
extends EpsCanvas

This class implements a visualization pane for various kinds of visualizations. It provides a collection of data structures for different visualizations. The drawing itself is done by specific classes that run as threads to avoid blocking the user interface.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Canvas
Canvas.AccessibleAWTCanvas
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  BufferedImage bi
           
protected  Graphics2D big
           
protected  CircledBarsAdvancedConfig cbaCfg
           
protected  CircledFansConfig cfCfg
           
protected  ColorMap cm
           
protected  CSRConfig csrCfg
           
protected  DataMatrix distMat
           
protected  EpsGraphics2D eps
           
protected  GHSOM ghsom
           
protected  GHSOMConfig ghsomCfg
           
protected  Vector labels
           
protected  boolean loadBufferedImage
           
protected  Vector moElements
           
protected  ProbabilisticNetworkConfig pnCfg
           
protected  SunburstConfig sbCfg
           
protected  SunburstNode sbRoot
           
protected  SDH sdh
           
protected  SDHConfig sdhCfg
           
protected  SOM som
           
protected  SOMConfig somCfg
           
protected  DataMatrix toMat
           
static int TYPE_DISTANCE_MATRIX_CIRCLED_FANS
          TYPE_DISTANCE_MATRIX_CIRCLED_FANS defines the visualization of a distance matrix with circled fans.
static int TYPE_DISTANCE_MATRIX_CONTINUOUS_SIMILARITY_RING
          TYPE_DISTANCE_MATRIX_CONTINUOUS_SIMILARITY_RING defines the visualization of a distance matrix with a continuous similarity ring.
static int TYPE_DISTANCE_MATRIX_MDS
          TYPE_DISTANCE_MATRIX_MDS defines the visualization of a Sammon's Mapping.
static int TYPE_DISTANCE_MATRIX_PROBABILISTIC_NETWORK
          TYPE_DISTANCE_MATRIX_PROBABILISTIC_NETWORK defines the visualization of a distance matrix with a probabilistic network.
static int TYPE_DISTANCE_VECTOR_CIRCLED_BARS
          TYPE_DISTANCE_VECTOR_CIRCLED_BARS defines the visualization of a distance vector with circled bars.
static int TYPE_EXPERIMENTAL
          TYPE_EXPERIMENTAL defines a visualization for experimental use.
static int TYPE_GHSOMGRID
          TYPE_SOMGRID defines the visualization of a SOM-Grid.
static int TYPE_MDMGRID
          TYPE_MDMGRID defines the visualization of a MDM-Grid.
static int TYPE_SDH
          TYPE_SDH defines the visualization of a Smoothed Data Histogram (SDH).
static int TYPE_SOMGRID
          TYPE_SOMGRID defines the visualization of a SOM-Grid.
static int TYPE_TERM_OCCURRENCE_MATRIX_SUNBURST
          TYPE_TERM_OCCURRENCE_MATRIX_SUNBURST defines the visualization of a term occurrence matrix with a sunburst.
protected  VisuPreferences visuPreferences
           
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
VisuPane()
          Creates a new VisuPane-instance with an undefined visualization type.
VisuPane(int type)
          Creates a new VisuPane-instance and sets its visualization type to the argument type.
VisuPane(JProgressBar progressBar)
           
 
Method Summary
 CircledBarsAdvancedConfig getCircledBarsAdvancedConfig()
          Returns the configuration for a Circled-Bars-Advanced-Visualization.
 CircledBarsVisu getCircledBarsVisu()
           
 CircledFansConfig getCircledFansConfig()
          Returns the configuration for a Circled-Fans-Visualization.
 ColorMap getColorMap()
          Returns the ColorMap which is currently used.
 CSRConfig getCSRConfig()
          Returns the configuration for a Continuous-Similarity-Ring-Visualization.
 GHSOM getGHSOM()
           
 GHSOMConfig getGHSOMConfig()
          Returns the configuration for a GHSOM-Calculation.
 GHSOMGridVisu getGHSOMVisalizer()
           
 BufferedImage getImage()
          Returns the content of the canvas (for saving in a file).
 Vector getLabels()
          Returns a Vector containing the labels that should be visualized.
 ProbabilisticNetworkConfig getProbabilisticNetworkConfig()
          Returns the configuration for the Probabilistic-Network-Visualization.
 SDHConfig getSDHConfig()
          Returns the configuration for an SDH-Visualization.
 SOMConfig getSOMConfig()
          Returns the configuration for a SOM-Calculation.
 SunburstConfig getSunburstConfig()
          Returns the configuration for a Sunburst-Visualization.
 VisuPreferences getVisuPreferences()
          Returns the user preferences for the visualization pane.
 int getVisuType()
           
 void initMouseListener()
          First all existing visualisation dependent mouse listeners are removed (That means that the popup menu is not removed).
 void paint(Graphics g)
          Paints a visualization according to the type set with setVisuType(int).
 void registerPopupMenuListener(JPopupMenu menu)
          add this object as a popup menu listener to the given popup menu
 void resetVisuThreads()
          Kills all threads currenty performing visualization tasks
 void setCircledBarsAdvancedConfig(CircledBarsAdvancedConfig cbaCfg)
          Sets the configuration for a Circled-Bars-Visualization.
 void setCircledFansConfig(CircledFansConfig cfCfg)
          Sets the configuration for a Circled-Fans-Visualization.
 void setColorMap(ColorMap cm)
          Sets the colormap for the visualizations.
 void setCSRConfig(CSRConfig csrCfg)
          Sets the configuration for a Continuous-Similarity-Ring-Visualization.
 void setDistanceMatrix(DataMatrix distMatrix)
          Sets the internal distance matrix to the passed DataMatrix.
 void setGHSOM(GHSOM ghsom)
           
 void setGHSOMConfig(GHSOMConfig ghsomCfg)
          Sets the configuration for a GHSOM-Calculation.
 void setLabels(Vector l)
          Sets the labels for the data items to visualize.
 void setLoadBufferedImage(boolean loadBufferedImage)
          Sets, whether the visualization should be loaded from a (previously saved) buffered image or be redrawn.
 void setProbabilisticNetworkConfig(ProbabilisticNetworkConfig pnCfg)
          Sets the configuration for a Probabilistic-Network-Visualization.
 void setSDH(SDH sdh)
          Sets the internal SDH-parameter to the argument sdh.
 void setSDHConfig(SDHConfig sdhCfg)
          Sets the configuration for an SDH-Visualization.
 void setSOM(SOM som)
          Sets the internal SOM-parameter to the argument som.
 void setSOMConfig(SOMConfig somCfg)
          Sets the configuration for a SOM-Calculation.
 void setSunburstConfig(SunburstConfig sbCfg)
          Sets the configuration for a Sunburst-Visualization.
 void setSunburstRootNode(SunburstNode sbRoot)
          Set the SunburstNode representing the root node of a sunburst visualization.
 void setTermOccurrenceMatrix(DataMatrix toMatrix)
          Sets the internal term occurrence matrix to the passed DataMatrix.
 void setVisuPreferences(VisuPreferences visuPrefs)
          Sets the user preferences for the visualization pane.
 void setVisuType(int type)
          Sets the visualization type of the VisuPane.
 
Methods inherited from class comirva.visu.epsgraphics.EpsCanvas
getBoundingBox, getEpsGraphics
 
Methods inherited from class java.awt.Canvas
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, update
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_SOMGRID

public static final int TYPE_SOMGRID
TYPE_SOMGRID defines the visualization of a SOM-Grid.

See Also:
Constant Field Values

TYPE_SDH

public static final int TYPE_SDH
TYPE_SDH defines the visualization of a Smoothed Data Histogram (SDH).

See Also:
Constant Field Values

TYPE_DISTANCE_VECTOR_CIRCLED_BARS

public static final int TYPE_DISTANCE_VECTOR_CIRCLED_BARS
TYPE_DISTANCE_VECTOR_CIRCLED_BARS defines the visualization of a distance vector with circled bars.

See Also:
Constant Field Values

TYPE_DISTANCE_MATRIX_CIRCLED_FANS

public static final int TYPE_DISTANCE_MATRIX_CIRCLED_FANS
TYPE_DISTANCE_MATRIX_CIRCLED_FANS defines the visualization of a distance matrix with circled fans.

See Also:
Constant Field Values

TYPE_DISTANCE_MATRIX_PROBABILISTIC_NETWORK

public static final int TYPE_DISTANCE_MATRIX_PROBABILISTIC_NETWORK
TYPE_DISTANCE_MATRIX_PROBABILISTIC_NETWORK defines the visualization of a distance matrix with a probabilistic network.

See Also:
Constant Field Values

TYPE_DISTANCE_MATRIX_CONTINUOUS_SIMILARITY_RING

public static final int TYPE_DISTANCE_MATRIX_CONTINUOUS_SIMILARITY_RING
TYPE_DISTANCE_MATRIX_CONTINUOUS_SIMILARITY_RING defines the visualization of a distance matrix with a continuous similarity ring.

See Also:
Constant Field Values

TYPE_DISTANCE_MATRIX_MDS

public static final int TYPE_DISTANCE_MATRIX_MDS
TYPE_DISTANCE_MATRIX_MDS defines the visualization of a Sammon's Mapping.

See Also:
Constant Field Values

TYPE_TERM_OCCURRENCE_MATRIX_SUNBURST

public static final int TYPE_TERM_OCCURRENCE_MATRIX_SUNBURST
TYPE_TERM_OCCURRENCE_MATRIX_SUNBURST defines the visualization of a term occurrence matrix with a sunburst.

See Also:
Constant Field Values

TYPE_MDMGRID

public static final int TYPE_MDMGRID
TYPE_MDMGRID defines the visualization of a MDM-Grid.

See Also:
Constant Field Values

TYPE_GHSOMGRID

public static final int TYPE_GHSOMGRID
TYPE_SOMGRID defines the visualization of a SOM-Grid.

See Also:
Constant Field Values

TYPE_EXPERIMENTAL

public static final int TYPE_EXPERIMENTAL
TYPE_EXPERIMENTAL defines a visualization for experimental use.

See Also:
Constant Field Values

visuPreferences

protected VisuPreferences visuPreferences

cm

protected ColorMap cm

moElements

protected Vector moElements

som

protected SOM som

ghsom

protected GHSOM ghsom

sdh

protected SDH sdh

distMat

protected DataMatrix distMat

toMat

protected DataMatrix toMat

sbRoot

protected SunburstNode sbRoot

labels

protected Vector labels

somCfg

protected SOMConfig somCfg

ghsomCfg

protected GHSOMConfig ghsomCfg

sdhCfg

protected SDHConfig sdhCfg

cbaCfg

protected CircledBarsAdvancedConfig cbaCfg

cfCfg

protected CircledFansConfig cfCfg

pnCfg

protected ProbabilisticNetworkConfig pnCfg

csrCfg

protected CSRConfig csrCfg

sbCfg

protected SunburstConfig sbCfg

bi

protected BufferedImage bi

big

protected Graphics2D big

loadBufferedImage

protected boolean loadBufferedImage

eps

protected EpsGraphics2D eps
Constructor Detail

VisuPane

public VisuPane()
Creates a new VisuPane-instance with an undefined visualization type.


VisuPane

public VisuPane(int type)
Creates a new VisuPane-instance and sets its visualization type to the argument type.

Parameters:
type - the type of the visualization
See Also:
TYPE_SOMGRID, TYPE_SDH, TYPE_DISTANCE_VECTOR_CIRCLED_BARS, TYPE_DISTANCE_MATRIX_CIRCLED_FANS, TYPE_DISTANCE_MATRIX_PROBABILISTIC_NETWORK, TYPE_DISTANCE_MATRIX_CONTINUOUS_SIMILARITY_RING, TYPE_TERM_OCCURRENCE_MATRIX_SUNBURST, TYPE_EXPERIMENTAL

VisuPane

public VisuPane(JProgressBar progressBar)
Method Detail

setVisuType

public void setVisuType(int type)
Sets the visualization type of the VisuPane.

Parameters:
type - the type of the visualization
See Also:
TYPE_SOMGRID, TYPE_SDH, TYPE_DISTANCE_VECTOR_CIRCLED_BARS, TYPE_DISTANCE_MATRIX_CIRCLED_FANS, TYPE_DISTANCE_MATRIX_PROBABILISTIC_NETWORK, TYPE_DISTANCE_MATRIX_CONTINUOUS_SIMILARITY_RING, TYPE_TERM_OCCURRENCE_MATRIX_SUNBURST, TYPE_EXPERIMENTAL

setVisuPreferences

public void setVisuPreferences(VisuPreferences visuPrefs)
Sets the user preferences for the visualization pane.

Parameters:
visuPrefs - a VisuPreferences-instance containing the preferences

getVisuPreferences

public VisuPreferences getVisuPreferences()
Returns the user preferences for the visualization pane.

Returns:
a VisuPreferences-instance containing the preferences

setColorMap

public void setColorMap(ColorMap cm)
Sets the colormap for the visualizations.

Parameters:
cm - the ColorMap that should be used

getColorMap

public ColorMap getColorMap()
Returns the ColorMap which is currently used.

Returns:
the ColorMap which is currently used

setLoadBufferedImage

public void setLoadBufferedImage(boolean loadBufferedImage)
Sets, whether the visualization should be loaded from a (previously saved) buffered image or be redrawn. If the argument loadBufferedImage is set to , complete drawing is forced, the next time the Canvas needs to be repainted (no loading from buffered image).

Parameters:
loadBufferedImage - true if visualization is to be loaded from buffered image, false if visualization should be redrawn

setSOM

public void setSOM(SOM som)
Sets the internal SOM-parameter to the argument som.

Parameters:
som - the SOM-instance for which the visualization is to be created

setSDH

public void setSDH(SDH sdh)
Sets the internal SDH-parameter to the argument sdh.

Parameters:
sdh - the SDH-instance for which the visualization is to be created

setDistanceMatrix

public void setDistanceMatrix(DataMatrix distMatrix)
Sets the internal distance matrix to the passed DataMatrix. A distance matrix must be quadratic.

Parameters:
distMatrix - the DataMatrix-instance that represents the distance matrix

setTermOccurrenceMatrix

public void setTermOccurrenceMatrix(DataMatrix toMatrix)
Sets the internal term occurrence matrix to the passed DataMatrix.

Parameters:
toMatrix - the DataMatrix-instance that represents the term occurrence matrix

setLabels

public void setLabels(Vector l)
Sets the labels for the data items to visualize. (for experimental use)

Parameters:
l - a Vector containing the labels

setSunburstRootNode

public void setSunburstRootNode(SunburstNode sbRoot)
Set the SunburstNode representing the root node of a sunburst visualization.

Parameters:
sbRoot - The sbRoot to set.

setSOMConfig

public void setSOMConfig(SOMConfig somCfg)
Sets the configuration for a SOM-Calculation.

Parameters:
somCfg - a SOMConfig-instance containing the configuration

setGHSOMConfig

public void setGHSOMConfig(GHSOMConfig ghsomCfg)
Sets the configuration for a GHSOM-Calculation.

Parameters:
ghsomCfg - a GHSOMConfig-instance containing the configuration

setSDHConfig

public void setSDHConfig(SDHConfig sdhCfg)
Sets the configuration for an SDH-Visualization.

Parameters:
sdhCfg - an SDHConfig-instance containing the configuration

setCircledBarsAdvancedConfig

public void setCircledBarsAdvancedConfig(CircledBarsAdvancedConfig cbaCfg)
Sets the configuration for a Circled-Bars-Visualization.

Parameters:
cbaCfg - a CircledBarsAdvancedConfig-instance containing the configuration

setCircledFansConfig

public void setCircledFansConfig(CircledFansConfig cfCfg)
Sets the configuration for a Circled-Fans-Visualization.

Parameters:
cfCfg - a CircledFansConfig-instance containing the configuration

setProbabilisticNetworkConfig

public void setProbabilisticNetworkConfig(ProbabilisticNetworkConfig pnCfg)
Sets the configuration for a Probabilistic-Network-Visualization.

Parameters:
pnCfg - a ProbabilisticNetworkConfig-instance containing the configuration

setCSRConfig

public void setCSRConfig(CSRConfig csrCfg)
Sets the configuration for a Continuous-Similarity-Ring-Visualization.

Parameters:
csrCfg - a CSRConfig-instance containing the configuration

setSunburstConfig

public void setSunburstConfig(SunburstConfig sbCfg)
Sets the configuration for a Sunburst-Visualization.

Parameters:
sbCfg - a SunburstConfig-instance containing the configuration

getSOMConfig

public SOMConfig getSOMConfig()
Returns the configuration for a SOM-Calculation.

Returns:
a SOMConfig-instance containing the configuration

getGHSOMConfig

public GHSOMConfig getGHSOMConfig()
Returns the configuration for a GHSOM-Calculation.

Returns:
a GHSOMConfig-instance containing the configuration

getSDHConfig

public SDHConfig getSDHConfig()
Returns the configuration for an SDH-Visualization.

Returns:
an SDHConfig-instance containing the configuration

getCircledBarsAdvancedConfig

public CircledBarsAdvancedConfig getCircledBarsAdvancedConfig()
Returns the configuration for a Circled-Bars-Advanced-Visualization.

Returns:
a CircledBarsAdvancedConfig-instance containing the configuration

getCircledFansConfig

public CircledFansConfig getCircledFansConfig()
Returns the configuration for a Circled-Fans-Visualization.

Returns:
a CircledFansConfig-instance containing the configuration

getProbabilisticNetworkConfig

public ProbabilisticNetworkConfig getProbabilisticNetworkConfig()
Returns the configuration for the Probabilistic-Network-Visualization.

Returns:
a ProbabilisticNetworkConfig-instance containing the configuration

getCSRConfig

public CSRConfig getCSRConfig()
Returns the configuration for a Continuous-Similarity-Ring-Visualization.

Returns:
a CSRConfig-instance containing the configuration

getSunburstConfig

public SunburstConfig getSunburstConfig()
Returns the configuration for a Sunburst-Visualization.

Returns:
a SunburstConfig-instance containing the configuration

getLabels

public Vector getLabels()
Returns a Vector containing the labels that should be visualized.

Returns:
a Vector containing the labels

paint

public void paint(Graphics g)
Paints a visualization according to the type set with setVisuType(int).

Overrides:
paint in class Canvas
See Also:
Component.paint(java.awt.Graphics)

resetVisuThreads

public void resetVisuThreads()
Kills all threads currenty performing visualization tasks


getImage

public BufferedImage getImage()
Returns the content of the canvas (for saving in a file).

Returns:
a BufferedImage containing the content of the visualization pane.

getGHSOM

public GHSOM getGHSOM()

setGHSOM

public void setGHSOM(GHSOM ghsom)

getGHSOMVisalizer

public GHSOMGridVisu getGHSOMVisalizer()

getVisuType

public int getVisuType()

getCircledBarsVisu

public CircledBarsVisu getCircledBarsVisu()

initMouseListener

public void initMouseListener()
First all existing visualisation dependent mouse listeners are removed (That means that the popup menu is not removed). Then the mouse listeners that are needed for the current visualisation are added. Depending on the current visualisation (given by visuType which is (set by setVisuType(int) and read by getVisuType()) the initMouseListener() method of the appropiate visu object is called or if a sepearate Listener object exists (like in case of the GHSOM Visu) an instance of this listener is created and added directly.


registerPopupMenuListener

public void registerPopupMenuListener(JPopupMenu menu)
add this object as a popup menu listener to the given popup menu

Parameters:
menu - the menu this object is added to as popup menu listener