org.knime.base.node.viz.plotter
Class AbstractPlotter

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
All Implemented Interfaces:
ComponentListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, HiLiteListener
Direct Known Subclasses:
AbstractHistogramPlotter, BasicPlotter, BinModelPlotter, PiePlotter

public abstract class AbstractPlotter
extends JPanel
implements HiLiteListener, ComponentListener

Provides functionality for zooming, moving and selection and is designed to be extended. For this purpose it provides means to support hiliting, creating the x and y Axis and get the mapped values for a given DataCell, whose values lies within the domain used to create the axes.

The plotter consists of a drawing pane and a properties panel which can be accessed. The size of each is adapted automatically. The plotter relies on an object implementing the DataProvider to access the data to visualize.

The two most important methods are updatePaintModel() and updateSize(). The former is called whenever the data to visualize might have changed, the latter is called when the size of the plotter has changed. In some cases this means no difference since the mapping of the data to the screen coordinates has to be done anyway, but if there are other things specific to the data to be visualized the updatePaintModel() is the correct place to access and display it.

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

Nested Class Summary
 class AbstractPlotter.MovingMouseListener
          When the drawing pane is larger then the viewport for it, this mouse listener realizes the possibility to drag the drawing pane inside the viewport.
 class AbstractPlotter.SelectionMouseListener
          The selection mouse listener checks the selection status, that is, if the mouse was dragged, the CTRL key is pressed and so on and calls the appropriate methods in the AbstractPlotter.
 class AbstractPlotter.ZoomMouseListener
          Realizes the zooming behaviour, when the mouse is clicked it calls the zoomByClick(Point), when the mouse is dragged the zoomByWindow(Rectangle) is called.
 
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 double DEFAULT_ZOOM_FACTOR
          The default zoom factor.
static String FADE_UNHILITED
          Constant for "Fade unhilited" menu entry.
static String HIDE_UNHILITED
          Constant for "show hilited only" menu entry.
static String SHOW_ALL
          Constant for the menu entry "show all".
static String SHOW_HIDE
          Constant for the show/hide menu title.
 
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
AbstractPlotter(AbstractDrawingPane drawingPane, AbstractPlotterProperties properties)
          Creates a new plotter with a drawing pane and a properties panel.
 
Method Summary
 void addMouseListener(PlotterMouseListener listener)
          If an additional mouse mode should be supported, extend the PlotterMouseListener and add it.
abstract  void clearSelection()
          Clears current selection.
 void componentHidden(ComponentEvent e)
          
 void componentMoved(ComponentEvent e)
          
 void componentResized(ComponentEvent e)
          Resizes the axes and calls updateSize(), the drawing pane is adapted to the new space only if the size is increased.
 void componentShown(ComponentEvent e)
          
 void createNominalXCoordinate(Set<DataCell> values)
          Creates a nominal x axis.
 void createNominalYCoordinate(Set<DataCell> values)
          Creates a nominal y axis.
 void createXCoordinate(double min, double max)
          Recalculates the domain of the x axis.
 void createXCoordinate(int min, int max)
          Recalculates the domain of the x axis.
 void createYCoordinate(double min, double max)
          Recalculates the domain of the y axis.
 void delegateAddHiLiteListener(HiLiteListener listener)
          Delegates the listener to the hilite handler.
 Set<RowKey> delegateGetHiLitKeys()
          Delegates to the hilite handler.
 void delegateHiLite(RowKey... ids)
          Delegates to the hilite handler.
 void delegateHiLite(Set<RowKey> ids)
          Delegates to the hilite handler.
 boolean delegateIsHiLit(RowKey... ids)
          delegates to the hilite handler.
 boolean delegateIsHiLit(Set<RowKey> ids)
          Delegates to the hilite handler.
 void delegateRemoveAllHiLiteListeners()
          Delegates to the hilite handler.
 void delegateRemoveHiLiteListener(HiLiteListener listener)
           
 void delegateUnHiLite(RowKey... ids)
          Delegates to the hilite handler.
 void delegateUnHiLite(Set<RowKey> ids)
          Delegates to the hilite handler.
 void delegateUnHiLiteAll()
          Delegates the unhilite all command to the hilite handler.
 void dispose()
          Notifies the plotter that it is not needed any more and can clean up all data and references it holds.
 void fillPopupMenu(JPopupMenu popupMenu)
          Fills the popup menu with (additional) elements.
 void fitToScreen()
          Fits to screen, that is it resizes the drawing pane to fit into the plotters dimension.
 Action getClearHiliteAction()
          This action calls delegateUnHiLiteAll(), if it is overridden take care to not return null since it might be called also when the getHiLiteMenu() returns null.
 PlotterMouseListener getCurrentMouseListener()
           
 int getDataArrayIdx()
           
 DataProvider getDataProvider()
           
 AbstractDrawingPane getDrawingPane()
           
 Dimension getDrawingPaneDimension()
           
 Action getHiliteAction()
          This action calls hiLiteSelected(), if it is overridden take care to not return null since it might be called also when the getHiLiteMenu() returns null.
 JMenu getHiLiteMenu()
          Returns the hilite menu displayed in the NodeView's menu bar.
protected  int getMappedXValue(DataCell x)
           
protected  int getMappedYValue(DataCell y)
           
 AbstractPlotterProperties getProperties()
           
 double getScreenYCoordinate(double y)
           
 Action getUnhiliteAction()
          This action calls unHiLiteSelected(), if it is overridden take care to not return null since it might be called also when the getHiLiteMenu() returns null.
 Axis getXAxis()
           
 Axis getYAxis()
           
abstract  void hiLite(KeyEvent event)
          Invoked when some item(s) were hilit.
abstract  void hiLiteSelected()
          Is called from the menu entry hilite selected.
 void removeMouseListener(Class<? extends PlotterMouseListener> listener)
          If one of the default mouse modes (selection, zooming, moving) should not be available, use this method to remove it.
abstract  void reset()
          Reset all local data which depends on the input data provided by the data provider.
abstract  void selectClickedElement(Point clicked)
          Implementing classes mayxselect the elements depending on the clicked position.
abstract  void selectElementsIn(Rectangle selectionRectangle)
          Implementing classes may select the elements in the selection rectangle obtained from the mouse dragging in selection mode.
 void setAntialiasing(boolean doAntialiasing)
          Turns antialiasing on (true) or off (false).
 void setDataArrayIdx(int dataArrayIdx)
           
 void setDataProvider(DataProvider provider)
           
 void setHeight(int height)
          Sets the height for the drawing pane.
 void setHiLiteHandler(HiLiteHandler handler)
           
 void setPreserve(boolean preserve)
           
 void setXAxis(Axis xAxis)
           
 void setYAxis(Axis yAxis)
           
abstract  void unHiLite(KeyEvent event)
          Invoked when some item(s) were unhilit.
abstract  void unHiLiteSelected()
          Is called by the menu entry unhilite selected.
 void updateAxisLength()
          Sets the size of the axes to the dimension of the drawing pane.
abstract  void updatePaintModel()
          Do the mapping from the models data to screen coordinates here and pass the visualization model to the drawing pane.
abstract  void updateSize()
          Whenever the size of the drawing pane is changed (zooming, resizing) this method is called in order to update the painting.
protected  void zoomByClick(Point clicked)
          Zooms the content of the drawing pane with the point clicked in center.
protected  void zoomByWindow(Rectangle draggedRectangle)
          Zooms the content of the drawing pane to the dragged rectangle.
 
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
 
Methods inherited from interface org.knime.core.node.property.hilite.HiLiteListener
unHiLiteAll
 

Field Detail

DEFAULT_ZOOM_FACTOR

public static final double DEFAULT_ZOOM_FACTOR
The default zoom factor.

See Also:
Constant Field Values

HIDE_UNHILITED

public static final String HIDE_UNHILITED
Constant for "show hilited only" menu entry.

See Also:
Constant Field Values

SHOW_ALL

public static final String SHOW_ALL
Constant for the menu entry "show all".

See Also:
Constant Field Values

FADE_UNHILITED

public static final String FADE_UNHILITED
Constant for "Fade unhilited" menu entry.

See Also:
Constant Field Values

SHOW_HIDE

public static final String SHOW_HIDE
Constant for the show/hide menu title.

See Also:
Constant Field Values
Constructor Detail

AbstractPlotter

public AbstractPlotter(AbstractDrawingPane drawingPane,
                       AbstractPlotterProperties properties)
Creates a new plotter with a drawing pane and a properties panel. The listener to the default properties (selection, zooming, moving, fit to screen) are registered.

Parameters:
drawingPane - the drawing pane
properties - the properties panel
Method Detail

getDrawingPaneDimension

public Dimension getDrawingPaneDimension()
Returns:
the actual dimension of the drawing pane.

zoomByWindow

protected void zoomByWindow(Rectangle draggedRectangle)
Zooms the content of the drawing pane to the dragged rectangle.

Parameters:
draggedRectangle - the dragged rectangle

zoomByClick

protected void zoomByClick(Point clicked)
Zooms the content of the drawing pane with the point clicked in center.

Parameters:
clicked - the point clicked becomes center.

fitToScreen

public final void fitToScreen()
Fits to screen, that is it resizes the drawing pane to fit into the plotters dimension.


componentResized

public final void componentResized(ComponentEvent e)
Resizes the axes and calls updateSize(), the drawing pane is adapted to the new space only if the size is increased.

Specified by:
componentResized in interface ComponentListener
Parameters:
e - the resize event

setHeight

public void setHeight(int height)
Sets the height for the drawing pane.

Parameters:
height - the height to set for the plotter

updateAxisLength

public void updateAxisLength()
Sets the size of the axes to the dimension of the drawing pane.


removeMouseListener

public void removeMouseListener(Class<? extends PlotterMouseListener> listener)
If one of the default mouse modes (selection, zooming, moving) should not be available, use this method to remove it. It will then not appear in the mouse mode selection box.

Parameters:
listener - the class of the listener to be removed.

getCurrentMouseListener

public PlotterMouseListener getCurrentMouseListener()
Returns:
the currently selected mouse listener.

addMouseListener

public void addMouseListener(PlotterMouseListener listener)
If an additional mouse mode should be supported, extend the PlotterMouseListener and add it. It will then appear in the mouse mode selection box displayed with the value of the toString() method.

Parameters:
listener - the listener to add.

setAntialiasing

public void setAntialiasing(boolean doAntialiasing)
Turns antialiasing on (true) or off (false).

Parameters:
doAntialiasing - true for antialiasing enabled, false otherwise.

getXAxis

public Axis getXAxis()
Returns:
the x axis.

setXAxis

public void setXAxis(Axis xAxis)
Parameters:
xAxis - the x axis to set for the drawing pane

getYAxis

public Axis getYAxis()
Returns:
the y axis.

setYAxis

public void setYAxis(Axis yAxis)
Parameters:
yAxis - the y axis to set for the drawing pane

setDataProvider

public void setDataProvider(DataProvider provider)
Parameters:
provider - the data provider.

getDataProvider

public DataProvider getDataProvider()
Returns:
the data provider.

getDataArrayIdx

public int getDataArrayIdx()
Returns:
the dataArrayIdx

setDataArrayIdx

public void setDataArrayIdx(int dataArrayIdx)
Parameters:
dataArrayIdx - the dataArrayIdx to set

getDrawingPane

public AbstractDrawingPane getDrawingPane()
Returns:
the drawing pane

getProperties

public AbstractPlotterProperties getProperties()
Returns:
the properties panel

getHiliteAction

