Muvicado HD
Loading...
Searching...
No Matches
Controller Class Reference

Manages the active Mode and connects UI elements with the PlayArea. More...

#include <Controller.h>

Inheritance diagram for Controller:
Collaboration diagram for Controller:

Instance Methods

(id) - initWithPlayArea:
(void) - setThings
(IBAction) - convert:
(void) - controlTextDidChange:
(Mode *) - mode
(ControllerMode- modeIndex
(void) - setMode:
(void) - setNextMode:
(IBAction) - setPlayMode:
(IBAction) - setRestMode:
(IBAction) - setDrawFreehandPadMode:
(IBAction) - setDrawPolygonPadMode:
(IBAction) - setDrawTraceMode:
(IBAction) - setMovePadMode:
(void) - showInfo1:
(void) - showInfo2:
(id) - init [implementation]
(void) - awakeFromNib [implementation]
(void) - dealloc [implementation]

Protected Attributes

ModecurrentMode
ControllerMode modeIndex
ControllerType controllerType
Modemodes [NUM_MODES]
IBOutlet NSTextField * infoField
IBOutlet NSTextField * infoLabel1
IBOutlet NSTextField * infoLabel2
IBOutlet PlayAreaplayArea

Properties

PlayAreaplayArea

Detailed Description

Manages the active Mode and connects UI elements with the PlayArea.

Concrete implementation of Controller behavior and lifecycle.

The Controller owns a table of Mode instances, exposes actions for switching modes, and provides utility methods for displaying information to the user.

Definition at line 56 of file Controller.h.

Method Documentation

◆ awakeFromNib

- (void) awakeFromNib
implementation

Finishes setup when loaded from a nib: creates modes and sets defaults.

Definition at line 62 of file Controller.m.

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

◆ controlTextDidChange:

- (void) controlTextDidChange: (NSNotification *) nd

Responds to text field edits to update controller state as needed.

Definition at line 131 of file Controller.m.

◆ convert:

- (IBAction) convert: (id) sender

Placeholder action for future conversion functionality.

Definition at line 126 of file Controller.m.

◆ dealloc

- (void) dealloc
implementation

Releases owned mode instances and the play area before deallocation.

Definition at line 86 of file Controller.m.

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

◆ init

- (id) init
implementation

Initializes a Controller instance not yet connected to a PlayArea. Use setThings or awakeFromNib to complete setup.

Definition at line 36 of file Controller.m.

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

◆ initWithPlayArea:

- (id) initWithPlayArea: (PlayArea *) aPlayArea

Designated initializer for programmatic setup.

Parameters
aPlayAreaThe play area to be managed by this controller.
Returns
An initialized Controller instance.

Initializes a Controller for a given PlayArea (programmatic creation).

Parameters
aPlayAreaThe play area to manage.

Definition at line 49 of file Controller.m.

◆ mode

- (Mode *) mode

Returns the currently active Mode instance.

Returns
The active Mode, or nil if in Play.

Returns the currently active Mode instance.

Definition at line 179 of file Controller.m.

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

◆ modeIndex

- (ControllerMode) modeIndex

Returns the current mode index.

Returns
The enum value representing the active mode.

◆ setDrawFreehandPadMode:

- (IBAction) setDrawFreehandPadMode: (id) sender

Switches to Draw Freehand Pad mode.

Definition at line 232 of file Controller.m.

Here is the call graph for this function:

◆ setDrawPolygonPadMode:

- (IBAction) setDrawPolygonPadMode: (id) sender

Switches to Draw Polygon Pad mode.

Definition at line 239 of file Controller.m.

Here is the call graph for this function:

◆ setDrawTraceMode:

- (IBAction) setDrawTraceMode: (id) sender

Switches to Draw Trace mode.

Definition at line 246 of file Controller.m.

Here is the call graph for this function:

◆ setMode:

- (void) setMode: (ControllerMode) aContollerMode

Sets the current interaction mode and updates the PlayArea accordingly.

Parameters
aControllerModeThe mode to activate.

Sets the current interaction mode and updates the PlayArea accordingly.

Parameters
aContollerModeThe mode to activate.

Definition at line 194 of file Controller.m.

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

◆ setMovePadMode:

- (IBAction) setMovePadMode: (id) sender

Switches to Move Pad mode.

Definition at line 253 of file Controller.m.

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

◆ setNextMode:

- (void) setNextMode: (ControllerMode) aContollerMode

Prepares a mode to be used as the next mode by the current one, if supported.

Parameters
aControllerModeThe mode to set as next.

Sets the next mode to be used by the current mode, if supported.

Parameters
aContollerModeThe mode to designate as next.

Definition at line 208 of file Controller.m.

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

◆ setPlayMode:

- (IBAction) setPlayMode: (id) sender

Switches to Play mode.

Definition at line 218 of file Controller.m.

Here is the call graph for this function:

◆ setRestMode:

- (IBAction) setRestMode: (id) sender

Switches to Rest mode.

Definition at line 225 of file Controller.m.

Here is the call graph for this function:

◆ setThings

- (void) setThings

Performs setup analogous to awakeFromNib for code-generated instances.

Replacement for awakeFromNib when creating Controller programmatically.

Performs the same setup work as awakeFromNib (creating modes, wiring them to the PlayArea, and establishing defaults) for controllers that are instantiated in code rather than loaded from a nib.

Performs programmatic setup analogous to awakeFromNib.

Definition at line 102 of file Controller.m.

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

◆ showInfo1:

- (void) showInfo1: (NSString *) formatString
, (...)  

Displays a formatted message in info label 1. Accepts a printf-style format string and arguments.

Definition at line 142 of file Controller.m.

Here is the caller graph for this function:

◆ showInfo2:

- (void) showInfo2: (NSString *) formatString
, (...)  

Displays a formatted message in info label 2. Accepts a printf-style format string and arguments.

Definition at line 162 of file Controller.m.

Member Data Documentation

◆ controllerType

- (ControllerType) controllerType
protected

Indicates how this controller instance was configured/created.

Definition at line 62 of file Controller.h.

◆ currentMode

- (Mode*) currentMode
protected

The currently active interaction mode.

Definition at line 58 of file Controller.h.

◆ infoField

- (IBOutlet NSTextField*) infoField
protected

Label for primary informational messages.

Definition at line 66 of file Controller.h.

◆ infoLabel1

- (IBOutlet NSTextField*) infoLabel1
protected

Secondary informational label 1.

Definition at line 68 of file Controller.h.

◆ infoLabel2

- (IBOutlet NSTextField*) infoLabel2
protected

Secondary informational label 2.

Definition at line 70 of file Controller.h.

◆ modeIndex

- (ControllerMode) modeIndex
protected

Index of the currently active mode in the modes table.

Returns the enum value for the current mode.

Definition at line 185 of file Controller.m.

◆ modes

- (Mode* modes[NUM_MODES])
protected

Mode instances indexed by ControllerMode.

Definition at line 64 of file Controller.h.

◆ playArea

- (IBOutlet PlayArea*) playArea
protected

The play area view managed by this controller.

Definition at line 72 of file Controller.h.

Property Documentation

◆ playArea

- (PlayArea*) playArea
readwritenonatomicstrong

Exposes the managed PlayArea to Swift and other components.

Definition at line 76 of file Controller.h.


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