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

Base class for interaction modes used by PlayArea and Controller. More...

#include <Mode.h>

Inheritance diagram for Mode:
Collaboration diagram for Mode:

Instance Methods

(id) - initWithPlayArea:forController:
(NSCursor *) - cursor
(NSString *) - name
(void) - mouseDown:
 No-op default implementation; subclasses override.
(void) - mouseDragged:
 No-op default implementation; subclasses override.
(void) - mouseMoved:
 No-op default implementation; subclasses override.
(void) - mouseUp:
 No-op default implementation; subclasses override.
(void) - keyDown:
 No-op default implementation; subclasses override.
(void) - drawRect:
 No-op default implementation; subclasses override.
(void) - setNextMode:
(void) - setUp
 Lifecycle hook; default is no-op.
(void) - cleanUp
 Lifecycle hook; default is no-op.
(id) - init [implementation]

Protected Attributes

PlayAreaplayArea
Controllercontroller
ModenextMode

Detailed Description

Base class for interaction modes used by PlayArea and Controller.

Concrete defaults for Mode: no-op event handlers and helpers.

Subclasses override mouse/key handling and drawing hooks to implement specific behaviors. Modes may chain to a nextMode when complete.

Definition at line 20 of file Mode.h.

Method Documentation

◆ cleanUp

- (void) cleanUp

Lifecycle hook; default is no-op.

Called when the mode is deactivated to release/clear state.

Reimplemented in DrawFreehandPadMode, DrawPolygonPadMode, DrawTraceMode, and MovePadMode.

Definition at line 78 of file Mode.m.

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

◆ cursor

- (NSCursor *) cursor

Returns the cursor to display while this mode is active.

Default cursor: arrow. Subclasses may override.

Reimplemented in DrawFreehandPadMode, DrawPolygonPadMode, DrawTraceMode, and MovePadMode.

Definition at line 34 of file Mode.m.

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

◆ drawRect:

- (void) drawRect: (NSRect) dirtyRect

No-op default implementation; subclasses override.

Optional drawing overlay while the mode is active.

Reimplemented in MovePadMode.

Definition at line 64 of file Mode.m.

Here is the caller graph for this function:

◆ init

- (id) init
implementation

Initializes the mode with no nextMode by default.

Reimplemented in DrawFreehandPadMode, DrawPolygonPadMode, and DrawTraceMode.

Definition at line 15 of file Mode.m.

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

◆ initWithPlayArea:forController:

- (id) initWithPlayArea: (PlayArea *) aPlayArea
forController: (Controller *) theController 

Designated initializer. Wires the mode to a play area and controller.

Designated initializer wiring the play area and controller.

Definition at line 24 of file Mode.m.

Here is the call graph for this function:

◆ keyDown:

- (void) keyDown: (NSEvent *) event

No-op default implementation; subclasses override.

Event hook; subclasses override to handle events.

Reimplemented in MovePadMode.

Definition at line 60 of file Mode.m.

Here is the caller graph for this function:

◆ mouseDown:

- (void) mouseDown: (NSEvent *) event

No-op default implementation; subclasses override.

Event hook; subclasses override to handle events.

Reimplemented in DrawFreehandPadMode, DrawPolygonPadMode, DrawTraceMode, and MovePadMode.

Definition at line 44 of file Mode.m.

Here is the caller graph for this function:

◆ mouseDragged:

- (void) mouseDragged: (NSEvent *) event

No-op default implementation; subclasses override.

Event hook; subclasses override to handle events.

Reimplemented in DrawFreehandPadMode, DrawPolygonPadMode, DrawTraceMode, and MovePadMode.

Definition at line 48 of file Mode.m.

Here is the caller graph for this function:

◆ mouseMoved:

- (void) mouseMoved: (NSEvent *) event

No-op default implementation; subclasses override.

Event hook; subclasses override to handle events.

Reimplemented in DrawFreehandPadMode, DrawPolygonPadMode, DrawTraceMode, and MovePadMode.

Definition at line 52 of file Mode.m.

Here is the caller graph for this function:

◆ mouseUp:

- (void) mouseUp: (NSEvent *) event

No-op default implementation; subclasses override.

Event hook; subclasses override to handle events.

Reimplemented in DrawFreehandPadMode, DrawPolygonPadMode, DrawTraceMode, MovePadMode, and RestMode.

Definition at line 56 of file Mode.m.

Here is the caller graph for this function:

◆ name

- (NSString *) name

Human-readable name of the mode for logging/UI.

Default name used for logging when no specific mode is set.

Reimplemented in DrawFreehandPadMode, DrawPolygonPadMode, DrawTraceMode, MovePadMode, and RestMode.

Definition at line 39 of file Mode.m.

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

◆ setNextMode:

- (void) setNextMode: (Mode *) aMode

Sets the next mode to transition to after completion.

Sets the next mode in the interaction sequence.

Definition at line 68 of file Mode.m.

Here is the caller graph for this function:

◆ setUp

- (void) setUp

Lifecycle hook; default is no-op.

Called when the mode becomes active to allocate/setup state.

Reimplemented in DrawFreehandPadMode, DrawPolygonPadMode, DrawTraceMode, and MovePadMode.

Definition at line 74 of file Mode.m.

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

Member Data Documentation

◆ controller

- (Controller*) controller
protected

The controller coordinating mode switches.

Definition at line 24 of file Mode.h.

◆ nextMode

- (Mode*) nextMode
protected

Optional next mode to switch to when this mode completes.

Definition at line 26 of file Mode.h.

◆ playArea

- (PlayArea*) playArea
protected

The play area this mode manipulates.

Definition at line 22 of file Mode.h.


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