Class AttributeKeys
- java.lang.Object
-
- org.jhotdraw.draw.AttributeKeys
-
- Direct Known Subclasses:
- ODGAttributeKeys, SVGAttributeKeys
public class AttributeKeys extends java.lang.ObjectDefines a put of well knownFigureattributes.If you are developing an applications that uses a different put or an extended put of attributes, it is recommended to create a new AttributeKeys class, and to define all needed AttributeKeys as static variables in there.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classAttributeKeys.Alignmentstatic classAttributeKeys.Orientationstatic classAttributeKeys.StrokePlacementstatic classAttributeKeys.StrokeTypestatic classAttributeKeys.Underfillstatic classAttributeKeys.WindingRule
-
Field Summary
Fields Modifier and Type Field and Description static AttributeKey<Liner>BEZIER_PATH_LAYOUTERThe value of this attribute is a Liner object.static AttributeKey<java.awt.Color>CANVAS_FILL_COLORCanvas fill color.static AttributeKey<java.lang.Double>CANVAS_FILL_OPACITYCanvas fill opacity.static AttributeKey<java.lang.Double>CANVAS_HEIGHTThe height of the canvas.static AttributeKey<java.lang.Double>CANVAS_WIDTHThe width of the canvas.static AttributeKey<AttributeKeys.Alignment>CHILD_ALIGNMENTThe value of this attribute is a Alignment object.static AttributeKey<AttributeKeys.Alignment>COMPOSITE_ALIGNMENTThe value of this attribute is a Alignment object.static AttributeKey<Insets2D.Double>DECORATOR_INSETSThe value of this attribute is a Insets2D.Double object.static AttributeKey<LineDecoration>END_DECORATIONstatic AttributeKey<java.awt.Color>FILL_COLORFigure fill color.static AttributeKey<AttributeKeys.Underfill>FILL_UNDER_STROKEFill under stroke.static AttributeKey<java.lang.Boolean>FONT_BOLDThe value of this attribute is a Boolean object.static AttributeKey<java.awt.Font>FONT_FACEThe value of this attribute is a Font object, which is used as a prototype to create the font for the text.static AttributeKey<java.lang.Boolean>FONT_ITALICThe value of this attribute is a Boolean object.static AttributeKey<java.lang.Double>FONT_SIZEThe value of this attribute is a double object.static AttributeKey<java.lang.Boolean>FONT_UNDERLINEThe value of this attribute is a Boolean object.static AttributeKey<java.lang.Boolean>IS_STROKE_DASH_FACTORA boolean used to indicate whether STROKE_DASHES and STROKE_DASH_PHASE shall be interpreted as factors of STROKE_WIDTH, or whether they are absolute values.static AttributeKey<java.lang.Boolean>IS_STROKE_MITER_LIMIT_FACTORA boolean used to indicate whether STROKE_MITER_LIMIT is a factor of STROKE_WIDTH, or whether it represents an absolute value.static AttributeKey<Insets2D.Double>LAYOUT_INSETSThe value of this attribute is a Insets2D.Double object.static AttributeKey<AttributeKeys.Orientation>ORIENTATIONSpecifies the orientation of a Figure.static AttributeKey<java.lang.Boolean>PATH_CLOSEDWhether to path a BezierFigure is closed.static AttributeKey<LineDecoration>START_DECORATIONstatic AttributeKey<java.lang.Integer>STROKE_CAPStroke join.static AttributeKey<java.awt.Color>STROKE_COLORStroke color.static AttributeKey<java.lang.Double>STROKE_DASH_PHASEA double used to specify the starting phase of the stroke dashes.static AttributeKey<double[]>STROKE_DASHESAn array of doubles used to specify the dash pattern in a BasicStroke;static AttributeKey<java.lang.Double>STROKE_INNER_WIDTH_FACTORFactor for the stroke inner width.static AttributeKey<java.lang.Integer>STROKE_JOINStroke join.static AttributeKey<java.lang.Double>STROKE_MITER_LIMITStroke miter limit factor.static AttributeKey<AttributeKeys.StrokePlacement>STROKE_PLACEMENTStroke placement.static AttributeKey<AttributeKeys.StrokeType>STROKE_TYPEStroke type.static AttributeKey<java.lang.Double>STROKE_WIDTHStroke width.static java.util.Map<java.lang.String,AttributeKey>supportedAttributeMapstatic java.util.Set<AttributeKey>supportedAttributesA put with all attributes defined by this class.static AttributeKey<java.lang.String>TEXTThe value of this attribute is a String object, which is used to display the text of the figure.static AttributeKey<AttributeKeys.Alignment>TEXT_ALIGNMENTText alignment.static AttributeKey<java.awt.Color>TEXT_COLORText color.static AttributeKey<java.awt.Color>TEXT_SHADOW_COLORText shadow color.static AttributeKey<Dimension2DDouble>TEXT_SHADOW_OFFSETText shadow offset.static AttributeKey<java.awt.geom.AffineTransform>TRANSFORMSpecifies the transform of a Figure.static AttributeKey<java.lang.Boolean>UNCLOSED_PATH_FILLEDWhether an unclosed path of a BezierFigure is filled.static AttributeKey<AttributeKeys.WindingRule>WINDING_RULEFill under stroke.
-
Constructor Summary
Constructors Constructor and Description AttributeKeys()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static java.awt.FontgetFont(Figure f)static intgetFontStyle(Figure f)static java.awt.StrokegetHitStroke(Figure f)Returns a stroke which is useful for hit-testing.static doublegetPerpendicularDrawGrowth(Figure f)Returns the distance, that a Rectangle needs to grow (or shrink) to draw (aka stroke) its shape as specified by the FILL_UNDER_STROKE and STROKE_POSITION attributes of a figure.static doublegetPerpendicularFillGrowth(Figure f)Returns the distance, that a Rectangle needs to grow (or shrink) to fill its shape as specified by the FILL_UNDER_STROKE and STROKE_POSITION attributes of a figure.static doublegetPerpendicularHitGrowth(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.StrokegetStroke(Figure f)static doublegetStrokeTotalMiterLimit(Figure f)Convenience method for computing the total stroke miter limit from the STROKE_MITER_LIMIT, and IS_STROKE_MITER_LIMIT factor.static doublegetStrokeTotalWidth(Figure f)Convenience method for computing the total stroke width from the STROKE_WIDTH, STROKE_INNER_WIDTH and STROKE_TYPE attributes.
-
-
-
Field Detail
-
CANVAS_FILL_COLOR
public static final AttributeKey<java.awt.Color> CANVAS_FILL_COLOR
Canvas fill color. The value of this attribute is a Color object. This attribute is used by a Drawing object to specify the fill color of the drawing. The default value is white.
-
CANVAS_FILL_OPACITY
public static final AttributeKey<java.lang.Double> CANVAS_FILL_OPACITY
Canvas fill opacity. The value of this attribute is a Double object. This is a value between 0 and 1 whereas 0 is translucent and 1 is fully opaque.
-
CANVAS_WIDTH
public static final AttributeKey<java.lang.Double> CANVAS_WIDTH
The width of the canvas. The value of this attribute is a Double object. This is a value between 1 and Double.MAX_VALUE. If the value is null, the width is dynamically adapted to the content of the drawing.
-
CANVAS_HEIGHT
public static final AttributeKey<java.lang.Double> CANVAS_HEIGHT
The height of the canvas. The value of this attribute is a Double object. This is a value between 1 and Double.MAX_VALUE. If the value is null, the height is dynamically adapted to the content of the drawing.
-
FILL_COLOR
public static final AttributeKey<java.awt.Color> FILL_COLOR
Figure fill color. The value of this attribute is a Color object.
-
PATH_CLOSED
public static final AttributeKey<java.lang.Boolean> PATH_CLOSED
Whether to path a BezierFigure is closed. The value of this attribute is a Boolean object.
-
UNCLOSED_PATH_FILLED
public static final AttributeKey<java.lang.Boolean> UNCLOSED_PATH_FILLED
Whether an unclosed path of a BezierFigure is filled. The value of this attribute is a Boolean object.
-
WINDING_RULE
public static final AttributeKey<AttributeKeys.WindingRule> WINDING_RULE
Fill under stroke. The value of this attribute is a Boolean object.
-
FILL_UNDER_STROKE
public static final AttributeKey<AttributeKeys.Underfill> FILL_UNDER_STROKE
Fill under stroke. The value of this attribute is a Boolean object.
-
STROKE_COLOR
public static final AttributeKey<java.awt.Color> STROKE_COLOR
Stroke color. The value of this attribute is a Color object.
-
STROKE_WIDTH
public static final AttributeKey<java.lang.Double> STROKE_WIDTH
Stroke width. A double used to construct a BasicStroke or the outline of a DoubleStroke.
-
STROKE_INNER_WIDTH_FACTOR
public static final AttributeKey<java.lang.Double> STROKE_INNER_WIDTH_FACTOR
Factor for the stroke inner width. This is a double. The default value is 2.FIXME - This is not flexible enough. Lets replace this with a STROKE_STRIPES_ARRAY
and a IS_STROKE_STRIPES_FACTOR.
-
STROKE_JOIN
public static final AttributeKey<java.lang.Integer> STROKE_JOIN
Stroke join. One of the BasicStroke.JOIN_... values used to construct a BasicStroke.
-
STROKE_CAP
public static final AttributeKey<java.lang.Integer> STROKE_CAP
Stroke join. One of the BasicStroke.CAP_... values used to construct a BasicStroke.
-
STROKE_MITER_LIMIT
public static final AttributeKey<java.lang.Double> STROKE_MITER_LIMIT
Stroke miter limit factor. A double multiplied by total stroke width, used to construct the miter limit of a BasicStroke.
-
IS_STROKE_MITER_LIMIT_FACTOR
public static final AttributeKey<java.lang.Boolean> IS_STROKE_MITER_LIMIT_FACTOR
A boolean used to indicate whether STROKE_MITER_LIMIT is a factor of STROKE_WIDTH, or whether it represents an absolute value.
-
STROKE_DASHES
public static final AttributeKey<double[]> STROKE_DASHES
An array of doubles used to specify the dash pattern in a BasicStroke;
-
STROKE_DASH_PHASE
public static final AttributeKey<java.lang.Double> STROKE_DASH_PHASE
A double used to specify the starting phase of the stroke dashes.
-
IS_STROKE_DASH_FACTOR
public static final AttributeKey<java.lang.Boolean> IS_STROKE_DASH_FACTOR
A boolean used to indicate whether STROKE_DASHES and STROKE_DASH_PHASE shall be interpreted as factors of STROKE_WIDTH, or whether they are absolute values.
-
STROKE_TYPE
public static final AttributeKey<AttributeKeys.StrokeType> STROKE_TYPE
Stroke type. The value of this attribute is either VALUE_STROKE_TYPE_BASIC or VALUE_STROKE_TYPE_DOUBLE. FIXME - Type should be an enumeration.
-
STROKE_PLACEMENT
public static final AttributeKey<AttributeKeys.StrokePlacement> STROKE_PLACEMENT
Stroke placement. The value is either StrokePlacement.CENTER, StrokePlacement.INSIDE or StrokePlacement.OUTSIDE. This only has effect for closed paths. On open paths, the stroke is always centered on the path.The default value is StrokePlacement.CENTER.
-
TEXT
public static final AttributeKey<java.lang.String> TEXT
The value of this attribute is a String object, which is used to display the text of the figure.
-
TEXT_COLOR
public static final AttributeKey<java.awt.Color> TEXT_COLOR
Text color. The value of this attribute is a Color object.
-
TEXT_SHADOW_COLOR
public static final AttributeKey<java.awt.Color> TEXT_SHADOW_COLOR
Text shadow color. The value of this attribute is a Color object.
-
TEXT_SHADOW_OFFSET
public static final AttributeKey<Dimension2DDouble> TEXT_SHADOW_OFFSET
Text shadow offset. The value of this attribute is a Dimension2DDouble object.
-
TEXT_ALIGNMENT
public static final AttributeKey<AttributeKeys.Alignment> TEXT_ALIGNMENT
Text alignment. The value of this attribute is a Alignment enum.
-
FONT_FACE
public static final AttributeKey<java.awt.Font> FONT_FACE
The value of this attribute is a Font object, which is used as a prototype to create the font for the text.
-
FONT_SIZE
public static final AttributeKey<java.lang.Double> FONT_SIZE
The value of this attribute is a double object.
-
FONT_BOLD
public static final AttributeKey<java.lang.Boolean> FONT_BOLD
The value of this attribute is a Boolean object.
-
FONT_ITALIC
public static final AttributeKey<java.lang.Boolean> FONT_ITALIC
The value of this attribute is a Boolean object.
-
FONT_UNDERLINE
public static final AttributeKey<java.lang.Boolean> FONT_UNDERLINE
The value of this attribute is a Boolean object.
-
BEZIER_PATH_LAYOUTER
public static final AttributeKey<Liner> BEZIER_PATH_LAYOUTER
The value of this attribute is a Liner object.
-
END_DECORATION
public static final AttributeKey<LineDecoration> END_DECORATION
-
START_DECORATION
public static final AttributeKey<LineDecoration> START_DECORATION
-
DECORATOR_INSETS
public static final AttributeKey<Insets2D.Double> DECORATOR_INSETS
The value of this attribute is a Insets2D.Double object.
-
LAYOUT_INSETS
public static final AttributeKey<Insets2D.Double> LAYOUT_INSETS
The value of this attribute is a Insets2D.Double object.This attribute can be put on a CompositeFigure, which uses a Layouter to lay out its children.
The insets are used to determine the insets between the bounds of the CompositeFigure and its children.
-
COMPOSITE_ALIGNMENT
public static final AttributeKey<AttributeKeys.Alignment> COMPOSITE_ALIGNMENT
The value of this attribute is a Alignment object.This attribute can be put on a CompositeFigure, which uses a Layouter to lay out its children.
The insets are used to determine the default alignment of the children of the CompositeFigure.
-
CHILD_ALIGNMENT
public static final AttributeKey<AttributeKeys.Alignment> CHILD_ALIGNMENT
The value of this attribute is a Alignment object.This attribute can be put on a child of a CompositeFigure, which uses a Layouter to lay out its children.
Layouters should use this attribute, to determine the default alignment of the child figures contained in the CompositeFigure which they lay out.
-
TRANSFORM
public static final AttributeKey<java.awt.geom.AffineTransform> TRANSFORM
Specifies the transform of a Figure.
-
ORIENTATION
public static final AttributeKey<AttributeKeys.Orientation> ORIENTATION
Specifies the orientation of a Figure.
-
supportedAttributes
public static final java.util.Set<AttributeKey> supportedAttributes
A put with all attributes defined by this class.
-
supportedAttributeMap
public static final java.util.Map<java.lang.String,AttributeKey> supportedAttributeMap
-
-
Method Detail
-
getStrokeTotalWidth
public static double getStrokeTotalWidth(Figure f)
Convenience method for computing the total stroke width from the STROKE_WIDTH, STROKE_INNER_WIDTH and STROKE_TYPE attributes.
-
getStrokeTotalMiterLimit
public static double getStrokeTotalMiterLimit(Figure f)
Convenience method for computing the total stroke miter limit from the STROKE_MITER_LIMIT, and IS_STROKE_MITER_LIMIT factor.
-
getStroke
public static java.awt.Stroke getStroke(Figure f)
-
getHitStroke
public static java.awt.Stroke getHitStroke(Figure f)
Returns a stroke which is useful for hit-testing. The stroke reflects the stroke width, but not the stroke dashes attribute.- Parameters:
f-- Returns:
- A stroke suited for creating a shape for hit testing.
-
getFontStyle
public static int getFontStyle(Figure f)
-
getPerpendicularFillGrowth
public static double getPerpendicularFillGrowth(Figure f)
Returns the distance, that a Rectangle needs to grow (or shrink) to fill its 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.
-
getPerpendicularDrawGrowth
public static double getPerpendicularDrawGrowth(Figure f)
Returns the distance, that a Rectangle needs to grow (or shrink) to draw (aka stroke) its 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.
-
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.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG