net.ctdp.rfdynhud.properties
Class ImagePropertyWithTexture
java.lang.Object
net.ctdp.rfdynhud.properties.Property
net.ctdp.rfdynhud.properties.StringProperty
net.ctdp.rfdynhud.properties.ImageProperty
net.ctdp.rfdynhud.properties.ImagePropertyWithTexture
public class ImagePropertyWithTexture
- extends ImageProperty
The ImagePropertyWithTexture
serves for customizing an image
and provides a TextureImage2D
instance with a given size.
- Author:
- Marvin Froehlich (CTDP)
Methods inherited from class net.ctdp.rfdynhud.properties.Property |
getButtonText, getButtonTooltip, getDocumentationSource, getEditorType, getKeeper, getName, getNameForDisplay, getValueForConfigurationFile, isMatchingKey, isReadOnly, onButtonClicked, quoteValueInConfigurationFile, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ImagePropertyWithTexture
public ImagePropertyWithTexture(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 valuereadonly
- read only property?noImageAllowed
- allow "no image" for this property?
ImagePropertyWithTexture
public ImagePropertyWithTexture(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
ImagePropertyWithTexture
public ImagePropertyWithTexture(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 valuereadonly
- read only property?
ImagePropertyWithTexture
public ImagePropertyWithTexture(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
updateSize
public TextureImage2D updateSize(int width,
int height,
boolean isEditorMode)
- Updates the stored
TextureImage2D
to the given size and returns the texture.
- Parameters:
width
- the new widthheight
- the new heightisEditorMode
- is rendering in editor?
- Returns:
- the scaled texture.
getTexture
public final TextureImage2D getTexture()
- Gets the scaled texture. Make sure to call
updateSize(int, int, boolean)
before.
- Returns:
- the scaled texture.
hasTexture
public final boolean hasTexture()
- Gets whether this property keeps a scaled texture instance.
- Returns:
- whether this property keeps a scaled texture instance.
onValueChanged
protected void onValueChanged(java.lang.String oldValue,
java.lang.String newValue)
- Invoked when the property's value has changed.
- Overrides:
onValueChanged
in class StringProperty
- Parameters:
oldValue
- the old valuenewValue
- the new value