net.ctdp.rfdynhud.properties
Class ImagePropertyWithTransTexture
java.lang.Object
net.ctdp.rfdynhud.properties.Property
net.ctdp.rfdynhud.properties.StringProperty
net.ctdp.rfdynhud.properties.ImageProperty
net.ctdp.rfdynhud.properties.ImagePropertyWithTransTexture
public class ImagePropertyWithTransTexture
- extends ImageProperty
The ImagePropertyWithTransTexture
serves for customizing an image
and provides a TransformableTexture
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 |
ImagePropertyWithTransTexture
public ImagePropertyWithTransTexture(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?
ImagePropertyWithTransTexture
public ImagePropertyWithTransTexture(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
ImagePropertyWithTransTexture
public ImagePropertyWithTransTexture(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?
ImagePropertyWithTransTexture
public ImagePropertyWithTransTexture(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 TransformableTexture updateSize(int width,
int height,
boolean isEditorMode,
boolean[] changeInfo)
- Updates the stored
TransformableTexture
to the given size and returns the texture.
- Parameters:
width
- the new widthheight
- the new heightisEditorMode
- is rendering in editor?changeInfo
- if non null
the first element tells you, whether 'possibleResult' has been recycled and the second element, whether the texture has been (re)drawn
- Returns:
- the scaled texture.
updateSize
public final TransformableTexture updateSize(int width,
int height,
boolean isEditorMode)
- Updates the stored
TransformableTexture
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 TransformableTexture 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