com.rapidminer.gui.plotter
Class PlotterAdapter

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 com.rapidminer.gui.plotter.PlotterAdapter
All Implemented Interfaces:
Plotter, Renderable, Reportable, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible
Direct Known Subclasses:
Abstract2DChartPlotter, AbstractPieChartPlotter, AndrewsCurves, BarChartPlotter, BoundDiagram, BubbleChartPlotter, ColorQuartileMatrixPlotter, ColorQuartilePlotter, DensityPlotter, DeviationChartPlotter, DistributionPlotter, HintonDiagram, HistogramChart, HistogramColorChart, JMathPlotter, MultipleScatterPlotter, MultipleSeriesChartPlotter, ParallelPlotter, ParallelPlotter2, ParetoChartPlotter, RadVizPlotter, ScatterMatrixPlotter, ScatterPlotter, SeriesChartPlotter, SimilarityKDistanceVisualization, SOMPlotter, SurveyPlotter

public abstract class PlotterAdapter
extends javax.swing.JPanel
implements Plotter

This adapter class can be used for simple plotter implementation which only need to overwrite the methods they need. Most method implementations are rather restrictive and need to be overwritten for the more sophisticated plotter possibilities. The complete plotting has to be done in the paintComponent(Graphics) method (which must be invoked by super.paintComponent in order to get the correct color schemes), plotter updates should be intitiated by invoking Component.repaint(). Subclasses should at least react to setDataTable(DataTable) in order to properly update the plotter. Another method usually overridden is setPlotColumn(int, boolean). Other overridden methods might include the methods for plot column and axis column handling.

Author:
Ingo Mierswa
See Also:
Serialized Form

Nested Class Summary
protected static class PlotterAdapter.EllipsoidPointStyle
          The point style that should be used for plotting points.
protected static class PlotterAdapter.LineColorIcon
          This icon is displayed before the columns to indicate the color and line style (as a legend or key).
protected static class PlotterAdapter.LineStyle
          The line style that should be used for plotting lines.
protected static class PlotterAdapter.LineStyleIcon
          This icon is displayed before the columns to indicate the color and line style (as a legend or key).
protected static interface PlotterAdapter.PointStyle
          The point style that should be used for plotting points.
protected static class PlotterAdapter.RectanglePointStyle
          The point style that should be used for plotting points.
protected static class PlotterAdapter.StarPointStyle
          The point style that should be used for plotting points.
protected static class PlotterAdapter.TriangularPointStyle
          The point style that should be used for plotting points.
protected static class PlotterAdapter.TurnedTriangularPointStyle
          The point style that should be used for plotting points.
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected static PlotterAdapter.PointStyle ELLIPSOID_POINT_STYLE
           
protected static java.awt.Color GRID_COLOR
           
protected static PlotterAdapter.PointStyle[] KNOWN_POINT_STYLES
           
static java.awt.Font LABEL_FONT
           
static java.awt.Font LABEL_FONT_BOLD
           
protected static java.awt.Color[] LINE_COLORS
           
protected static java.awt.Stroke[] LINE_STROKES
           
protected static javax.swing.Icon[] LINE_STYLE_ICONS
           
protected static PlotterAdapter.LineStyle[] LINE_STYLES
           
static int MARGIN
           
protected static PlotterAdapter.PointStyle[] POINT_STYLES
           
static double POINTSIZE
           
protected static PlotterAdapter.PointStyle RECTANGLE_POINT_STYLE
           
protected static PlotterAdapter.PointStyle STAR_POINT_STYLE
           
protected static java.awt.Color TOOLTIP_COLOR
           
protected static PlotterAdapter.PointStyle TRIANGUALAR_POINT_STYLE
           
protected static PlotterAdapter.PointStyle TURNED_TRIANGUALAR_POINT_STYLE
           
static int WEIGHT_BORDER_WIDTH
           
 
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 com.rapidminer.gui.plotter.Plotter
MULTIPLE_SELECTION, NO_SELECTION, SINGLE_SELECTION
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
PlotterAdapter()
           
 
Method Summary
 boolean canHandleContinousJittering()
          Indicates if the jittering can be handled continously.
 boolean canHandleJitter()
          Returns false.
 boolean canHandleZooming()
          Returns false.
 void dataTableUpdated(DataTable source)
          Invokes Component.repaint().
