org.jzy3d.chart.controllers.mouse.selection
Class AbstractMouseSelector

java.lang.Object
  extended by org.jzy3d.chart.controllers.mouse.selection.AbstractMouseSelector
All Implemented Interfaces:
MouseListener, MouseMotionListener, MouseWheelListener, EventListener
Direct Known Subclasses:
ScatterMouseSelector, SphereMouseSelector

public abstract class AbstractMouseSelector
extends Object
implements MouseListener, MouseMotionListener, MouseWheelListener


Field Summary
protected  Chart chart
           
protected  boolean dragging
           
protected  IntegerCoord2d in
           
protected  IntegerCoord2d last
           
protected  IntegerCoord2d out
           
protected  Renderer2d selectionRenderer
           
 
Constructor Summary
AbstractMouseSelector()
           
 
Method Summary
abstract  void clearLastSelection()
           
 void dispose()
           
protected  void dragSelection(MouseEvent e)
           
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  Renderer2d initRenderer2d(ICanvas c)
           
protected  boolean matchRectangleSelection(IntegerCoord2d in, IntegerCoord2d out, Coord3d projection, int width, int height)
           
protected  boolean matchRectangleSelection(IntegerCoord2d in, IntegerCoord2d out, float px, float py, int width, int height)
           
 void mouseClicked(MouseEvent e)
           
 void mouseDragged(MouseEvent e)
           
 void mouseEntered(MouseEvent e)
           
 void mouseExited(MouseEvent e)
           
 void mouseMoved(MouseEvent e)
           
 void mousePressed(MouseEvent e)
           
 void mouseReleased(MouseEvent e)
           
 void mouseWheelMoved(MouseWheelEvent e)
           
protected abstract  void processSelection(Scene scene, View view, int width, int height)
           
 void register(Chart chart)
           
protected  void releaseSelection(MouseEvent e)
           
protected  void rollOver(MouseEvent e)
           
protected  void startSelection(MouseEvent e)
           
 void unregister()
           
protected  void updateLast()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

chart

protected Chart chart

dragging

protected boolean dragging

in

protected IntegerCoord2d in

out

protected IntegerCoord2d out

last

protected IntegerCoord2d last

selectionRenderer

protected Renderer2d selectionRenderer
Constructor Detail

AbstractMouseSelector

public AbstractMouseSelector()
Method Detail

dispose

public void dispose()

register

public void register(Chart chart)

unregister

public void unregister()

initRenderer2d

protected Renderer2d 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);

See Also:
AbstractViewport} and {@link Camera}

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 point
out - The mouse selection end point
px - A projected point x value
py - A projected point y value
width - The canvas dimension
height - 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)

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:
mousePressed in interface MouseListener

mouseDragged

public void mouseDragged(MouseEvent e)
Specified by:
mouseDragged in interface MouseMotionListener

mouseReleased

public void mouseReleased(MouseEvent e)
Specified by:
mouseReleased in interface MouseListener

mouseMoved

public void mouseMoved(MouseEvent e)
Specified by:
mouseMoved in interface MouseMotionListener

mouseWheelMoved

public void mouseWheelMoved(MouseWheelEvent e)
Specified by:
mouseWheelMoved in interface MouseWheelListener

mouseEntered

public void mouseEntered(MouseEvent e)
Specified by:
mouseEntered in interface MouseListener

mouseExited

public void mouseExited(MouseEvent e)
Specified by:
mouseExited in interface MouseListener

mouseClicked

public void mouseClicked(MouseEvent e)
Specified by:
mouseClicked in interface MouseListener