|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.rapidminer.gui.plotter.charts.ChartPanelShiftController
public class ChartPanelShiftController
This class provides ways to shift (aka pan/scroll) a plot. The shift is done through the arrow keys and its step can be configured to be a fixed amount, a percentual of the current axis or a range in pixels.
This class only supports plots of type XYPlot,
ContourPlot and
FastScatterPlot.
Use ← and → to shift the plot left and right;
Use ↑ and ↓ to shift the plot up and down;
Press the SHIFT key to increase the shift by a factor of 10.
| Field Summary | |
|---|---|
static int |
SHIFT_FIXED
PAN plot by a fixed amout (eg. 5 range units) |
static int |
SHIFT_PERCENTUAL
PAN plot by a fixed percentual of the range (eg. 1%) |
static int |
SHIFT_PIXEL
PAN plot by a fixed number of pixels (eg. 1px) |
| Constructor Summary | |
|---|---|
ChartPanelShiftController(org.jfree.chart.ChartPanel chartPanel)
Creates a new controller to handle plot shifts. |
|
| Method Summary | |
|---|---|
double |
getFixedDomainShiftUnits()
Returns the fixed shift step for the domain axis. |
double |
getFixedRangeShiftUnits()
Returns the fixed shift step for the range axis. |
protected org.jfree.chart.axis.ValueAxis[] |
getPlotAxis(org.jfree.chart.JFreeChart chart,
boolean domain)
Returns the ValueAxis for the plot or null if the plot
doesn't have one. |
int |
getShiftType()
Returns the current shift type. |
protected boolean |
isHorizontalPlot(org.jfree.chart.plot.Plot plot)
Returns the plot orientation. |
boolean |
isPlotSupported()
Returns whether or not the plot supports shifting. |
void |
keyPressed(java.awt.event.KeyEvent e)
Pan / Shifts a plot if the arrow keys are pressed. |
void |
mouseClicked(java.awt.event.MouseEvent mouseEvent)
|
void |
mouseDragged(java.awt.event.MouseEvent mouseEvent)
|
void |
mouseEntered(java.awt.event.MouseEvent mouseEvent)
|
void |
mouseExited(java.awt.event.MouseEvent mouseEvent)
|
void |
mouseMoved(java.awt.event.MouseEvent mouseEvent)
|
void |
mousePressed(java.awt.event.MouseEvent mouseEvent)
|
void |
mouseReleased(java.awt.event.MouseEvent mouseEvent)
|
void |
setFixedDomainShiftUnits(double fixedDomainShiftUnits)
Sets the fixed shift step for the domain axis. |
void |
setFixedRangeShiftUnits(double fixedRangeShiftUnits)
Sets the fixed shift step for the range axis. |
void |
setOnlyXShift(boolean onlyXShift)
|
void |
setShiftType(int shiftType)
Sets the shift type. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int SHIFT_PERCENTUAL
public static final int SHIFT_PIXEL
public static final int SHIFT_FIXED
| Constructor Detail |
|---|
public ChartPanelShiftController(org.jfree.chart.ChartPanel chartPanel)
chartPanel - The panel displaying the plot.| Method Detail |
|---|
public void setOnlyXShift(boolean onlyXShift)
protected boolean isHorizontalPlot(org.jfree.chart.plot.Plot plot)
VERTICAL;
False = HORIZONTAL
protected org.jfree.chart.axis.ValueAxis[] getPlotAxis(org.jfree.chart.JFreeChart chart,
boolean domain)
null if the plot
doesn't have one.
chart - The chartdomain - True = get Domain axis. False = get Range axis.
null if the plot doesn't
have one.public void keyPressed(java.awt.event.KeyEvent e)
public void mouseDragged(java.awt.event.MouseEvent mouseEvent)
mouseDragged in interface java.awt.event.MouseMotionListenerpublic void mouseMoved(java.awt.event.MouseEvent mouseEvent)
mouseMoved in interface java.awt.event.MouseMotionListenerpublic void mouseReleased(java.awt.event.MouseEvent mouseEvent)
mouseReleased in interface java.awt.event.MouseListenerpublic void mouseClicked(java.awt.event.MouseEvent mouseEvent)
mouseClicked in interface java.awt.event.MouseListenerpublic void mousePressed(java.awt.event.MouseEvent mouseEvent)
mousePressed in interface java.awt.event.MouseListenerpublic void mouseEntered(java.awt.event.MouseEvent mouseEvent)
mouseEntered in interface java.awt.event.MouseListenerpublic void mouseExited(java.awt.event.MouseEvent mouseEvent)
mouseExited in interface java.awt.event.MouseListenerpublic double getFixedDomainShiftUnits()
public void setFixedDomainShiftUnits(double fixedDomainShiftUnits)
fixedDomainShiftUnits - the fixed shift step for the domain axis.public double getFixedRangeShiftUnits()
public void setFixedRangeShiftUnits(double fixedRangeShiftUnits)
fixedRangeShiftUnits - the fixed shift step for the range axis.public int getShiftType()
SHIFT_FIXED,
SHIFT_PERCENTUAL,
SHIFT_PIXELpublic void setShiftType(int shiftType)
shiftType - the new shift type.SHIFT_FIXED,
SHIFT_PERCENTUAL,
SHIFT_PIXELpublic boolean isPlotSupported()
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||