|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.ctdp.rfdynhud.widgets.WidgetsConfiguration
public class WidgetsConfiguration
The WidgetsConfiguration
handles the drawing of all visible widgets.
Nested Class Summary | |
---|---|
static interface |
WidgetsConfiguration.ConfigurationLoadListener
|
Constructor Summary | |
---|---|
WidgetsConfiguration(int gameResX,
int gameResY)
Creates a new WidgetsConfiguration . |
Method Summary | |
---|---|
boolean |
addBorderAlias(java.lang.String alias,
java.lang.String border)
Maps a new border alias to its filename. |
boolean |
addNamedColor(java.lang.String name,
java.awt.Color color)
Maps a new named color. |
boolean |
addNamedFont(java.lang.String name,
java.lang.String fontStr)
Maps a new named font. |
java.lang.String |
findFreeName(java.lang.String baseName)
Finds a free name starting with 'baseName'. |
java.util.Set<java.lang.String> |
getBorderAliases()
Gets all currently mapped font names. |
java.lang.String |
getBorderName(java.lang.String alias)
Gets a border filename from the map or null , if not found. |
java.util.Set<java.lang.String> |
getColorNames()
Gets all currently mapped color names. |
java.util.Set<java.lang.String> |
getFontNames()
Gets all currently mapped font names. |
GameResolution |
getGameResolution()
|
int |
getId()
|
InputMappings |
getInputMappings()
|
java.lang.String |
getName()
|
java.awt.Color |
getNamedColor(java.lang.String name)
Gets a named color from the map or null , if not found. |
java.awt.Font |
getNamedFont(java.lang.String name)
Gets a named font from the map or null , if not found. |
java.lang.String |
getNamedFontString(java.lang.String name)
Gets a named font from the map or null , if not found. |
java.lang.Boolean |
getNamedFontVirtual(java.lang.String name)
Gets a named font's virtual flag from the map or null , if not found. |
int |
getNumWidgets()
Gets the number of Widget s in this manager. |
void |
getProperties(PropertiesContainer propsCont,
boolean forceAll)
Puts all editable properties to the editor. |
boolean |
getUseClassScoring()
Gets whether class relative scoring is enabled or not. |
Widget |
getWidget(int index)
Gets the index-th Widget from this manager. |
Widget |
getWidget(java.lang.String name)
Gets the Widget with the specified name from this manager. |
boolean |
isValid()
|
void |
loadProperty(PropertyLoader loader)
Loads (and parses) a certain property from a config file. |
void |
onPropertyChanged(Property property,
java.lang.Object oldValue,
java.lang.Object newValue)
Invoked when a kept Property has changed. |
java.lang.String |
removeBorderAlias(java.lang.String alias)
Removes a mapped border alias. |
java.awt.Color |
removeNamedColor(java.lang.String name)
Removes a mapped named color. |
java.awt.Font |
removeNamedFont(java.lang.String name)
Removes a mapped named font. |
void |
renameBorder(java.lang.String oldName,
java.lang.String newName)
|
void |
renameColor(java.lang.String oldName,
java.lang.String newName)
Renames the color. |
void |
renameFont(java.lang.String oldName,
java.lang.String newName)
|
void |
resetBorders(java.lang.String oldName,
java.lang.String newValue)
|
void |
resetColors(java.lang.String oldName,
java.lang.String newValue)
Reset colors to defaults. |
void |
resetFonts(java.lang.String oldName,
java.lang.String newValue)
|
void |
saveProperties(PropertyWriter writer)
Saves all settings to the config file. |
void |
setAllDirtyFlags()
Sets the dirty flags on all Widget s. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WidgetsConfiguration(int gameResX, int gameResY)
WidgetsConfiguration
.
gameResX
- gameResY
- Method Detail |
---|
public final int getId()
public final java.lang.String getName()
public final boolean isValid()
public java.lang.String findFreeName(java.lang.String baseName)
baseName
- the name prefix
public final int getNumWidgets()
Widget
s in this manager.
Widget
s in this manager.public final Widget getWidget(int index)
Widget
from this manager.
index
- the Widget's index
Widget
from this manager.public final Widget getWidget(java.lang.String name)
Widget
with the specified name from this manager.
name
- the Widget's name
Widget
with the specified name from this manager.public void setAllDirtyFlags()
Widget
s.
public final InputMappings getInputMappings()
public final GameResolution getGameResolution()
public boolean addNamedColor(java.lang.String name, java.awt.Color color)
name
- the namecolor
- the color
public final java.awt.Color getNamedColor(java.lang.String name)
null
, if not found.
name
- the name
null
, if not found.public final java.util.Set<java.lang.String> getColorNames()
public java.awt.Color removeNamedColor(java.lang.String name)
name
- the name
public void renameColor(java.lang.String oldName, java.lang.String newName)
oldName
- the old namenewName
- the new namepublic void resetColors(java.lang.String oldName, java.lang.String newValue)
oldName
- the old namenewValue
- the new namepublic boolean addNamedFont(java.lang.String name, java.lang.String fontStr)
name
- the namefontStr
- tje font definition
public final java.awt.Font getNamedFont(java.lang.String name)
null
, if not found.
name
- the name
null
, if not found.public final java.lang.String getNamedFontString(java.lang.String name)
null
, if not found.
name
- the name
null
, if not found.public final java.lang.Boolean getNamedFontVirtual(java.lang.String name)
null
, if not found.
name
- the name
null
, if not found.public final java.util.Set<java.lang.String> getFontNames()
public java.awt.Font removeNamedFont(java.lang.String name)
name
- the name
public void renameFont(java.lang.String oldName, java.lang.String newName)
public void resetFonts(java.lang.String oldName, java.lang.String newValue)
public boolean addBorderAlias(java.lang.String alias, java.lang.String border)
alias
- the alias nameborder
- the border
public final java.lang.String getBorderName(java.lang.String alias)
null
, if not found.
alias
- the alias name
null
, if not found.public final java.util.Set<java.lang.String> getBorderAliases()
public java.lang.String removeBorderAlias(java.lang.String alias)
alias
- the alias name
public void renameBorder(java.lang.String oldName, java.lang.String newName)
public void resetBorders(java.lang.String oldName, java.lang.String newValue)
public final boolean getUseClassScoring()
public void onPropertyChanged(Property property, java.lang.Object oldValue, java.lang.Object newValue)
Property
has changed.
onPropertyChanged
in interface PropertiesKeeper
property
- the changed propertyoldValue
- the old valuenewValue
- the new valuepublic void saveProperties(PropertyWriter writer) throws java.io.IOException
saveProperties
in interface PropertiesKeeper
writer
- the widgets configuration writer to write properties to
java.io.IOException
- if something went wrongpublic void loadProperty(PropertyLoader loader)
loadProperty
in interface PropertiesKeeper
loader
- the property loader to load properties frompublic void getProperties(PropertiesContainer propsCont, boolean forceAll)
getProperties
in interface PropertiesKeeper
propsCont
- the container to add the properties toforceAll
- If true
, all properties provided by this PropertiesKeeper
must be added.
If false
, only the properties, that are relevant for the current PropertiesKeeper
's situation have to be added, some can be ignored.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |