hep.wired.interaction
Class AbstractInteractionHandler

java.lang.Object
  extended by hep.wired.interaction.AbstractInteractionHandler
All Implemented Interfaces:
InteractionHandler, WiredRegistry.ID, org.freehep.xml.io.XMLIO
Direct Known Subclasses:
DefaultInteractionHandler, NullInteractionHandler

public abstract class AbstractInteractionHandler
extends Object
implements InteractionHandler

Near complete (null) implementation of an InteractionHandler.

Version:
$Id: AbstractInteractionHandler.java 13850 2011-07-06 19:23:23Z onoprien $
Author:
Mark Donszelmann

Constructor Summary
protected AbstractInteractionHandler(String name)
          Creates an AbstractInteractionHandler.
 
Method Summary
 boolean altKeyPressed(RecordPlot plot, KeyEvent event)
          Called when the alt key is pressed.
 boolean altKeyReleased(RecordPlot plot, KeyEvent event)
          Called when the alt key is released.
 boolean ctrlKeyPressed(RecordPlot plot, KeyEvent event)
          Called when the ctrl key is pressed.
 boolean ctrlKeyReleased(RecordPlot plot, KeyEvent event)
          Called when the ctrl key is released.
 boolean ctrlMetaKeyPressed(RecordPlot plot, KeyEvent event)
          Called when the ctrl (other OSs) or meta (MacOS) key is pressed key is pressed.
 boolean ctrlMetaKeyReleased(RecordPlot plot, KeyEvent event)
          Called when the ctrl (other OSs) or meta (MacOS) key is released.
 boolean equals(Object other)
          Overridden to use interaction handler name in comparisons.
 boolean escKeyPressed(RecordPlot plot, KeyEvent event)
          Called when the esc key is pressed.
 boolean escKeyReleased(RecordPlot plot, KeyEvent event)
          Called when the esc key is released.
 int getHeight()
          Returns the height of the interaction panel.
 Icon getIcon(int size)
          Returns associated icon
 String getID()
           
 String getName()
          Returns the name of the Interaction Handler.
 int getWidth()
          Returns the width of the interaction panel.
 int hashCode()
          Overridden to use interaction handler name to generate hash code.
 boolean keyTyped(RecordPlot plot, KeyEvent event)
          Called when a key is typed.
 boolean metaKeyPressed(RecordPlot plot, KeyEvent event)
          Called when the meta/option key is pressed.
 boolean metaKeyReleased(RecordPlot plot, KeyEvent event)
          Called when the meta/option key is released.
 void mouseButton1Clicked(RecordPlot plot, MouseEvent event)
          Called when mouse button 1 is clicked
 void mouseButton1DragEnded(RecordPlot plot, MouseEvent event)
          Called when mouse button 1 is ending a drag
 void mouseButton1Dragged(RecordPlot plot, MouseEvent event)
          Called when mouse button 1 is dragged
 void mouseButton1DragStarted(RecordPlot plot, MouseEvent event)
          Called when mouse button 1 is starting a drag
 void mouseButton1Pressed(RecordPlot plot, MouseEvent event)
          Called when mouse button 1 is pressed
 void mouseButton1Released(RecordPlot plot, MouseEvent event)
          Called when mouse button 1 is released
 void mouseEntered(RecordPlot plot, MouseEvent event)
          Called when the mouse is entering the component
 void mouseExited(RecordPlot plot, MouseEvent event)
          Called when the mouse is exitting the component
 void mouseMoved(RecordPlot plot, MouseEvent event)
          Called when the mouse is moved
 void mouseWheelMoved(RecordPlot plot, MouseWheelEvent event)
          Called when the mousewheel is moved
 boolean otherKeyPressed(RecordPlot plot, KeyEvent event)
          Called when any other key is pressed.
 boolean otherKeyReleased(RecordPlot plot, KeyEvent event)
          Called when any other key is released.
 void reset(RecordPlot plot, InputEvent event)
          Called to reset the interaction handler in its initial state.
 void restore(org.freehep.xml.io.XMLIOManager xmlioManager, org.jdom.Element nodeEl)
           
 void save(org.freehep.xml.io.XMLIOManager xmlioManager, org.jdom.Element nodeEl)
           
 void setRecord(RecordPlot plot, Object record)
          Sets the Record which is displayed in the GraphicsPanel.
 void setSelected(RecordPlot plot, boolean selected)
          Called when underlying plot is selected/unselected.
 void setSize(RecordPlot plot, int width, int height)
          Sets the size of the wired plot on the handler, to be able to move/resize objects drawn by the handler.
 boolean shiftKeyPressed(RecordPlot plot, KeyEvent event)
          Called when the shift key is pressed.
 boolean shiftKeyReleased(RecordPlot plot, KeyEvent event)
          Called when the esc key is released.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface hep.wired.services.InteractionHandler
