com.imagero.gui.swing
Class JShape

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended bycom.imagero.gui.swing.JShape
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
Direct Known Subclasses:
JBorderShape, JHistogram

public class JShape
extends javax.swing.JComponent

JShape. Non-rectangular JComponent.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  ShapeUnit[] shapeUnits
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JShape()
           
JShape(java.awt.Shape shape)
           
JShape(ShapeUnit shapeUnit)
           
JShape(ShapeUnit[] shapeUnits)
           
 
Method Summary
 void addMouseListener(java.awt.event.MouseListener l, int index)
           
 void addMouseMotionListener(java.awt.event.MouseMotionListener l, int index)
           
protected  void createClip()
          create clip Shape for this component
 float getAlpha()
           
 java.awt.Shape getClip()
          get clip area for drawing this component
 ShapeUnit getDefaultShapeUnit()
           
protected  com.imagero.gui.swing.JShape.Dispatcher getDispatcher()
           
 java.awt.Dimension getPreferredSize()
          If the preferredSize has been set to a non-null value just returns it.
 double getScaleX()
           
 double getScaleY()
           
 ShapeUnit getShapeUnit(int index)
           
protected  ShapeUnit getShapeUnitAt(int x, int y)
           
 int getShapeUnitCount()
           
 double getShearX()
           
 double getShearY()
           
 javax.swing.plaf.ComponentUI getUI()
           
 java.lang.String getUIClassID()
          Returns the UIDefaults key used to look up the name of the swing.plaf.ComponentUI class that defines the look and feel for this component.
 boolean isOpaque()
          Returns true if this component is completely opaque.
static void main(java.lang.String[] args)
           
 void normalize()
           
protected  void paintChildren(java.awt.Graphics g)
          Paints this component's children.
 void removeMouseListener(java.awt.event.MouseListener l, int index)
           
 void removeMouseMotionListener(java.awt.event.MouseMotionListener l, int index)
           
 void resetTransform()
           
 void rotate(double angle)
           
 void scale(double scaleX, double scaleY)
           
 void setAlpha(float alpha)
           
 void setRotate(double angle)
           
 void setScale(double scaleX, double scaleY)
           
protected  void setShapeUnit(ShapeUnit shapeUnit, int index)
           
protected  void setShapeUnits(ShapeUnit[] shapeUnits)
           
 void setShear(double shearX, double shearY)
           
 void setUI(ShapeUI ui)
           
 void shear(double shearX, double shearY)
           
 void updateUI()
          Resets the UI property to a value from the current look and feel.
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isMaximumSizeSet, isMinimumSizeSet, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, list, list, paintComponents, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getSize, getToolkit, getTreeLock, hasFocus, imageUpdate, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, list, list, list, paintAll, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

shapeUnits

protected ShapeUnit[] shapeUnits
Constructor Detail

JShape

public JShape()

JShape

public JShape(java.awt.Shape shape)

JShape

public JShape(ShapeUnit shapeUnit)

JShape

public JShape(ShapeUnit[] shapeUnits)
Method Detail

addMouseListener

public void addMouseListener(java.awt.event.MouseListener l,
                             int index)

addMouseMotionListener

public void addMouseMotionListener(java.awt.event.MouseMotionListener l,
                                   int index)

createClip

protected void createClip()
create clip Shape for this component


getAlpha

public float getAlpha()

getClip

public java.awt.Shape getClip()
get clip area for drawing this component

Returns:
Shape

getDefaultShapeUnit

public ShapeUnit getDefaultShapeUnit()

getDispatcher

protected com.imagero.gui.swing.JShape.Dispatcher getDispatcher()

getPreferredSize

public java.awt.Dimension getPreferredSize()
Description copied from class: javax.swing.JComponent
If the preferredSize has been set to a non-null value just returns it. If the UI delegate's getPreferredSize method returns a non null value then return that; otherwise defer to the component's layout manager.

Returns:
the value of the preferredSize property
See Also:
JComponent.setPreferredSize(java.awt.Dimension), ComponentUI

getScaleX

public double getScaleX()

getScaleY

public double getScaleY()

getShapeUnit

public ShapeUnit getShapeUnit(int index)

getShapeUnitAt

protected ShapeUnit getShapeUnitAt(int x,
                                   int y)

getShapeUnitCount

public int getShapeUnitCount()

getShearX

public double getShearX()

getShearY

public double getShearY()

getUI

public javax.swing.plaf.ComponentUI getUI()

getUIClassID

public java.lang.String getUIClassID()
Description copied from class: javax.swing.JComponent
Returns the UIDefaults key used to look up the name of the swing.plaf.ComponentUI class that defines the look and feel for this component. Most applications will never need to call this method. Subclasses of JComponent that support pluggable look and feel should override this method to return a UIDefaults key that maps to the ComponentUI subclass that defines their look and feel.

Returns:
the UIDefaults key for a ComponentUI subclass
See Also:
UIDefaults.getUI(javax.swing.JComponent)

isOpaque

public boolean isOpaque()
Description copied from class: javax.swing.JComponent
Returns true if this component is completely opaque.

An opaque component paints every pixel within its rectangular bounds. A non-opaque component paints only a subset of its pixels or none at all, allowing the pixels underneath it to "show through". Therefore, a component that does not fully paint its pixels provides a degree of transparency.

Subclasses that guarantee to always completely paint their contents should override this method and return true.

Returns:
true if this component is completely opaque
See Also:
JComponent.setOpaque(boolean)

main

public static void main(java.lang.String[] args)

normalize

public void normalize()

paintChildren

protected void paintChildren(java.awt.Graphics g)
Description copied from class: javax.swing.JComponent
Paints this component's children. If shouldUseBuffer is true, no component ancestor has a buffer and the component children can use a buffer if they have one. Otherwise, one ancestor has a buffer currently in use and children should not use a buffer to paint.

Parameters:
g - the Graphics context in which to paint
See Also:
JComponent.paint(java.awt.Graphics), Container.paint(java.awt.Graphics)

removeMouseListener

public void removeMouseListener(java.awt.event.MouseListener l,
                                int index)

removeMouseMotionListener

public void removeMouseMotionListener(java.awt.event.MouseMotionListener l,
                                      int index)

resetTransform

public void resetTransform()

rotate

public void rotate(double angle)

scale

public void scale(double scaleX,
                  double scaleY)

setAlpha

public void setAlpha(float alpha)

setRotate

public void setRotate(double angle)

setScale

public void setScale(double scaleX,
                     double scaleY)

setShapeUnit

protected void setShapeUnit(ShapeUnit shapeUnit,
                            int index)

setShapeUnits

protected void setShapeUnits(ShapeUnit[] shapeUnits)

setShear

public void setShear(double shearX,
                     double shearY)

setUI

public void setUI(ShapeUI ui)

shear

public void shear(double shearX,
                  double shearY)

updateUI

public void updateUI()
Description copied from class: javax.swing.JComponent
Resets the UI property to a value from the current look and feel. JComponent subclasses must override this method like this:
   public void updateUI() {
      setUI((SliderUI)UIManager.getUI(this);
   }
  

See Also:
JComponent.setUI(javax.swing.plaf.ComponentUI), UIManager.getLookAndFeel(), UIManager.getUI(javax.swing.JComponent)