Public Member Functions | |
void | chartMouseClicked (org.jfree.chart.ChartMouseEvent oEvent) |
Interprets a mouse click on the chart. | |
void | mousePressed (java.awt.event.MouseEvent oEvent) |
Captures the point of click for possible dragging. | |
void | mouseDragged (java.awt.event.MouseEvent oEvent) |
Handles a 'mouse dragged' event. | |
void | mouseReleased (java.awt.event.MouseEvent oEvent) |
Handles a mouse button release event, presumably after a drag to select cells. | |
void | mouseClicked (java.awt.event.MouseEvent oEvent) |
Does nothing. | |
void | chartMouseMoved (org.jfree.chart.ChartMouseEvent oEvent) |
Does nothing. | |
void | mouseEntered (java.awt.event.MouseEvent oEvent) |
Does nothing. | |
void | mouseExited (java.awt.event.MouseEvent oEvent) |
Does nothing. | |
void | mouseMoved (java.awt.event.MouseEvent oEvent) |
Does nothing. | |
Private Member Functions | |
Point | getPointInRectangle (int x, int y, Rectangle2D area) |
Returns a point based on (x, y) but constrained to be within the bounds of the given rectangle. | |
void | SetCellValues (int iFromX, int iFromY, int iToX, int iToY) |
Handles the selection of cells from a drag mouse event. | |
void | SetCellValues (int iXClickPoint, int iYClickPoint) |
Handles the selection of a cell from a single mouse click. | |
Private Attributes | |
java.awt.geom.Point2D | m_jDragPoint = null |
The selection rectangle starting point (selected by the user with a mouse click). | |
java.awt.geom.Rectangle2D | m_jDragRectangle = null |
The selection rectangle (selected by the user with the mouse). |
This will detect both single clicks on the chart and click-and-drag. When a user has selected a cell or group of cells on this chart, this will toggle them as selected/unselected with the parent window.
Copyright: Copyright (c) Charles D. Canham 2003
Company: Institute of Ecosystem Studies
void javawrapper.SubplotEdit.SubplotMouseListener.chartMouseClicked | ( | org.jfree.chart.ChartMouseEvent | oEvent | ) |
Interprets a mouse click on the chart.
This takes the point of the click and translates the click point to chart coordinates. The cell containing the click point is toggled between true and false in m_oDataset.mp_bData.
oEvent | MouseEvent from which to get the click point. |
void javawrapper.SubplotEdit.SubplotMouseListener.mousePressed | ( | java.awt.event.MouseEvent | oEvent | ) |
Captures the point of click for possible dragging.
I modified this code from org.jfree.chart.ChartPanel.mousePressed by David Gilbert.
oEvent | MouseEvent from which to get the click point. |
Point javawrapper.SubplotEdit.SubplotMouseListener.getPointInRectangle | ( | int | x, | |
int | y, | |||
Rectangle2D | area | |||
) | [private] |
Returns a point based on (x, y) but constrained to be within the bounds of the given rectangle.
This method could be moved to JCommon.
x | the x-coordinate. | |
y | the y-coordinate. | |
area | the rectangle (null not permitted). |
void javawrapper.SubplotEdit.SubplotMouseListener.mouseDragged | ( | java.awt.event.MouseEvent | oEvent | ) |
Handles a 'mouse dragged' event.
Draws a rectangle of the drag. I modified this code from org.jfree.chart.ChartPanel.mouseDragged by David Gilbert.
oEvent | the mouse event. |
void javawrapper.SubplotEdit.SubplotMouseListener.mouseReleased | ( | java.awt.event.MouseEvent | oEvent | ) |
Handles a mouse button release event, presumably after a drag to select cells.
This will take all the cells selected in the drag, and toggle their value in m_oDataset.mp_bData between true and false. I modified the code for retrieving drag coordinates from from org.jfree.chart.ChartPanel.mouseReleased by David Gilbert.
oEvent | Mouse event. |
void javawrapper.SubplotEdit.SubplotMouseListener.SetCellValues | ( | int | iFromX, | |
int | iFromY, | |||
int | iToX, | |||
int | iToY | |||
) | [private] |
Handles the selection of cells from a drag mouse event.
This takes the points, translates them to plot coordinates, translates those to plot cells, and then toggles the values in each cell between true and false in m_oDataset.mp_bData.
iFromX | X coordinate of the beginning point of drag, in Java2D coordinates. | |
iFromY | Y coordinate of the beginning point of drag, in Java2D coordinates. | |
iToX | X coordinate of the end point of drag, in Java2D coordinates. | |
iToY | Y coordinate of the end point of drag, in Java2D coordinates. |
ModelException | passing through from called methods. |
void javawrapper.SubplotEdit.SubplotMouseListener.SetCellValues | ( | int | iXClickPoint, | |
int | iYClickPoint | |||
) | [private] |
Handles the selection of a cell from a single mouse click.
This takes the point, translates it to plot coordinates, translates it to plot cells, and then toggles the value in the cell between true and false in m_oDataset.mp_bData.
iXClickPoint | The X click point, in Java2D coordinates. | |
iYClickPoint | The Y click point, in Java2D coordinates. |
ModelException | Passed through from called methods. |
void javawrapper.SubplotEdit.SubplotMouseListener.mouseClicked | ( | java.awt.event.MouseEvent | oEvent | ) |
Does nothing.
oEvent | Ignored. |
void javawrapper.SubplotEdit.SubplotMouseListener.chartMouseMoved | ( | org.jfree.chart.ChartMouseEvent | oEvent | ) |
Does nothing.
oEvent | Ignored. |
void javawrapper.SubplotEdit.SubplotMouseListener.mouseEntered | ( | java.awt.event.MouseEvent | oEvent | ) |
Does nothing.
oEvent | Ignored. |
void javawrapper.SubplotEdit.SubplotMouseListener.mouseExited | ( | java.awt.event.MouseEvent | oEvent | ) |
Does nothing.
oEvent | Ignored. |
void javawrapper.SubplotEdit.SubplotMouseListener.mouseMoved | ( | java.awt.event.MouseEvent | oEvent | ) |
Does nothing.
oEvent | Ignored. |
java.awt.geom.Point2D javawrapper.SubplotEdit.SubplotMouseListener.m_jDragPoint = null [private] |
The selection rectangle starting point (selected by the user with a mouse click).
java.awt.geom.Rectangle2D javawrapper.SubplotEdit.SubplotMouseListener.m_jDragRectangle = null [private] |
The selection rectangle (selected by the user with the mouse).