|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectpackageForLT06.DotController3
public class DotController3
This class encapsulates a very simple controller. Recall the role of the controller, which is to take the user input and figures out what it means to the model. In this particular case, the controller implements a logic whereby mouse clicks by the user changes the data model. See the API for the method mouseClicked(MouseEvent e) below for details. This class provides a constructor that requires a DotModel and a DotView. This controller observes the view and respond to user events performed upon the view by the user according to the logic below. This controller listens for mouse events. The logic is specified in terms of results to the data model.
Constructor Summary | |
---|---|
DotController3(FilledDotView view,
DotModel model)
Instantiates the controller. |
|
DotController3(WireFrameDotView view,
DotModel model)
Instantiates the controller. |
Method Summary | |
---|---|
void |
mouseClicked(java.awt.event.MouseEvent e)
Any mouse click at any position in the display causes the color of all of the dots to be changed to red, if they are not already red. |
void |
mouseEntered(java.awt.event.MouseEvent e)
Does nothing |
void |
mouseExited(java.awt.event.MouseEvent e)
Does nothing |
void |
mousePressed(java.awt.event.MouseEvent e)
Does nothing |
void |
mouseReleased(java.awt.event.MouseEvent e)
Does nothing |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DotController3(WireFrameDotView view, DotModel model)
view
- model
- public DotController3(FilledDotView view, DotModel model)
view
- model
- Method Detail |
---|
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |