org.knime.base.node.viz.plotter.line
Class LinePlotter
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.knime.base.node.viz.plotter.AbstractPlotter
org.knime.base.node.viz.plotter.basic.BasicPlotter
org.knime.base.node.viz.plotter.columns.TwoColumnPlotter
org.knime.base.node.viz.plotter.scatter.ScatterPlotter
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
Field Summary |
static int |
SIZE
Initial dot size. |
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
BasicDrawingElement s
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.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.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 |
SIZE
public static final int SIZE
- Initial dot size.
- See Also:
- Constant Field Values
LinePlotter
public LinePlotter(AbstractDrawingPane panel,
AbstractPlotterProperties properties)
- The construction kit constructor. Registers all necessary listeners.
- Parameters:
panel
- the drawing panelproperties
- the properties
LinePlotter
public LinePlotter()
- Default constructor.
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
BasicDrawingElement
s
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 1p2
- the domain value 2xValues
- 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.