|
|||||||||
| 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.Tools
Class Tools is the top-level Model class for the apps ToolBar. It contains instances of all necessary Model classes for access to methods. It contains methods for all ToolBar operations.
| Field Summary | |
protected int |
activeTool
An index to the active Canvas object. |
protected java.util.Vector |
canvasList
A local reference to the list of canvases. |
protected int |
currentArrows
|
protected java.awt.Color |
currentBackgroundColor
A Color value to store the current background color. |
protected java.awt.Color |
currentColor
A Color value to store the current color. |
protected java.util.Vector |
currentFillType
An int to store the current fill type. |
protected java.awt.BasicStroke |
currentStroke
A BasicStroke to store the current stroke. |
protected java.util.Vector |
graphicsBuffer
A Vector to store graphics which are copied or cut. |
protected JDraw |
jdraw
A local reference to the top-level JDraw object. |
| Fields inherited from class mvp.Model |
view |
| Constructor Summary | |
Tools(mvp.View view,
JDraw jdraw)
Construct this with the given View component. |
|
| Method Summary | |
void |
drawCurve()
Set drawCurve as the activeTool. |
void |
drawEllipse()
Set drawEllipse as the activeTool. |
void |
drawLine()
Set drawLine as the activeTool. |
void |
drawMultiLine()
Set drawMultiLine as the activeTool. |
void |
drawPolygon()
Set drawPolygon as the activeTool. |
void |
drawRectangle()
Set drawRectangle as the activeTool. |
void |
drawShape()
Set drawShape as the activeTool. |
void |
drawText()
Set drawText as the activeTool. |
int |
getActiveTool()
Returns the int value in activeTool. |
int |
getActiveWindowIndex()
Returns the activeWindowIndex. |
int |
getCurrentArrows()
|
java.awt.Color |
getCurrentBackgroundColor()
Returns the Color object stored in currentBackgroundColor. |
java.awt.Color |
getCurrentColor()
Returns the Color value in currentColor. |
java.util.Vector |
getCurrentFillType()
Returns the int value stored in currentFillType. |
java.awt.BasicStroke |
getCurrentStroke()
Returns the BasicStroke currently stored in currentStroke. |
void |
move()
Set Move as the activeTool. |
void |
reshape()
Set Reshape as the activeTool. |
void |
rotate()
Set Rotate as the activeTool. |
void |
scale()
Set Scale as the activeTool. |
void |
select()
Set Selection as the activeTool. |
void |
setActiveTool(int toolIndex)
Sets the given integer as activeTool. |
void |
setActiveWindowIndex(int newIndex)
Set the activeWindowIndex given the parameter int. |
void |
setCanvasList(java.util.Vector cList)
Set the canvasList as the given Vector. |
void |
setCurrentBackgroundColor(java.awt.Color c)
Sets the currentBackgroundColor value given the parameter Color. |
void |
setCurrentColor(java.awt.Color c)
Sets the currentColor value given the parameter Color. |
void |
setCurrentFillType(java.util.Vector p)
Sets currentFillType as the passed in int value. |
void |
setCurrentStroke(java.awt.BasicStroke bs,
int arrows)
Sets currentStroke as the passed in BasicStroke. |
void |
stretch()
Set Stretch as the activeTool. |
| 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 java.util.Vector canvasList
protected int activeTool
protected java.awt.Color currentColor
protected java.awt.Color currentBackgroundColor
protected java.util.Vector currentFillType
protected java.awt.BasicStroke currentStroke
protected JDraw jdraw
protected java.util.Vector graphicsBuffer
protected int currentArrows
| Constructor Detail |
public Tools(mvp.View view,
JDraw jdraw)
view - - The View object to be passed to the parent constructor.jdraw - - The JDraw object to be set as this.jdraw.| Method Detail |
public void select()
public void move()
public void scale()
public void stretch()
public void rotate()
public void reshape()
public void drawText()
public void drawLine()
public void drawMultiLine()
public void drawCurve()
public void drawEllipse()
public void drawRectangle()
public void drawPolygon()
public void drawShape()
public void setCanvasList(java.util.Vector cList)
cList - - The Vector to be set as canvasList.public int getActiveWindowIndex()
public void setActiveWindowIndex(int newIndex)
newIndex - - The int value to be stored as the ActiveWindowIndex.public void setActiveTool(int toolIndex)
toolIndex - - The int value to be stored in toolIndex.public int getActiveTool()
public java.awt.Color getCurrentColor()
public void setCurrentColor(java.awt.Color c)
c - - The Color object to be stored as currentColor.public void setCurrentBackgroundColor(java.awt.Color c)
c - - The Color object to be stored as currentBackgroundColor.public java.awt.Color getCurrentBackgroundColor()
public java.util.Vector getCurrentFillType()
public void setCurrentFillType(java.util.Vector p)
f - - The int value to be stored in currentFillType.
public void setCurrentStroke(java.awt.BasicStroke bs,
int arrows)
bs - - The BasicStroke to be stored in currentStroke.public java.awt.BasicStroke getCurrentStroke()
public int getCurrentArrows()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||