Package org.knime.base.node.viz.plotter.basic

The idea behind the BasicPlotter is to provide a small fraction of the functionality known from "R" or "GnuPlot", if you have some basic elements, such as lines, ellipses, rectangles, you want to add to your view you can use the BasicPlotter.

See:
          Description

Class Summary
Basic2DDrawingElement This class is a specialization of the BasicDrawingElement by providing a flag whether the shape should be filled or not.
BasicDrawingElement A drawing element consists of points which are already mapped to the drawing pane's dimension.
BasicDrawingPane The BasicDrawingPane stores the BasicDrawingElements and paints them in the BasicDrawingPane.paintContent(Graphics) method by calling their #paint(Graphics2D) method.
BasicDrawingPaneImpl  
BasicEllipse Represents an ellipse defined by two points, the lower-left and the upper-right corner, different from normal Java graphics behavior!
BasicLine Represents a line by a list of points which are connected to one line.
BasicPlotter Tha BasicPlotter provides means to add some simple, basic graphical forms to the drawing pane, which are automatically mapped to the drawing pane's dimension.
BasicPlotterImpl  
BasicRectangle Represents a rectangle which is defined by two points, the upper-left and the lower-right corner as known from Java Graphics.
BasicText Represents a textline, the startpoint has to be set with the #addDomainValue(DataCellPoint).
DataCellPoint A DataCellPoint consists of two DataCells, one for the x and one for the y axis.
 

Package org.knime.base.node.viz.plotter.basic Description

The idea behind the BasicPlotter is to provide a small fraction of the functionality known from "R" or "GnuPlot", if you have some basic elements, such as lines, ellipses, rectangles, you want to add to your view you can use the BasicPlotter.

 
addLine(double[] yValues, Color color, Stroke stroke)
addLine(double[] xValues, double[] yValues, Color color, Stroke stroke)
addRectangle(double x, double y, int width, int height, Color color, Stroke stroke, boolean filled)
addEllipse(double xCenter, double yCenter, double width, double height, Color color, Stroke stroke, boolean filled)
The usage of the BasicPlotter methods only makes sense, if the the domain values of the elements are known but not the mapped values. One example is a scatter plot where you want to add a regression line. Here only the domain values of the line are known and can simply be added as a line to the plotter with the domain values. The BasicPlotter will map the domain values to the drawing pane's size. If you set preserve = true in the AbstractPlotter the existing ranges of the coordinates won't be adapted. If you set preserve to false, the ranges will be adapted if, for example, the added rectangle is larger than the existing range of the coordinates. Another possibility is to add a DataArray which will be visualized with a line connecting all values in the columns, where the row number is the x axis and the value of the column is painted at the y axis.
addLine(DataArray data, int columnIndex, Color color, Stroke stroke)
If you want to add a specific element to the BasicPlotter you can extend the BasicDrawingElement or the Basic2DDrawingElement (described below) with
addBasicDrawingElement(BasicDrawingElement element)

BasicDrawingElement and Basic2DDrawingElement

A BasicDrawingElement consists of a number of domain values and the referring mapped points, a color and a stroke. Whenever the size is changed, the BasicPlotter takes the domain values and maps them to the current drawing pane size. How the BasicDrawingElement is actually painted (depending on the given points) is defined in the paint method which is abstract. The Basic2DDrawingElement extends the BasicDrawingElement by holding a flag, whether the form should be filled or not. Thus, if you want to add, for example, a triangle you have to extend the Basic2DDrawingElement then assert that the given points are the left corner, the top and the right corner and define the paint method to connect the points or fill the shape.

BasicDrawingPane

You can add BasicDrawingElements to the BasicDrawingPane, get them and clear the BasicDrawingElements with the following methods:
addDrawingElement(BasicDrawingElement element)
getDrawingElements()
clearPlot()



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.