|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbibliothek.gui.dock.support.lookandfeel.LookAndFeelList
public class LookAndFeelList
A list of LookAndFeels, can setup a LookAndFeel when
asked. It's possible to add a LookAndFeelListener to this list and
receive events whenever the LookAndFeel changes.
Clients should use getDefaultList() to get a list of LookAndFeels
| Nested Class Summary | |
|---|---|
static class |
LookAndFeelList.Info
Information about a LookAndFeel. |
| Constructor Summary | |
|---|---|
protected |
LookAndFeelList()
Crates a new list and collects all available LookAndFeels. |
| Method Summary | |
|---|---|
void |
add(LookAndFeelList.Info info)
Adds a new LookAndFeel to the list. |
void |
addComponentCollector(ComponentCollector c)
Adds a set of root- Components to this list, the set of
roots will be used to find all JComponents
which need to be updated when the LookAndFeel changes. |
void |
addLookAndFeelListener(LookAndFeelListener listener)
Adds a listener to this list, the listener will be notified whenever the LookAndFeel is changed. |
LookAndFeelList.Info |
get(int index)
Gets the index'th LookAndFeel. |
LookAndFeelList.Info |
getDefault()
Gets information about the LookAndFeel that is used when
the system can decide on its own. |
static LookAndFeelList |
getDefaultList()
Gets the global list of LookAndFeels |
LookAndFeelList.Info |
getFull(int index)
Gets the index'th LookAndFeel, where 0 means the
default, 1 the system and
anything else the normal, moved by 2 steps, LookAndFeels. |
LookAndFeelList.Info |
getFull(String key)
Gets the LookAndFeel whose unique identifier is key. |
LookAndFeelList.Info |
getLookAndFeel()
Gets the LookAndFeel which is currently used. |
LookAndFeelList.Info |
getSystem()
Gets information about the LookAndFeel that imitates
the native look of the system. |
int |
indexOf(LookAndFeelList.Info info)
Gets the location of info. |
int |
indexOfFull(LookAndFeelList.Info info)
Gets the index of info, where 0 means the
default, 1 the system and
anything else the normal, moved by 2 steps, LookAndFeels. |
void |
insert(int index,
LookAndFeelList.Info info)
Inserts a new LookAndFeel into the list. |
boolean |
isAllowReadOnlyOnce()
Whether multiple calls to read(DataInputStream) have
an effect or not. |
String |
keyOfFull(LookAndFeelList.Info info)
Gets a unique identifier for info. |
protected Collection<Component> |
listComponents()
Creates a list containing all root- Components of this application,
the ComponentCollectors are used to build this list. |
protected LookAndFeelListener[] |
listeners()
Gets all LookAndFeelListener that are known to this list. |
void |
read(DataInputStream in)
Reads which LookAndFeel was used earlier and calls
setLookAndFeel
to set the old LookAndFeel. |
void |
readXML(XElement element)
Reads which LookAndFeel was used earlier and calls
setLookAndFeel
to set the old LookAndFeel. |
void |
remove(int index)
Removes a LookAndFeel from this list. |
void |
remove(LookAndFeelList.Info info)
Removes the LookAndFeel at location index from
this list. |
void |
removeComponentCollector(ComponentCollector c)
Removes an earlier added set of roots. |
void |
removeLookAndFeelListener(LookAndFeelListener listener)
Removes a listener from this list. |
void |
setAllowReadOnlyOnce(boolean allowReadOnlyOnce)
Sets whether multiple calls to read(DataInputStream) will
have an effect. |
void |
setDefault(LookAndFeelList.Info defaultInfo)
Sets the default- LookAndFeel. |
static void |
setDefaultList(LookAndFeelList list)
Sets the default LookAndFeelList. |
void |
setLookAndFeel(LookAndFeelList.Info lookAndFeel)
Exchanges the currently used LookAndFeel. |
void |
setReadOnce(boolean read)
Sets whether this list has already read something once, or whether it is fresh. |
void |
setSystem(LookAndFeelList.Info systemInfo)
Sets the system- LookAndFeel. |
int |
size()
Gets the number of LookAndFeels that are known to this list. |
void |
write(DataOutputStream out)
Writes which LookAndFeel is currently used. |
void |
writeXML(XElement element)
Writes which LookAndFeel is currently used. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected LookAndFeelList()
LookAndFeels.
| Method Detail |
|---|
public static LookAndFeelList getDefaultList()
LookAndFeels
nullpublic static void setDefaultList(LookAndFeelList list)
LookAndFeelList.
list - the list, can be nullpublic boolean isAllowReadOnlyOnce()
read(DataInputStream) have
an effect or not.
true if only the first read-call has an effect.public void setAllowReadOnlyOnce(boolean allowReadOnlyOnce)
read(DataInputStream) will
have an effect.
allowReadOnlyOnce - true if only the first
read will have an effect, false if the LookAndFeel
can change every time read(DataInputStream) is called.public void setReadOnce(boolean read)
read - true if at least one time one of the
read methods was called, false otherwise.public void addLookAndFeelListener(LookAndFeelListener listener)
LookAndFeel is changed.
listener - the new listenerpublic void removeLookAndFeelListener(LookAndFeelListener listener)
listener - the listener to removeprotected LookAndFeelListener[] listeners()
LookAndFeelListener that are known to this list.
public void addComponentCollector(ComponentCollector c)
Components to this list, the set of
roots will be used to find all JComponents
which need to be updated when the LookAndFeel changes.
c - the new set of rootspublic void removeComponentCollector(ComponentCollector c)
c - the rootspublic void add(LookAndFeelList.Info info)
LookAndFeel to the list.
info - the new LookAndFeel
public void insert(int index,
LookAndFeelList.Info info)
LookAndFeel into the list.
index - the location of the new LookAndFeelinfo - the new LookAndFeelpublic int size()
LookAndFeels that are known to this list.
public LookAndFeelList.Info get(int index)
LookAndFeel.
index - the location of the LookAndFeel
public int indexOf(LookAndFeelList.Info info)
info.
info - a LookAndFeel
info or -1public LookAndFeelList.Info getFull(int index)
LookAndFeel, where 0 means the
default, 1 the system and
anything else the normal, moved by 2 steps, LookAndFeels.
index - the location of the LookAndFeel
public int indexOfFull(LookAndFeelList.Info info)
info, where 0 means the
default, 1 the system and
anything else the normal, moved by 2 steps, LookAndFeels.
info - the LookAndFeel to search
infopublic LookAndFeelList.Info getFull(String key)
LookAndFeel whose unique identifier is key.
key - the key to search
LookAndFeel or null if key was not foundpublic String keyOfFull(LookAndFeelList.Info info)
info.
info - the item whose identifier is searched
infopublic void remove(LookAndFeelList.Info info)
LookAndFeel at location index from
this list.
info - the LookAndFeel to removepublic void remove(int index)
LookAndFeel from this list.
index - the location of the element to removepublic LookAndFeelList.Info getLookAndFeel()
LookAndFeel which is currently used.
public void setLookAndFeel(LookAndFeelList.Info lookAndFeel)
LookAndFeel.
lookAndFeel - information about a LookAndFeel, not nullpublic LookAndFeelList.Info getDefault()
LookAndFeel that is used when
the system can decide on its own.
LookAndFeelpublic void setDefault(LookAndFeelList.Info defaultInfo)
LookAndFeel. Please note that getDefault()
will return another LookAndFeelList.Info, even if the behavior of that other
info is the same as defaultInfo.
defaultInfo - the default LookAndFeelpublic LookAndFeelList.Info getSystem()
LookAndFeel that imitates
the native look of the system.
LookAndFeelpublic void setSystem(LookAndFeelList.Info systemInfo)
LookAndFeel. Please note that getSystem()
will return another LookAndFeelList.Info, even if the behavior of that other
info is the same as systemInfo.
systemInfo - the system LookAndFeel
public void write(DataOutputStream out)
throws IOException
LookAndFeel is currently used.
out - the stream to write into
IOException - if the method can't write into out
public void read(DataInputStream in)
throws IOException
LookAndFeel was used earlier and calls
setLookAndFeel
to set the old LookAndFeel.
in - the stream to read from
IOException - if in can't be readpublic void writeXML(XElement element)
LookAndFeel is currently used.
element - the element to write into, the attributes of
element will not be changed.public void readXML(XElement element)
LookAndFeel was used earlier and calls
setLookAndFeel
to set the old LookAndFeel.
element - the element to read fromprotected Collection<Component> listComponents()
Components of this application,
the ComponentCollectors are used to build this list.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||