org.jhotdraw.samples.svg.gui
Class SelectionOpacityIcon

java.lang.Object
  extended by javax.swing.ImageIcon
      extended by org.jhotdraw.samples.svg.gui.SelectionOpacityIcon
All Implemented Interfaces:
java.io.Serializable, javax.accessibility.Accessible, javax.swing.Icon

public class SelectionOpacityIcon
extends javax.swing.ImageIcon

SelectionOpacityIcon visualizes an opacity attribute of the selected Figure(s) in the active DrawingView of a DrawingEditor.

Version:
$Id: SelectionOpacityIcon.java 564 2009-10-10 10:21:01Z rawcoder $
Author:
Werner Randelshofer
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.ImageIcon
javax.swing.ImageIcon.AccessibleImageIcon
 
Field Summary
private  DrawingEditor editor
           
private  AttributeKey<java.awt.Color> fillColorKey
           
private  java.awt.Shape fillShape
           
private  AttributeKey<java.lang.Double> opacityKey
           
private  AttributeKey<java.awt.Color> strokeColorKey
           
private  java.awt.Shape strokeShape
           
 
Fields inherited from class javax.swing.ImageIcon
component, tracker
 
Constructor Summary
SelectionOpacityIcon(DrawingEditor editor, AttributeKey<java.lang.Double> opacityKey, AttributeKey<java.awt.Color> fillColorKey, AttributeKey<java.awt.Color> strokeColorKey, java.awt.Image image, java.awt.Shape fillShape, java.awt.Shape strokeShape)
           
SelectionOpacityIcon(DrawingEditor editor, AttributeKey<java.lang.Double> opacityKey, AttributeKey<java.awt.Color> fillColorKey, AttributeKey<java.awt.Color> strokeColorKey, java.net.URL imageLocation, java.awt.Shape fillShape, java.awt.Shape strokeShape)
          Creates a new instance.
 
Method Summary
 void paintIcon(java.awt.Component c, java.awt.Graphics gr, int x, int y)
           
 
Methods inherited from class javax.swing.ImageIcon
getAccessibleContext, getDescription, getIconHeight, getIconWidth, getImage, getImageLoadStatus, getImageObserver, loadImage, setDescription, setImage, setImageObserver, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

editor

private DrawingEditor editor

opacityKey

private AttributeKey<java.lang.Double> opacityKey

fillColorKey

private AttributeKey<java.awt.Color> fillColorKey

strokeColorKey

private AttributeKey<java.awt.Color> strokeColorKey

fillShape

private java.awt.Shape fillShape

strokeShape

private java.awt.Shape strokeShape
Constructor Detail

SelectionOpacityIcon

public SelectionOpacityIcon(DrawingEditor editor,
                            AttributeKey<java.lang.Double> opacityKey,
                            AttributeKey<java.awt.Color> fillColorKey,
                            AttributeKey<java.awt.Color> strokeColorKey,
                            java.net.URL imageLocation,
                            java.awt.Shape fillShape,
                            java.awt.Shape strokeShape)
Creates a new instance.

Parameters:
editor - The drawing editor.
opacityKey - The opacityKey of the default attribute
imageLocation - the icon image
fillShape - The shape to be drawn with the fillColor of the default attribute.

SelectionOpacityIcon

public SelectionOpacityIcon(DrawingEditor editor,
                            AttributeKey<java.lang.Double> opacityKey,
                            AttributeKey<java.awt.Color> fillColorKey,
                            AttributeKey<java.awt.Color> strokeColorKey,
                            java.awt.Image image,
                            java.awt.Shape fillShape,
                            java.awt.Shape strokeShape)
Method Detail

paintIcon

public void paintIcon(java.awt.Component c,
                      java.awt.Graphics gr,
                      int x,
                      int y)
Specified by:
paintIcon in interface javax.swing.Icon
Overrides:
paintIcon in class javax.swing.ImageIcon