public class PicAttributeSet extends java.lang.Object implements PicObjectConstants
Modifier and Type | Field and Description |
---|---|
static jpicedt.graphic.model.DefaultAttributeSet |
DEFAULT_SET
an immutable attribute set that serves as the resolving parent if no resolving parent
is explicitly set
|
protected java.util.HashMap |
map
a map holding name/value pairs
|
protected PicAttributeSet |
parent
if non-null, used as the resolving parent when name is not found in current set
|
ARROW_GLOBAL_SCALE_LENGTH, ARROW_GLOBAL_SCALE_WIDTH, ARROW_INSET_SCALE, ARROW_LENGTH_SCALE, ARROW_WIDTH_LINEWIDTH_SCALE, ARROW_WIDTH_MINIMUM_MM, BRACKET_LENGTH_SCALE, CROSSHATCH, CROSSHATCH_FILLED, DASH_OPAQUE, DASH_TRANSPARENT, DASH1, DASH2, DASH3, DASHED, DIMEN, DOT_SEP, DOT_SEP1, DOT_SEP2, DOT_SEP3, DOTTED, DOUBLE_COLOR, DOUBLE_LINE, DOUBLE_SEP, FILL_COLOR, FILL_STYLE, HATCH_ANGLE, HATCH_COLOR, HATCH_SEP, HATCH_WIDTH, HLINES, HLINES_FILLED, INNER, LEFT_ARROW, LINE_COLOR, LINE_STYLE, LINE_WIDTH, MIDDLE, NONE, OUTER, OVER_STRIKE, OVER_STRIKE_COLOR, OVER_STRIKE_WIDTH, POLYDOTS_ANGLE, POLYDOTS_CIRCLE, POLYDOTS_DISK, POLYDOTS_PENTAGON, POLYDOTS_PENTAGON_FILLED, POLYDOTS_PLUS, POLYDOTS_SCALE_H, POLYDOTS_SCALE_V, POLYDOTS_SIZE_LINEWIDTH_SCALE, POLYDOTS_SIZE_MINIMUM_MM, POLYDOTS_SQUARE, POLYDOTS_SQUARE_FILLED, POLYDOTS_STYLE, POLYDOTS_SUPERIMPOSE, POLYDOTS_TRIANGLE, POLYDOTS_TRIANGLE_FILLED, PS_POINT, PST_CUSTOM, RBRACKET_LENGTH_SCALE, RIGHT_ARROW, SHADOW, SHADOW_ANGLE, SHADOW_COLOR, SHADOW_SIZE, SOLID, TBAR_WIDTH_LINEWIDTH_SCALE, TBAR_WIDTH_MINIMUM_MM, TEXT_BOX_CIRCLE, TEXT_BOX_NO_FRAME, TEXT_BOX_OVAL, TEXT_BOX_RECTANGLE, TEXT_FRAME, TEXT_HALIGN_CENTER, TEXT_HALIGN_LEFT, TEXT_HALIGN_RIGHT, TEXT_HOR_ALIGN, TEXT_ROTATION, TEXT_VALIGN_BASELINE, TEXT_VALIGN_BOTTOM, TEXT_VALIGN_CENTER, TEXT_VALIGN_TOP, TEXT_VERT_ALIGN, VLINES, VLINES_FILLED
Constructor and Description |
---|
PicAttributeSet()
Create a new PicAttributeSet with DEFAULT_SET as the resolving parent.
|
PicAttributeSet(PicAttributeSet src)
cloning constructor
|
Modifier and Type | Method and Description |
---|---|
PicAttributeSet |
copyAttributes()
return a copy of this PicAttributeSet with the same resolving parent as the source,
and which is guaranteed not to change over time.
|
java.lang.Object |
getAttribute(PicAttributeName name)
Returns the attribute with the given name, possibly resolving to parent if "name" is not
defined in this set.
|
int |
getAttributeCount()
Returns the number of attributes contained in this set ; this doesn't include the attributes
of the resolving parent.
|
java.util.Iterator |
getAttributeNames()
Returns an iterator over the names of the attributes in this attribute set ; this
doesn't iterate over the keys of the resolving parent.
|
PicAttributeSet |
getResolveParent()
Returns the resolving parent, or DEFAULT_SET if it's null.
|
void |
setAttribute(PicAttributeName name,
java.lang.Object value)
Add a new name/value pair to the set if it's present nor in the set, nor in the resolving parent,
otherwise modify the value for the given name.
|
void |
setAttributes(PicAttributeSet src)
Sets several name/value pairs at a time from the given set.
|
void |
setResolveParent(PicAttributeSet parent)
set the resolving parent.
|
java.lang.String |
toString()
Returns a text representation of this attribute set, for debugging purpose
|
public static final jpicedt.graphic.model.DefaultAttributeSet DEFAULT_SET
protected java.util.HashMap map
protected PicAttributeSet parent
public PicAttributeSet()
PicObjectConstants
public PicAttributeSet(PicAttributeSet src)
src
- the attribute set to be cloned ; set the resolving parent to the resolving parent
of the source.public PicAttributeSet getResolveParent()
public void setResolveParent(PicAttributeSet parent)
parent
- if null, set the parent to DEFAULT_SET.public PicAttributeSet copyAttributes()
public java.lang.Object getAttribute(PicAttributeName name)
public void setAttribute(PicAttributeName name, java.lang.Object value)
name
- attribute namevalue
- attribute valuejava.lang.IllegalArgumentException
- if value's runtime type is not an allowed class for the given attribute namePicObjectConstants
public void setAttributes(PicAttributeSet src)
public int getAttributeCount()
public java.util.Iterator getAttributeNames()
public java.lang.String toString()
toString
in class java.lang.Object
Submit a bug : syd@jpicedt.org