public class LookAndFeelList extends Object
LookAndFeels, can setup a LookAndFeel when
asked. It's possible to add a LookAndFeelListener to this list and
receive events whenever the LookAndFeel changes.getDefaultList() to get a list of LookAndFeels| Modifier and Type | Class and Description |
|---|---|
static class |
LookAndFeelList.Info
Information about a
LookAndFeel. |
| Modifier | Constructor and Description |
|---|---|
protected |
LookAndFeelList()
Crates a new list and collects all available
LookAndFeels. |
| Modifier and Type | Method and Description |
|---|---|
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)
|
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)
|
void |
readXML(XElement element)
|
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. |
protected LookAndFeelList()
LookAndFeels.public static LookAndFeelList getDefaultList()
LookAndFeelsnullpublic 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 LookAndFeelpublic 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 LookAndFeelpublic int indexOf(LookAndFeelList.Info info)
info.info - a LookAndFeelinfo 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 LookAndFeelpublic 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 searchinfopublic LookAndFeelList.Info getFull(String key)
LookAndFeel whose unique identifier is key.key - the key to searchLookAndFeel or null if key was not foundpublic String keyOfFull(LookAndFeelList.Info info)
info.info - the item whose identifier is searchedinfopublic 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 LookAndFeelpublic void write(DataOutputStream out) throws IOException
LookAndFeel is currently used.out - the stream to write intoIOException - if the method can't write into outpublic void read(DataInputStream in) throws IOException
in - the stream to read fromIOException - 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)
element - the element to read fromprotected Collection<Component> listComponents()
Components of this application,
the ComponentCollectors are used to build this list.Copyright © 2018. All rights reserved.