|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectpackageForLT06.DotController2
public class DotController2
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 | |
---|---|
DotController2(FilledDotView view,
DotModel model)
Instantiates the controller. |
|
DotController2(WireFrameDotView view,
DotModel model)
Instantiates the controller. |
Method Summary | |
---|---|
void |
mouseClicked(java.awt.event.MouseEvent e)
Any mouse click in the top half of the view causes the size of the first dot in the model to increased by 10%. |
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 DotController2(WireFrameDotView view, DotModel model)
view
- model
- public DotController2(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 |