AbstractAssembledWidget

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## net.ctdp.rfdynhud.widgets.base.widget
Class AbstractAssembledWidget

    java.lang.Object
      net.ctdp.rfdynhud.widgets.base.widget.Widget
          net.ctdp.rfdynhud.widgets.base.widget.StatefulWidget<java.lang.Object,java.lang.Object>
              net.ctdp.rfdynhud.widgets.base.widget.AbstractAssembledWidget

All Implemented Interfaces:
  java.lang.Cloneable, PropertiesKeeper

Direct Known Subclasses:
  AssembledWidget

    public abstract class AbstractAssembledWidget

extends StatefulWidget<java.lang.Object,java.lang.Object>

An assembled `Widget` is a master `Widget` for other client `Widget`s. The client `Widget`s define its actual display.

Author:
  Marvin Froehlich

Field Summary

Fields inherited from class net.ctdp.rfdynhud.widgets.base.widget.Widget
`LOG_CHANNEL, NEEDED_DATA_ALL, NEEDED_DATA_SCORING, NEEDED_DATA_TELEMETRY`

Constructor Summary
`protected` | `AbstractAssembledWidget(WidgetSet widgetSet, WidgetPackage widgetPackage, float width, boolean widthPercent, float height, boolean heightPercent, boolean initParts)` Creates a new Widget.
`protected` | `AbstractAssembledWidget(WidgetSet widgetSet, WidgetPackage widgetPackage, float width, float height, boolean initParts)` Creates a new Widget.

