com.imagero.gui.swing.plaf.basic
Class BasicShapeUI

java.lang.Object
  extended byjavax.swing.plaf.ComponentUI
      extended bycom.imagero.gui.swing.plaf.ShapeUI
          extended bycom.imagero.gui.swing.plaf.basic.BasicShapeUI

public class BasicShapeUI
extends ShapeUI

BasicShapeUI.java


Constructor Summary
BasicShapeUI()
           
 
Method Summary
 boolean contains(javax.swing.JComponent c, int x, int y)
          Returns true if the specified x,y location is contained within the look and feel's defined shape of the specified component.
protected  java.awt.event.ComponentListener createComponentListener()
           
protected  java.awt.event.MouseListener createMouseListener()
           
protected  java.beans.PropertyChangeListener createPropertyChangeListener()
           
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
          Returns an instance of the UI delegate for the specified component.
protected  java.awt.event.ComponentListener getComponentListener()
           
protected  java.awt.event.MouseListener getMouseListener()
           
protected  java.beans.PropertyChangeListener getPropertyChangeListener()
           
protected  void installListeners(JShape js)
           
 void installUI(javax.swing.JComponent c)
          Configures the specified component appropriate for the look and feel.
 boolean isSelected(javax.swing.JComponent c)
           
 void paint(java.awt.Graphics2D g, javax.swing.JComponent c)
           
 void paint(java.awt.Graphics g, javax.swing.JComponent c)
          Paints the specified component appropriate for the look and feel.
protected  void uninstallListeners(JShape js)
           
 void uninstallUI(javax.swing.JComponent c)
          Reverses configuration which was done on the specified component during installUI.
 
Methods inherited from class javax.swing.plaf.ComponentUI
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

BasicShapeUI

public BasicShapeUI()
Method Detail

contains

public boolean contains(javax.swing.JComponent c,
                        int x,
                        int y)
Description copied from class: javax.swing.plaf.ComponentUI
Returns true if the specified x,y location is contained within the look and feel's defined shape of the specified component. x and y are defined to be relative to the coordinate system of the specified component. Although a component's bounds is constrained to a rectangle, this method provides the means for defining a non-rectangular shape within those bounds for the purpose of hit detection.

Parameters:
c - the component where the x,y location is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
x - the x coordinate of the point
y - the y coordinate of the point
See Also:
JComponent.contains(int, int), Component.contains(int, int)

createComponentListener

protected java.awt.event.ComponentListener createComponentListener()

createMouseListener

protected java.awt.event.MouseListener createMouseListener()

createPropertyChangeListener

protected java.beans.PropertyChangeListener createPropertyChangeListener()

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
Description copied from class: javax.swing.plaf.ComponentUI
Returns an instance of the UI delegate for the specified component. Each subclass must provide its own static createUI method that returns an instance of that UI delegate subclass. If the UI delegate subclass is stateless, it may return an instance that is shared by multiple components. If the UI delegate is stateful, then it should return a new instance per component. The default implementation of this method throws an error, as it should never be invoked.


getComponentListener

protected java.awt.event.ComponentListener getComponentListener()

getMouseListener

protected java.awt.event.MouseListener getMouseListener()

getPropertyChangeListener

protected java.beans.PropertyChangeListener getPropertyChangeListener()

installListeners

protected void installListeners(JShape js)

installUI

public void installUI(javax.swing.JComponent c)
Description copied from class: javax.swing.plaf.ComponentUI
Configures the specified component appropriate for the look and feel. This method is invoked when the ComponentUI instance is being installed as the UI delegate on the specified component. This method should completely configure the component for the look and feel, including the following:
  1. Install any default property values for color, fonts, borders, icons, opacity, etc. on the component. Whenever possible, property values initialized by the client program should not be overridden.
  2. Install a LayoutManager on the component if necessary.
  3. Create/add any required sub-components to the component.
  4. Create/install event listeners on the component.
  5. Create/install a PropertyChangeListener on the component in order to detect and respond to component property changes appropriately.
  6. Install keyboard UI (mnemonics, traversal, etc.) on the component.
  7. Initialize any appropriate instance data.

Parameters:
c - the component where this UI delegate is being installed
See Also:
ComponentUI.uninstallUI(javax.swing.JComponent), JComponent.setUI(javax.swing.plaf.ComponentUI), JComponent.updateUI()

isSelected

public boolean isSelected(javax.swing.JComponent c)

paint

public void paint(java.awt.Graphics2D g,
                  javax.swing.JComponent c)

paint

public void paint(java.awt.Graphics g,
                  javax.swing.JComponent c)
Description copied from class: javax.swing.plaf.ComponentUI
Paints the specified component appropriate for the look and feel. This method is invoked from the ComponentUI.update method when the specified component is being painted. Subclasses should override this method and use the specified Graphics object to render the content of the component.

Parameters:
g - the Graphics context in which to paint
c - the component being painted; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
See Also:
ComponentUI.update(java.awt.Graphics, javax.swing.JComponent)

uninstallListeners

protected void uninstallListeners(JShape js)

uninstallUI

public void uninstallUI(javax.swing.JComponent c)
Description copied from class: javax.swing.plaf.ComponentUI
Reverses configuration which was done on the specified component during installUI. This method is invoked when this UIComponent instance is being removed as the UI delegate for the specified component. This method should undo the configuration performed in installUI, being careful to leave the JComponent instance in a clean state (no extraneous listeners, look-and-feel-specific property objects, etc.). This should include the following:
  1. Remove any UI-set borders from the component.
  2. Remove any UI-set layout managers on the component.
  3. Remove any UI-added sub-components from the component.
  4. Remove any UI-added event/property listeners from the component.
  5. Remove any UI-installed keyboard UI from the component.
  6. Nullify any allocated instance data objects to allow for GC.

Parameters:
c - the component from which this UI delegate is being removed; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
See Also:
ComponentUI.installUI(javax.swing.JComponent), JComponent.updateUI()