Skip to content

Commit 71f545f

Browse files
committed
GET OVAL TOOL WORKING
1 parent 4ee8c54 commit 71f545f

File tree

12 files changed

+210
-60
lines changed

12 files changed

+210
-60
lines changed

SoftwareConstruction_DataAbstraction/finalProject/SimpleDrawingPlayer-starter/.idea/workspace.xml

Lines changed: 154 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
-106 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
84 Bytes
Binary file not shown.
929 Bytes
Binary file not shown.
954 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
-259 Bytes
Binary file not shown.

SoftwareConstruction_DataAbstraction/finalProject/SimpleDrawingPlayer-starter/src/ui/DrawingEditor.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,12 @@ private void createTools() {
151151
toolArea.setSize(new Dimension(0, 0));
152152
add(toolArea, BorderLayout.SOUTH);
153153

154-
ShapeTool rectTool = new ShapeTool(this, toolArea);
154+
ShapeTool rectTool = new RectangleTool(this, toolArea);
155155
tools.add(rectTool);
156156

157+
ShapeTool ovalTool = new OvalTool(this, toolArea);
158+
tools.add(ovalTool);
159+
157160
MoveTool moveTool = new MoveTool(this, toolArea);
158161
tools.add(moveTool);
159162

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package ui.tools;
2+
3+
import model.Oval;
4+
import ui.DrawingEditor;
5+
6+
import javax.swing.*;
7+
import java.awt.event.MouseEvent;
8+
9+
public class OvalTool extends ShapeTool {
10+
11+
public OvalTool(DrawingEditor editor, JComponent parent) {
12+
super(editor, parent);
13+
}
14+
15+
@Override
16+
protected String getLabel() {
17+
return "Oval";
18+
}
19+
20+
@Override
21+
protected void makeShape(MouseEvent e) {
22+
shape = new Oval(e.getPoint(), editor.getMidiSynth());
23+
}
24+
}

0 commit comments

Comments
 (0)