|
||||||||||
| 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
org.knime.base.node.viz.plotter.columns.TwoColumnPlotter
org.knime.base.node.viz.plotter.scatter.ScatterPlotter
public class ScatterPlotter
Maps the two selected columns to the screen coordinates. The resulting points
in 2-dimensional space are represented by
DotInfos, which are stored
in a DotInfoArray which is
then passed to the
ScatterPlotterDrawingPane.
For nominal values it is typically that many points are on the same
coordinate which leads to overplotting. One possible solution is to jitter
the points around the original point, to visualize that many points are on
the same coordinate. The jittering for nominal values is done here.
| 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 | |
|---|---|
ScatterPlotter()
Default constructor with ScatterPlotterDrawingPane
and
ScatterPlotterProperties. |
|
ScatterPlotter(AbstractDrawingPane panel,
AbstractPlotterProperties properties)
Construction kit constructor to construct a customized plotter, registeres all necessary listeners. |
|
| Method Summary | |
|---|---|
protected void |
calculateCoordinates(DotInfoArray dotsArray)
Given the actual size of the drawing pane, the actual zoom factor, and min/max values it calculates the screen coordinates for each dot info in the array passed in. |
void |
clearSelection()
Clears current selection. |
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)
The inherited hilite menu from the AbstractPlotter and the show all,
fade or hide unhilited menu. |
int |
getDotSize()
|
Action |
getFadeAction()
The ScatterPlotter adds the posssibility to show, fade or
hide unhilited dots and this is the fade unhilited action. |
Action |
getHideAction()
The ScatterPlotter adds the posssibility to show, fade or
hide unhilited dots and this is the hide unhilited action. |
protected int |
getJitterRate()
|
protected int |
getMappedXValue(DataCell x)
|
protected int |
getMappedYValue(DataCell y)
|
Action |
getShowAllAction()
The ScatterPlotter adds the posssibility to show, fade or
hide unhilited dots and this is the show all action. |
JMenu |
getShowHideMenu()
The ScatterPlotter adds the posssibility to show, fade or
hide unhilited dots and this is the complete menu to hide, fade. |
void |
hiLite(KeyEvent event)
Invoked when some item(s) were hilit. |
void |
hiLiteSelected()
Is called from the menu entry hilite selected. |
protected boolean |
isHideMode()
|
protected boolean |
isScatterPlotterDrawingPane()
|
protected boolean |
isScatterPlotterProperties()
|
protected void |
jitterDots(DotInfo[] dots,
int xAxisJitterRange,
int yAxisJitterRange)
Jitters the dots according to the kind of axis and there values. |
void |
reset()
Passes an empty DotInfoArray to the
.ScatterPlotterDrawingPane. |
void |
selectClickedElement(Point p)
Implementing classes mayxselect the elements depending on the clicked position. |
void |
selectElementsIn(Rectangle selectionRectangle)
Implementing classes may select the elements in the selection rectangle obtained from the mouse dragging in selection mode. |
void |
setDotSize(int dotSize)
Sets the size of the dots and sets a tick offset to both axes to ensure that the points are always completely visible. |
void |
setHideMode(boolean hide)
|
protected void |
setJitterRate(int jitterRate)
|
void |
unHiLite(KeyEvent event)
Invoked when some item(s) were unhilit. |
void |
unHiLiteAll(KeyEvent event)
Invoked, when everything (all rows) are unhilit. |
void |
unHiLiteSelected()
Is called by the menu entry unhilite selected. |
void |
updatePaintModel()
The data points of the data to visulaize are mapped to screen coordinates, represented by DotInfo and are passed in
a DotInfoArray to the
.ScatterPlotterDrawingPane. |
void |
updateSize()
Updates the size by mapping the domain values of the BasicDrawingElements
to the drawing pane's dimension. |
| Methods inherited from class org.knime.base.node.viz.plotter.columns.TwoColumnPlotter |
|---|
getSelectedXColumn, getSelectedXColumnIndex, getSelectedYColumn, getSelectedYColumnIndex, setDataProvider, setSelectableColumns |
| Methods inherited from class org.knime.base.node.viz.plotter.basic.BasicPlotter |
|---|
addBasicDrawingElement, addEllipse, addLine, addLine, addLine, addLine, addRectangle, addText |
| 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 |
| Constructor Detail |
|---|
public ScatterPlotter(AbstractDrawingPane panel,
AbstractPlotterProperties properties)
panel - the drawing paneproperties - the propertiespublic ScatterPlotter()
ScatterPlotterDrawingPane
and
ScatterPlotterProperties.
| Method Detail |
|---|
public void reset()
DotInfoArray to the
.ScatterPlotterDrawingPane.
reset in class BasicPlotterAbstractPlotter.reset()public void dispose()
dispose in class AbstractPlotterpublic void setDotSize(int dotSize)
dotSize - the dot size.public int getDotSize()
protected void setJitterRate(int jitterRate)
jitterRate - the jitter rate.protected int getJitterRate()
public Action getShowAllAction()
ScatterPlotter adds the posssibility to show, fade or
hide unhilited dots and this is the show all action. The hide flag is
administered in the ScatterPlotter, since hidden points
are not passed to the
.ScatterPlotterDrawingPane,
the fade flag is administered in the
.ScatterPlotterDrawingPane,
since the dots are painted but with a different (faded) color.
public Action getHideAction()
ScatterPlotter adds the posssibility to show, fade or
hide unhilited dots and this is the hide unhilited action. The hide flag
is administered in the ScatterPlotter, since hidden
points are not passed to the
.ScatterPlotterDrawingPane,
the fade flag is administered in the
.ScatterPlotterDrawingPane,
since the dots are painted but with a different (faded) color.
protected boolean isHideMode()
public void setHideMode(boolean hide)
hide - flag whether to hide unhilited dots.public Action getFadeAction()
ScatterPlotter adds the posssibility to show, fade or
hide unhilited dots and this is the fade unhilited action. The hide flag
is administered in the ScatterPlotter, since hidden
points are not passed to the
.ScatterPlotterDrawingPane,
the fade flag is administered in the
.ScatterPlotterDrawingPane,
since the dots are painted but with a different (faded) color.
public JMenu getShowHideMenu()
ScatterPlotter adds the posssibility to show, fade or
hide unhilited dots and this is the complete menu to hide, fade. The hide
flag is administered in the ScatterPlotter, since hidden
points are not passed to the
.ScatterPlotterDrawingPane,
the fade flag is administered in the
.ScatterPlotterDrawingPane,
since the dots are painted but with a different (faded) color.
public void fillPopupMenu(JPopupMenu popupMenu)
AbstractPlotter and the show all,
fade or hide unhilited menu.
Fills the popup menu with (additional) elements. In this class the
hilite, unhilite and clear hilite actions are added.
fillPopupMenu in class AbstractPlotterpopupMenu - the popup menu to fill.public void updatePaintModel()
DotInfo and are passed in
a DotInfoArray to the
.ScatterPlotterDrawingPane. Repaint of the drawing pane is triggered.
Jittering is also triggered from here.
updatePaintModel in class TwoColumnPlotter#updatePaintModel()protected void calculateCoordinates(DotInfoArray dotsArray)
dotsArray - the array containing the dots.
protected void jitterDots(DotInfo[] dots,
int xAxisJitterRange,
int yAxisJitterRange)
dots - the dots to jitterxAxisJitterRange - the available range to jitter for the x axisyAxisJitterRange - the available range ot jitter for the y axisprotected boolean isScatterPlotterDrawingPane()
protected boolean isScatterPlotterProperties()
public void updateSize()
BasicDrawingElements
to the drawing pane's dimension.
updateSize in class BasicPlotterAbstractPlotter.updateSize()protected int getMappedXValue(DataCell x)
getMappedXValue in class AbstractPlotterx - domain value
protected int getMappedYValue(DataCell y)
getMappedYValue in class AbstractPlottery - domain value
public void selectElementsIn(Rectangle selectionRectangle)
selectElementsIn in class AbstractPlotterselectionRectangle - the selection rectangle from the dragged mouse
in selection modepublic void selectClickedElement(Point p)
selectClickedElement in class AbstractPlotterp - the clicked pointpublic void clearSelection()
clearSelection in class AbstractPlotterpublic void hiLiteSelected()
hiLiteSelected in class AbstractPlotterpublic void unHiLiteSelected()
unHiLiteSelected in class AbstractPlotterpublic void unHiLiteAll(KeyEvent event)
event - contains a list of row key that were unhilitpublic void hiLite(KeyEvent event)
hiLite in interface HiLiteListenerhiLite in class AbstractPlotterevent - contains a list of row keys that were hilitpublic void unHiLite(KeyEvent event)
unHiLite in interface HiLiteListenerunHiLite in class AbstractPlotterevent - contains a list of row keys that were unhilit
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||