Method Summary
`void` | `afterConfigurationLoaded(WidgetsConfiguration widgetsConfig, LiveGameData gameData, boolean isEditorMode)` This event is fired right after the `WidgetsConfiguration` has been (re-)loaded.
`protected void` | `arrangeParts(Widget[] parts)` This method is called when the configuration has been loaded.
`void` | `bake(boolean convertToPixels)` Bakes effective position and size to variables, so that they don't need to be recalculated during runtime on each access.
`void` | `beforeConfigurationCleared(WidgetsConfiguration widgetsConfig, LiveGameData gameData, boolean isEditorMode)` This event is fired right before the `WidgetsConfiguration` is cleared.
`protected boolean` | `canHaveBackground()` Defines, if this Widget type can have a background.
`protected boolean` | `checkForChanges(LiveGameData gameData, boolean isEditorMode, TextureImage2D texture, int width, int height)` Checks, if the Widget needs any changes before it is drawn.
`protected net.ctdp.rfdynhud.widgets.base.widget.AbstractAssembledWidget.AssembledGeneralStore` | `createGeneralStore()` Creates a store object for all widgets of this type.
`protected net.ctdp.rfdynhud.widgets.base.widget.AbstractAssembledWidget.AssembledLocalStore` | `createLocalStore()` Creates a store object for this Widget only.
`protected void` | `drawWidget(Clock clock, boolean needsCompleteRedraw, LiveGameData gameData, boolean isEditorMode, TextureImage2D texture, int offsetX, int offsetY, int width, int height)` This method must contain the actual drawing code for this Widget.
`java.lang.String` | `findFreePartName(java.lang.String baseName)` Finds a free name starting with 'baseName'.
`void` | `forceReinitialization(boolean forwardCall)`
`java.lang.String` | `getDefaultBorderValue(java.lang.String name)` Gets the default value for the given border alias/name.
`java.lang.String` | `getDefaultNamedColorValue(java.lang.String name)` Gets the default value for the given named color.
`java.lang.String` | `getDefaultNamedFontValue(java.lang.String name)` Gets the default value for the given named font.
`int` | `getMaxHeight(LiveGameData gameData, boolean isEditorMode)` Gets the maximum height covered by this `Widget`.
`int` | `getMaxWidth(LiveGameData gameData, boolean isEditorMode)` Gets the maximum width covered by this `Widget`.
`int` | `getMinHeight(LiveGameData gameData, boolean isEditorMode)` Gets the minimum height for this `Widget` in pixels.
`int` | `getMinWidth(LiveGameData gameData, boolean isEditorMode)` Gets the minimum width for this `Widget` in pixels.
`int` | `getNeededData()` Gets the data indicators for the data needed for this `Widget` to be drawn (bitmask).
`protected Widget` | `getNewInstanceForClone()`
`int` | `getNumParts()` Gets the number of `Widget` parts in this `AbstractAssembledWidget`.
`Widget` | `getPart(int index)` Gets the i-th `Widget`-part in this `AbstractAssembledWidget`.
`void` | `getProperties(PropertiesContainer propsCont, boolean forceAll)` Puts all editable properties to the editor.
`boolean` | `hasMasterCanvas(boolean isEditorMode)` Returns `true`, if this `Widget` draws on the main texture, `false` otherwise.
`protected boolean` | `hasText()` Defines, if a Widget type (potentially) contains any text.
`protected void` | `initialize(LiveGameData gameData, boolean isEditorMode, DrawnStringFactory drawnStringFactory, TextureImage2D texture, int width, int height)` This method is called once to initialized `DrawnString`s used on this Widget.
`protected abstract Widget[]` | `initParts(float width, boolean widthPercent, float height, boolean heightPercent)`
`protected void` | `initSubTextures(LiveGameData gameData, boolean isEditorMode, int widgetInnerWidth, int widgetInnerHeight, SubTextureCollector collector)` Gets the `TransformableTexture`s, that this `Widget` keeps.
`void` | `loadProperty(PropertyLoader loader)` Loads (and parses) a certain property from a config file.
`java.lang.Boolean` | `onBoundInputStateChanged(InputAction action, boolean state, int modifierMask, long when, LiveGameData gameData, boolean isEditorMode)` This event is fired, when a bound input component has changed its state.
`void` | `onGarageEntered(LiveGameData gameData, boolean isEditorMode)` This method is called when a the car entered the garage.
`void` | `onGarageExited(LiveGameData gameData, boolean isEditorMode)` This method is called when a the car exited the garage.
`void` | `onLapStarted(VehicleScoringInfo vsi, LiveGameData gameData, boolean isEditorMode)` This method is called when a lap has been finished and a new one was started.
`void` | `onNeededDataComplete(LiveGameData gameData, boolean isEditorMode)` This method is called when the needed data is available in realtime mode.
`void` | `onPitsEntered(LiveGameData gameData, boolean isEditorMode)` This method is called when a the car entered the pits.
`void` | `onPitsExited(LiveGameData gameData, boolean isEditorMode)` This method is called when a the car exited the pits.
`void` | `onRealtimeEntered(LiveGameData gameData, boolean isEditorMode)` This method is called when a the user entered realtime mode.
`void` | `onRealtimeExited(LiveGameData gameData, boolean isEditorMode)` This method is called when a the user exited realtime mode.
`void` | `onScoringInfoUpdated(LiveGameData gameData, boolean isEditorMode)` This method is called when `ScoringInfo` have been updated (done at 2Hz).
`void` | `onSessionStarted(SessionType sessionType, LiveGameData gameData, boolean isEditorMode)` This method is executed when a new session was started.
`void` | `onTrackChanged(java.lang.String trackname, LiveGameData gameData, boolean isEditorMode)` This method is executed when a new track was loaded.
`protected java.lang.Boolean` | `onVehicleControlChanged(VehicleScoringInfo viewedVSI, LiveGameData gameData, boolean isEditorMode)` This method is called when either the player's vehicle control has changed or another vehicle is being viewed.
`void` | `onVehicleSetupUpdated(LiveGameData gameData, boolean isEditorMode)` This method is called when `VehicleSetup` has been updated.
`void` | `saveProperties(PropertyWriter writer)` Saves all settings to the config file.
`void` | `setAllPosAndSizeToPercents()`
`void` | `setAllPosAndSizeToPixels()`
`void` | `setDirtyFlag(boolean forwardCall)`
`java.lang.Boolean` | `updateVisibility(LiveGameData gameData, boolean isEditorMode)` This method is called first by the rendering system each to check for visibility changes.

