org.pbjar.jxlayer.plaf.misc
Class MagnifierUI

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.misc.GeneralLayerUI<JComponent,MagnifierUI.MagnifierState>
                  extended by org.pbjar.jxlayer.plaf.misc.MagnifierUI
All Implemented Interfaces:
Serializable

public class MagnifierUI
extends GeneralLayerUI<JComponent,MagnifierUI.MagnifierState>

Shows a magnification glass on top of a component.

Author:
Piet Blok
See Also:
Serialized Form

Nested Class Summary
protected static class MagnifierUI.MagnifierState
          Holds state information.
 
Constructor Summary
MagnifierUI()
          Create an instance with AWTEventListener disabled.
MagnifierUI(boolean enableAWTEventListener)
          Create an instance.
 
Method Summary
protected  MagnifierUI.MagnifierState createStateObject(org.jdesktop.jxlayer.JXLayer<JComponent> layer)
          Create a StateObject specific for this LayerUI and the JXLayer argument.
 List<Action> getActions(org.jdesktop.jxlayer.JXLayer<JComponent> layer)
          Return Actions that: Set magnification factor.
protected  void paintLayer(Graphics2D g2, org.jdesktop.jxlayer.JXLayer<JComponent> layer)
           
protected  void processMouseEvent(MouseEvent e, org.jdesktop.jxlayer.JXLayer<JComponent> layer)
           
protected  void processMouseMotionEvent(MouseEvent e, org.jdesktop.jxlayer.JXLayer<JComponent> layer)
           
 
Methods inherited from class org.pbjar.jxlayer.plaf.misc.GeneralLayerUI
cleanupStateObject, getActions, getName, getStateObject, installUI, isAWTEventListenerEnabled, processMouseWheelEvent, uninstallUI
 
Methods inherited from class org.jdesktop.jxlayer.plaf.AbstractLayerUI
configureGraphics, eventDispatched, getClip, getComposite, getLayerEventMask, 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

MagnifierUI

public MagnifierUI()
Create an instance with AWTEventListener disabled.


MagnifierUI

public MagnifierUI(boolean enableAWTEventListener)
Create an instance.

Via the enableAWTEventListener argument, AWTEventListener can be enabled or disabled.

Parameters:
enableAWTEventListener - if true, AWTEventListener will be enabled. Specifying true Solves a problem with non editable JTextComponents.
Throws:
SecurityException - when enableAWTEventListener is true and if a security manager exists and its checkPermission method doesn't allow the operation.
See Also:
Toolkit.addAWTEventListener(AWTEventListener, long)
Method Detail

getActions

public List<Action> getActions(org.jdesktop.jxlayer.JXLayer<JComponent> layer)
Return Actions that:
  1. Set magnification factor.
  2. Set the glass radius.

Overrides:
getActions in class GeneralLayerUI<JComponent,MagnifierUI.MagnifierState>
Parameters:
layer - the JXLayer
Returns:
a list of applicable actions

createStateObject

protected MagnifierUI.MagnifierState createStateObject(org.jdesktop.jxlayer.JXLayer<JComponent> layer)
Description copied from class: GeneralLayerUI
Create a StateObject specific for this LayerUI and the JXLayer argument. The default implementation returns null.

Overrides:
createStateObject in class GeneralLayerUI<JComponent,MagnifierUI.MagnifierState>
Parameters:
layer - the JXLayer
Returns:
a StateObject or null, if no state is maintained.

paintLayer

protected void paintLayer(Graphics2D g2,
                          org.jdesktop.jxlayer.JXLayer<JComponent> layer)

processMouseEvent

protected void processMouseEvent(MouseEvent e,
                                 org.jdesktop.jxlayer.JXLayer<JComponent> layer)

processMouseMotionEvent

protected void processMouseMotionEvent(MouseEvent e,
                                       org.jdesktop.jxlayer.JXLayer<JComponent> layer)