public Action getHiliteAction()
This action calls hiLiteSelected(), if it is overridden take care to not return null since it might be called also when the getHiLiteMenu() returns null. If no hilite behavior should be implemented either let the hiLiteSelected() empty (recommended) or override this method by returning an empty action.

Returns:
the menu entry for hilite

getUnhiliteAction

public Action getUnhiliteAction()
This action calls unHiLiteSelected(), if it is overridden take care to not return null since it might be called also when the getHiLiteMenu() returns null. If no hilite behavior should be implemented either let the unHiLiteSelected() empty (recommended) or override this method by returning an empty action.

Returns:
the menu entry for unhilite

getClearHiliteAction

public Action getClearHiliteAction()
This action calls delegateUnHiLiteAll(), if it is overridden take care to not return null since it might be called also when the getHiLiteMenu() returns null. If not hilite behavior should be implemented override this method by returning an empty action (not recommended).

Returns:
the menu entry for clear hilite

fillPopupMenu

public void fillPopupMenu(JPopupMenu popupMenu)
Fills the popup menu with (additional) elements. In this class the hilite, unhilite and clear hilite actions are added.

Parameters:
popupMenu - the popup menu to fill.

getHiLiteMenu

public JMenu getHiLiteMenu()
Returns the hilite menu displayed in the NodeView's menu bar. In this class the hilite, unhilite and clear hilite actions are added. This method is called in the DefaultVisualizationNodeView if it is not null, i.e. if an extending plotter doesn't support hiliting override this method by returning null.

Returns:
the filled menu for the NodeView's menu bar.

hiLite

public abstract void hiLite(KeyEvent event)
Invoked when some item(s) were hilit.

Specified by:
hiLite in interface HiLiteListener
Parameters:
event - contains a list of row keys that were hilit

unHiLite

public abstract void unHiLite(KeyEvent event)
Invoked when some item(s) were unhilit.

Specified by:
unHiLite in interface HiLiteListener
Parameters:
event - contains a list of row keys that were unhilit

unHiLiteSelected

public abstract void unHiLiteSelected()
Is called by the menu entry unhilite selected. Should unhilite selected elements.


hiLiteSelected

public abstract void hiLiteSelected()
Is called from the menu entry hilite selected. Should hilite selected elements.


delegateUnHiLiteAll

public void delegateUnHiLiteAll()
Delegates the unhilite all command to the hilite handler.


setHiLiteHandler

public void setHiLiteHandler(HiLiteHandler handler)
Parameters:
handler - a new hilite handler

delegateAddHiLiteListener

public void delegateAddHiLiteListener(HiLiteListener listener)
Delegates the listener to the hilite handler.

Parameters:
listener - the listener

delegateGetHiLitKeys

public Set<RowKey> delegateGetHiLitKeys()
Delegates to the hilite handler.

Returns:
the hilited keys.
See Also:
HiLiteHandler.getHiLitKeys()

delegateHiLite

public void delegateHiLite(RowKey... ids)
Delegates to the hilite handler.

Parameters:
ids - the keys to be hilited.
See Also:
HiLiteHandler.fireHiLiteEvent( RowKey...)

delegateHiLite

public void delegateHiLite(Set<RowKey> ids)
Delegates to the hilite handler.

Parameters:
ids - the keys to be hilited
See Also:
HiLiteHandler.fireHiLiteEvent( java.util.Set)

delegateIsHiLit

public boolean delegateIsHiLit(RowKey... ids)
delegates to the hilite handler.

Parameters:
ids - the ids to be checked.
Returns:
true if all passed keys are hilited
See Also:
HiLiteHandler.isHiLit( RowKey...)

delegateIsHiLit

public boolean delegateIsHiLit(Set<RowKey> ids)
Delegates to the hilite handler.

Parameters:
ids - the ids to be checked.
Returns:
true if all passed keys are hilited
See Also:
HiLiteHandler.isHiLit( RowKey...)

delegateRemoveAllHiLiteListeners

public void delegateRemoveAllHiLiteListeners()
Delegates to the hilite handler.

