|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.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
public abstract class 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. It may be used in the cases, where only the domain values for
these forms are known. There are some possibilities to add these basic forms
directly:
addEllipse(double, double, double, double, Color, Stroke, boolean)
,
addLine(double[], Color, Stroke)
,
addRectangle(double, double, double, double,Color, Stroke, boolean)
,
addText(String, DataCell, DataCell, Color)
. If some other forms are
needed, the
BasicDrawingElement
may be
extended and added with the
addBasicDrawingElement(BasicDrawingElement)
.
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 |
---|
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 | |
---|---|
BasicPlotter()
Constructs a plotter with a BasicDrawingPane and the
AbstractPlotterProperties . |
|
BasicPlotter(AbstractDrawingPane panel,
AbstractPlotterProperties properties)
Always provide a possibility to construct a customized plotter. |
Method Summary | |
---|---|
void |
addBasicDrawingElement(BasicDrawingElement element)
Adds a drawing element to the drawing pane. |
void |
addEllipse(double xCenter,
double yCenter,
double width,
double height,
Color color,
Stroke stroke,
boolean filled)
Adds an ellipse with the center point (!) and the height width. |
void |
addLine(DataArray table,
int colIdx,
Color color,
Stroke stroke)
Deprecated. use addLine(DataArray, int, int, Color, Stroke)
instead |
void |
addLine(DataArray table,
int xIdx,
int yIdx,
Color color,
Stroke stroke)
Plots the column in the table specified by the column index as a line plot. |
void |
addLine(double[] y,
Color color,
Stroke stroke)
Paints the values in the double array as y-values and the x-values are simply the position in the array, which implies, that the y-values are equidistant. |
void |
addLine(double[] x,
double[] y,
Color color,
Stroke stroke)
Adds a line based on the points defined by the x and y values in the referring double arrays. |
void |
addRectangle(double x,
double y,
double width,
double height,
Color color,
Stroke stroke,
boolean filled)
Adds a rectangle defined by the upper-left corner and the width and height. |
void |
addText(String text,
DataCell x,
DataCell y,
Color color)
Adds a text at the position defined by the values of the both DataCell s (lower-left corner). |
void |
reset()
Reset all local data which depends on the input data provided by the data provider. |
void |
updateSize()
Updates the size by mapping the domain values of the BasicDrawingElement s
to the drawing pane's dimension. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
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 |
Constructor Detail |
---|
public BasicPlotter(AbstractDrawingPane panel, AbstractPlotterProperties properties)
panel
- the drawing paneproperties
- the propertiespublic BasicPlotter()
BasicDrawingPane
and the
AbstractPlotterProperties
.
Method Detail |
---|
public void reset()
reset
in class AbstractPlotter
public void addLine(DataArray table, int xIdx, int yIdx, Color color, Stroke stroke)
table
- the table containing the data to be plotted.xIdx
- - the x column index specifying the data to be plotted.yIdx
- - the x column index specifying the data to be plotted.color
- the color of the line (may be null)stroke
- the stroke of the line (may be null)@Deprecated public void addLine(DataArray table, int colIdx, Color color, Stroke stroke)
addLine(DataArray, int, int, Color, Stroke)
instead
table
- the table containing the data to be plotted.colIdx
- - the column index specifying the data to be plotted.color
- the color of the line (may be null)stroke
- the stroke of the line (may be null)public void addLine(double[] y, Color color, Stroke stroke)
null
, then the
default values for them are used (the currently set color and stroke in
the graphics object).
y
- the equidistant y valuescolor
- color of the line, might be null
, then the
default color is usedstroke
- stroke of the line, might be null
, then the
default stroke is usedpublic void addLine(double[] x, double[] y, Color color, Stroke stroke)
x
- the x coordinates (not mapped)y
- the y coordinates (not mapped)color
- the colorstroke
- the strokepublic void addEllipse(double xCenter, double yCenter, double width, double height, Color color, Stroke stroke, boolean filled)
xCenter
- xyCenter
- ywidth
- widthheight
- heightcolor
- colorstroke
- strokefilled
- true if the ellipse should be filled.public void addRectangle(double x, double y, double width, double height, Color color, Stroke stroke, boolean filled)
x
- xy
- ywidth
- widthheight
- heightcolor
- colorstroke
- strokefilled
- true if the rectangle should be filled.public void addText(String text, DataCell x, DataCell y, Color color)
DataCell
s (lower-left corner).
text
- the text to be displayedx
- left position of the texty
- the bottom position of the textcolor
- the color of the text (might be null: then the default color
is used)public void addBasicDrawingElement(BasicDrawingElement element)
element
- a drawing element.public void updateSize()
BasicDrawingElement
s
to the drawing pane's dimension.
updateSize
in class AbstractPlotter
AbstractPlotter.updateSize()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |