Class MouseEventAdapter
- java.lang.Object
-
- net.sf.jguiraffe.gui.platform.swing.builder.event.SwingEventAdapter
-
- net.sf.jguiraffe.gui.platform.swing.builder.event.MouseEventAdapter
-
- All Implemented Interfaces:
MouseListener,EventListener
public class MouseEventAdapter extends SwingEventAdapter implements MouseListener
A specific Swing event adapter implementation that deals with mouse events.
- Version:
- $Id: MouseEventAdapter.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Constructor Summary
Constructors Constructor Description MouseEventAdapter(net.sf.jguiraffe.gui.builder.event.FormEventManager eventManager, net.sf.jguiraffe.gui.forms.ComponentHandler<?> handler, String name)Creates a new instance ofMouseEventAdapterthat passes the events it receives to theFormEventManager.MouseEventAdapter(net.sf.jguiraffe.gui.builder.event.FormMouseListener l, net.sf.jguiraffe.gui.forms.ComponentHandler<?> handler, String name)Creates a new instance ofMouseEventAdapterthat passes the events it receives to the specifiedFormMouseListener.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected net.sf.jguiraffe.gui.builder.event.FormMouseEventcreateEvent(MouseEvent srcEvent, net.sf.jguiraffe.gui.builder.event.FormMouseEvent.Type type)Creates aFormMouseEventfrom the specified source Swing event using the given event type.protected net.sf.jguiraffe.gui.builder.event.FormListenerTypegetListenerType()Returns theFormListenerTypefor this event adapter.voidmouseClicked(MouseEvent event)Notifies this listener about a mouse entered event.voidmouseEntered(MouseEvent event)Notifies this listener about a mouse entered event.voidmouseExited(MouseEvent event)Notifies this listener about a mouse exited event.voidmousePressed(MouseEvent event)Notifies this listener about a mouse pressed event.voidmouseReleased(MouseEvent event)Notifies this listener about a mouse released event.-
Methods inherited from class net.sf.jguiraffe.gui.platform.swing.builder.event.SwingEventAdapter
fireEvent, getEventListener, getEventManager, getHandler, getName
-
-
-
-
Constructor Detail
-
MouseEventAdapter
public MouseEventAdapter(net.sf.jguiraffe.gui.builder.event.FormMouseListener l, net.sf.jguiraffe.gui.forms.ComponentHandler<?> handler, String name)Creates a new instance ofMouseEventAdapterthat passes the events it receives to the specifiedFormMouseListener.- Parameters:
l- theFormMouseListener(must not be null)handler- theComponentHandlername- the name of the component- Throws:
IllegalArgumentException- if theFormMouseListeneris null
-
MouseEventAdapter
public MouseEventAdapter(net.sf.jguiraffe.gui.builder.event.FormEventManager eventManager, net.sf.jguiraffe.gui.forms.ComponentHandler<?> handler, String name)Creates a new instance ofMouseEventAdapterthat passes the events it receives to theFormEventManager.- Parameters:
eventManager- theFormEventManager(must not be null)handler- theComponentHandlername- the name of the component- Throws:
IllegalArgumentException- if theFormEventManageris null
-
-
Method Detail
-
mouseClicked
public void mouseClicked(MouseEvent event)
Notifies this listener about a mouse entered event. This implementation checks theclickCountproperty to find out whether this is a normal click or a double click. This determines the type of the correspondingFormMouseEvent. Then such aFormMouseEventis created and passed to theSwingEventAdapter.fireEvent(net.sf.jguiraffe.gui.builder.event.FormEvent)method.- Specified by:
mouseClickedin interfaceMouseListener- Parameters:
event- the Swing mouse event
-
mouseEntered
public void mouseEntered(MouseEvent event)
Notifies this listener about a mouse entered event. This implementation creates a correspondingFormMouseEventand passes it to theSwingEventAdapter.fireEvent(net.sf.jguiraffe.gui.builder.event.FormEvent)method.- Specified by:
mouseEnteredin interfaceMouseListener- Parameters:
event- the Swing mouse event
-
mouseExited
public void mouseExited(MouseEvent event)
Notifies this listener about a mouse exited event. This implementation creates a correspondingFormMouseEventand passes it to theSwingEventAdapter.fireEvent(net.sf.jguiraffe.gui.builder.event.FormEvent)method.- Specified by:
mouseExitedin interfaceMouseListener- Parameters:
event- the Swing mouse event
-
mousePressed
public void mousePressed(MouseEvent event)
Notifies this listener about a mouse pressed event. This implementation creates a correspondingFormMouseEventand passes it to theSwingEventAdapter.fireEvent(net.sf.jguiraffe.gui.builder.event.FormEvent)method.- Specified by:
mousePressedin interfaceMouseListener- Parameters:
event- the Swing mouse event
-
mouseReleased
public void mouseReleased(MouseEvent event)
Notifies this listener about a mouse released event. This implementation creates a correspondingFormMouseEventand passes it to theSwingEventAdapter.fireEvent(net.sf.jguiraffe.gui.builder.event.FormEvent)method.- Specified by:
mouseReleasedin interfaceMouseListener- Parameters:
event- the Swing mouse event
-
getListenerType
protected net.sf.jguiraffe.gui.builder.event.FormListenerType getListenerType()
Returns theFormListenerTypefor this event adapter. This implementation returns the type for mouse listeners.- Specified by:
getListenerTypein classSwingEventAdapter- Returns:
- the
FormListenerType
-
createEvent
protected net.sf.jguiraffe.gui.builder.event.FormMouseEvent createEvent(MouseEvent srcEvent, net.sf.jguiraffe.gui.builder.event.FormMouseEvent.Type type)
Creates aFormMouseEventfrom the specified source Swing event using the given event type.- Parameters:
srcEvent- the source Swing eventtype- the event type- Returns:
- the new
FormMouseEvent
-
-