Methods inherited from class net.ctdp.rfdynhud.widgets.base.widget.StatefulWidget
`getGeneralStore, getGeneralStoreKey, getLocalStore`

Methods inherited from class net.ctdp.rfdynhud.widgets.base.widget.Widget
`addBackgroundPropertyToContainer, addBorderPropertyToContainer, addFontPropertiesToContainer, addPaddingPropertiesToContainer, addPositionAndSizePropertiesToContainer, addTypeAndNamePropertiesToContainer, addVisibilityPropertiesToContainer, canHaveBorder, clearBackgroundRegion, clearRegion, clearRegion, clone, cloneProperty, debug, debugCS, drawBackground, drawBorder, drawWidget, forceAndSetDirty, forceCompleteRedraw, forceReinitialization, getAbsoluteOffsetX, getAbsoluteOffsetY, getAutoVisibility, getBackground, getBackgroundProperty, getBorder, getBorderProperty, getConfiguration, getDirtyFlag, getDocumentationSource, getDrawnStringFactory, getEffectiveHeight, getEffectiveWidth, getFont, getFontColor, getFontColorProperty, getFontProperty, getInitialBackground, getInnerSize, getInputActions, getInputVisibility, getMasterWidget, getName, getOffsetXToRootMasterWidget, getOffsetYToRootMasterWidget, getPaddingBottom, getPaddingLeft, getPaddingPropertyBottom, getPaddingPropertyLeft, getPaddingPropertyRight, getPaddingPropertyTop, getPaddingRight, getPaddingTop, getPosition, getPropertiesForParentGroup, getPropertiesIterator, getSize, getSubTextures, getUpdatedVisibility, getWidgetController, getWidgetPackage, getWidgetSet, getZIndex, hasBorder, hasFixedSize, isFontAntiAliased, isVisible, log, log, logCS, logCS, onBackgroundChanged, onCanvasSizeChanged, onCompleteRedrawForced, onDirtyFlagSet, onPositionChanged, onPropertyChanged, onReinitializationForced, onSizeChanged, onVisibilityChanged, prepareForMenuItem, setDirtyFlag, setName, setPadding, setWidgetController, setZIndex, visibilityChangedSinceLastDraw`

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### AbstractAssembledWidget

    protected AbstractAssembledWidget(WidgetSet widgetSet,
                                      WidgetPackage widgetPackage,
                                      float width,
                                      boolean widthPercent,
                                      float height,
                                      boolean heightPercent,
                                      boolean initParts)

  Creates a new Widget.

  Parameters:
    `widgetSet` - the `WidgetSet` this `Widget` belongs to
    `widgetPackage` - the package in the editor
    `width` - negative numbers for (screen_width - width)
    `widthPercent` - width parameter treated as percents
    `height` - negative numbers for (screen_height - height)
    `heightPercent` - height parameter treated as percents
    `initParts` - this parameter must exist in your contructor and has to be forwarded to this

### AbstractAssembledWidget

    protected AbstractAssembledWidget(WidgetSet widgetSet,
                                      WidgetPackage widgetPackage,
                                      float width,
                                      float height,
                                      boolean initParts)

  Creates a new Widget.

  Parameters:
    `widgetSet` - the `WidgetSet` this `Widget` belongs to
    `widgetPackage` - the package in the editor
    `width` - negative numbers for (screen_width - width)
    `height` - negative numbers for (screen_height - height)
    `initParts` - this parameter must exist in your contructor and has to be forwarded to this

Method Detail

### findFreePartName

    public java.lang.String findFreePartName(java.lang.String baseName)

  Finds a free name starting with 'baseName'.

  Parameters:
    `baseName` - the name prefix
  Returns:
    the found free name.

