|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lightdev.app.shtm.CombinedAttribute
public class CombinedAttribute
A class to represent an attribute combining several other attributes.
The CSS 1.0 specification defines 'shorthand properties' which can hold more than one value separated by blanks. Depending on the number of values inside the property the values are applied following a fixed ratio.
Following is an excerpt of the spec for CSS property
border-width
There can be from one to four values, with the following interpretation: one value: all four border widths are set to that value two values: top and bottom border widths are set to the first value, right and left are set to the second three values: top is set to the first, right and left are set to the second, bottom is set to the third four values: top, right, bottom and left, respectively
In SimplyHTML this spec is used on properties margin, padding, border-width and border-color
Field Summary | |
---|---|
static int |
ATTR_BOTTOM
index of bottom value |
static int |
ATTR_LEFT
index of left value |
static int |
ATTR_RIGHT
index of right value |
static int |
ATTR_TOP
index of top value |
Constructor Summary | |
---|---|
CombinedAttribute(java.lang.Object key,
javax.swing.text.AttributeSet a,
boolean includeParents)
construct a CombinedAttribute for a certain
attribute out of a given set of attributes |
Method Summary | |
---|---|
java.lang.String |
getAttribute()
get all values of this CombinedAttribute
as one attribute. |
java.lang.String |
getAttribute(int side)
get one attribute of this CombinedAttribute |
java.lang.Object |
getAttributeKey()
get the attribute key this CombinedAttribute represents |
int |
getOppositeSide(int side)
get the side opposite of a given side |
boolean |
isEmpty()
determine whether or not the set of attributes this CombinedAttribute was created from contained any
of the attributes in this CombinedAttribute |
void |
setAttribute(int side,
java.lang.String value)
set one attribute of this CombinedAttribute |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ATTR_TOP
public static final int ATTR_RIGHT
public static final int ATTR_BOTTOM
public static final int ATTR_LEFT
Constructor Detail |
---|
public CombinedAttribute(java.lang.Object key, javax.swing.text.AttributeSet a, boolean includeParents)
CombinedAttribute
for a certain
attribute out of a given set of attributes
key
- the attribute key to get single attribute values froma
- the set of attributes to get the attribute of type 'key'Method Detail |
---|
public boolean isEmpty()
CombinedAttribute
was created from contained any
of the attributes in this CombinedAttribute
Can be used for instance to determine whether or not this
CombinedAttribute
should be written
CombinedAttribute
contains
default values only, false if notpublic int getOppositeSide(int side)
side
- the side to get the opposite of
public void setAttribute(int side, java.lang.String value)
CombinedAttribute
side
- the side to set the attribute for, one of ATTR_TOP,
ATTR_RIGHT, ATTR_BOTTOM, ATTR_LEFTvalue
- the attribute value to setpublic java.lang.String getAttribute(int side)
CombinedAttribute
side
- the side to get the attribute for, one of ATTR_TOP,
ATTR_RIGHT, ATTR_BOTTOM, ATTR_LEFT
public java.lang.Object getAttributeKey()
CombinedAttribute
represents
public java.lang.String getAttribute()
CombinedAttribute
as one attribute.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |