org.das2.event.MouseModule

A MouseModule is a pluggable unit that promotes simple mouse events into human events or actions that are useful for science analysis. Each component has a mouseInputAdapter that manages a set of mouseModules, one is active at any given time. The DasMouseInputAdapter will delegate mouse events, key events, and mouse wheel events to the active mouse module. This base class will be extended by instances of MouseModule, overriding methods they wish to handle.

MouseModule( org.das2.graph.DasCanvasComponent parent )

create the mouse module for the parent component. This is without a drag renderer, and the class name is used for the label. paint graphic feedback to the human operator.

MouseModule( org.das2.graph.DasCanvasComponent parent, org.das2.event.DragRenderer dragRenderer, String label )

create the mouse module for the parent component using the dragRenderer to paint graphic feedback to the human operator. For example, the dragRenderer might draw a box during the click-drag-release mouse action, and then on release this mouse module creates the event used elsewhere.


drawListIcon

drawListIcon( java.awt.Graphics2D g, int x, int y ) → void

Parameters

g - a Graphics2D
x - an int
y - an int

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getCursor

getCursor( ) → java.awt.Cursor

return a cursor that indicates the selected module. Note this is currently not used.

Returns:

a cursor that indicates the selected module.

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getDirections

getDirections( ) → String

allow one-line directions to be added to the mouse module. This is used in Autoplot for the status bar.

Returns:

the directions, or null.

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getDragRenderer

getDragRenderer( ) → org.das2.event.DragRenderer

return the current drag renderer.

Returns:

the current drag renderer.

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getLabel

getLabel( ) → String

returns a human-readable string that identifies the module

Returns:

a human-readable string that identifies the module

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getListIcon

getListIcon( ) → javax.swing.Icon

return the list icon. This will be be overridden by MouseModules to give a visual reference.

Returns:

the list icon.

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getListLabel

getListLabel( ) → String

Returns:

java.lang.String

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getParent

getParent( ) → org.das2.graph.DasCanvasComponent

return the canvas component (for example, a DasPlot) where this MouseModule is listening.

Returns:

the canvas component.

[search for examples] [view on GitHub] [view on old javadoc] [view source]


keyPressed

keyPressed( java.awt.event.KeyEvent keyEvent ) → void

Parameters

keyEvent - a KeyEvent

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


keyReleased

keyReleased( java.awt.event.KeyEvent keyEvent ) → void

Parameters

keyEvent - a KeyEvent

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


keyTyped

keyTyped( java.awt.event.KeyEvent keyEvent ) → void

Parameters

keyEvent - a KeyEvent

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


mouseClicked

mouseClicked( java.awt.event.MouseEvent e ) → void

Parameters

e - a MouseEvent

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


mouseDragged

mouseDragged( java.awt.event.MouseEvent e ) → void

Parameters

e - a MouseEvent

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


mouseEntered

mouseEntered( java.awt.event.MouseEvent e ) → void

Parameters

e - a MouseEvent

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


mouseExited

mouseExited( java.awt.event.MouseEvent e ) → void

Parameters

e - a MouseEvent

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


mouseMoved

mouseMoved( java.awt.event.MouseEvent e ) → void

Parameters

e - a MouseEvent

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


mousePointSelected

mousePointSelected( org.das2.event.MousePointSelectionEvent e ) → void

Action to take when a point (click or drag) is selected. This is intended to be overridden.

Parameters

e - the event.

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


mousePressed

mousePressed( java.awt.event.MouseEvent e ) → void

Parameters

e - a MouseEvent

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


mouseRangeSelected

mouseRangeSelected( org.das2.event.MouseDragEvent e ) → void

Action to take when a mouse range (click, drag, release) has been selected. This is intended to be overridden.

Parameters

e - the drag event.

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


mouseReleased

mouseReleased( java.awt.event.MouseEvent e ) → void

Parameters

e - a MouseEvent

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


mouseWheelMoved

mouseWheelMoved( java.awt.event.MouseWheelEvent e ) → void

Parameters

e - a MouseWheelEvent

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


position

position( org.das2.graph.DasDevicePosition ddp, int pos, int threshold ) → org.das2.event.MouseModule.Pos

indicate if the position (pixels) is near the ends of the DasRow or DasColumn. Note that the max of a row is its bottom.

Parameters

ddp - the row or column
pos - the position to describe.
threshold - pixel distance to the boundary, 20 is often used.

Returns:

enumeration of the position, for example Pos.beyondMin.

[search for examples] [view on GitHub] [view on old javadoc] [view source]


setDirections

setDirections( String directions ) → void

set the human-readable directions string, so clients like Autoplot can display them.

Parameters

directions - human-readable directions.

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


setDragRenderer

setDragRenderer( org.das2.event.DragRenderer d ) → void

set the drag renderer. (Made public when the digitizer had different modes.)

Parameters

d - set the drag renderer.

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


setLabel

setLabel( String label ) → void

set the human-readable label.

Parameters

label - the human-readable label.

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]