protected  void drawGenericNominalLegend(java.awt.Graphics graphics, java.lang.String[] names, PlotterAdapter.PointStyle[] pointStyles, java.awt.Color[] colors, int xOffset, int alpha)
           
protected  void drawLegend(java.awt.Graphics graphics, DataTable table, int legendColumn)
          This method can be used to draw a legend on the given graphics context.
protected  void drawLegend(java.awt.Graphics graphics, DataTable table, int legendColumn, int xOffset, int alpha)
          This method can be used to draw a legend on the given graphics context.
 void drawNumericalLegend(java.awt.Graphics graphics, int width, java.lang.String minColorString, java.lang.String maxColorString, int alpha)
          This method can be used to draw a legend on the given graphics context.
protected  void drawPoint(java.awt.Graphics2D g, double x, double y, java.awt.Color color, java.awt.Color borderColor)
          This helper method can be used to draw a point in the given graphics object.
protected  void drawPoint(java.awt.Graphics2D g, PlotterAdapter.PointStyle pointStyle, double x, double y, java.awt.Color color, java.awt.Color borderColor)
          This helper method can be used to draw a point in the given graphics object.
 void drawSimpleDateLegend(java.awt.Graphics graphics, int x, int y, DataTable table, int legendColumn, double min, double max)
           
 void drawSimpleNumericalLegend(java.awt.Graphics graphics, int x, int y, java.lang.String minColorString, java.lang.String maxColorString)
          This method can be used to draw a legend on the given graphics context.
protected  void drawToolTip(java.awt.Graphics2D g, ToolTip toolTip)
           
protected  void drawWeightRectangle(java.awt.Graphics2D newSpace, DataTable dataTable, int column, double maxWeight, int plotterSize)
           
 void finishRendering()
          Do nothing.
 void forcePlotGeneration()
          This default implementation does nothing.
 java.util.List<ParameterType> getAdditionalParameterKeys()
          The default implementation delivers an empty set.
 int getAxis(int axis)
          Returns -1.
 java.lang.String getAxisName(int index)
          Returns null.
 ColorProvider getColorProvider()
           
 javax.swing.Icon getIcon(int index)
          Returns a line icon depending on the index.
 java.lang.String getIdForPos(int x, int y)
          Returns null.
 int getInitialZoomFactor()
          Returns 1.
protected  double getMaxWeight(DataTable dataTable)
           
 int getNumberOfAxes()
          Returns 0.
protected  int getNumberOfPlots(DataTable table)
           
protected  double getNumericalTicSize(double min, double max)
           
 javax.swing.JComponent getOptionsComponent(int index)
          Returns null.
 java.util.List<ParameterType> getParameterTypes()
          Returns the list of parameter types supported by this plotter for setting from outside.
 boolean getPlotColumn(int dimension)
          Returns false.
 java.lang.String getPlotName()
          Returns null.
 javax.swing.JComponent getPlotter()
          Returns this.
 PlotterCondition getPlotterCondition()
          Returns a BasicPlotterCondition allowing for all DataTables.
 java.lang.String getPlotterName()
          Returns the name of this plotter.
protected  PlotterAdapter.PointStyle getPointStyle(int styleIndex)
           
 java.awt.geom.Point2D getPositionInDataSpace(java.awt.Point p)
          Returns null.
 java.awt.Dimension getPreferredSize()
           
 int getRenderHeight(int preferredHeight)
          This method return the pixel height the rendering needs
 int getRenderWidth(int preferredWidth)
          This method returns the pixel width the rendering needs
protected  double getTicSize(DataTable dataTable, int column, double min, double max)
           
 int getValuePlotSelectionType()
          Returns Plotter.SINGLE_SELECTION.
static java.awt.Color getWeightColor(double weight, double maxWeight)
          Returns a color for the given weight.
 boolean hasOptionsDialog()
          Returns false.
 boolean hasSaveImageButton()
          Returns false.
 boolean isProvidingCoordinates()
          Returns false.
 boolean isSaveable()
          Returns false.
 boolean isSupportingAbsoluteValues()
          Returns false.
 boolean isSupportingLogScale(int axis)
          Returns true if a log scale for this column is supported.
 boolean isSupportingLogScaleForPlotColumns()
          Returns true if a log scale for the plot columns is supported.
 boolean isSupportingSorting()
          Returns false.
 void paintComponent(java.awt.Graphics g)
          Invokes super method and sets correct color schemes.
 void prepareRendering()
          Invokes force plot generation.
 void render(java.awt.Graphics graphics, int width, int height)
          This method paints the visual representation onto the given graphics
 void save()
          Does nothing.
 void setAbsolute(boolean absolute)
          Does nothing.
 void setAdditionalParameter(java.lang.String key, java.lang.String value)
          The default implementation does nothing.
 void setAxis(int plotterAxis, int dimension)
          Does nothing.
 void setDataTable(DataTable dataTable)
          Does nothing.
 void setDragBounds(int x, int y, int w, int h)
          Does nothing.
 void setDrawRange(double x, double y, double w, double h)
          Does nothing.
 void setJitter(int jitter)
          Does nothing.
 void setKey(java.lang.String key)
          Does nothing.
 void setLogScale(int axis, boolean logScale)
          Sets if the given axis should be plotted with log scale.
 void setLogScaleForPlotColumns(boolean logScale)
          Sets if the plot columns should be plotted with log scale.
 void setMousePosInDataSpace(int mouseX, int mouseY)
          Does nothing.
 void setParameter(DataTable dataTable, java.lang.String key, java.lang.Object value)
          Sets the given parameter.
 void setPlotColumn(int dimension, boolean plot)
          Does nothing.
 void setSorting(boolean sorting)
          Does nothing.
 void setZooming(int zooming)
          Does nothing.
 void showOptionsDialog()
          Does nothing.
 void stopUpdates(boolean value)
          This default implementation does nothing.
 
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, 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, 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 com.rapidminer.gui.plotter.Plotter
addMouseListener, addMouseMotionListener
 

Field Detail

POINTSIZE

public static final double POINTSIZE
See Also:
Constant Field Values

MARGIN

public static final int MARGIN
See Also:
Constant Field Values

WEIGHT_BORDER_WIDTH

public static final int WEIGHT_BORDER_WIDTH
See Also:
Constant Field Values

LABEL_FONT_BOLD

public static final java.awt.Font LABEL_FONT_BOLD

LABEL_FONT

public static final java.awt.Font LABEL_FONT

GRID_COLOR

protected static final java.awt.Color GRID_COLOR

TOOLTIP_COLOR

protected static final java.awt.Color TOOLTIP_COLOR

ELLIPSOID_POINT_STYLE

protected static final PlotterAdapter.PointStyle ELLIPSOID_POINT_STYLE

RECTANGLE_POINT_STYLE

protected static final PlotterAdapter.PointStyle RECTANGLE_POINT_STYLE

TRIANGUALAR_POINT_STYLE

protected static final PlotterAdapter.PointStyle TRIANGUALAR_POINT_STYLE

TURNED_TRIANGUALAR_POINT_STYLE

protected static final PlotterAdapter.PointStyle TURNED_TRIANGUALAR_POINT_STYLE

STAR_POINT_STYLE

protected static final PlotterAdapter.PointStyle STAR_POINT_STYLE

LINE_COLORS

protected static final java.awt.Color[] LINE_COLORS

KNOWN_POINT_STYLES

protected static final PlotterAdapter.PointStyle[] KNOWN_POINT_STYLES

LINE_STROKES

protected static final java.awt.Stroke[] LINE_STROKES

LINE_STYLES

protected static final PlotterAdapter.LineStyle[] LINE_STYLES

POINT_STYLES

protected static final PlotterAdapter.PointStyle[] POINT_STYLES

LINE_STYLE_ICONS

protected static final javax.swing.Icon[] LINE_STYLE_ICONS
Constructor Detail

PlotterAdapter

public PlotterAdapter()
Method Detail

getPlotterName

public java.lang.String getPlotterName()
Description copied from interface: Plotter
Returns the name of this plotter.

Specified by:
getPlotterName in interface Plotter

forcePlotGeneration

public void forcePlotGeneration()
This default implementation does nothing. Subclasses might implement this method to enforce plotter generation for reporting / file writing.

Specified by:
forcePlotGeneration in interface Plotter

stopUpdates

public void stopUpdates(boolean value)
This default implementation does nothing. Subclasses might use this hint that graphical updates should not be performed until all settings are made.

Specified by:
stopUpdates in interface Plotter

paintComponent

public void paintComponent(java.awt.Graphics g)
Invokes super method and sets correct color schemes. Should be overwritten by children, but invokation of this super method must still be performed in order to get correct color schemes.

Overrides:
paintComponent in class javax.swing.JComponent

canHandleJitter

public boolean canHandleJitter()
Returns false. Subclasses should overwrite this method if they want to allow jittering. Subclasses overriding this method should also override setJitter(int).

Specified by:
canHandleJitter in interface Plotter

canHandleContinousJittering

public boolean canHandleContinousJittering()
Description copied from interface: Plotter
Indicates if the jittering can be handled continously.

Specified by:
canHandleContinousJittering in interface Plotter

canHandleZooming

public boolean canHandleZooming()
Returns false. Subclasses should overwrite this method if they want to allow zooming. Subclasses overriding this method should also override setZooming(int).

Specified by:
canHandleZooming in interface Plotter

getAxis

public int getAxis(int axis)
Returns -1. Subclasses overriding this method should also override getAxisName(int), setAxis(int, int), and getNumberOfAxes().

Specified by:
getAxis in interface Plotter

getAxisName

public java.lang.String getAxisName(int index)
Returns null. Subclasses overriding this method should also override getAxis(int), setAxis(int, int), and getNumberOfAxes().

Specified by:
getAxisName in interface Plotter

getIcon

public javax.swing.Icon getIcon(int index)
Returns a line icon depending on the index.

Specified by:
getIcon in interface Plotter

getIdForPos

public java.lang.String getIdForPos(int x,
                                    int y)
Returns null. Subclasses which are able to derive a point from a mouse position should return a proper Id which can be used for object visualizers.

Specified by:
getIdForPos in interface Plotter

getInitialZoomFactor

public int getInitialZoomFactor()
Returns 1. Subclasses might want to deliver another initial zoom factor between 1 and 100.

Specified by:
getInitialZoomFactor in interface Plotter

getNumberOfAxes

public int getNumberOfAxes()
Returns 0. Subclasses overriding this method should also override getAxisName(int), setAxis(int, int), and getAxis(int).

Specified by:
getNumberOfAxes in interface Plotter

getOptionsComponent

public javax.swing.JComponent getOptionsComponent(int index)
Returns null. Subclasses might override this method in order to provide additional option components.

Specified by:
getOptionsComponent in interface Plotter

getPlotColumn

public boolean getPlotColumn(int dimension)
Returns false. Subclasses should override this method and return true for the columns which should be plotted.

Specified by:
getPlotColumn in interface Plotter

getPlotName

public java.lang.String getPlotName()
Returns null. Subclasses might return another name more fitting the plot selection box or list.

Specified by:
getPlotName in interface Plotter

getPlotter

public javax.swing.JComponent getPlotter()
Returns this. Subclasses which do not want to use this object (JPanel) for plotting should directly implement Plotter.

Specified by:
getPlotter in interface Plotter

getPlotterCondition

public PlotterCondition getPlotterCondition()
Returns a BasicPlotterCondition allowing for all DataTables. Subclasses should override this method in order to indicate that they might not be able to handle certain data tables.

Specified by:
getPlotterCondition in interface Plotter

getPositionInDataSpace

public java.awt.geom.Point2D getPositionInDataSpace(java.awt.Point p)
Returns null. Subclasses which are able to calculate the position in data space from a position in screen space should return the proper position. Please note that you have to override the method isProvidingCoordinates(), too.

Specified by:
getPositionInDataSpace in interface Plotter

getValuePlotSelectionType

public int getValuePlotSelectionType()
Returns Plotter.SINGLE_SELECTION. Subclasses might override this method and return Plotter.NO_SELECTION or Plotter.MULTIPLE_SELECTION.

Specified by:
getValuePlotSelectionType in interface Plotter

hasOptionsDialog

public boolean hasOptionsDialog()
Returns false. Subclasses should override this method if they want to provide an options dialog.

Specified by:
hasOptionsDialog in interface Plotter

hasSaveImageButton

public boolean hasSaveImageButton()
Returns false. Subclasses might want to indicate that this plotter has an save (export) image button of its own by returning true.

Specified by:
hasSaveImageButton in interface Plotter

isProvidingCoordinates

public boolean isProvidingCoordinates()
Returns false. Subclasses might override this method in order to indicate that this plotter is able to deliver plot coordinates. Please note that overriding subclasses should also override getPositionInDataSpace(Point).

Specified by:
isProvidingCoordinates in interface Plotter

isSaveable

public boolean isSaveable()
Returns false. Subclasses might want to override this method to indicate that they are able to save the data into a file. In this case, the method save() should also be overridden.

