|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.plaf.ComponentUI
org.jdesktop.jxlayer.plaf.LayerUI<V>
org.jdesktop.jxlayer.plaf.AbstractLayerUI<javax.swing.JScrollPane>
org.jdesktop.jxlayer.plaf.ext.MouseScrollableUI
public class MouseScrollableUI
The MouseScrollableUI provides the mouse auto-scrolling feature
for your applications. Wrap your JScrollPane with a JXLayer,
set an instance of MouseScrollableUI as the JXLayer's ui
and after that, pressing the middle mouse button inside the JScrollPane
will activate the auto-scrolling mode.
MouseScrollableUI:
// a JScrollPane to be enhanced with mouse auto-scrolling
JScrollPane myScrollPane = getMyScrollPane();
JXLayer<JScrollPane> layer =
new JXLayer<JScrollPane>(myScrollPane, new MouseScrollableUI());
// add the layer to a frame or a panel, like any other component
frame.add(layer);
The MouseScrollableDemo is
available
| Constructor Summary | |
|---|---|
MouseScrollableUI()
Creates a new instance of MouseScrollableUI. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
|
void |
eventDispatched(java.awt.AWTEvent e,
JXLayer<? extends javax.swing.JScrollPane> l)
Dispatches AWTEvents for JXLayer
and all it subcomponents to this LayerUI.
To enable the process<eventType>Event
method for the given class of event.
Preprocesses the AWTEvent to deactivate mouse scrolling
when any key was pressed or focus left the JXLayer. |
void |
installUI(javax.swing.JComponent c)
Configures the JXLayer this LayerUI is set to. |
protected boolean |
isMouseScrollingTrigger(java.awt.event.MouseEvent mouseEvent)
Returns true if mouseEvent is a mouse auto-scrolling trigger. |
protected void |
processMouseEvent(java.awt.event.MouseEvent e,
JXLayer<? extends javax.swing.JScrollPane> l)
Processes MouseEvent occurring on the JXLayer
or any of its subcomponents.
Activates the mouse auto-scrolling if e is a scrolling trigger. |
protected void |
processMouseMotionEvent(java.awt.event.MouseEvent e,
JXLayer<? extends javax.swing.JScrollPane> l)
Processes mouse motion events occurring on the JXLayer
or any of its subcomponents.
Scrolls the JXLayer's view JScrollPane
if mouse scrolling is activated |
void |
uninstallUI(javax.swing.JComponent c)
|
| Methods inherited from class org.jdesktop.jxlayer.plaf.AbstractLayerUI |
|---|
configureGraphics, getClip, getComposite, getLayerEventMask, getRenderingHints, getTransform, handlePropertyChangeEvent, isDirty, paint, paintLayer, processFocusEvent, processKeyEvent, processMouseWheelEvent, setDirty |
| Methods inherited from class javax.swing.plaf.ComponentUI |
|---|
contains, createUI, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, getPreferredSize, update |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MouseScrollableUI()
MouseScrollableUI.
| Method Detail |
|---|
public void installUI(javax.swing.JComponent c)
LayerUIJXLayer this LayerUI is set to.
The default implementation registers the LayerUI
as a property change listener for the passed JXLayer
installUI in class AbstractLayerUI<javax.swing.JScrollPane>c - the JXLayer where this UI delegate is being installedpublic void uninstallUI(javax.swing.JComponent c)
LayerUI
uninstallUI in class AbstractLayerUI<javax.swing.JScrollPane>
protected void processMouseEvent(java.awt.event.MouseEvent e,
JXLayer<? extends javax.swing.JScrollPane> l)
MouseEvent occurring on the JXLayer
or any of its subcomponents.
Activates the mouse auto-scrolling if e is a scrolling trigger.
processMouseEvent in class AbstractLayerUI<javax.swing.JScrollPane>e - the MouseEvent to be processedl - the layer this LayerUI is set toisMouseScrollingTrigger(MouseEvent)protected boolean isMouseScrollingTrigger(java.awt.event.MouseEvent mouseEvent)
true if mouseEvent is a mouse auto-scrolling trigger.
mouseEvent - the mouseEvent to be tested
true if mouseEvent is a mouse auto-scrolling trigger,
otherwise returns false
protected void processMouseMotionEvent(java.awt.event.MouseEvent e,
JXLayer<? extends javax.swing.JScrollPane> l)
JXLayer
or any of its subcomponents.
Scrolls the JXLayer's view JScrollPane
if mouse scrolling is activated
processMouseMotionEvent in class AbstractLayerUI<javax.swing.JScrollPane>e - the MouseEvent to be processedl - the layer this LayerUI is set to
public void eventDispatched(java.awt.AWTEvent e,
JXLayer<? extends javax.swing.JScrollPane> l)
AWTEvents for JXLayer
and all it subcomponents to this LayerUI.
To enable the AWTEvent of particular type,
you should call JXLayer.setLayerEventMask(long)
in LayerUI.installUI(javax.swing.JComponent)
and set the layer event mask to 0
in LayerUI.uninstallUI(javax.swing.JComponent) after that
process<eventType>Event
method for the given class of event.
Preprocesses the AWTEvent to deactivate mouse scrolling
when any key was pressed or focus left the JXLayer.
eventDispatched in class AbstractLayerUI<javax.swing.JScrollPane>e - the event to be dispatchedl - the layer this LayerUI is set toJXLayer.setLayerEventMask(long),
JXLayer.getLayerEventMask()public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListener
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||