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
Fields Modifier and Type Field Description protected ICanvascanvasprotected Chartchartprotected booleandraggingprotected IntegerCoord2dinprotected IntegerCoord2dlastprotected IntegerCoord2doutprotected AWTRenderer2dselectionRenderer
-
Constructor Summary
Constructors Constructor Description AWTAbstractMouseSelector()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidclearLastSelection()voiddispose()protected voiddragSelection(MouseEvent e)protected voiddrawRectangle(Graphics2D g2d, IntegerCoord2d in, IntegerCoord2d out)protected abstract voiddrawSelection(Graphics2D g, int width, int height)Drawing occurs in the selection renderer which as the dimension of the GL2 scene viewport.protected AWTRenderer2dinitRenderer2d(ICanvas c)protected booleanmatchRectangleSelection(IntegerCoord2d in, IntegerCoord2d out, float px, float py, int width, int height)protected booleanmatchRectangleSelection(IntegerCoord2d in, IntegerCoord2d out, Coord3d projection, int width, int height)voidmouseClicked(MouseEvent e)voidmouseDragged(MouseEvent e)voidmouseEntered(MouseEvent e)voidmouseExited(MouseEvent e)voidmouseMoved(MouseEvent e)voidmousePressed(MouseEvent e)voidmouseReleased(MouseEvent e)voidmouseWheelMoved(MouseEvent e)protected abstract voidprocessSelection(Scene scene, View view, int width, int height)voidregister(Chart chart)protected voidreleaseSelection(MouseEvent e)protected voidrollOver(MouseEvent e)protected voidstartSelection(MouseEvent e)voidunregister()protected voidupdateLast()intx(MouseEvent e)IntegerCoord2dxy(MouseEvent e)inty(MouseEvent e)
-
-
-
Field Detail
-
chart
protected Chart chart
-
canvas
protected ICanvas canvas
-
dragging
protected boolean dragging
-
in
protected IntegerCoord2d in
-
out
protected IntegerCoord2d out
-
last
protected IntegerCoord2d last
-
selectionRenderer
protected AWTRenderer2d selectionRenderer
-
-
Method Detail
-
dispose
public void dispose()
-
register
public void register(Chart chart)
-
unregister
public void unregister()
-
initRenderer2d
protected AWTRenderer2d initRenderer2d(ICanvas c)
-
processSelection
protected abstract void processSelection(Scene scene, View view, int width, int height)
-
drawSelection
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. 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
protected void drawRectangle(Graphics2D g2d, IntegerCoord2d in, IntegerCoord2d out)
-
startSelection
protected void startSelection(MouseEvent e)
-
xy
public IntegerCoord2d xy(MouseEvent e)
-
x
public int x(MouseEvent e)
-
y
public int y(MouseEvent e)
-
dragSelection
protected void dragSelection(MouseEvent e)
-
releaseSelection
protected void releaseSelection(MouseEvent e)
-
rollOver
protected void rollOver(MouseEvent e)
-
updateLast
protected void updateLast()
-
mousePressed
public void mousePressed(MouseEvent e)
- Specified by:
mousePressedin interfaceMouseListener
-
mouseReleased
public void mouseReleased(MouseEvent e)
- Specified by:
mouseReleasedin interfaceMouseListener
-
mouseDragged
public void mouseDragged(MouseEvent e)
- Specified by:
mouseDraggedin interfaceMouseMotionListener
-
mouseMoved
public void mouseMoved(MouseEvent e)
- Specified by:
mouseMovedin interfaceMouseMotionListener
-
mouseWheelMoved
public void mouseWheelMoved(MouseEvent e)
-
mouseEntered
public void mouseEntered(MouseEvent e)
- Specified by:
mouseEnteredin interfaceMouseListener
-
mouseExited
public void mouseExited(MouseEvent e)
- Specified by:
mouseExitedin interfaceMouseListener
-
mouseClicked
public void mouseClicked(MouseEvent e)
- Specified by:
mouseClickedin interfaceMouseListener
-
-