JHotDraw 7.1

org.jhotdraw.samples.odg
Class ODGAttributeKeys

java.lang.Object
  extended by org.jhotdraw.draw.AttributeKeys
      extended by org.jhotdraw.samples.odg.ODGAttributeKeys

public class ODGAttributeKeys
extends AttributeKeys

ODGAttributeKeys.

The descriptions of the attributes have been taken from the Open Document Specification version 1.1. http://docs.oasis-open.org/office/v1.1/OS/OpenDocument-v1.1.pdf

Version:
1.0 July 28, 2007 Created.
Author:
Werner Randelshofer

Nested Class Summary
 
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 ODG figure.
static AttributeKey<java.lang.Double> FILL_OPACITY
          Specifies the fill opacity of a ODG figure.
static AttributeKey<ODGConstants.FillStyle> FILL_STYLE
          Specifies the fill style of a ODG figure.
static AttributeKey<java.lang.String> NAME
          The attribute draw:name assigns a name to the drawing shape.
static AttributeKey<java.lang.Double> OPACITY
          Specifies the overall opacity of a ODG figure.
static AttributeKey<Gradient> STROKE_GRADIENT
          Specifies the stroke gradient of a ODG figure.
static AttributeKey<java.lang.Double> STROKE_OPACITY
          Specifies the stroke opacity of a ODG figure.
static AttributeKey<ODGConstants.StrokeStyle> STROKE_STYLE
          Specifies the stroke style of a ODG figure.
 
Fields inherited from class org.jhotdraw.draw.AttributeKeys
BEZIER_PATH_LAYOUTER, CANVAS_FILL_COLOR, CANVAS_FILL_OPACITY, 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
 
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 java.awt.Stroke getStroke(Figure f)
           
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 ODG default values.
 
Methods inherited from class org.jhotdraw.draw.AttributeKeys
getFont, getFontStyle, getPerpendicularDrawGrowth, getPerpendicularFillGrowth, getPerpendicularHitGrowth, getStrokeTotalMiterLimit, getStrokeTotalWidth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final AttributeKey<java.lang.String> NAME
The attribute draw:name assigns a name to the drawing shape.


OPACITY

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


FILL_STYLE

public static final AttributeKey<ODGConstants.FillStyle> FILL_STYLE
Specifies the fill style of a ODG figure. The attribute draw:fill specifies the fill style for a graphic object. Graphic objects that are not closed, such as a path without a closepath at the end, will not be filled. The fill operation does not automatically close all open subpaths by connecting the last point of the subpath with the first point of the subpath before painting the fill. The attribute has the following values: • none: the drawing object is not filled. • solid: the drawing object is filled with color specified by the draw:fill-color attribute. • bitmap: the drawing object is filled with the bitmap specified by the draw:fill-image- name attribute. • gradient: the drawing object is filled with the gradient specified by the draw:fill- gradient-name attribute. • hatch: the drawing object is filled with the hatch specified by the draw:fill-hatch-name attribute.


FILL_GRADIENT

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


FILL_OPACITY

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


STROKE_STYLE

public static final AttributeKey<ODGConstants.StrokeStyle> STROKE_STYLE
Specifies the stroke style of a ODG figure. The attribute draw:stroke specifies the style of the stroke on the current object. The value none means that no stroke is drawn, and the value solid means that a solid stroke is drawn. If the value is dash, the stroke referenced by the draw:stroke-dash property is drawn.


STROKE_GRADIENT

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


STROKE_OPACITY

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

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.


getStroke

public static java.awt.Stroke getStroke(Figure f)

setDefaults

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


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