Last active
November 4, 2019 07:28
-
-
Save libliboom/06069a97de3bd42158dc336bc74b14e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GraphicEditor { | |
... | |
public void mouseDown() { | |
tool.mouseDown(); | |
} | |
... | |
} | |
class RectangleTool { | |
private GraphicEditor editor; | |
public RectangleTool(GraphicEditor editor) { | |
this.editor = editor; | |
} | |
public void mouseDown() { | |
editor.add(new RectangleFigure()); | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment