|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractMap<K,V> java.util.HashMap dsto.dfc.swing.styles.StyleSheet
public class StyleSheet
A sheet of styles and their values. Clients will generally create a
subclass of this class in which they declare a set of static final
style instances (possibly based on AbstractStyle). See test.ui.style_sheet.TestStyleSheetView
for an example.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.util.AbstractMap |
---|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V> |
Field Summary | |
---|---|
protected Style[] |
styles
|
Constructor Summary | |
---|---|
StyleSheet()
Creates an empty style sheet with no styles. |
|
StyleSheet(Style[] styles)
Create an empty style sheet with a given set of acceptable styles. |
|
StyleSheet(StyleSheet sheet)
Create a style sheet that is a copy of another. |
Method Summary | |
---|---|
Color |
getColor(Style key)
Shortcut to get a color value from the sheet. |
Font |
getFont(Style key)
Shortcut to get a font value from the sheet. |
int |
getInt(Style key,
int defaultValue)
Shortcut to get an int value from the sheet. |
Style[] |
getStyles()
Get the accepted styles for this sheet. |
String |
getSummary()
Get a text summary of the styles that have values (eg "Fill Colour, Font"). |
boolean |
hasValue(Style style)
|
void |
merge(StyleSheet sheet)
Merge another sheet with this sheet, copying all non-null values from sheet into this sheet. |
Methods inherited from class java.util.HashMap |
---|
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
Methods inherited from class java.util.AbstractMap |
---|
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Field Detail |
---|
protected Style[] styles
Constructor Detail |
---|
public StyleSheet()
public StyleSheet(Style[] styles)
styles
- The acceptable styles.public StyleSheet(StyleSheet sheet)
Method Detail |
---|
public Style[] getStyles()
public boolean hasValue(Style style)
public void merge(StyleSheet sheet)
public Color getColor(Style key)
public Font getFont(Style key)
public int getInt(Style key, int defaultValue)
key
- The key for the value.defaultValue
- The value returned when there is no value for key.
public String getSummary()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |