org.pbjar.jxlayer.plaf.ext
Class MouseEventUI<V extends JComponent>

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by org.jdesktop.jxlayer.plaf.LayerUI<V>
          extended by org.jdesktop.jxlayer.plaf.AbstractLayerUI<V>
              extended by org.pbjar.jxlayer.plaf.ext.MouseEventUI<V>
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
TransformUI

public class MouseEventUI<V extends JComponent>
extends org.jdesktop.jxlayer.plaf.AbstractLayerUI<V>

This class provides for MouseEvent re-dispatching. It may be used to set a tool tip on JXLayer's glass pane and still have the child components receive MouseEvents.

Note: A MouseEventUI instance cannot be shared and can be set to a single JXLayer instance only.

See Also:
Serialized Form

Constructor Summary
MouseEventUI()
           
 
Method Summary
 void eventDispatched(AWTEvent event, org.jdesktop.jxlayer.JXLayer<V> layer)
          Overridden to allow for re-dispatching of mouse events to their intended (visual) recipients, rather than to the components according to their bounds.
protected  org.jdesktop.jxlayer.JXLayer<V> getInstalledLayer()
           
 long getLayerEventMask()
          Overridden to only get the following event types: AWTEvent.MOUSE_EVENT_MASK, AWTEvent.MOUSE_MOTION_EVENT_MASK and AWTEvent.MOUSE_WHEEL_EVENT_MASK.
 void installUI(JComponent component)
          Overridden to check if this LayerUI has not been installed already, and to set the argument component as the installed JXLayer.
protected  void processMouseWheelEvent(MouseWheelEvent event, org.jdesktop.jxlayer.JXLayer<V> jxlayer)
          Re-dispatches the event to the first component in the hierarchy that has a MouseWheelListener registered.
 void uninstallUI(JComponent c)
          Overridden to remove the installed JXLayer.
 
Methods inherited from class org.jdesktop.jxlayer.plaf.AbstractLayerUI
configureGraphics, eventDispatched, getClip, getComposite, getRenderingHints, getTransform, handlePropertyChangeEvent, isDirty, paint, paintLayer, processFocusEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, setDirty
 
Methods inherited from class org.jdesktop.jxlayer.plaf.LayerUI
addPropertyChangeListener, addPropertyChangeListener, contains, firePropertyChange, getPreferredScrollableViewportSize, getPropertyChangeListeners, getPropertyChangeListeners, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, removePropertyChangeListener, removePropertyChangeListener, updateUI
 
Methods inherited from class javax.swing.plaf.ComponentUI
createUI, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MouseEventUI

public MouseEventUI()
Method Detail

eventDispatched

public void eventDispatched(AWTEvent event,
                            org.jdesktop.jxlayer.JXLayer<V> layer)
Overridden to allow for re-dispatching of mouse events to their intended (visual) recipients, rather than to the components according to their bounds.


getLayerEventMask

public long getLayerEventMask()
Overridden to only get the following event types: AWTEvent.MOUSE_EVENT_MASK, AWTEvent.MOUSE_MOTION_EVENT_MASK and AWTEvent.MOUSE_WHEEL_EVENT_MASK.

Overrides:
getLayerEventMask in class org.jdesktop.jxlayer.plaf.AbstractLayerUI<V extends JComponent>

installUI

public void installUI(JComponent component)
               throws IllegalStateException
Overridden to check if this LayerUI has not been installed already, and to set the argument component as the installed JXLayer.

Overrides:
installUI in class org.jdesktop.jxlayer.plaf.AbstractLayerUI<V extends JComponent>
Throws:
IllegalStateException - when this LayerUI has been installed already
See Also:
getInstalledLayer()

uninstallUI

public void uninstallUI(JComponent c)
Overridden to remove the installed JXLayer.

Overrides:
uninstallUI in class org.jdesktop.jxlayer.plaf.AbstractLayerUI<V extends JComponent>

getInstalledLayer

protected org.jdesktop.jxlayer.JXLayer<V> getInstalledLayer()

processMouseWheelEvent

protected void processMouseWheelEvent(MouseWheelEvent event,
                                      org.jdesktop.jxlayer.JXLayer<V> jxlayer)
Re-dispatches the event to the first component in the hierarchy that has a MouseWheelListener registered.