net.sf.latexdraw.instruments
Class CopierCutterPaster

java.lang.Object
  extended by org.malai.instrument.Instrument
      extended by org.malai.instrument.WidgetInstrument
          extended by net.sf.latexdraw.instruments.CopierCutterPaster
All Implemented Interfaces:
ActionHandler, Preferenciable, Modifiable, Reinitialisable, UndoHandler

public class CopierCutterPaster
extends WidgetInstrument

This instrument permits to copy, cut and paste the selected shapes.

This file is part of LaTeXDraw.
Copyright (c) 2005-2012 Arnaud BLOUIN

LaTeXDraw is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
LaTeXDraw is distributed without any warranty; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

06/03/2011

Since:
3.0
Author:
Arnaud BLOUIN

Field Summary
protected  MMenuItem copyMenu
          The menu item to copy the shapes.
protected  MMenuItem cutMenu
          The menu item to cut the shapes.
protected  IDrawing drawing
          The drawing that contains the shapes.
protected  MMenuItem pasteMenu
          The menu item to paste the shapes.
 
Fields inherited from class org.malai.instrument.WidgetInstrument
composer
 
Fields inherited from class org.malai.instrument.Instrument
activated, eventables, links, modified
 
Constructor Summary
CopierCutterPaster(UIComposer<?> composer, IDrawing drawing)
          Creates the instrument.
 
Method Summary
 MMenuItem getCopyMenu()
           
 MMenuItem getCutMenu()
           
 MMenuItem getPasteMenu()
           
protected  void initialiseLinks()
          Initialises the links of the instrument.
protected  void initialiseWidgets()
          Initialises the widgets of the instrument.
 void onActionAdded(Action action)
          Notifies the handler when the given action is added to the registry.
 void setActivated(boolean activated)
          Activates or deactivates the instrument.
protected  void updateWidgets(Action executedAction)
          Updates the widgets of the instrument.
 
Methods inherited from class org.malai.instrument.WidgetInstrument
getComposer, setActivated
 
Methods inherited from class org.malai.instrument.Instrument
addEventable, addLink, clearEvents, getLinks, getSizeLinks, hasLinks, interimFeedback, isActivated, isModified, load, onActionAborted, onActionCancelled, onActionDone, onActionExecuted, onUndoableAdded, onUndoableRedo, onUndoableUndo, reinit, removeLink, save, setModified
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyMenu

protected MMenuItem copyMenu
The menu item to copy the shapes.


pasteMenu

protected MMenuItem pasteMenu
The menu item to paste the shapes.


cutMenu

protected MMenuItem cutMenu
The menu item to cut the shapes.


drawing

protected IDrawing drawing
The drawing that contains the shapes.

Constructor Detail

CopierCutterPaster

public CopierCutterPaster(UIComposer<?> composer,
                          IDrawing drawing)
Creates the instrument.

Parameters:
drawing - The drawing that contains the shapes.
composer - The composer that manages the widgets of the instrument.
Throws:
java.lang.IllegalArgumentException - If the given drawing is null.
Since:
3.0
Method Detail

initialiseWidgets

protected void initialiseWidgets()
Description copied from class: WidgetInstrument
Initialises the widgets of the instrument.

Specified by:
initialiseWidgets in class WidgetInstrument

setActivated

public void setActivated(boolean activated)
Description copied from class: Instrument
Activates or deactivates the instrument.

Overrides:
setActivated in class Instrument
Parameters:
activated - True = activation.

updateWidgets

protected void updateWidgets(Action executedAction)
Updates the widgets of the instrument.

Parameters:
executedAction - The action currently executed. Can be null.
Since:
3.0

initialiseLinks

protected void initialiseLinks()
Description copied from class: Instrument
Initialises the links of the instrument.

Specified by:
initialiseLinks in class Instrument

getCopyMenu

public MMenuItem getCopyMenu()
Returns:
The menu item used to copy selected shapes.
Since:
3.0

getPasteMenu

public MMenuItem getPasteMenu()
Returns:
The menu item used to paste selected shapes.
Since:
3.0

getCutMenu

public MMenuItem getCutMenu()
Returns:
The menu item used to cut selected shapes.
Since:
3.0

onActionAdded

public void onActionAdded(Action action)
Description copied from interface: ActionHandler
Notifies the handler when the given action is added to the registry.

Specified by:
onActionAdded in interface ActionHandler
Overrides:
onActionAdded in class Instrument
Parameters:
action - The added action.