org.knime.base.node.viz.plotter.parcoord
Class ParallelCoordinateDrawingPane

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.knime.base.node.viz.plotter.AbstractDrawingPane
                      extended by org.knime.base.node.viz.plotter.basic.BasicDrawingPane
                          extended by org.knime.base.node.viz.plotter.parcoord.ParallelCoordinateDrawingPane
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class ParallelCoordinateDrawingPane
extends BasicDrawingPane

Since the ParallelCoordinatesPlotter only calculates the mapped datapoints, the connection of them by lines or curves is done here, also the missing values handling. Thus, also the interpretation of the line thickness, dot size, fading of unhilited lines is done here.

Author:
Fabian Dill, University of Konstanz
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static int BOTTOM_SPACE
          Constant for the space at the bottom between margin and axes.
static int DOT_SIZE
          Constant for the dot size.
static int TOP_SPACE
          Constant for the space at the top before the axes begin.
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
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
ParallelCoordinateDrawingPane()
           
 
Method Summary
protected  boolean checkLabelSpace(Set<String> labels, FontMetrics metrics, int distance)
          Checks for all labels if the string length is smaller than the distance between two parallel axes.
protected  void drawAxes(Graphics g)
          Draws the parallel axes and, if missing values are displayed explicitly, the horizontal line at the bottom.
protected  void drawLabels(Graphics g)
           
protected  void drawLines(Graphics g, List<LineInfo> lines)
          Draws the lines / rows.
protected  void drawNominalAxis(Graphics g, NominalParallelAxis axis)
          Draws a nominal axis with the labels of all possible values.
protected  void drawNumericAxis(Graphics g, NumericParallelAxis axis)
          Draws a numeric axis with the min value at the bottom and the max value at the top.
 List<ParallelAxis> getAxes()
           
 List<LineInfo> getLines()
           
 String getToolTipText(MouseEvent e)
          
 void paintContent(Graphics g)
          Paints all added BasicDrawingElements by calling their #paint(Graphics2D) method.
protected  void paintDot(Graphics g, Point p, LineInfo line, int size)
          Paints one dot with its shape.
 void setAxes(List<ParallelAxis> axes)
          Sets the axes with the data column spec, since it contains all necessary information (like domain, type, etc).
 void setDrawCurves(boolean drawCurves)
           
 void setFadeUnhilited(boolean fade)
           
 void setHideUnhilited(boolean hide)
           
 void setLines(List<LineInfo> lines)
           
 void setLineThickness(int lineThickness)
           
 void setShowDots(boolean showDots)
           
 void setShowMissingValues(boolean showMissingVals)
           
 void setSkipValues(boolean skip)
           
 
Methods inherited from class org.knime.base.node.viz.plotter.basic.BasicDrawingPane
addDrawingElement, clearPlot, getDrawingElements
 
Methods inherited from class org.knime.base.node.viz.plotter.AbstractDrawingPane
getDragStart, getSelectionRectangle, isMouseDown, paintComponent, paintSelectionRectangle, setAntialiasing, setDragEnd, setDragStart, setMouseDown
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TOP_SPACE

public static final int TOP_SPACE
Constant for the space at the top before the axes begin.

See Also:
Constant Field Values

BOTTOM_SPACE

public static final int BOTTOM_SPACE
Constant for the space at the bottom between margin and axes.

See Also:
Constant Field Values

DOT_SIZE

public static final int DOT_SIZE
Constant for the dot size.

See Also:
Constant Field Values
Constructor Detail

ParallelCoordinateDrawingPane

public ParallelCoordinateDrawingPane()
Method Detail

setAxes

public void setAxes(List<ParallelAxis> axes)
Sets the axes with the data column spec, since it contains all necessary information (like domain, type, etc).

Parameters:
axes - the parallel axes.

setLines

public void setLines(List<LineInfo> lines)
Parameters:
lines - the lines / rows (mapped).

getLines

public List<LineInfo> getLines()
Returns:
the lines / rows (mapped).

getAxes

public List<ParallelAxis> getAxes()
Returns:
the parallel axes

setShowDots

public void setShowDots(boolean showDots)
Parameters:
showDots - true if the dots on the axis should be painted, false otherwise.

setSkipValues

public void setSkipValues(boolean skip)
Parameters:
skip - true if missing values should be skipped.

setShowMissingValues

public void setShowMissingValues(boolean showMissingVals)
Parameters:
showMissingVals - true if missing values should have an extra place on the referring axis.

setFadeUnhilited

public void setFadeUnhilited(boolean fade)
Parameters:
fade - true if unhilited rows should be faded.

setHideUnhilited

public void setHideUnhilited(boolean hide)
Parameters:
hide - true if only hilite rows should be displayed

setDrawCurves

public void setDrawCurves(boolean drawCurves)
Parameters:
drawCurves - true, if the rows should be displayed as curves.

setLineThickness

public void setLineThickness(int lineThickness)
Parameters:
lineThickness - the thickness of the lines.

paintContent

public void paintContent(Graphics g)
Paints all added BasicDrawingElements by calling their #paint(Graphics2D) method. If the BasicDrawingPane is extended this method have to be called with super.paintContent() in order to maintain the functionality of painting BasicDrawingElements.

Overrides:
paintContent in class BasicDrawingPane
Parameters:
g - the graphics object
See Also:
AbstractDrawingPane.paintContent( java.awt.Graphics)

drawAxes

protected void drawAxes(Graphics g)
Draws the parallel axes and, if missing values are displayed explicitly, the horizontal line at the bottom.

Parameters:
g - the graphics object

drawLabels

protected void drawLabels(Graphics g)

drawNominalAxis

protected void drawNominalAxis(Graphics g,
                               NominalParallelAxis axis)
Draws a nominal axis with the labels of all possible values.

Parameters:
g - the graphics object
axis - the axis

checkLabelSpace

protected boolean checkLabelSpace(Set<String> labels,
                                  FontMetrics metrics,
                                  int distance)
Checks for all labels if the string length is smaller than the distance between two parallel axes.

Parameters:
labels - the labels
metrics - the font metrics
distance - the available space
Returns:
true if the string length of all labels is smaller than the distance

drawNumericAxis

protected void drawNumericAxis(Graphics g,
                               NumericParallelAxis axis)
Draws a numeric axis with the min value at the bottom and the max value at the top.

Parameters:
g - the graphics object
axis - the axis

drawLines

protected void drawLines(Graphics g,
                         List<LineInfo> lines)
Draws the lines / rows.

Parameters:
lines - the lines
g - the graphics object

paintDot

protected void paintDot(Graphics g,
                        Point p,
                        LineInfo line,
                        int size)
Paints one dot with its shape.

Parameters:
g - the graphics object
p - the point
line - the line
size - the size

getToolTipText

public String getToolTipText(MouseEvent e)

Overrides:
getToolTipText in class JComponent


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.