jdraw.text
Class Text
java.lang.Object
|
+--java.util.Observable
|
+--mvp.Model
|
+--jdraw.text.Text
- All Implemented Interfaces:
- java.io.Serializable
- public class Text
- extends mvp.Model
Class Text is the Model class for font options such as font style,
font size, and font type.
- See Also:
- Serialized Form
|
Field Summary |
protected java.awt.Font |
currentFont
A Font object to store the current Font. |
protected FontGroup |
currentFontGroup
A variable to store a reference to the currentFont. |
protected int |
currentFontSize
An integer object to store the current Font Size. |
protected int |
currentFontStyle
An integer object to store the current Font Style. |
protected JDraw |
jdraw
A local reference to the top-level JDraw object. |
| Fields inherited from class mvp.Model |
view |
|
Constructor Summary |
Text(mvp.View view,
JDraw jdraw)
Construct this with the given View object. |
| 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 |
currentFontGroup
protected FontGroup currentFontGroup
- A variable to store a reference to the currentFont.
currentFontSize
protected int currentFontSize
- An integer object to store the current Font Size.
currentFontStyle
protected int currentFontStyle
- An integer object to store the current Font Style.
currentFont
protected java.awt.Font currentFont
- A Font object to store the current Font.
jdraw
protected JDraw jdraw
- A local reference to the top-level JDraw object.
Text
public Text(mvp.View view,
JDraw jdraw)
- Construct this with the given View object.
- Parameters:
view - - The View object to be passed to the parent constructor.
selectFontType
public void selectFontType(FontGroup fontGroup)
- Select the font type, given the desired FontGroup.
- Parameters:
fontGroup - - The FontGroup object from which to determine the new Font.
selectFontSize
public void selectFontSize(int fontSize)
- Select the font size.
- Parameters:
fontSize - - The int value used to set the current font size (in points).
selectFontStyle
public void selectFontStyle(int fontStyle)
- Select the font style.
- Parameters:
fontStyle - - The int value used to set the current font style.
**Note: 0 - PLAIN, 1 - BOLD, 2 - ITALIC, 3 - BOLD/ITALIC
getFontType
public java.awt.Font getFontType()
- Returns:
- - The Font value currently stored in currentFont.
getFontSize
public int getFontSize()
- Returns:
- - The int value currently stored in currentFontSize.
saveActiveWindowState
public boolean saveActiveWindowState()
- If there is an active Canvas, its state is saved and true is returned.
Else false is returned.
redrawActiveCanvasWindow
public void redrawActiveCanvasWindow()
- Calls the redrawPage method of the currently active CanvasWindow.