Specified by:
isSaveable in interface Plotter

save

public void save()
Does nothing. Please note that subclasses which want to allow saving should also override the method isSaveable().

Specified by:
save in interface Plotter

setAxis

public void setAxis(int plotterAxis,
                    int dimension)
Does nothing. Subclasses overriding this method should also override getAxis(int), getAxisName(int), and getNumberOfAxes().

Specified by:
setAxis in interface Plotter

setDragBounds

public void setDragBounds(int x,
                          int y,
                          int w,
                          int h)
Does nothing. Can be used for setting the current drag bounds in screen space.

Specified by:
setDragBounds in interface Plotter

setDrawRange

public void setDrawRange(double x,
                         double y,
                         double w,
                         double h)
Does nothing. Subclasses might override this method if they want to allow setting the actual draw range which might be different from the data range.

Specified by:
setDrawRange in interface Plotter

setJitter

public void setJitter(int jitter)
Does nothing. Subclasses should overwrite this method if they want to allow jittering. Subclasses overriding this method should also override canHandleJitter().

Specified by:
setJitter in interface Plotter

setKey

public void setKey(java.lang.String key)
Does nothing. Subclasses might override this method if they want to allow a key (legend).

Specified by:
setKey in interface Plotter

setMousePosInDataSpace

public void setMousePosInDataSpace(int mouseX,
                                   int mouseY)
Does nothing. This method might be used by subclasses if they want to react on mouse moves, e.g. by showing tool tips.

Specified by:
setMousePosInDataSpace in interface Plotter

setPlotColumn

public void setPlotColumn(int dimension,
                          boolean plot)
Does nothing. Subclasses should override this method if they want to allow plot column selection. In this case, the method getPlotColumn(int) should also be overriden.

Specified by:
setPlotColumn in interface Plotter

setDataTable

public void setDataTable(DataTable dataTable)
Does nothing.

Specified by:
setDataTable in interface Plotter

setZooming

public void setZooming(int zooming)
Does nothing. Subclasses should overwrite this method if they want to allow zooming. Subclasses overriding this method should also override canHandleZooming().

Specified by:
setZooming in interface Plotter

showOptionsDialog

public void showOptionsDialog()
Does nothing. Subclasses might implement this method in order to provide an options dialog.

Specified by:
showOptionsDialog in interface Plotter

isSupportingLogScale

public boolean isSupportingLogScale(int axis)
Returns true if a log scale for this column is supported. The default implementation returns false.

Specified by:
isSupportingLogScale in interface Plotter

isSupportingLogScaleForPlotColumns

public boolean isSupportingLogScaleForPlotColumns()
Returns true if a log scale for the plot columns is supported. The default implementation returns false.

Specified by:
isSupportingLogScaleForPlotColumns in interface Plotter

setLogScale

public void setLogScale(int axis,
                        boolean logScale)
Sets if the given axis should be plotted with log scale. The default implementation does nothing.

Specified by:
setLogScale in interface Plotter

setLogScaleForPlotColumns

public void setLogScaleForPlotColumns(boolean logScale)
Sets if the plot columns should be plotted with log scale. The default implementation does nothing.

Specified by:
setLogScaleForPlotColumns in interface Plotter

isSupportingAbsoluteValues

public boolean isSupportingAbsoluteValues()
Returns false.

Specified by:
isSupportingAbsoluteValues in interface Plotter

isSupportingSorting

public boolean isSupportingSorting()
Returns false.

Specified by:
isSupportingSorting in interface Plotter

setAbsolute

public void setAbsolute(boolean absolute)
Does nothing.

Specified by:
setAbsolute in interface Plotter

setSorting

public void setSorting(boolean sorting)
Does nothing.

Specified by:
setSorting in interface Plotter

dataTableUpdated

public final void dataTableUpdated(DataTable source)
Invokes Component.repaint(). Will be invoked since all plotters are DataTableListeners.


getColorProvider

public ColorProvider getColorProvider()

getPointStyle

protected PlotterAdapter.PointStyle getPointStyle(int styleIndex)

drawPoint

protected void drawPoint(java.awt.Graphics2D g,
                         double x,
                         double y,
                         java.awt.Color color,
                         java.awt.Color borderColor)
This helper method can be used to draw a point in the given graphics object.


drawPoint

