|
Muvicado HD
|
Manages the active Mode and connects UI elements with the PlayArea. More...
#include <Controller.h>


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 | |
| Mode * | currentMode |
| ControllerMode | modeIndex |
| ControllerType | controllerType |
| Mode * | modes [NUM_MODES] |
| IBOutlet NSTextField * | infoField |
| IBOutlet NSTextField * | infoLabel1 |
| IBOutlet NSTextField * | infoLabel2 |
| IBOutlet PlayArea * | playArea |
Properties | |
| PlayArea * | playArea |
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.
|
implementation |
Finishes setup when loaded from a nib: creates modes and sets defaults.
Definition at line 62 of file Controller.m.


| - (void) controlTextDidChange: | (NSNotification *) | nd |
Responds to text field edits to update controller state as needed.
Definition at line 131 of file Controller.m.
| - (IBAction) convert: | (id) | sender |
Placeholder action for future conversion functionality.
Definition at line 126 of file Controller.m.
|
implementation |
Releases owned mode instances and the play area before deallocation.
Definition at line 86 of file Controller.m.


|
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.


| - (id) initWithPlayArea: | (PlayArea *) | aPlayArea |
Designated initializer for programmatic setup.
| aPlayArea | The play area to be managed by this controller. |
Initializes a Controller for a given PlayArea (programmatic creation).
| aPlayArea | The play area to manage. |
Definition at line 49 of file Controller.m.
| - (Mode *) mode |
Returns the currently active Mode instance.
Returns the currently active Mode instance.
Definition at line 179 of file Controller.m.


| - (ControllerMode) modeIndex |
Returns the current mode index.
| - (IBAction) setDrawFreehandPadMode: | (id) | sender |
Switches to Draw Freehand Pad mode.
Definition at line 232 of file Controller.m.

| - (IBAction) setDrawPolygonPadMode: | (id) | sender |
Switches to Draw Polygon Pad mode.
Definition at line 239 of file Controller.m.

| - (IBAction) setDrawTraceMode: | (id) | sender |
Switches to Draw Trace mode.
Definition at line 246 of file Controller.m.

| - (void) setMode: | (ControllerMode) | aContollerMode |
Sets the current interaction mode and updates the PlayArea accordingly.
| aControllerMode | The mode to activate. |
Sets the current interaction mode and updates the PlayArea accordingly.
| aContollerMode | The mode to activate. |
Definition at line 194 of file Controller.m.


| - (IBAction) setMovePadMode: | (id) | sender |
Switches to Move Pad mode.
Definition at line 253 of file Controller.m.


| - (void) setNextMode: | (ControllerMode) | aContollerMode |
Prepares a mode to be used as the next mode by the current one, if supported.
| aControllerMode | The mode to set as next. |
Sets the next mode to be used by the current mode, if supported.
| aContollerMode | The mode to designate as next. |
Definition at line 208 of file Controller.m.


| - (IBAction) setPlayMode: | (id) | sender |
Switches to Play mode.
Definition at line 218 of file Controller.m.

| - (IBAction) setRestMode: | (id) | sender |
Switches to Rest mode.
Definition at line 225 of file Controller.m.

| - (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.


| - (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.

| - (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.
|
protected |
Indicates how this controller instance was configured/created.
Definition at line 62 of file Controller.h.
|
protected |
The currently active interaction mode.
Definition at line 58 of file Controller.h.
|
protected |
Label for primary informational messages.
Definition at line 66 of file Controller.h.
|
protected |
Secondary informational label 1.
Definition at line 68 of file Controller.h.
|
protected |
Secondary informational label 2.
Definition at line 70 of file Controller.h.
|
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.
Mode instances indexed by ControllerMode.
Definition at line 64 of file Controller.h.
|
protected |
The play area view managed by this controller.
Definition at line 72 of file Controller.h.
|
readwritenonatomicstrong |
Exposes the managed PlayArea to Swift and other components.
Definition at line 76 of file Controller.h.