|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.util.Observable
|
+--mvp.Model
|
+--jdraw.jdraw.JDraw
Class JDraw is the top-level model class for the JDraw app. JDraw has references for the three main model classes of the system: Tools, Commands, and Canvas.
| Field Summary | |
protected int |
activeIndex
An int value indicating the index of the currently active Canvas. |
protected AskSaveDialog |
askSaveDialog
A Dialog for asking what the user wants to do when closing a changed file. |
protected javax.swing.JButton |
cancelButton
Still working on this stuff. |
protected java.util.Vector |
canvas
The Top-Level Vector of Canvases. |
protected Commands |
commands
The Top-Level Commands model. |
protected boolean |
controlDown
A boolean value indicating whether the control key is down. |
protected JDrawUI |
jdrawUI
Local reference to the system's Top-Level View object. |
protected Tools |
tools
The Top-Level Tools model. |
| Fields inherited from class mvp.Model |
view |
| Constructor Summary | |
JDraw(JDrawUI jdrawUI)
Construct this with the given companion view. |
|
| Method Summary | |
void |
cancelButtonClicked()
Simply Hide the AskSaveDialog. |
int |
getActiveWindowIndex()
|
Canvas |
getCanvas(int i)
Returns the Canvas designated by the integer parameter. |
Commands |
getCommands()
Returns the Top-Level Commands object. |
boolean |
getControlDown()
|
JDrawUI |
getJDrawUI()
A local reference to the Top-Level View component. |
Canvas |
getLastCanvas()
|
Tools |
getTools()
Returns the Top-Level Tools object. |
void |
group()
Calls groupSelected on the currently active Canvas. |
void |
newCanvas()
Create a new Canvas by adding a new element to Canvas vector. |
void |
newCanvas(java.lang.String title)
Create a new Canvas as above, but set the title of the window, given the String parameter. |
void |
noButton()
Close the window without saving. |
void |
redo()
Calls redoLastUndo on the currently active Canvas. |
void |
removeCanvas(int ind)
Bring up the askSaveDialog if necessary. |
void |
removeCanvas(int ind,
int cancelFlag)
Bring up the askSaveDialog if necessary. |
void |
setActiveWindowIndex(int index)
|
void |
setCanvas(Canvas newCanvas,
CanvasWindow canWindow)
|
void |
setControlDown(boolean newControlDown)
|
void |
setView(JDrawUI jdrawUI)
Set the given JDrawUI component as this.jdrawUI. |
void |
undo()
Calls undoLastAction on the currently active Canvas. |
void |
ungroup()
Calls ungroupSelected on the currently active Canvas. |
void |
yesButton()
Close the window and save the Canvas to ... |
| Methods inherited from class mvp.Model |
getView, setView |
| Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected Commands commands
protected java.util.Vector canvas
protected Tools tools
protected JDrawUI jdrawUI
protected AskSaveDialog askSaveDialog
protected javax.swing.JButton cancelButton
protected int activeIndex
protected boolean controlDown
| Constructor Detail |
public JDraw(JDrawUI jdrawUI)
jdrawUI - - The JDrawUI object passed to parent constructor and set
as this.jdrawUI.| Method Detail |
public void setView(JDrawUI jdrawUI)
jdrawUI - - The JDrawUI object to be set an this.jdrawUI.public void newCanvas()
public void newCanvas(java.lang.String title)
title - - The String used as the Title of the Window.
public void setCanvas(Canvas newCanvas,
CanvasWindow canWindow)
public Canvas getLastCanvas()
public void yesButton()
public void noButton()
public void cancelButtonClicked()
public void removeCanvas(int ind)
public void removeCanvas(int ind,
int cancelFlag)
public Commands getCommands()
public Canvas getCanvas(int i)
public Tools getTools()
public JDrawUI getJDrawUI()
public int getActiveWindowIndex()
public void setActiveWindowIndex(int index)
index - - The int value to store in this.activeIndex.public void undo()
public void redo()
public void group()
public void ungroup()
public void setControlDown(boolean newControlDown)
newControlDown - - The boolean value to store in this.controlDown.public boolean getControlDown()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||