jdraw.edit_ui
Class EditMenu

java.lang.Object
  |
  +--mvp.View
        |
        +--jdraw.edit_ui.EditMenu
All Implemented Interfaces:
java.util.Observer

public class EditMenu
extends mvp.View

Class EditMenu is the pulldown menu for the Edit model. The EditMenu widget is a JMenu. Anonymous instances of JMenuItem are defined for each menu item.


Field Summary
protected  javax.swing.JMenuItem deleteItem
          A JMenuItem for the 'Delete' item.
protected  Edit edit
          A local reference to the Edit model.
protected  PreciseMoveDialog preciseMoveDialog
          A PreciseMoveDialog for 'Precise Move...'.
protected  PreciseRotateDialog preciseRotateDialog
          A PreciseRotateDialog for 'Precise Rotate...'.
protected  javax.swing.JMenuItem redoItem
          A JMenuItem for the 'Redo' item.
protected  javax.swing.JMenuItem undoItem
          A JMenuItem for the 'Undo' item.
 
Fields inherited from class mvp.View
editable, model, screen, shown, widget, window
 
Constructor Summary
EditMenu(mvp.Screen screen, Edit edit, EditUI editUI)
          Construct the menu with the given Edit model.
 
Method Summary
protected  void addCopy()
          Add the 'Copy' menu item.
protected  void addCut()
          Add the 'Cut' menu item.
protected  void addDelete()
          Add the 'Delete' menu item.
protected  void addDuplicate()
          Add the 'Duplicate' menu item.
protected  void addFlipHorizontal()
          Add the 'Flip Horizontally' menu item.
protected  void addFlipVertical()
          Add the 'Flip Vertically' menu item.
protected  void addPaste()
          Add the 'Paste' menu item.
protected  void addPreciseMove()
          Add the 'Precise Move ...' menu item.
protected  void addPreciseRotate()
          Add the 'Precise Rotate' menu item.
protected  void addPreciseScale()
          Add the 'Precise Scale ...' menu item.
protected  void addRedo()
          Add the 'Redo' menu item.
protected  void addRotateClockwise()
          Add the 'Rotate 90 CW' menu item.
protected  void addRotateCounter()
          Add the 'Rotate 90 CCW' menu item.
protected  void addSelectAll()
          Add the 'Select All' menu item.
protected  void addUndo()
          Add the 'Undo' menu item.
 java.awt.Component compose()
          Compose the menu items into the pulldown.
 Edit getEdit()
           
 void setRedoActive(boolean enable)
           
 void setUndoActive(boolean enable)
           
 
Methods inherited from class mvp.View
getModel, getWidget, getWindow, hide, isEditable, isShown, run, setEditable, setModel, show, show, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

edit

protected Edit edit
A local reference to the Edit model.

undoItem

protected javax.swing.JMenuItem undoItem
A JMenuItem for the 'Undo' item.

redoItem

protected javax.swing.JMenuItem redoItem
A JMenuItem for the 'Redo' item.

deleteItem

protected javax.swing.JMenuItem deleteItem
A JMenuItem for the 'Delete' item.

preciseMoveDialog

protected PreciseMoveDialog preciseMoveDialog
A PreciseMoveDialog for 'Precise Move...'.

preciseRotateDialog

protected PreciseRotateDialog preciseRotateDialog
A PreciseRotateDialog for 'Precise Rotate...'.
Constructor Detail

EditMenu

public EditMenu(mvp.Screen screen,
                Edit edit,
                EditUI editUI)
Construct the menu with the given Edit model. Copy Edit object into local reference.
Parameters:
screen - - The Screen object to be passed to constructor.
edit - - The companion Edit object.
editUI - - The companion EditUI object.
Method Detail

compose

public java.awt.Component compose()
Compose the menu items into the pulldown. Separator added after 'SelectAll.'
Overrides:
compose in class mvp.View

addUndo

protected void addUndo()
Add the 'Undo' menu item. Invokes Edit.undo() method.

setUndoActive

public void setUndoActive(boolean enable)

addRedo

protected void addRedo()
Add the 'Redo' menu item. Invokes Edit.redo() method.

setRedoActive

public void setRedoActive(boolean enable)

addCut

protected void addCut()
Add the 'Cut' menu item. Invokes Edit.cut() method.

addCopy

protected void addCopy()
Add the 'Copy' menu item. Invokes Edit.copy() method.

addPaste

protected void addPaste()
Add the 'Paste' menu item. Invokes Edit.Paste() method.

addDuplicate

protected void addDuplicate()
Add the 'Duplicate' menu item. Invokes Edit.duplicate() method.

addDelete

protected void addDelete()
Add the 'Delete' menu item. Invokes Edit.delete() method.

addSelectAll

protected void addSelectAll()
Add the 'Select All' menu item. Invokes Edit.selectAll() method.

addFlipHorizontal

protected void addFlipHorizontal()
Add the 'Flip Horizontally' menu item. Invokes Edit.flipHorizontal() method.

addFlipVertical

protected void addFlipVertical()
Add the 'Flip Vertically' menu item. Invokes Edit.flipVertical() method.

addRotateClockwise

protected void addRotateClockwise()
Add the 'Rotate 90 CW' menu item. Invokes Edit.rotateClockwise() method.

addRotateCounter

protected void addRotateCounter()
Add the 'Rotate 90 CCW' menu item. Invokes Edit.rotateCounter() method.

addPreciseMove

protected void addPreciseMove()
Add the 'Precise Move ...' menu item. Invokes Edit.preciseMove() method.

addPreciseScale

protected void addPreciseScale()
Add the 'Precise Scale ...' menu item. Invokes Edit.preciseScale() method.

addPreciseRotate

protected void addPreciseRotate()
Add the 'Precise Rotate' menu item. Invokes Edit.preciseRotate() method.

getEdit

public Edit getEdit()