JHotDraw 7.0.9

org.jhotdraw.samples.svg
Class SVGAttributeKeys

java.lang.Object
  extended by org.jhotdraw.draw.AttributeKeys
      extended by org.jhotdraw.samples.svg.SVGAttributeKeys

public class SVGAttributeKeys
extends AttributeKeys

SVGAttributeKeys.

Version:
1.2 2007-04-22 Attribute Key LINK added.
1.1 2007-04-10 Attribute key TEXT_ALIGN added.
1.0 December 9, 2006 Created.
Author:
Werner Randelshofer

Nested Class Summary
static class SVGAttributeKeys.TextAlign
           
static class SVGAttributeKeys.TextAnchor
           
 
Nested classes/interfaces inherited from class org.jhotdraw.draw.AttributeKeys
AttributeKeys.Orientation, AttributeKeys.StrokePlacement, AttributeKeys.StrokeType, AttributeKeys.Underfill, AttributeKeys.WindingRule
 
Field Summary
static AttributeKey<Gradient> FILL_GRADIENT
          Specifies the fill gradient of a SVG figure.
static AttributeKey<java.lang.Double> FILL_OPACITY
          Specifies the fill opacity of a SVG figure.
static AttributeKey<java.lang.String> LINK
          Specifies a link.
static AttributeKey<java.lang.Double> OPACITY
          Specifies the overall opacity of a SVG figure.
static AttributeKey<Gradient> STROKE_GRADIENT
          Specifies the stroke gradient of a SVG figure.
static AttributeKey<java.lang.Double> STROKE_OPACITY
          Specifies the stroke opacity of a SVG figure.
static AttributeKey<SVGAttributeKeys.TextAlign> TEXT_ALIGN
          Specifies the text alignment of a SVGText figure.
static AttributeKey<SVGAttributeKeys.TextAnchor> TEXT_ANCHOR
          Specifies the text anchor of a SVGText figure.
 
Fields inherited from class org.jhotdraw.draw.AttributeKeys
BEZIER_PATH_LAYOUTER, CLOSED, DECORATOR_INSETS, END_DECORATION, FILL_COLOR, FILL_OPEN_PATH, FILL_UNDER_STROKE, FONT_BOLD, FONT_FACE, FONT_ITALIC, FONT_SIZE, FONT_UNDERLINE, IS_STROKE_DASH_FACTOR, IS_STROKE_MITER_LIMIT_FACTOR, LAYOUT_INSETS, ORIENTATION, START_DECORATION, STROKE_CAP, STROKE_COLOR, STROKE_DASH_PHASE, STROKE_DASHES, STROKE_INNER_WIDTH_FACTOR, STROKE_JOIN, STROKE_MITER_LIMIT, STROKE_PLACEMENT, STROKE_TYPE, STROKE_WIDTH, supportedAttributeMap, supportedAttributes, TEXT, TEXT_COLOR, TEXT_SHADOW_COLOR, TEXT_SHADOW_OFFSET, TRANSFORM, WINDING_RULE
 
Constructor Summary
SVGAttributeKeys()
           
 
Method Summary
static java.awt.Paint getFillPaint(Figure f)
          Gets the fill paint for the specified figure based on the attributes FILL_GRADIENT, FILL_OPACITY, FILL_PAINT and the bounds of the figure.
static double getPerpendicularHitGrowth(Figure f)
          Returns the distance, that a Rectangle needs to grow (or shrink) to make hit detections on a shape as specified by the FILL_UNDER_STROKE and STROKE_POSITION attributes of a figure.
static java.awt.Paint getStrokePaint(Figure f)
          Gets the stroke paint for the specified figure based on the attributes STROKE_GRADIENT, STROKE_OPACITY, STROKE_PAINT and the bounds of the figure.
static void setDefaults(Figure f)
          Sets SVG default values.
 
Methods inherited from class org.jhotdraw.draw.AttributeKeys
getFont, getFontStyle, getPerpendicularDrawGrowth, getPerpendicularFillGrowth, getStroke, getStrokeTotalMiterLimit, getStrokeTotalWidth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEXT_ANCHOR

public static final AttributeKey<SVGAttributeKeys.TextAnchor> TEXT_ANCHOR
Specifies the text anchor of a SVGText figure.


TEXT_ALIGN

public static final AttributeKey<SVGAttributeKeys.TextAlign> TEXT_ALIGN
Specifies the text alignment of a SVGText figure.


FILL_GRADIENT

public static final AttributeKey<Gradient> FILL_GRADIENT
Specifies the fill gradient of a SVG figure.


FILL_OPACITY

public static final AttributeKey<java.lang.Double> FILL_OPACITY
Specifies the fill opacity of a SVG figure. This is a value between 0 and 1 whereas 0 is translucent and 1 is fully opaque.


OPACITY

public static final AttributeKey<java.lang.Double> OPACITY
Specifies the overall opacity of a SVG figure. This is a value between 0 and 1 whereas 0 is translucent and 1 is fully opaque.


STROKE_GRADIENT

public static final AttributeKey<Gradient> STROKE_GRADIENT
Specifies the stroke gradient of a SVG figure.


STROKE_OPACITY

public static final AttributeKey<java.lang.Double> STROKE_OPACITY
Specifies the stroke opacity of a SVG figure. This is a value between 0 and 1 whereas 0 is translucent and 1 is fully opaque.


LINK

public static final AttributeKey<java.lang.String> LINK
Specifies a link. In an SVG file, the link is stored in a "a" element which encloses the figure. http://www.w3.org/TR/SVGMobile12/linking.html#AElement

Constructor Detail

SVGAttributeKeys

public SVGAttributeKeys()
Method Detail

getFillPaint

public static java.awt.Paint getFillPaint(Figure f)
Gets the fill paint for the specified figure based on the attributes FILL_GRADIENT, FILL_OPACITY, FILL_PAINT and the bounds of the figure. Returns null if the figure is not filled.


getStrokePaint

public static java.awt.Paint getStrokePaint(Figure f)
Gets the stroke paint for the specified figure based on the attributes STROKE_GRADIENT, STROKE_OPACITY, STROKE_PAINT and the bounds of the figure. Returns null if the figure is not filled.


setDefaults

public static void setDefaults(Figure f)
Sets SVG default values.


getPerpendicularHitGrowth

public static double getPerpendicularHitGrowth(Figure f)
Returns the distance, that a Rectangle needs to grow (or shrink) to make hit detections on a shape as specified by the FILL_UNDER_STROKE and STROKE_POSITION attributes of a figure. The value returned is the number of units that need to be grown (or shrunk) perpendicular to a stroke on an outline of the shape.


Copyright 1996-2007 (c) JHotDraw.org.
Some rights reserved.