Gridarta Editor
net.sf.gridarta.gui.utils.DirectionComponent Class Referenceabstract

A GUI component for selecting a direction. More...

+ Inheritance diagram for net.sf.gridarta.gui.utils.DirectionComponent:
+ Collaboration diagram for net.sf.gridarta.gui.utils.DirectionComponent:

Public Member Functions

void direction0 ()
 Action method for direction. More...
 
void direction1 ()
 Action method for direction. More...
 
void direction2 ()
 Action method for direction. More...
 
void direction3 ()
 Action method for direction. More...
 
void direction4 ()
 Action method for direction. More...
 
void direction5 ()
 Action method for direction. More...
 
void direction6 ()
 Action method for direction. More...
 
void direction7 ()
 Action method for direction. More...
 
void direction8 ()
 Action method for direction. More...
 
void directionnull ()
 Action method for default direction. More...
 
void setEnabled (final boolean enabled)
 
final void updateDirection (@Nullable final Integer direction)
 Sets the selected direction. More...
 

Protected Member Functions

abstract void direction (@Nullable Integer direction)
 Called whenever a direction button has been selected. More...
 
 DirectionComponent (final boolean includeDefault)
 Creates a new instance. More...
 
final void updateEnabled (final boolean enableButtons)
 Enables/disables the direction buttons for a given archetype. More...
 

Private Member Functions

void createButton (@Nullable final Integer direction, @NotNull final GridBagConstraints gbc, final int x, final int y)
 Creates a direction button. More...
 
void updateEnabled ()
 Enables/disables the buttons. More...
 

Private Attributes

final ButtonGroup directionButtonGroup = new ButtonGroup()
 The ButtonGroup for the direction buttons. More...
 
final Collection< JToggleButton > directionButtons = new ArrayList<>()
 The buttons in directionButtonGroup. More...
 
final Map< Integer, JToggleButton > directions = new HashMap<>(9)
 Maps direction to button. More...
 
boolean enableButtons
 Whether the buttons are currently enabled. More...
 

Static Private Attributes

static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta")
 The ActionBuilder instance. More...
 
static final Insets EMPTY_INSETS = new Insets(0, 0, 0, 0)
 Empty Insets. More...
 
static final long serialVersionUID = 1L
 The serial version UID. More...
 

Detailed Description

A GUI component for selecting a direction.

Author
Michael Toennies
Andreas Vogl
Christian Hujer
Andreas Kirschbaum AbstractClassExtendsConcreteClass

Definition at line 48 of file DirectionComponent.java.

Constructor & Destructor Documentation

◆ DirectionComponent()

net.sf.gridarta.gui.utils.DirectionComponent.DirectionComponent ( final boolean  includeDefault)
protected

Creates a new instance.

Parameters
includeDefaultwhether the "default" button should be shown

Definition at line 94 of file DirectionComponent.java.

References net.sf.gridarta.gui.utils.DirectionComponent.createButton(), net.sf.gridarta.gui.utils.DirectionComponent.updateDirection(), and net.sf.gridarta.gui.utils.DirectionComponent.updateEnabled().

+ Here is the call graph for this function:

Member Function Documentation

◆ createButton()

void net.sf.gridarta.gui.utils.DirectionComponent.createButton ( @Nullable final Integer  direction,
@NotNull final GridBagConstraints  gbc,
final int  x,
final int  y 
)
private

Creates a direction button.

Parameters
directionthe direction for the button
gbcthe grid bag constraints to modify
xthe x position of the button
ythe y position of the button

Definition at line 144 of file DirectionComponent.java.

Referenced by net.sf.gridarta.gui.utils.DirectionComponent.DirectionComponent().

+ Here is the caller graph for this function:

◆ direction()

◆ direction0()

void net.sf.gridarta.gui.utils.DirectionComponent.direction0 ( )

Action method for direction.

Definition at line 162 of file DirectionComponent.java.

References net.sf.gridarta.gui.utils.DirectionComponent.direction().

+ Here is the call graph for this function:

◆ direction1()

void net.sf.gridarta.gui.utils.DirectionComponent.direction1 ( )

Action method for direction.

Definition at line 170 of file DirectionComponent.java.

References net.sf.gridarta.gui.utils.DirectionComponent.direction().

+ Here is the call graph for this function:

◆ direction2()

void net.sf.gridarta.gui.utils.DirectionComponent.direction2 ( )

Action method for direction.

Definition at line 178 of file DirectionComponent.java.

References net.sf.gridarta.gui.utils.DirectionComponent.direction().

+ Here is the call graph for this function:

◆ direction3()

void net.sf.gridarta.gui.utils.DirectionComponent.direction3 ( )

Action method for direction.

Definition at line 186 of file DirectionComponent.java.

References net.sf.gridarta.gui.utils.DirectionComponent.direction().

+ Here is the call graph for this function:

◆ direction4()

void net.sf.gridarta.gui.utils.DirectionComponent.direction4 ( )

Action method for direction.

Definition at line 194 of file DirectionComponent.java.

References net.sf.gridarta.gui.utils.DirectionComponent.direction().

+ Here is the call graph for this function:

◆ direction5()

void net.sf.gridarta.gui.utils.DirectionComponent.direction5 ( )

Action method for direction.

Definition at line 202 of file DirectionComponent.java.

References net.sf.gridarta.gui.utils.DirectionComponent.direction().

+ Here is the call graph for this function:

◆ direction6()

void net.sf.gridarta.gui.utils.DirectionComponent.direction6 ( )

Action method for direction.

Definition at line 210 of file DirectionComponent.java.

References net.sf.gridarta.gui.utils.DirectionComponent.direction().

+ Here is the call graph for this function:

◆ direction7()

void net.sf.gridarta.gui.utils.DirectionComponent.direction7 ( )

Action method for direction.

Definition at line 218 of file DirectionComponent.java.

References net.sf.gridarta.gui.utils.DirectionComponent.direction().

+ Here is the call graph for this function:

◆ direction8()

void net.sf.gridarta.gui.utils.DirectionComponent.direction8 ( )

Action method for direction.

Definition at line 226 of file DirectionComponent.java.

References net.sf.gridarta.gui.utils.DirectionComponent.direction().

+ Here is the call graph for this function:

◆ directionnull()

void net.sf.gridarta.gui.utils.DirectionComponent.directionnull ( )

Action method for default direction.

Definition at line 234 of file DirectionComponent.java.

References net.sf.gridarta.gui.utils.DirectionComponent.direction().

+ Here is the call graph for this function:

◆ setEnabled()

void net.sf.gridarta.gui.utils.DirectionComponent.setEnabled ( final boolean  enabled)

◆ updateDirection()

final void net.sf.gridarta.gui.utils.DirectionComponent.updateDirection ( @Nullable final Integer  direction)

◆ updateEnabled() [1/2]

final void net.sf.gridarta.gui.utils.DirectionComponent.updateEnabled ( final boolean  enableButtons)
protected

Enables/disables the direction buttons for a given archetype.

Parameters
enableButtonswhether the buttons are enabled

Definition at line 121 of file DirectionComponent.java.

References net.sf.gridarta.gui.utils.DirectionComponent.enableButtons, and net.sf.gridarta.gui.utils.DirectionComponent.updateEnabled().

+ Here is the call graph for this function:

◆ updateEnabled() [2/2]

Member Data Documentation

◆ ACTION_BUILDER

final ActionBuilder net.sf.gridarta.gui.utils.DirectionComponent.ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta")
staticprivate

The ActionBuilder instance.

Definition at line 59 of file DirectionComponent.java.

◆ directionButtonGroup

final ButtonGroup net.sf.gridarta.gui.utils.DirectionComponent.directionButtonGroup = new ButtonGroup()
private

The ButtonGroup for the direction buttons.

Definition at line 71 of file DirectionComponent.java.

◆ directionButtons

final Collection<JToggleButton> net.sf.gridarta.gui.utils.DirectionComponent.directionButtons = new ArrayList<>()
private

The buttons in directionButtonGroup.

Definition at line 77 of file DirectionComponent.java.

◆ directions

final Map<Integer, JToggleButton> net.sf.gridarta.gui.utils.DirectionComponent.directions = new HashMap<>(9)
private

Maps direction to button.

Definition at line 83 of file DirectionComponent.java.

◆ EMPTY_INSETS

final Insets net.sf.gridarta.gui.utils.DirectionComponent.EMPTY_INSETS = new Insets(0, 0, 0, 0)
staticprivate

Empty Insets.

Definition at line 65 of file DirectionComponent.java.

◆ enableButtons

boolean net.sf.gridarta.gui.utils.DirectionComponent.enableButtons
private

Whether the buttons are currently enabled.

Definition at line 88 of file DirectionComponent.java.

Referenced by net.sf.gridarta.gui.utils.DirectionComponent.updateEnabled().

◆ serialVersionUID

final long net.sf.gridarta.gui.utils.DirectionComponent.serialVersionUID = 1L
staticprivate

The serial version UID.

Definition at line 53 of file DirectionComponent.java.


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