See Also:
#removeAllHiLiteListeners()

delegateRemoveHiLiteListener

public void delegateRemoveHiLiteListener(HiLiteListener listener)
Parameters:
listener - the listener to be removed.
See Also:
#removeHiLiteListener(org.knime.core.node.property.hilite.HiLiteListener)

delegateUnHiLite

public void delegateUnHiLite(RowKey... ids)
Delegates to the hilite handler.

Parameters:
ids - the ids to be unhilited.
See Also:
#fireUnHiLiteEvent(RowKey...)

delegateUnHiLite

public void delegateUnHiLite(Set<RowKey> ids)
Delegates to the hilite handler.

Parameters:
ids - the ids to be unhilited.
See Also:
HiLiteHandler.fireUnHiLiteEvent( java.util.Set)

selectElementsIn

public abstract void selectElementsIn(Rectangle selectionRectangle)
Implementing classes may select the elements in the selection rectangle obtained from the mouse dragging in selection mode.

Parameters:
selectionRectangle - the selection rectangle from the dragged mouse in selection mode

selectClickedElement

public abstract void selectClickedElement(Point clicked)
Implementing classes mayxselect the elements depending on the clicked position. This method is called only when the element should be selected, that is, it is already determined whether the CTRL key is pressed or not.

Parameters:
clicked - the clicked point

clearSelection

public abstract void clearSelection()
Clears current selection.


updateSize

public abstract void updateSize()
Whenever the size of the drawing pane is changed (zooming, resizing) this method is called in order to update the painting.


updatePaintModel

public abstract void updatePaintModel()
Do the mapping from the models data to screen coordinates here and pass the visualization model to the drawing pane.


reset

public abstract void reset()
Reset all local data which depends on the input data provided by the data provider.


dispose

public void dispose()
Notifies the plotter that it is not needed any more and can clean up all data and references it holds.


setPreserve

public void setPreserve(boolean preserve)
Parameters:
preserve - true if old min max values of the axes should be preserved, false otherwise.

getMappedXValue

protected int getMappedXValue(DataCell x)
Parameters:
x - domain value
Returns:
mapped value

getMappedYValue

protected int getMappedYValue(DataCell y)
Parameters:
y - domain value
Returns:
mapped value

createYCoordinate

public void createYCoordinate(double min,
                              double max)
Recalculates the domain of the y axis. If preserve is set to false the passed values are taken as min and max no matter was was set before. If preserve is set to true (default) the possibly already available min and max values are preserved.

Parameters:
min - the min value
max - the max value setPreserve(boolean)

createXCoordinate

public void createXCoordinate(double min,
                              double max)
Recalculates the domain of the x axis. If preserve is set to false the passed values are taken as min and max no matter was was set before. If preserve is set to true (default) the possibly already available min and max values are preserved.

Parameters:
min - the min value
max - the max value setPreserve(boolean)

createXCoordinate

public void createXCoordinate(int min,
                              int max)
Recalculates the domain of the x axis. If preserve is set to false the passed values are taken as min and max no matter was was set before. If preserve is set to true (default) the possibly already available min and max values are preserved.

Parameters:
min - the min value
max - the max value setPreserve(boolean)

createNominalXCoordinate

public void createNominalXCoordinate(Set<DataCell> values)
Creates a nominal x axis.

Parameters:
values - the possible values.

createNominalYCoordinate

public void createNominalYCoordinate(Set<DataCell> values)
Creates a nominal y axis.

Parameters:
values - the possible values.

getScreenYCoordinate

public final double getScreenYCoordinate(double y)
Parameters:
y - the mapped y value
Returns:
the y value but counted from bottom.

componentHidden

public void componentHidden(ComponentEvent e)

Specified by:
componentHidden in interface ComponentListener

componentMoved

public void componentMoved(ComponentEvent e)

Specified by:
componentMoved in interface ComponentListener

componentShown

public void componentShown(ComponentEvent e)

Specified by:
componentShown in interface ComponentListener


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.