|
|||||||||
Home >> All >> jpicedt >> graphic >> [ model overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: ![]() ![]() ![]() |
DETAIL: FIELD | CONSTR | METHOD |
jpicedt.graphic.model
Class PicAttributeSet

java.lang.Objectjpicedt.graphic.model.PicAttributeSet
- All Implemented Interfaces:
- PicObjectConstants
- Direct Known Subclasses:
- DefaultAttributeSet
- public class PicAttributeSet
- extends java.lang.Object
- implements PicObjectConstants
- extends java.lang.Object
a class that stores non-default graphical attributes (e.g. "fill", "stroke", etc... ) in a hashtable. If a key is not found in the map, we look up the resolving parent.
Field Summary | |
static DefaultAttributeSet |
DEFAULT_SET
an immutable attribute that serves as the resolving parent if no resolving parent is explicitly set |
private java.util.HashMap |
map
|
private PicAttributeSet |
parent
|
Fields inherited from interface jpicedt.graphic.model.PicObjectConstants |
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, MaxAttributeNameIndex, MIDDLE, NONE, OUTER, POLYGON_DOTS, POLYGON_SOLID, POLYGON_STYLE, PS_POINT, RIGHT_ARROW, SHADOW, SHADOW_ANGLE, SHADOW_COLOR, SHADOW_SIZE, SOLID, VLINES, VLINES_FILLED |
Constructor Summary | |
PicAttributeSet()
Create a new PicAttributeSet with DEFAULT_SET as the resolving parent. |
|
PicAttributeSet(PicAttributeSet src)
cloning constructor |
|
PicAttributeSet(java.lang.String lineStyle,
java.awt.Color lineColor,
double lineWidth,
double dashTransparent,
double dashOpaque,
java.lang.String fillStyle,
java.awt.Color fillColor,
Arrow leftArrow,
Arrow rightArrow)
Create a new PicAttributeSet with the given values. |
Method Summary | |
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)
|
int |
getAttributeCount()
|
java.util.Iterator |
getAttributeNames()
|
PicAttributeSet |
getResolveParent()
|
static void |
main(java.lang.String[] arg)
|
private void |
removeRedundantAttributes()
Remove name/value pair already defined in the resolving parent. |
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 |
setResolveParent(PicAttributeSet parent)
set the resolving parent. |
java.lang.String |
toString()
Convert this Object to a human-readable String. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
DEFAULT_SET
public static final DefaultAttributeSet DEFAULT_SET
- an immutable attribute that serves as the resolving parent if no resolving parent
is explicitly set
map
private transient java.util.HashMap map
parent
private PicAttributeSet parent
Constructor Detail |
PicAttributeSet
public PicAttributeSet()
- Create a new PicAttributeSet with DEFAULT_SET as the resolving parent.
PicAttributeSet
public PicAttributeSet(java.lang.String lineStyle, java.awt.Color lineColor, double lineWidth, double dashTransparent, double dashOpaque, java.lang.String fillStyle, java.awt.Color fillColor, Arrow leftArrow, Arrow rightArrow)
- Create a new PicAttributeSet with the given values.
PicAttributeSet
public PicAttributeSet(PicAttributeSet src)
- cloning constructor
Method Detail |
getResolveParent
public PicAttributeSet getResolveParent()
setResolveParent
public void setResolveParent(PicAttributeSet parent)
- set the resolving parent.
copyAttributes
public 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.
getAttribute
public java.lang.Object getAttribute(PicAttributeName name)
removeRedundantAttributes
private void removeRedundantAttributes()
- Remove name/value pair already defined in the resolving parent.
setAttribute
public 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. If the pair then exists in the resolving parent,
remove it from this set.
getAttributeCount
public int getAttributeCount()
getAttributeNames
public java.util.Iterator getAttributeNames()
toString
public java.lang.String toString()
- Description copied from class:
java.lang.Object
- Convert this Object to a human-readable String.
There are no limits placed on how long this String
should be or what it should contain. We suggest you
make it as intuitive as possible to be able to place
it into System.out.println() 55
and such.
It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.
This method will be called when performing string concatenation with this object. If the result is
null
, string concatenation will instead use"null"
.The default implementation returns
getClass().getName() + "@" + Integer.toHexString(hashCode())
.
main
public static void main(java.lang.String[] arg)
|
|||||||||
Home >> All >> jpicedt >> graphic >> [ model overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: ![]() ![]() ![]() |
DETAIL: FIELD | CONSTR | METHOD |