### getNumParts

    public final int getNumParts()

  Gets the number of `Widget` parts in this `AbstractAssembledWidget`.

  Returns:
    the number of `Widget` parts in this `AbstractAssembledWidget`.

### getPart

    public final Widget getPart(int index)

  Gets the i-th `Widget`-part in this `AbstractAssembledWidget`.

  Parameters:
    `index` - the index
  Returns:
    the i-th `Widget`-part in this `AbstractAssembledWidget`.

### createGeneralStore

    protected final net.ctdp.rfdynhud.widgets.base.widget.AbstractAssembledWidget.AssembledGeneralStore createGeneralStore()

  Creates a store object for all widgets of this type.

  Specified by:
    `createGeneralStore` in class `StatefulWidget<java.lang.Object,java.lang.Object>`
  Returns:
    the general store object. `null` is explicitly permitted and default implementation simply returns `null`.

### createLocalStore

    protected final net.ctdp.rfdynhud.widgets.base.widget.AbstractAssembledWidget.AssembledLocalStore createLocalStore()

  Creates a store object for this Widget only.

  Specified by:
    `createLocalStore` in class `StatefulWidget<java.lang.Object,java.lang.Object>`
  Returns:
    the local store object. `null` is explicitly permitted and default implementation simply returns `null`.

### arrangeParts

    protected void arrangeParts(Widget[] parts)

  This method is called when the configuration has been loaded.

  Parameters:
    `parts` - the parts to arrange

### getDefaultBorderValue

    public java.lang.String getDefaultBorderValue(java.lang.String name)

  Gets the default value for the given border alias/name.

  Overrides:
    `getDefaultBorderValue` in class `Widget`
  Parameters:
    `name` - the border name to query
  Returns:
    the default value for the given border alias/name.

### getDefaultNamedColorValue

    public java.lang.String getDefaultNamedColorValue(java.lang.String name)

  Gets the default value for the given named color.

  Overrides:
    `getDefaultNamedColorValue` in class `Widget`
  Parameters:
    `name` - the color name to query
  Returns:
    the default value for the given named color.

### getDefaultNamedFontValue

    public java.lang.String getDefaultNamedFontValue(java.lang.String name)

  Gets the default value for the given named font.

  Overrides:
    `getDefaultNamedFontValue` in class `Widget`
  Parameters:
    `name` - the font name to query
  Returns:
    the default value for the given named font.

### initSubTextures

    protected void initSubTextures(LiveGameData gameData,
                                   boolean isEditorMode,
                                   int widgetInnerWidth,
                                   int widgetInnerHeight,
                                   SubTextureCollector collector)

  Gets the `TransformableTexture`s, that this `Widget` keeps.

  Specified by:
    `initSubTextures` in class `Widget`
  Parameters:
    `gameData` - the live game data
    `isEditorMode` - rendering in the editor?
    `widgetInnerWidth` - the total widget width excluding borders
    `widgetInnerHeight` - the total widget height excluding borders
    `collector` - the collector to collect all the sub textures

### setDirtyFlag

    public void setDirtyFlag(boolean forwardCall)

### forceReinitialization

    public void forceReinitialization(boolean forwardCall)

### getMinWidth

    public int getMinWidth(LiveGameData gameData,
                           boolean isEditorMode)

  Gets the minimum width for this `Widget` in pixels.

  Overrides:
    `getMinWidth` in class `Widget`
  Parameters:
    `gameData` - the live game data
    `isEditorMode` - rendering in the editor?
  Returns:
    the minimum width for this `Widget` in pixels.

### getMinHeight

    public int getMinHeight(LiveGameData gameData,
                            boolean isEditorMode)

  Gets the minimum height for this `Widget` in pixels.

  Overrides:
    `getMinHeight` in class `Widget`
  Parameters:
    `gameData` - the live game data
    `isEditorMode` - rendering in the editor?
  Returns:
    the minimum height for this `Widget` in pixels.

### getMaxWidth

    public int getMaxWidth(LiveGameData gameData,
                           boolean isEditorMode)

  Gets the maximum width covered by this `Widget`. By default this method returns the result of getEffectiveWidth(gameResX). Override this method, if it will change its size during game play.

  Overrides:
    `getMaxWidth` in class `Widget`
  Parameters:
    `gameData` - the live game data
    `isEditorMode` - rendering in the editor?
  Returns:
    the maximum width covered by this `Widget`.

### getMaxHeight

    public int getMaxHeight(LiveGameData gameData,
                            boolean isEditorMode)

  Gets the maximum height covered by this `Widget`. By default this method returns the result of getEffectiveHeight(gameResX). Override this method, if it will change its size during game play.

  Overrides:
    `getMaxHeight` in class `Widget`
  Parameters:
    `gameData` - the live game data
    `isEditorMode` - rendering in the editor?
  Returns:
    the maximum height covered by this `Widget`.

### bake

    public void bake(boolean convertToPixels)

  Bakes effective position and size to variables, so that they don't need to be recalculated during runtime on each access.

  Overrides:
    `bake` in class `Widget`
  Parameters:
    `convertToPixels` - if true, all coordinates are converted to absolute pixels and positioned to TOP_LEFT.

### setAllPosAndSizeToPercents

    public void setAllPosAndSizeToPercents()

  Overrides:
    `setAllPosAndSizeToPercents` in class `Widget`

### setAllPosAndSizeToPixels

    public void setAllPosAndSizeToPixels()

  Overrides:
    `setAllPosAndSizeToPixels` in class `Widget`

### updateVisibility

    public java.lang.Boolean updateVisibility(LiveGameData gameData,
                                              boolean isEditorMode)

  This method is called first by the rendering system each to check for visibility changes. This doesn't affect the visiblity toggled by the `Widget.onBoundInputStateChanged(InputAction, boolean, int, long, LiveGameData, boolean)` method. Automatic visiblity can also override the result.

  Overrides:
    `updateVisibility` in class `Widget`
  Parameters:
    `gameData` - the live game data
    `isEditorMode` - `true`, if the Editor is used for rendering instead of rFactor
  Returns:
    `true` to set visible, `false` to set invisible, `null` for no change in visibility.
  See Also:
    `Widget.getUpdatedVisibility()`

### getNeededData

    public int getNeededData()

  Gets the data indicators for the data needed for this `Widget` to be drawn (bitmask).

  Overrides:
    `getNeededData` in class `Widget`
  Returns:
    the data indicators for the data needed for this `Widget` to be drawn.
  See Also:
    `Widget.NEEDED_DATA_TELEMETRY`, `Widget.NEEDED_DATA_SCORING`, `Widget.NEEDED_DATA_SCORING`

### afterConfigurationLoaded

    public void afterConfigurationLoaded(WidgetsConfiguration widgetsConfig,
                                         LiveGameData gameData,
                                         boolean isEditorMode)

  This event is fired right after the `WidgetsConfiguration` has been (re-)loaded.

  Overrides:
    `afterConfigurationLoaded` in class `Widget`
  Parameters:
    `widgetsConfig` - the widgets configuration
    `gameData` - the live game data
    `isEditorMode` - `true`, if the Editor is used for rendering instead of rFactor

### beforeConfigurationCleared

    public void beforeConfigurationCleared(WidgetsConfiguration widgetsConfig,
                                           LiveGameData gameData,
                                           boolean isEditorMode)

  This event is fired right before the `WidgetsConfiguration` is cleared.

  Overrides:
    `beforeConfigurationCleared` in class `Widget`
  Parameters:
    `widgetsConfig` - the widgets configuration
    `gameData` - the live game data
    `isEditorMode` - `true`, if the Editor is used for rendering instead of rFactor

### onTrackChanged

    public void onTrackChanged(java.lang.String trackname,
                               LiveGameData gameData,
                               boolean isEditorMode)

  This method is executed when a new track was loaded.

  Overrides:
    `onTrackChanged` in class `Widget`
  Parameters:
    `trackname` - the current track's name
    `gameData` - the live game data
    `isEditorMode` - `true`, if the Editor is used for rendering instead of rFactor

### onSessionStarted

    public void onSessionStarted(SessionType sessionType,
                                 LiveGameData gameData,
                                 boolean isEditorMode)

  This method is executed when a new session was started.

  Overrides:
    `onSessionStarted` in class `Widget`
  Parameters:
    `sessionType` - the current session type
    `gameData` - the live game data
    `isEditorMode` - `true`, if the Editor is used for rendering instead of rFactor

### onRealtimeEntered

    public void onRealtimeEntered(LiveGameData gameData,
                                  boolean isEditorMode)

  This method is called when a the user entered realtime mode. If your `Widget` needs some data to be drawn correctly, consider using `Widget.onNeededDataComplete(LiveGameData, boolean)`.

  Overrides:
    `onRealtimeEntered` in class `Widget`
  Parameters:
    `gameData` - the live game data
    `isEditorMode` - `true`, if the Editor is used for rendering instead of rFactor

### onScoringInfoUpdated

    public void onScoringInfoUpdated(LiveGameData gameData,
                                     boolean isEditorMode)

  This method is called when `ScoringInfo` have been updated (done at 2Hz).

  Overrides:
    `onScoringInfoUpdated` in class `Widget`
  Parameters:
    `gameData` - the live game data
    `isEditorMode` - `true`, if the Editor is used for rendering instead of rFactor

### onVehicleSetupUpdated

    public void onVehicleSetupUpdated(LiveGameData gameData,
                                      boolean isEditorMode)

  This method is called when `VehicleSetup` has been updated.

  Overrides:
    `onVehicleSetupUpdated` in class `Widget`
  Parameters:
    `gameData` - the live game data
    `isEditorMode` - `true`, if the Editor is used for rendering instead of rFactor

### onNeededDataComplete

    public void onNeededDataComplete(LiveGameData gameData,
                                     boolean isEditorMode)

  This method is called when the needed data is available in realtime mode.

  Overrides:
    `onNeededDataComplete` in class `Widget`
  Parameters:
    `gameData` - the live game data
    `isEditorMode` - `true`, if the Editor is used for rendering instead of rFactor

### onPitsEntered

    public void onPitsEntered(LiveGameData gameData,
                              boolean isEditorMode)

  This method is called when a the car entered the pits.

  Overrides:
    `onPitsEntered` in class `Widget`
  Parameters:
    `gameData` - the live game data
    `isEditorMode` - `true`, if the Editor is used for rendering instead of rFactor

### onGarageEntered

    public void onGarageEntered(LiveGameData gameData,
                                boolean isEditorMode)

  This method is called when a the car entered the garage.

  Overrides:
    `onGarageEntered` in class `Widget`
  Parameters:
    `gameData` - the live game data
    `isEditorMode` - `true`, if the Editor is used for rendering instead of rFactor

### onGarageExited

    public void onGarageExited(LiveGameData gameData,
                               boolean isEditorMode)

  This method is called when a the car exited the garage.

  Overrides:
    `onGarageExited` in class `Widget`
  Parameters:
    `gameData` - the live game data
    `isEditorMode` - `true`, if the Editor is used for rendering instead of rFactor

### onPitsExited

    public void onPitsExited(LiveGameData gameData,
                             boolean isEditorMode)

  This method is called when a the car exited the pits.

  Overrides:
    `onPitsExited` in class `Widget`
  Parameters:
    `gameData` - the live game data
    `isEditorMode` - `true`, if the Editor is used for rendering instead of rFactor

