|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjfig.commands.Command
jfig.commands.ResizeTextCommand
resize or modify a text object's attributes.
On each mouse click, the text font size is increased (normal click) or decreased (shift+click, middle click) by one step, in the order { 6, 8, 9, 10, 11, 12, 14, 15, 17, 18, 20, 22, 24, 27, 30, 35, 40 } points. For each right click, the text attributes are toggled between { normal, bold, italic }.
| Field Summary | |
int |
ENLARGE
|
protected int |
fontIndex
|
protected int |
fontSize
|
static int[] |
fontSizeTable
|
protected int |
mode
|
protected int |
n_points
|
protected FigText |
object
|
protected int |
oldFontIndex
|
protected int |
oldFontSize
|
int |
SHRINK
|
int |
TOGGLE
|
| Fields inherited from class jfig.commands.Command |
editor, objectCanvas, ready |
| Constructor Summary | |
ResizeTextCommand(FigBasicEditor editor,
FigCanvas objectCanvas)
|
|
| Method Summary | |
void |
execute()
execute the current editor command This method is empty for class Command. |
java.lang.String |
getDescription()
one-line description of this command return a one-line desription of this command, e.g. to label the undo/redo buttons, if any |
FigObject[] |
getModifiedObjects()
return an array-wrapped reference to the text object (to be) resized by this command. |
void |
mousePressed(FigCanvasEvent evt)
select the object to move (at position startPoint) and its new position (endPoint). |
java.lang.String |
toString()
return a (possibly verbose) description of this Command object |
void |
undo()
undo this command Try to undo this command as far as possible. |
| Methods inherited from class jfig.commands.Command |
cancel, isReady, message, notifyEditor, statusMessage |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected int n_points
protected FigText object
protected int fontSize
protected int oldFontSize
protected int fontIndex
protected int oldFontIndex
protected int mode
public final int ENLARGE
public final int SHRINK
public final int TOGGLE
public static final int[] fontSizeTable
| Constructor Detail |
public ResizeTextCommand(FigBasicEditor editor,
FigCanvas objectCanvas)
| Method Detail |
public FigObject[] getModifiedObjects()
getModifiedObjects in class Commandpublic void execute()
CommandThis method is empty for class Command.
execute in class Commandpublic void undo()
CommandTry to undo this command as far as possible. Don't try to undo() a command that has never been execute()d before. This method is empty for class Command.
undo in class Commandpublic void mousePressed(FigCanvasEvent evt)
To allow for selection of stacked objects at/near startPoint, we use the following algorithm: First, we simply use editor.findObjectAt() to find the topmost object (if any) at or near startPoint. If an object is found, its corners are highlighted, while all other object markers are removed.
If the user clicks again on/near startPoint - and with the SHIFT-key hold down, the editor.findNextObjectAt() method is called repeatedly, to find the next objects.
The selected object is moved as soon as the users clicks on a position different from the startPoint.
mousePressed in class Commandpublic java.lang.String getDescription()
Commandreturn a one-line desription of this command, e.g. to label the undo/redo buttons, if any
getDescription in class Commandpublic java.lang.String toString()
Command
toString in class Command
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||