changeCursor, getDescription, isSupportedBy
 

Constructor Detail

AbstractInteractionHandler

protected AbstractInteractionHandler(String name)
Creates an AbstractInteractionHandler.

Method Detail

getID

public String getID()
Specified by:
getID in interface WiredRegistry.ID

getName

public String getName()
Description copied from interface: InteractionHandler
Returns the name of the Interaction Handler.

Specified by:
getName in interface InteractionHandler

setRecord

public void setRecord(RecordPlot plot,
                      Object record)
Description copied from interface: InteractionHandler
Sets the Record which is displayed in the GraphicsPanel. To be used if the interaction handler is event dependent.

Specified by:
setRecord in interface InteractionHandler

setSelected

public void setSelected(RecordPlot plot,
                        boolean selected)
Description copied from interface: InteractionHandler
Called when underlying plot is selected/unselected.

Specified by:
setSelected in interface InteractionHandler

setSize

public void setSize(RecordPlot plot,
                    int width,
                    int height)
Description copied from interface: InteractionHandler
Sets the size of the wired plot on the handler, to be able to move/resize objects drawn by the handler.

Specified by:
setSize in interface InteractionHandler

getWidth

public int getWidth()
Description copied from interface: InteractionHandler
Returns the width of the interaction panel.

Specified by:
getWidth in interface InteractionHandler

getHeight

public int getHeight()
Description copied from interface: InteractionHandler
Returns the height of the interaction panel.

Specified by:
getHeight in interface InteractionHandler

getIcon

public Icon getIcon(int size)
Description copied from interface: InteractionHandler
Returns associated icon

Specified by:
getIcon in interface InteractionHandler

reset

public void reset(RecordPlot plot,
                  InputEvent event)
Description copied from interface: InteractionHandler
Called to reset the interaction handler in its initial state.

Specified by:
reset in interface InteractionHandler

mouseButton1Clicked

public void mouseButton1Clicked(RecordPlot plot,
                                MouseEvent event)
Description copied from interface: InteractionHandler
Called when mouse button 1 is clicked

Specified by:
mouseButton1Clicked in interface InteractionHandler

mouseButton1Pressed

public void mouseButton1Pressed(RecordPlot plot,
                                MouseEvent event)
Description copied from interface: InteractionHandler
Called when mouse button 1 is pressed

Specified by:
mouseButton1Pressed in interface InteractionHandler

mouseButton1Released

public void mouseButton1Released(RecordPlot plot,
                                 MouseEvent event)
Description copied from interface: InteractionHandler
Called when mouse button 1 is released

Specified by:
mouseButton1Released in interface InteractionHandler

mouseButton1DragStarted

public void mouseButton1DragStarted(RecordPlot plot,
                                    MouseEvent event)
Description copied from interface: InteractionHandler
Called when mouse button 1 is starting a drag

Specified by:
mouseButton1DragStarted in interface InteractionHandler

mouseButton1Dragged

public void mouseButton1Dragged(RecordPlot plot,
                                MouseEvent event)
Description copied from interface: InteractionHandler
Called when mouse button 1 is dragged

Specified by:
mouseButton1Dragged in interface InteractionHandler

mouseButton1DragEnded

public void mouseButton1DragEnded(RecordPlot plot,
                                  MouseEvent event)
Description copied from interface: InteractionHandler
Called when mouse button 1 is ending a drag

Specified by:
mouseButton1DragEnded in interface InteractionHandler

mouseMoved

public void mouseMoved(RecordPlot plot,
                       MouseEvent event)
Description copied from interface: InteractionHandler
Called when the mouse is moved

Specified by:
mouseMoved in interface InteractionHandler

mouseEntered

public void mouseEntered(RecordPlot plot,
                         MouseEvent event)
Description copied from interface: InteractionHandler
Called when the mouse is entering the component

Specified by:
mouseEntered in interface InteractionHandler

mouseExited

public void mouseExited(RecordPlot plot,
                        MouseEvent event)
Description copied from interface: InteractionHandler
Called when the mouse is exitting the component

Specified by:
mouseExited in interface InteractionHandler

mouseWheelMoved

public void mouseWheelMoved(RecordPlot plot,
                            MouseWheelEvent event)
Description copied from interface: InteractionHandler
Called when the mousewheel is moved

Specified by:
mouseWheelMoved in interface InteractionHandler

escKeyPressed

public boolean escKeyPressed(RecordPlot plot,
                             KeyEvent event)
Description copied from interface: InteractionHandler
Called when the esc key is pressed. Return true if the event is handled.

Specified by:
escKeyPressed in interface InteractionHandler

escKeyReleased

public boolean escKeyReleased(RecordPlot plot,
                              KeyEvent event)
Description copied from interface: InteractionHandler
Called when the esc key is released. Return true if the event is handled.

Specified by:
escKeyReleased in interface InteractionHandler

altKeyPressed

public boolean altKeyPressed(RecordPlot plot,
                             KeyEvent event)
Description copied from interface: InteractionHandler
Called when the alt key is pressed. Return true if the event is handled.

Specified by:
altKeyPressed in interface InteractionHandler

altKeyReleased

public boolean altKeyReleased(RecordPlot plot,
                              KeyEvent event)
Description copied from interface: InteractionHandler
Called when the alt key is released. Return true if the event is handled.

Specified by:
altKeyReleased in interface InteractionHandler

ctrlKeyPressed

public boolean ctrlKeyPressed(RecordPlot plot,
                              KeyEvent event)
Description copied from interface: InteractionHandler
Called when the ctrl key is pressed. Return true if the event is handled.

Specified by:
ctrlKeyPressed in interface InteractionHandler

ctrlKeyReleased

public boolean ctrlKeyReleased(RecordPlot plot,
                               KeyEvent event)
Description copied from interface: InteractionHandler
Called when the ctrl key is released. Return true if the event is handled.

Specified by:
ctrlKeyReleased in interface InteractionHandler

shiftKeyPressed

public boolean shiftKeyPressed(RecordPlot plot,
                               KeyEvent event)
Description copied from interface: InteractionHandler
Called when the shift key is pressed. Return true if the event is handled.

Specified by:
shiftKeyPressed in interface InteractionHandler

shiftKeyReleased

public boolean shiftKeyReleased(RecordPlot plot,
                                KeyEvent event)
Description copied from interface: InteractionHandler
Called when the esc key is released. Return true if the event is handled.

Specified by:
shiftKeyReleased in interface InteractionHandler

metaKeyPressed

public boolean metaKeyPressed(RecordPlot plot,
                              KeyEvent event)
Description copied from interface: InteractionHandler
Called when the meta/option key is pressed. Return true if the event is handled.

Specified by:
metaKeyPressed in interface InteractionHandler

metaKeyReleased

public boolean metaKeyReleased(RecordPlot plot,
                               KeyEvent event)
Description copied from interface: InteractionHandler
Called when the meta/option key is released. Return true if the event is handled.

Specified by:
metaKeyReleased in interface InteractionHandler

ctrlMetaKeyPressed

public boolean ctrlMetaKeyPressed(RecordPlot plot,
                                  KeyEvent event)
Description copied from interface: InteractionHandler
Called when the ctrl (other OSs) or meta (MacOS) key is pressed key is pressed. Return true if the event is handled. If handles ctrlKeyPressed or metaKeyPressed will NOT be called.

Specified by:
ctrlMetaKeyPressed in interface InteractionHandler

ctrlMetaKeyReleased

public boolean ctrlMetaKeyReleased(RecordPlot plot,
                                   KeyEvent event)
Description copied from interface: InteractionHandler
Called when the ctrl (other OSs) or meta (MacOS) key is released. Return true if the event is handled. If handled crlKeyPressed or metaKeyPressed will NOT be called.

Specified by:
ctrlMetaKeyReleased in interface InteractionHandler

otherKeyPressed

public boolean otherKeyPressed(RecordPlot plot,
                               KeyEvent event)
Description copied from interface: InteractionHandler
Called when any other key is pressed. Return true if the event is handled.

Specified by:
otherKeyPressed in interface InteractionHandler

otherKeyReleased

public boolean otherKeyReleased(RecordPlot plot,
                                KeyEvent event)
Description copied from interface: InteractionHandler
Called when any other key is released. Return true if the event is handled.

Specified by:
otherKeyReleased in interface InteractionHandler

keyTyped

public boolean keyTyped(RecordPlot plot,
                        KeyEvent event)
Description copied from interface: InteractionHandler
Called when a key is typed.

Specified by:
keyTyped in interface InteractionHandler

save

public void save(org.freehep.xml.io.XMLIOManager xmlioManager,
                 org.jdom.Element nodeEl)
Specified by:
save in interface org.freehep.xml.io.XMLIO

restore

public void restore(org.freehep.xml.io.XMLIOManager xmlioManager,
                    org.jdom.Element nodeEl)
Specified by:
restore in interface org.freehep.xml.io.XMLIO

equals

public boolean equals(Object other)
Overridden to use interaction handler name in comparisons.

Overrides:
equals in class Object

hashCode

public int hashCode()
Overridden to use interaction handler name to generate hash code.

Overrides:
hashCode in class Object


Copyright © 1996-2013 FreeHEP. All Rights Reserved.