protected void drawPoint(java.awt.Graphics2D g,
                         PlotterAdapter.PointStyle pointStyle,
                         double x,
                         double y,
                         java.awt.Color color,
                         java.awt.Color borderColor)
This helper method can be used to draw a point in the given graphics object.


drawLegend

protected void drawLegend(java.awt.Graphics graphics,
                          DataTable table,
                          int legendColumn)
This method can be used to draw a legend on the given graphics context.


drawLegend

protected void drawLegend(java.awt.Graphics graphics,
                          DataTable table,
                          int legendColumn,
                          int xOffset,
                          int alpha)
This method can be used to draw a legend on the given graphics context.


drawNumericalLegend

public void drawNumericalLegend(java.awt.Graphics graphics,
                                int width,
                                java.lang.String minColorString,
                                java.lang.String maxColorString,
                                int alpha)
This method can be used to draw a legend on the given graphics context.


drawSimpleNumericalLegend

public void drawSimpleNumericalLegend(java.awt.Graphics graphics,
                                      int x,
                                      int y,
                                      java.lang.String minColorString,
                                      java.lang.String maxColorString)
This method can be used to draw a legend on the given graphics context.


drawSimpleDateLegend

public void drawSimpleDateLegend(java.awt.Graphics graphics,
                                 int x,
                                 int y,
                                 DataTable table,
                                 int legendColumn,
                                 double min,
                                 double max)

drawGenericNominalLegend

protected void drawGenericNominalLegend(java.awt.Graphics graphics,
                                        java.lang.String[] names,
                                        PlotterAdapter.PointStyle[] pointStyles,
                                        java.awt.Color[] colors,
                                        int xOffset,
                                        int alpha)

drawToolTip

protected void drawToolTip(java.awt.Graphics2D g,
                           ToolTip toolTip)

getNumberOfPlots

protected int getNumberOfPlots(DataTable table)

getTicSize

protected double getTicSize(DataTable dataTable,
                            int column,
                            double min,
                            double max)

getNumericalTicSize

protected double getNumericalTicSize(double min,
                                     double max)

getMaxWeight

protected double getMaxWeight(DataTable dataTable)

getWeightColor

public static java.awt.Color getWeightColor(double weight,
                                            double maxWeight)
Returns a color for the given weight. If weight or maxWeight are Double.NaN, just Color.white will be returned.


drawWeightRectangle

protected void drawWeightRectangle(java.awt.Graphics2D newSpace,
                                   DataTable dataTable,
                                   int column,
                                   double maxWeight,
                                   int plotterSize)

getPreferredSize

public java.awt.Dimension getPreferredSize()
Overrides:
getPreferredSize in class javax.swing.JComponent

prepareRendering

public void prepareRendering()
Invokes force plot generation.

Specified by:
prepareRendering in interface Renderable

finishRendering

public void finishRendering()
Do nothing.

Specified by:
finishRendering in interface Renderable

getRenderHeight

public int getRenderHeight(int preferredHeight)
Description copied from interface: Renderable
This method return the pixel height the rendering needs

Specified by:
getRenderHeight in interface Renderable
Parameters:
preferredHeight - tells the renderable of the size it should deliver best
Returns:
the pixel height

getRenderWidth

public int getRenderWidth(int preferredWidth)
Description copied from interface: Renderable
This method returns the pixel width the rendering needs

Specified by:
getRenderWidth in interface Renderable
Parameters:
preferredWidth - tells the renderable of the size it should deliver best
Returns:
the pixel width

render

public void render(java.awt.Graphics graphics,
                   int width,
                   int height)
Description copied from interface: Renderable
This method paints the visual representation onto the given graphics

Specified by:
render in interface Renderable
Parameters:
graphics - the graphics to render onto

setParameter

public void setParameter(DataTable dataTable,
                         java.lang.String key,
                         java.lang.Object value)
Description copied from interface: Plotter
Sets the given parameter.

Specified by:
setParameter in interface Plotter

getAdditionalParameterKeys

public java.util.List<ParameterType> getAdditionalParameterKeys()
The default implementation delivers an empty set.


setAdditionalParameter

public void setAdditionalParameter(java.lang.String key,
                                   java.lang.String value)
The default implementation does nothing.


getParameterTypes

public java.util.List<ParameterType> getParameterTypes()
Description copied from interface: Plotter
Returns the list of parameter types supported by this plotter for setting from outside.

Specified by:
getParameterTypes in interface Plotter


Copyright © 2001-2009 by Rapid-I