|
| 1 | +# Processes for Data Flow Diagram |
| 2 | + |
| 3 | +## Level 0: Masonry Framework Communication with MusicBlocks |
| 4 | + |
| 5 | +1. **Load Configuration**: |
| 6 | + - Input: Configuration File |
| 7 | + - Output: Initialized System |
| 8 | + |
| 9 | +2. **Save Configuration**: |
| 10 | + - Input: Current State |
| 11 | + - Output: Updated Configuration File |
| 12 | + |
| 13 | +3. **Generate Syntax Tree**: |
| 14 | + - Input: Brick Stack Data |
| 15 | + - Output: Syntax Tree |
| 16 | + |
| 17 | +4. **Parse Syntax Tree**: |
| 18 | + - Input: Syntax Tree |
| 19 | + - Output: Executable Actions |
| 20 | + |
| 21 | +## Level 1: Interaction between Brick, Palette, Workspace, and Stack of Bricks |
| 22 | + |
| 23 | +### Bricks |
| 24 | + |
| 25 | +1. **Initialize Brick**: |
| 26 | + - Input: Brick Properties |
| 27 | + - Output: Initialized Brick |
| 28 | + |
| 29 | +2. **Provide Brick Properties**: |
| 30 | + - Input: Brick ID from Workspace |
| 31 | + - Output: Brick Properties to Workspace |
| 32 | + |
| 33 | +### Palette |
| 34 | + |
| 35 | +1. **Load Brick List**: |
| 36 | + - Input: Configuration Settings |
| 37 | + - Output: List of Bricks |
| 38 | + |
| 39 | +2. **Select Brick**: |
| 40 | + - Input: Brick Selection |
| 41 | + - Output: Selected Brick Properties to Workspace |
| 42 | + (How this works is, The palette will have a loaded list of SVGs. When you drag one from palette on |
| 43 | + to the workspace, the brick will be created on the workspace whos id matches to the one in brick) |
| 44 | + |
| 45 | +### Workspace |
| 46 | + |
| 47 | +1. **Add Brick to Workspace**: |
| 48 | + - Input: Brick Properties from Palette |
| 49 | + - Output: Updated Workspace |
| 50 | + |
| 51 | +2. **Update Brick Position**: |
| 52 | + - Input: Brick ID and Position Data |
| 53 | + - Output: Updated Brick Position in Workspace |
| 54 | + |
| 55 | +3. **Connect Bricks**: |
| 56 | + - Input: Brick IDs and Connection Data |
| 57 | + - Output: Updated Brick Stack in Workspace |
| 58 | + |
| 59 | +4. **Disconnect Bricks**: |
| 60 | + - Input: Brick IDs |
| 61 | + - Output: Updated Brick Stack in Workspace |
| 62 | + |
| 63 | +5. **Save Workspace State**: |
| 64 | + - Input: Current Workspace Data |
| 65 | + - Output: Saved Workspace State |
| 66 | + |
| 67 | +### Stack of Bricks |
| 68 | + |
| 69 | +1. **Initialize Stack**: |
| 70 | + - Input: Brick Stack Data |
| 71 | + - Output: Initialized Stack |
| 72 | + |
| 73 | +2. **Provide Stack Properties**: |
| 74 | + - Input: Stack ID from Workspace |
| 75 | + - Output: Stack Properties to Workspace |
| 76 | + |
| 77 | +## Level 2: Detailed Interaction within MVC Architecture |
| 78 | + |
| 79 | +### Model |
| 80 | + |
| 81 | +1. BrickModel: |
| 82 | + - Properties: |
| 83 | + - brickType |
| 84 | + - originalColor |
| 85 | + - hoverColor |
| 86 | + - disconnectedColor |
| 87 | + - executionColor |
| 88 | + - highlightState |
| 89 | + - shape |
| 90 | + - sprites |
| 91 | + - labels |
| 92 | + - inputPorts |
| 93 | + - outputPorts |
| 94 | + - editableTextLabels |
| 95 | + - Methods: |
| 96 | + - setHighlightState(state) |
| 97 | + - updateProperties(properties) |
| 98 | + - updateLabels(labels) |
| 99 | + - updatePorts(inputPorts, outputPorts) |
| 100 | +2. StackModel: |
| 101 | + - Properties: |
| 102 | + - connectedBricks |
| 103 | + - startPosition |
| 104 | + - validationRules |
| 105 | + - collapsibleState |
| 106 | + - Methods: |
| 107 | + - addBrick(brick) |
| 108 | + - removeBrick(brick) |
| 109 | + - updateProperties(properties) |
| 110 | + - validateStack() |
| 111 | + - setCollapsibleState(state) |
| 112 | +3. PaletteModel: |
| 113 | + - Properties: |
| 114 | + - availableBricks |
| 115 | + - categories |
| 116 | + - searchQuery |
| 117 | + - filters |
| 118 | + - Methods: |
| 119 | + - loadBricks(bricks) |
| 120 | + - updateBrickAvailability(brick, available) |
| 121 | + - categorizeItems(categories) |
| 122 | + - filterItems(filters) |
| 123 | + - searchItems(query) |
| 124 | +4. WorkspaceModel: |
| 125 | + - Properties: |
| 126 | + - connectedStacks |
| 127 | + - brickPositions |
| 128 | + - zoomLevel |
| 129 | + - undoRedoStack |
| 130 | + - Methods: |
| 131 | + - addStack(stack) |
| 132 | + - removeStack(stack) |
| 133 | + - updateBrickPosition(brick, position) |
| 134 | + - connectBricks(brick1, brick2) |
| 135 | + - disconnectBricks(brick1, brick2) |
| 136 | + - deleteBrick(brick) |
| 137 | + - zoomIn() |
| 138 | + - zoomOut() |
| 139 | + - undo() |
| 140 | + - redo() |
| 141 | + |
| 142 | +### View |
| 143 | + |
| 144 | +1. BrickView: |
| 145 | + - Methods: |
| 146 | + - renderBrick(brick) |
| 147 | + - updateBrickAppearance(brick) |
| 148 | + - renderInlineTextEditing(brick) |
| 149 | + - renderContextMenu(brick) |
| 150 | +2. StackView: |
| 151 | + - Methods: |
| 152 | + - renderStack(stack) |
| 153 | + - updateStackAppearance(stack) |
| 154 | + - renderValidationFeedback(stack) |
| 155 | + - renderCollapsibleState(stack) |
| 156 | +3. PaletteView: |
| 157 | + - Methods: |
| 158 | + - renderPalette(palette) |
| 159 | + - updatePaletteAppearance(palette) |
| 160 | + - renderCategories(categories) |
| 161 | + - renderSearchBar(searchQuery) |
| 162 | + - renderFilters(filters) |
| 163 | +4. WorkspaceView: |
| 164 | + - Methods: |
| 165 | + - renderWorkspace(workspace) |
| 166 | + - updateWorkspaceAppearance(workspace) |
| 167 | + - handleUserInteractions(interaction) |
| 168 | + - renderZoomControls(zoomLevel) |
| 169 | + - renderUndoRedoButtons(undoRedoStack) |
| 170 | + |
| 171 | +### Controller |
| 172 | + |
| 173 | +1. BrickController: |
| 174 | + - Methods: |
| 175 | + - handleBrickPropertyChange(brick, properties) |
| 176 | + - handleBrickHighlightStateChange(brick, state) |
| 177 | + - handleInlineTextEditing(brick, text) |
| 178 | + - handleContextMenuAction(brick, action) |
| 179 | +2. StackController: |
| 180 | + - Methods: |
| 181 | + - handleAddBrick(stack, brick) |
| 182 | + - handleRemoveBrick(stack, brick) |
| 183 | + - handleStackPropertyChange(stack, properties) |
| 184 | + - handleStackValidation(stack) |
| 185 | + - handleCollapsibleStateChange(stack, state) |
| 186 | +3. PaletteController: |
| 187 | + - Methods: |
| 188 | + - handleBrickLoad(palette, bricks) |
| 189 | + - handleBrickAvailabilityChange(palette, brick, available) |
| 190 | + - handleCategorization(palette, categories) |
| 191 | + - handleFiltering(palette, filters) |
| 192 | + - handleSearching(palette, query) |
| 193 | +4. WorkspaceController: |
| 194 | + - Methods: |
| 195 | + - handleAddStack(workspace, stack) |
| 196 | + - handleRemoveStack(workspace, stack) |
| 197 | + - handleBrickPositionChange(workspace, brick, position) |
| 198 | + - handleBrickConnection(workspace, brick1, brick2) |
| 199 | + - handleBrickDisconnection(workspace, brick1, brick2) |
| 200 | + - handleBrickDeletion(workspace, brick) |
| 201 | + - handleZoomIn(workspace) |
| 202 | + - handleZoomOut(workspace) |
| 203 | + - handleUndo(workspace) |
| 204 | + - handleRedo(workspace) |
0 commit comments