public class MouseEventAdapter extends SwingEventAdapter implements MouseListener
A specific Swing event adapter implementation that deals with mouse events.
Constructor and Description |
---|
MouseEventAdapter(FormEventManager eventManager,
ComponentHandler<?> handler,
String name)
Creates a new instance of
MouseEventAdapter that passes the
events it receives to the FormEventManager . |
MouseEventAdapter(FormMouseListener l,
ComponentHandler<?> handler,
String name)
Creates a new instance of
MouseEventAdapter that passes the
events it receives to the specified FormMouseListener . |
Modifier and Type | Method and Description |
---|---|
protected FormMouseEvent |
createEvent(MouseEvent srcEvent,
FormMouseEvent.Type type)
Creates a
FormMouseEvent from the specified source Swing event
using the given event type. |
protected FormListenerType |
getListenerType()
Returns the
FormListenerType for this event adapter. |
void |
mouseClicked(MouseEvent event)
Notifies this listener about a mouse entered event.
|
void |
mouseEntered(MouseEvent event)
Notifies this listener about a mouse entered event.
|
void |
mouseExited(MouseEvent event)
Notifies this listener about a mouse exited event.
|
void |
mousePressed(MouseEvent event)
Notifies this listener about a mouse pressed event.
|
void |
mouseReleased(MouseEvent event)
Notifies this listener about a mouse released event.
|
fireEvent, getEventListener, getEventManager, getHandler, getName
public MouseEventAdapter(FormMouseListener l, ComponentHandler<?> handler, String name)
MouseEventAdapter
that passes the
events it receives to the specified FormMouseListener
.l
- the FormMouseListener
(must not be null)handler
- the ComponentHandler
name
- the name of the componentIllegalArgumentException
- if the FormMouseListener
is
nullpublic MouseEventAdapter(FormEventManager eventManager, ComponentHandler<?> handler, String name)
MouseEventAdapter
that passes the
events it receives to the FormEventManager
.eventManager
- the FormEventManager
(must not be
null)handler
- the ComponentHandler
name
- the name of the componentIllegalArgumentException
- if the FormEventManager
is
nullpublic void mouseClicked(MouseEvent event)
clickCount
property to find out whether this is a
normal click or a double click. This determines the type of the
corresponding FormMouseEvent
. Then such a FormMouseEvent
is created and passed to the
SwingEventAdapter.fireEvent(net.sf.jguiraffe.gui.builder.event.FormEvent)
method.mouseClicked
in interface MouseListener
event
- the Swing mouse eventpublic void mouseEntered(MouseEvent event)
FormMouseEvent
and passes it to the
SwingEventAdapter.fireEvent(net.sf.jguiraffe.gui.builder.event.FormEvent)
method.mouseEntered
in interface MouseListener
event
- the Swing mouse eventpublic void mouseExited(MouseEvent event)
FormMouseEvent
and passes it to the
SwingEventAdapter.fireEvent(net.sf.jguiraffe.gui.builder.event.FormEvent)
method.mouseExited
in interface MouseListener
event
- the Swing mouse eventpublic void mousePressed(MouseEvent event)
FormMouseEvent
and passes it to the
SwingEventAdapter.fireEvent(net.sf.jguiraffe.gui.builder.event.FormEvent)
method.mousePressed
in interface MouseListener
event
- the Swing mouse eventpublic void mouseReleased(MouseEvent event)
FormMouseEvent
and passes it to the
SwingEventAdapter.fireEvent(net.sf.jguiraffe.gui.builder.event.FormEvent)
method.mouseReleased
in interface MouseListener
event
- the Swing mouse eventprotected FormListenerType getListenerType()
FormListenerType
for this event adapter. This
implementation returns the type for mouse listeners.getListenerType
in class SwingEventAdapter
FormListenerType
protected FormMouseEvent createEvent(MouseEvent srcEvent, FormMouseEvent.Type type)
FormMouseEvent
from the specified source Swing event
using the given event type.srcEvent
- the source Swing eventtype
- the event typeFormMouseEvent
Copyright © 2016 The JGUIraffe Team. All rights reserved.