|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.event.MouseAdapter
org.fhcrc.cpl.toolbox.gui.chart.ChartMouseAndMotionListener
public abstract class ChartMouseAndMotionListener
Superclass for MouseListener/MouseMotionListener combos to hang on charts, with some utility methods. This was built initially in order to display selection boxes on top of a histogram, in a subclass, but I've tried to put stuff at this level that might be useful in other contexts NOTE: should only be used with charts that use XYPlots
| Field Summary | |
|---|---|
protected org.jfree.chart.ChartPanel |
_chartPanel
|
protected static org.apache.log4j.Logger |
_log
|
protected org.jfree.chart.axis.NumberAxis |
domainAxis
|
protected org.jfree.chart.axis.NumberAxis |
rangeAxis
|
| Constructor Summary | |
|---|---|
ChartMouseAndMotionListener()
|
|
ChartMouseAndMotionListener(PanelWithChart panelWithChart)
|
|
| Method Summary | |
|---|---|
protected void |
drawAllButSelectedRegionHoriz(java.awt.geom.Rectangle2D selectedRegion,
java.awt.Stroke stroke,
java.awt.Color color,
boolean xorMode,
java.awt.Graphics2D g2)
Draw a box to the left of the selected region, and one to the right, that together encompass everything but the selection |
protected void |
drawSelectedRegion(java.awt.geom.Rectangle2D selectedRegion,
java.awt.Stroke stroke,
java.awt.Color fillColor,
boolean xorMode,
java.awt.Graphics2D g2)
Draws zoom rectangle (if present). |
org.jfree.chart.ChartPanel |
getChartPanel()
|
protected java.awt.Graphics2D |
getChartPanelGraphics()
Utility method for getting graphics |
protected java.awt.Point |
getPointInRectangle(int x,
int y,
java.awt.geom.Rectangle2D area)
Returns a point based on (x, y) but constrained to be within the bounds of the given rectangle. |
void |
setChartPanel(org.jfree.chart.ChartPanel _cp)
|
protected double |
transformMouseXValue(double rawValue)
Transform a mouse X value into a value in the units of the X axis of the chart. |
protected double |
transformXValueToMouse(double xValue)
Transform a value in the units of the X axis of the chart into a mouse x value Note: if there were multiple subplots, this would need to take a MouseEvent to determine which one |
| Methods inherited from class java.awt.event.MouseAdapter |
|---|
mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static org.apache.log4j.Logger _log
protected org.jfree.chart.ChartPanel _chartPanel
protected org.jfree.chart.axis.NumberAxis domainAxis
protected org.jfree.chart.axis.NumberAxis rangeAxis
| Constructor Detail |
|---|
public ChartMouseAndMotionListener()
public ChartMouseAndMotionListener(PanelWithChart panelWithChart)
| Method Detail |
|---|
protected java.awt.Point getPointInRectangle(int x,
int y,
java.awt.geom.Rectangle2D area)
x - the x-coordinate.y - the y-coordinate.area - the rectangle (null not permitted).
protected java.awt.Graphics2D getChartPanelGraphics()
protected double transformMouseXValue(double rawValue)
rawValue -
protected double transformXValueToMouse(double xValue)
xValue -
protected void drawSelectedRegion(java.awt.geom.Rectangle2D selectedRegion,
java.awt.Stroke stroke,
java.awt.Color fillColor,
boolean xorMode,
java.awt.Graphics2D g2)
selectedRegion - stroke - fillColor -
protected void drawAllButSelectedRegionHoriz(java.awt.geom.Rectangle2D selectedRegion,
java.awt.Stroke stroke,
java.awt.Color color,
boolean xorMode,
java.awt.Graphics2D g2)
selectedRegion - stroke - color - public org.jfree.chart.ChartPanel getChartPanel()
public void setChartPanel(org.jfree.chart.ChartPanel _cp)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||