Gridarta Editor
net.sf.gridarta.action.LightVisibleAction Class Reference
+ Inheritance diagram for net.sf.gridarta.action.LightVisibleAction:
+ Collaboration diagram for net.sf.gridarta.action.LightVisibleAction:

Public Member Functions

boolean isLightVisible ()
 
 LightVisibleAction (@NotNull final MapViewSettings mapViewSettings)
 
void setAction (@NotNull final Action action, @NotNull final String name)
 
void setLightVisible (final boolean lightVisible)
 

Private Member Functions

boolean doLightVisible (final boolean performAction, final boolean lightVisible)
 
void updateAction ()
 

Private Attributes

ToggleAction action
 
final MapViewSettings mapViewSettings
 
final MapViewSettingsListener mapViewSettingsListener
 

Detailed Description

An EditorAction that toggles whether map lighting is visible.

Author
Andreas Kirschbaum

Definition at line 35 of file LightVisibleAction.java.

Constructor & Destructor Documentation

◆ LightVisibleAction()

net.sf.gridarta.action.LightVisibleAction.LightVisibleAction ( @NotNull final MapViewSettings  mapViewSettings)

Creates a new instance.

Parameters
mapViewSettingsthe map view settings instance to use

Definition at line 96 of file LightVisibleAction.java.

References net.sf.gridarta.model.mapviewsettings.MapViewSettings.addMapViewSettingsListener(), net.sf.gridarta.action.LightVisibleAction.mapViewSettings, and net.sf.gridarta.action.LightVisibleAction.mapViewSettingsListener.

+ Here is the call graph for this function:

Member Function Documentation

◆ doLightVisible()

boolean net.sf.gridarta.action.LightVisibleAction.doLightVisible ( final boolean  performAction,
final boolean  lightVisible 
)
private

Executes the "light visible" action.

Parameters
performActionwhether the action should be performed
lightVisiblewhether the light should be visible; ignored unless
performAction
is set
Returns
whether the action was or can be performed @noinspection SameReturnValue

Definition at line 135 of file LightVisibleAction.java.

References net.sf.gridarta.action.LightVisibleAction.mapViewSettings, and net.sf.gridarta.model.mapviewsettings.MapViewSettings.setLightVisible().

Referenced by net.sf.gridarta.action.LightVisibleAction.isLightVisible(), net.sf.gridarta.action.LightVisibleAction.setLightVisible(), and net.sf.gridarta.action.LightVisibleAction.updateAction().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isLightVisible()

boolean net.sf.gridarta.action.LightVisibleAction.isLightVisible ( )

Action method for "light visible".

Returns
true
if the light is visible, or
false
if the light is invisible

Definition at line 107 of file LightVisibleAction.java.

References net.sf.gridarta.action.LightVisibleAction.doLightVisible(), net.sf.gridarta.model.mapviewsettings.MapViewSettings.isLightVisible(), and net.sf.gridarta.action.LightVisibleAction.mapViewSettings.

Referenced by net.sf.gridarta.action.LightVisibleAction.updateAction().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAction()

void net.sf.gridarta.action.LightVisibleAction.setAction ( @NotNull final Action  action,
@NotNull final String  name 
)

Sets the Action instance for this editor action.

Parameters
actionthe action instance
namethe name of the action

Implements net.sf.gridarta.utils.EditorAction.

Definition at line 123 of file LightVisibleAction.java.

References net.sf.gridarta.action.LightVisibleAction.action.

◆ setLightVisible()

void net.sf.gridarta.action.LightVisibleAction.setLightVisible ( final boolean  lightVisible)

Sets whether the light of the current map should be visible.

Parameters
lightVisiblenew visibility of light in current map,
true
if the light should be visible,
false
if invisible
See also
isLightVisible()

Definition at line 118 of file LightVisibleAction.java.

References net.sf.gridarta.action.LightVisibleAction.doLightVisible().

+ Here is the call graph for this function:

◆ updateAction()

void net.sf.gridarta.action.LightVisibleAction.updateAction ( )
private

Member Data Documentation

◆ action

ToggleAction net.sf.gridarta.action.LightVisibleAction.action
private

The ToggleAction associated with this editor action. Set to

null

if no action is associated.

Definition at line 48 of file LightVisibleAction.java.

Referenced by net.sf.gridarta.action.LightVisibleAction.setAction(), and net.sf.gridarta.action.LightVisibleAction.updateAction().

◆ mapViewSettings

◆ mapViewSettingsListener

final MapViewSettingsListener net.sf.gridarta.action.LightVisibleAction.mapViewSettingsListener
private

The documentation for this class was generated from the following file: