org.pbjar.jxlayer.plaf.misc
Class MouseDrawingUI

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,MouseDrawingUI.DrawingState>
                  extended by org.pbjar.jxlayer.plaf.misc.MouseDrawingUI
All Implemented Interfaces:
Serializable

public class MouseDrawingUI
extends GeneralLayerUI<JComponent,MouseDrawingUI.DrawingState>

A mouse drawing UI.

Author:
Piet Blok
See Also:
Serialized Form

Nested Class Summary
protected static class MouseDrawingUI.ColoredLine
          Defines one line.
protected static class MouseDrawingUI.DrawingState
          Holds state information.
 
Constructor Summary
MouseDrawingUI()
           
 
Method Summary
protected  MouseDrawingUI.DrawingState createStateObject(org.jdesktop.jxlayer.JXLayer<? extends JComponent> layer)
          Create a StateObject specific for this LayerUI and the JXLayer argument.
 List<Action> getActions(org.jdesktop.jxlayer.JXLayer<? extends JComponent> layer)
          Returns Actions for: Clear the current drawing.
protected  void paintLayer(Graphics2D g2, org.jdesktop.jxlayer.JXLayer<? extends JComponent> layer)
           
protected  void processMouseEvent(MouseEvent e, org.jdesktop.jxlayer.JXLayer<? extends JComponent> layer)
           
protected  void processMouseMotionEvent(MouseEvent e, org.jdesktop.jxlayer.JXLayer<? extends JComponent> layer)
           
 
Methods inherited from class org.pbjar.jxlayer.plaf.misc.GeneralLayerUI
cleanupStateObject, getActions, getName, getStateObject, installUI, processMouseWheelEvent, uninstallUI
 
Methods inherited from class org.jdesktop.jxlayer.plaf.AbstractLayerUI
configureGraphics, eventDispatched, getClip, getComposite, getLayerEventMask, getRenderingHints, getTransform, handlePropertyChangeEvent, isDirty, paint, processFocusEvent, processKeyEvent, 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

MouseDrawingUI

public MouseDrawingUI()
Method Detail

getActions

public List<Action> getActions(org.jdesktop.jxlayer.JXLayer<? extends JComponent> layer)
Returns Actions for:
  1. Clear the current drawing.
  2. Set the color for the next line to be drawn.

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

createStateObject

protected MouseDrawingUI.DrawingState createStateObject(org.jdesktop.jxlayer.JXLayer<? extends 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,MouseDrawingUI.DrawingState>
Parameters:
layer - the JXLayer
Returns:
a StateObject or null, if no state is maintained.

paintLayer

protected void paintLayer(Graphics2D g2,
                          org.jdesktop.jxlayer.JXLayer<? extends JComponent> layer)
Overrides:
paintLayer in class org.jdesktop.jxlayer.plaf.AbstractLayerUI<JComponent>

processMouseEvent

protected void processMouseEvent(MouseEvent e,
                                 org.jdesktop.jxlayer.JXLayer<? extends JComponent> layer)
Overrides:
processMouseEvent in class org.jdesktop.jxlayer.plaf.AbstractLayerUI<JComponent>

processMouseMotionEvent

protected void processMouseMotionEvent(MouseEvent e,
                                       org.jdesktop.jxlayer.JXLayer<? extends JComponent> layer)
Overrides:
processMouseMotionEvent in class org.jdesktop.jxlayer.plaf.AbstractLayerUI<JComponent>