### onRealtimeExited

    public void onRealtimeExited(LiveGameData gameData,
                                 boolean isEditorMode)

  This method is called when a the user exited realtime mode.

  Overrides:
    `onRealtimeExited` in class `Widget`
  Parameters:
    `gameData` - the live game data
    `isEditorMode` - `true`, if the Editor is used for rendering instead of rFactor

### onVehicleControlChanged

    protected java.lang.Boolean onVehicleControlChanged(VehicleScoringInfo viewedVSI,
                                                        LiveGameData gameData,
                                                        boolean isEditorMode)

  This method is called when either the player's vehicle control has changed or another vehicle is being viewed.

  Overrides:
    `onVehicleControlChanged` in class `Widget`
  Parameters:
    `viewedVSI` - the currently viewed vehicle
    `gameData` - the live game data
    `isEditorMode` - `true`, if the Editor is used for rendering instead of rFactor
  Returns:
    `true` to set visible, `false` to set invisible, `null` for no change in visibility. This doesn't affect the visiblity toggled by the `Widget.updateVisibility(LiveGameData, boolean)` method or `Widget.onBoundInputStateChanged(InputAction, boolean, int, long, LiveGameData, boolean)` method.
  See Also:
    `Widget.getAutoVisibility()`

### onLapStarted

    public void onLapStarted(VehicleScoringInfo vsi,
                             LiveGameData gameData,
                             boolean isEditorMode)

  This method is called when a lap has been finished and a new one was started.

  Overrides:
    `onLapStarted` in class `Widget`
  Parameters:
    `vsi` - the driver, who started the lap. If this is the leader and the session type is RACE, the whole race has moved on to the next lap.
    `gameData` - the live game data
    `isEditorMode` - `true`, if the Editor is used for rendering instead of rFactor

### onBoundInputStateChanged

    public java.lang.Boolean onBoundInputStateChanged(InputAction action,
                                                      boolean state,
                                                      int modifierMask,
                                                      long when,
                                                      LiveGameData gameData,
                                                      boolean isEditorMode)

  This event is fired, when a bound input component has changed its state.

  Overrides:
    `onBoundInputStateChanged` in class `Widget`
  Parameters:
    `action` - the triggered action
    `state` - the state of the input device component
    `modifierMask` - see `InputAction`
    `when` - the timestamp in nano seconds
    `gameData` - the live game data
    `isEditorMode` - `true`, if the Editor is used for rendering instead of rFactor
  Returns:
    `true` to set visible, `false` to set invisible, `null` for no change in visibility. This doesn't affect the visiblity toggled by the `Widget.updateVisibility(LiveGameData, boolean)` method. Automatic visiblity can also override the result.
  See Also:
    `Widget.getInputVisibility()`

### hasMasterCanvas

    public boolean hasMasterCanvas(boolean isEditorMode)

  Returns `true`, if this `Widget` draws on the main texture, `false` otherwise.
  Default is `true`.

  Overrides:
    `hasMasterCanvas` in class `Widget`
  Parameters:
    `isEditorMode` - `true`, if the Editor is used for rendering instead of rFactor
  Returns:
    `true`, if this `Widget` draws on the main texture, `false` otherwise.

### initialize

    protected void initialize(LiveGameData gameData,
                              boolean isEditorMode,
                              DrawnStringFactory drawnStringFactory,
                              TextureImage2D texture,
                              int width,
                              int height)

  This method is called once to initialized `DrawnString`s used on this Widget.

  Specified by:
    `initialize` in class `Widget`
  Parameters:
    `gameData` - the live game data
    `isEditorMode` - `true`, if the Editor is used for rendering instead of rFactor
    `drawnStringFactory` - a factory to get `DrawnString` instances from
    `texture` - the texture image to draw on. Use `TextureImage2D.getTextureCanvas()` to retrieve the `Texture2DCanvas` for Graphics2D drawing.
    `width` - the width on the texture
    `height` - the height on the texture

