net.ctdp.rfdynhud.properties
Class ImageProperty

java.lang.Object
  extended by net.ctdp.rfdynhud.properties.Property
      extended by net.ctdp.rfdynhud.properties.StringProperty
          extended by net.ctdp.rfdynhud.properties.ImageProperty
Direct Known Subclasses:
ImagePropertyWithTexture, ImagePropertyWithTransTexture

public class ImageProperty
extends StringProperty

The ImageProperty serves for customizing an image.

Author:
Marvin Froehlich (CTDP)

Field Summary
static boolean DEFAULT_NO_IMAGE_ALOWED
           
 
Constructor Summary
ImageProperty(java.lang.String name, java.lang.String defaultValue)
           
ImageProperty(java.lang.String name, java.lang.String defaultValue, boolean readonly)
           
ImageProperty(java.lang.String name, java.lang.String nameForDisplay, java.lang.String defaultValue)
           
ImageProperty(java.lang.String name, java.lang.String nameForDisplay, java.lang.String defaultValue, boolean readonly, boolean noImageAllowed)
           
 
Method Summary
 ImageTemplate getImage()
          Gets the ImageTemplate defined by this ImageProperty.
 java.lang.String getImageName()
          Gets the currently selected image name.
 boolean getNoImageAllowed()
          Gets whether "no image" is allowed for this property.
 boolean isNoImage()
          Gets whether this property is set to "no image".
 void loadValue(PropertyLoader loader, java.lang.String value)
          Loads the value from the configuration file.
 void setImageName(java.lang.String imageName)
          Sets the image name.
 
Methods inherited from class net.ctdp.rfdynhud.properties.StringProperty
getDefaultValue, getStringValue, getValue, onKeeperSet, onValueChanged, setStringValue, setStringValue, setValue
 
Methods inherited from class net.ctdp.rfdynhud.properties.Property
getButtonText, getButtonTooltip, getDocumentationSource, getEditorType, getKeeper, getName, getNameForDisplay, getValueForConfigurationFile, hasDefaultValue, isMatchingKey, isReadOnly, onButtonClicked, quoteValueInConfigurationFile, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_NO_IMAGE_ALOWED

public static final boolean DEFAULT_NO_IMAGE_ALOWED
See Also:
Constant Field Values
Constructor Detail

ImageProperty

public ImageProperty(java.lang.String name,
                     java.lang.String nameForDisplay,
                     java.lang.String defaultValue,
                     boolean readonly,
                     boolean noImageAllowed)
Parameters:
name - the technical name used internally. See Property.getName().
nameForDisplay - the name displayed in the editor. See Property.getNameForDisplay(). If null is passed, the value of the name parameter is used.
defaultValue - the default value
readonly - read only property?
noImageAllowed - allow "no image" for this property?

ImageProperty

public ImageProperty(java.lang.String name,
                     java.lang.String nameForDisplay,
                     java.lang.String defaultValue)
Parameters:
name - the technical name used internally. See Property.getName().
nameForDisplay - the name displayed in the editor. See Property.getNameForDisplay(). If null is passed, the value of the name parameter is used.
defaultValue - the default value

ImageProperty

public ImageProperty(java.lang.String name,
                     java.lang.String defaultValue,
                     boolean readonly)
Parameters:
name - the technical name used internally. See Property.getName(). 'nameForDisplay' is set to the same value.
defaultValue - the default value
readonly - read only property?

ImageProperty

public ImageProperty(java.lang.String name,
                     java.lang.String defaultValue)
Parameters:
name - the technical name used internally. See Property.getName(). 'nameForDisplay' is set to the same value.
defaultValue - the default value
Method Detail

getNoImageAllowed

public final boolean getNoImageAllowed()
Gets whether "no image" is allowed for this property.

Returns:
whether "no image" is allowed for this property.

setImageName

public final void setImageName(java.lang.String imageName)
Sets the image name.

Parameters:
imageName -

getImageName

public final java.lang.String getImageName()
Gets the currently selected image name.

Returns:
the currently selected image name.

isNoImage

public final boolean isNoImage()
Gets whether this property is set to "no image".

Returns:
whether this property is set to "no image".

getImage

public final ImageTemplate getImage()
Gets the ImageTemplate defined by this ImageProperty.

Returns:
the ImageTemplate defined by this ImageProperty or null, if set to no image.

loadValue

public void loadValue(PropertyLoader loader,
                      java.lang.String value)
Loads the value from the configuration file.

Overrides:
loadValue in class StringProperty
Parameters:
loader - the loader
value - the value to load