Left: Implement composite structures
This commit is contained in:
Executable
+11
@@ -0,0 +1,11 @@
|
||||
package view.interfaces;
|
||||
|
||||
public interface IDialogChoice<T> {
|
||||
String getDialogTitle();
|
||||
|
||||
String getDialogText();
|
||||
|
||||
T[] getDialogOptions();
|
||||
|
||||
T getCurrentSelection();
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package view.interfaces;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Stroke;
|
||||
import java.util.EnumMap;
|
||||
|
||||
import model.AbstractShape;
|
||||
import model.ShapeColor;
|
||||
|
||||
/**
|
||||
* IDrawShape interface
|
||||
*
|
||||
* Responsibility: Interface for the strategy pattern for drawing shapes.
|
||||
*
|
||||
* Note that if offset is true, an algorithm for drawing boundary is used instead.
|
||||
*
|
||||
* @author Minh Bui
|
||||
*
|
||||
*/
|
||||
|
||||
public interface IDrawShape {
|
||||
int SELECT_STROKE_OFFSET = 5;
|
||||
int SELECT_WIDTH_HEIGHT_OFFSET = 10;
|
||||
|
||||
void draw(AbstractShape shape, PaintCanvasBase canvas, EnumMap<ShapeColor, Color> colorMap, Stroke selectStroke,
|
||||
boolean offset);
|
||||
}
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
package view.interfaces;
|
||||
|
||||
public interface IEventCallback {
|
||||
void run();
|
||||
}
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
package view.interfaces;
|
||||
|
||||
import view.EventName;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
public interface IGuiWindow {
|
||||
JButton getButton(EventName eventName);
|
||||
}
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
package view.interfaces;
|
||||
|
||||
import view.EventName;
|
||||
|
||||
public interface IUiModule {
|
||||
void addEvent(EventName eventName, IEventCallback command);
|
||||
<T> T getDialogResponse(IDialogChoice dialogChoice);
|
||||
}
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
package view.interfaces;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
public abstract class PaintCanvasBase extends JComponent {
|
||||
public abstract Graphics2D getGraphics2D();
|
||||
}
|
||||
Reference in New Issue
Block a user