org.knime.base.node.viz.plotter.line
Class LinePlotter

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.AbstractPlotter
                      extended by org.knime.base.node.viz.plotter.basic.BasicPlotter
                          extended by org.knime.base.node.viz.plotter.columns.TwoColumnPlotter
                              extended by org.knime.base.node.viz.plotter.scatter.ScatterPlotter
                                  extended by org.knime.base.node.viz.plotter.line.LinePlotter
All Implemented Interfaces:
ComponentListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, HiLiteListener

public class LinePlotter
extends ScatterPlotter

Plots the values of all selected numeric columns as lines in a plot, where the x axis are the rows and the y axis are the values from the minimum of the values in all columns to the maximum of the values of all selected columns. The LinePlotter extends the ScatterPlotter to inherit the dot functionality and the hiliting behavior. It determines the overall minimum and maximum of the selected columns, creates the referring coordinates and calculates the mapped values. The so mapped data points are passed to the drawing pane in one large DotInfoArray. The LinePlotterDrawingPane connects the points by lines. Due to performance issues it initially plots the first five numeric columns.

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

Nested Class Summary
 
Nested classes/interfaces inherited from class org.knime.base.node.viz.plotter.AbstractPlotter
AbstractPlotter.MovingMouseListener, AbstractPlotter.SelectionMouseListener, AbstractPlotter.ZoomMouseListener
 
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 SIZE
          Initial dot size.
 
Fields inherited from class org.knime.base.node.viz.plotter.AbstractPlotter
DEFAULT_ZOOM_FACTOR, FADE_UNHILITED, HIDE_UNHILITED, SHOW_ALL, SHOW_HIDE
 
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
LinePlotter()
          Default constructor.
LinePlotter(AbstractDrawingPane panel, AbstractPlotterProperties properties)
          The construction kit constructor.
 
Method Summary
protected  void calculateDots()
          Calculates the screen coordinates (dots) for the lines and puts them in a large DotInfoArray, which is passed to the LinePlotterDrawingPane.
 DotInfo[] interpolate(Point p1, Point p2, List<DotInfo> xValues)
          The nr of intermediate points and the last row index is used to determine the x value (only the y value is interpolated).
 void reset()
          Sets color mapping and column selection to null.
 void setInterpolation(boolean enable)
          Missing values may be linearly interpolated, if true they will be interpolated, if false missing values will be left out and the line will be interrupted.
 void updatePaintModel()
          Creates the color mapping by dividing the hue circle of the HSB color model by the number of selected columns, calculates the coordinates by determining the overall minimum and maximum values of the selected columns and maps the data points to the resulting screen coordinates.
 void updateSize()
          Updates the size by mapping the domain values of the BasicDrawingElements to the drawing pane's dimension.
 
Methods inherited from class org.knime.base.node.viz.plotter.scatter.ScatterPlotter
calculateCoordinates, clearSelection, dispose, fillPopupMenu, getDotSize, getFadeAction, getHideAction, getJitterRate, getMappedXValue, getMappedYValue, getShowAllAction, getShowHideMenu, hiLite, hiLiteSelected, isHideMode, isScatterPlotterDrawingPane, isScatterPlotterProperties, jitterDots, selectClickedElement, selectElementsIn, setDotSize, setHideMode, setJitterRate, unHiLite, unHiLiteAll, unHiLiteSelected
 
Methods inherited from class org.knime.base.node.viz.plotter.columns.TwoColumnPlotter
getSelectedXColumn, getSelectedXColumnIndex, getSelectedYColumn, getSelectedYColumnIndex, setDataProvider, setSelectableColumns
 
Methods inherited from class org.knime.base.node.viz.plotter.basic.BasicPlotter
addBasicDrawingElement, addEllipse, addLine, addLine, addLine, addLine, addRectangle, addText
 
Methods inherited from class org.knime.base.node.viz.plotter.AbstractPlotter
addMouseListener, componentHidden, componentMoved, componentResized, componentShown, createNominalXCoordinate, createNominalYCoordinate, createXCoordinate, createXCoordinate, createYCoordinate, delegateAddHiLiteListener, delegateGetHiLitKeys, delegateHiLite, delegateHiLite, delegateIsHiLit, delegateIsHiLit, delegateRemoveAllHiLiteListeners, delegateRemoveHiLiteListener, delegateUnHiLite, delegateUnHiLite, delegateUnHiLiteAll, fitToScreen, getClearHiliteAction, getCurrentMouseListener, getDataArrayIdx, getDataProvider, getDrawingPane, getDrawingPaneDimension, getHiliteAction, getHiLiteMenu, getProperties, getScreenYCoordinate, getUnhiliteAction, getXAxis, getYAxis, removeMouseListener, setAntialiasing, setDataArrayIdx, setHeight, setHiLiteHandler, setPreserve, setXAxis, setYAxis, updateAxisLength, zoomByClick, zoomByWindow
 
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, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, 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

SIZE

public static final int SIZE
Initial dot size.

See Also:
Constant Field Values
Constructor Detail

LinePlotter

public LinePlotter(AbstractDrawingPane panel,
                   AbstractPlotterProperties properties)
The construction kit constructor. Registers all necessary listeners.

Parameters:
panel - the drawing panel
properties - the properties

LinePlotter

public LinePlotter()
Default constructor.

Method Detail

reset

public void reset()
Sets color mapping and column selection to null.

Overrides:
reset in class ScatterPlotter
See Also:
AbstractPlotter.reset()

setInterpolation

public void setInterpolation(boolean enable)
Missing values may be linearly interpolated, if true they will be interpolated, if false missing values will be left out and the line will be interrupted.

Parameters:
enable - true if missing values should be interpolated(linear), false otherwise

updatePaintModel

public void updatePaintModel()
Creates the color mapping by dividing the hue circle of the HSB color model by the number of selected columns, calculates the coordinates by determining the overall minimum and maximum values of the selected columns and maps the data points to the resulting screen coordinates.

Overrides:
updatePaintModel in class ScatterPlotter
See Also:
AbstractPlotter.updatePaintModel()

calculateDots

protected void calculateDots()
Calculates the screen coordinates (dots) for the lines and puts them in a large DotInfoArray, which is passed to the LinePlotterDrawingPane.


updateSize

public void updateSize()
Updates the size by mapping the domain values of the BasicDrawingElements to the drawing pane's dimension.

Overrides:
updateSize in class ScatterPlotter
See Also:
AbstractPlotter.updateSize()

interpolate

public DotInfo[] interpolate(Point p1,
                             Point p2,
                             List<DotInfo> xValues)
The nr of intermediate points and the last row index is used to determine the x value (only the y value is interpolated).

Parameters:
p1 - the domain value 1
p2 - the domain value 2
xValues - an array containing opoints with the right x value but missing y value.
Returns:
the interpolated domain values.


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.