### checkForChanges

    protected boolean checkForChanges(LiveGameData gameData,
                                      boolean isEditorMode,
                                      TextureImage2D texture,
                                      int width,
                                      int height)

  Checks, if the Widget needs any changes before it is drawn. If true, `Widget.drawBorder(boolean, BorderWrapper, TextureImage2D, int, int, int, int)` and possibly `Widget.drawBackground(LiveGameData, boolean, TextureImage2D, int, int, int, int, boolean)` are (re-)invoked.
  The original method is just an empty stub returning false.

  Overrides:
    `checkForChanges` in class `Widget`
  Parameters:
    `gameData` - the live game data
    `isEditorMode` - `true`, if the Editor is used for rendering instead of rFactor
    `texture` - the texture image to draw on. Use `TextureImage2D.getTextureCanvas()` to retrieve the `Texture2DCanvas` for Graphics2D drawing.
    `width` - the width on the texture
    `height` - the height on the texture
  Returns:
    true, if size has changed.

### drawWidget

    protected void drawWidget(Clock clock,
                              boolean needsCompleteRedraw,
                              LiveGameData gameData,
                              boolean isEditorMode,
                              TextureImage2D texture,
                              int offsetX,
                              int offsetY,
                              int width,
                              int height)

  This method must contain the actual drawing code for this Widget.

  Specified by:
    `drawWidget` in class `Widget`
  Parameters:
    `clock` - this is a clock for very dynamic content, that needs smooth display. If 'needsCompleteRedraw' is true, clock1 is also true.
    `needsCompleteRedraw` - whether this widget needs to be completely redrawn (true) or just the changed parts (false)
    `gameData` - the live game data
    `isEditorMode` - `true`, if the Editor is used for rendering instead of rFactor
    `texture` - the texture image to draw on. Use `TextureImage2D.getTextureCanvas()` to retrieve the `Texture2DCanvas` for Graphics2D drawing.
    `offsetX` - the x-offset on the texture
    `offsetY` - the y-offset on the texture
    `width` - the width on the texture
    `height` - the height on the texture

### saveProperties

    public void saveProperties(PropertyWriter writer)
                        throws java.io.IOException

  Saves all settings to the config file.

  Specified by:
    `saveProperties` in interface `PropertiesKeeper`
  Overrides:
    `saveProperties` in class `Widget`
  Parameters:
    `writer` - the widgets configuration writer to write properties to
  Throws:
    `java.io.IOException` - if something went wrong

### loadProperty

    public void loadProperty(PropertyLoader loader)

  Loads (and parses) a certain property from a config file.

  Specified by:
    `loadProperty` in interface `PropertiesKeeper`
  Overrides:
    `loadProperty` in class `Widget`
  Parameters:
    `loader` - the property loader to load properties from

### getProperties

    public void getProperties(PropertiesContainer propsCont,
                              boolean forceAll)

  Puts all editable properties to the editor.

  Specified by:
    `getProperties` in interface `PropertiesKeeper`
  Overrides:
    `getProperties` in class `Widget`
  Parameters:
    `propsCont` - the container to add the properties to
    `forceAll` - 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.

### getNewInstanceForClone

    protected Widget getNewInstanceForClone()

  Overrides:
    `getNewInstanceForClone` in class `Widget`

### hasText

    protected boolean hasText()

  Defines, if a Widget type (potentially) contains any text. If `false`, the editor won't provide font or font-color selection. Should return a contant value.

  Overrides:
    `hasText` in class `Widget`
  Returns:
    if this Widget can contain any text.

### canHaveBackground

    protected final boolean canHaveBackground()

  Defines, if this Widget type can have a background.

  Overrides:
    `canHaveBackground` in class `Widget`
  Returns:
    if this Widget type can have a background.

### initParts

    protected abstract Widget[] initParts(float width,
                                          boolean widthPercent,
                                          float height,
                                          boolean heightPercent)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD