Class AWTAbstractMouseSelector
java.lang.Object
org.jzy3d.chart.controllers.mouse.selection.AWTAbstractMouseSelector
- All Implemented Interfaces:
MouseListener
,MouseMotionListener
,EventListener
- Direct Known Subclasses:
AWTScatterMouseSelector
,AWTSphereMouseSelector
public abstract class AWTAbstractMouseSelector
extends Object
implements MouseListener, MouseMotionListener
-
Field Summary
Modifier and TypeFieldDescriptionprotected ICanvas
protected Chart
protected boolean
protected IntegerCoord2d
protected IntegerCoord2d
protected IntegerCoord2d
protected AWTRenderer2d
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
void
dispose()
protected void
protected void
drawRectangle
(Graphics2D g2d, IntegerCoord2d in, IntegerCoord2d out) protected abstract void
drawSelection
(Graphics2D g, int width, int height) Drawing occurs in the selection renderer which as the dimension of the GL2 scene viewport.protected AWTRenderer2d
protected boolean
matchRectangleSelection
(IntegerCoord2d in, IntegerCoord2d out, float px, float py, int width, int height) protected boolean
matchRectangleSelection
(IntegerCoord2d in, IntegerCoord2d out, Coord3d projection, int width, int height) void
void
void
void
void
void
void
void
protected abstract void
processSelection
(Scene scene, View view, int width, int height) void
protected void
protected void
protected void
void
protected void
int
x
(MouseEvent e) xy
(MouseEvent e) int
y
(MouseEvent e)
-
Field Details
-
chart
-
canvas
-
dragging
protected boolean dragging -
in
-
out
-
last
-
selectionRenderer
-
-
Constructor Details
-
AWTAbstractMouseSelector
public AWTAbstractMouseSelector()
-
-
Method Details
-
dispose
public void dispose() -
register
-
unregister
public void unregister() -
initRenderer2d
-
processSelection
-
drawSelection
Drawing occurs in the selection renderer which as the dimension of the GL2 scene viewport. In other words, one should not expect to draw on the entire canvas if the GL2 scene viewport only covers a slice of the screen. As an example, the following piece of code will draw a border around the GL2 scene: g2d.drawRect(1, 1, chart.getCanvas().getRendererWidth()-2, chart.getCanvas().getRendererHeight()-2); -
clearLastSelection
public abstract void clearLastSelection() -
matchRectangleSelection
protected boolean matchRectangleSelection(IntegerCoord2d in, IntegerCoord2d out, Coord3d projection, int width, int height) -
matchRectangleSelection
protected boolean matchRectangleSelection(IntegerCoord2d in, IntegerCoord2d out, float px, float py, int width, int height) - Parameters:
in
- The mouse selection start pointout
- The mouse selection end pointpx
- A projected point x valuepy
- A projected point y valuewidth
- The canvas dimensionheight
- The canvas dimension- Returns:
- true if the point (px,py) is inside the (in,out) mouse selection of a canvas having dimensions (width, height)
-
drawRectangle
-
startSelection
-
xy
-
x
-
y
-
dragSelection
-
releaseSelection
-
rollOver
-
updateLast
protected void updateLast() -
mousePressed
- Specified by:
mousePressed
in interfaceMouseListener
-
mouseReleased
- Specified by:
mouseReleased
in interfaceMouseListener
-
mouseDragged
- Specified by:
mouseDragged
in interfaceMouseMotionListener
-
mouseMoved
- Specified by:
mouseMoved
in interfaceMouseMotionListener
-
mouseWheelMoved
-
mouseEntered
- Specified by:
mouseEntered
in interfaceMouseListener
-
mouseExited
- Specified by:
mouseExited
in interfaceMouseListener
-
mouseClicked
- Specified by:
mouseClicked
in interfaceMouseListener
-