|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.formaria.aria.style.Style
public class Style
A style for storing information about the look of a component. Information such as font (face, size, bold, italic), color (fore, back).
Copyright (c) Formaria Ltd., 2008
License: see license.txt
$Revision: 2.5 $
| Field Summary | |
|---|---|
static int |
COLOR_BACK
The component back color style |
static int |
COLOR_FORE
The component fore color style |
static int |
FONT_FACE
The font face/family style |
static int |
FONT_ITALIC
The font italic style |
static int |
FONT_SIZE
The font size style |
static int |
FONT_WEIGHT
The font weight (bold) style |
static int |
NUM_DEFAULT_STYLES
|
protected java.lang.Object[] |
values
|
| Constructor Summary | |
|---|---|
Style()
Create a new style object |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
Create a copy of this component |
java.lang.Integer |
getFontHashcode()
Gets the font hashcode |
int |
getNumStyles()
Get the number of styles managed by this style object |
java.awt.Color |
getStyleAsColor(int key)
Retrieve a style element as a Color. |
int |
getStyleAsInt(int key)
Retrieve a style element as an int. |
java.lang.String |
getStyleAsString(int key)
Retrieve a style element as a String. |
int |
getStyleIndex(java.lang.String name)
Gets a integer constant corresponding to a style name |
java.lang.String |
getStyleName(int idx)
Get the name of a style |
java.lang.Object |
getStyleValue(int key)
Retrieve a style element as an object. |
void |
mergeStyle(Style newStyle)
For applying a hierarchy of styles to a new Style. |
static java.lang.Object |
parseColor(java.lang.String temp)
Parse a color string |
void |
setClosed(boolean state)
Mark the style as closed. |
void |
setNumStyles(int num)
Set the number of styles. |
void |
setStyle(int key,
int value)
Set a style element. |
void |
setStyle(int key,
java.lang.Object value)
Set a style element. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int FONT_FACE
public static final int FONT_SIZE
public static final int FONT_WEIGHT
public static final int FONT_ITALIC
public static final int COLOR_BACK
public static final int COLOR_FORE
public static final int NUM_DEFAULT_STYLES
protected java.lang.Object[] values
| Constructor Detail |
|---|
public Style()
| Method Detail |
|---|
public void setNumStyles(int num)
num - the number of new parameterspublic int getNumStyles()
public void setClosed(boolean state)
public int getStyleIndex(java.lang.String name)
name - the style name e.g. "font_face"
public java.lang.String getStyleName(int idx)
idx - the style index
public java.lang.Object clone()
clone in class java.lang.Object
public void setStyle(int key,
java.lang.Object value)
key - The index of the elementvalue - The Object value of the element
public void setStyle(int key,
int value)
key - The index of the elementvalue - The int value of the elementpublic int getStyleAsInt(int key)
key - The index of the style required
public java.lang.String getStyleAsString(int key)
key - The index of the style required
public java.lang.Object getStyleValue(int key)
key - The index of the style required
public java.awt.Color getStyleAsColor(int key)
key - The index of the style required
public void mergeStyle(Style newStyle)
newStyle - the style to merge with the current object.public java.lang.Integer getFontHashcode()
public static java.lang.Object parseColor(java.lang.String temp)
temp - the color string as either hex or decimal rgb
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||