net.sf.latexdraw.actions
Class InsertPicture

java.lang.Object
  extended by org.malai.action.Action
      extended by net.sf.latexdraw.actions.DrawingAction
          extended by net.sf.latexdraw.actions.ShapeAction<IShape>
              extended by net.sf.latexdraw.actions.AddShape
                  extended by net.sf.latexdraw.actions.InsertPicture
All Implemented Interfaces:
Modifying, Undoable

public class InsertPicture
extends AddShape

This action asks the user to select a picture and, if valid, adds it to a drawing.

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.

20/01/2012

Since:
3.0
Author:
Arnaud BLOUIN

Nested Class Summary
 
Nested classes/interfaces inherited from class org.malai.action.Action
Action.ActionStatus
 
Field Summary
protected  javax.swing.JFileChooser fileChooser
          The file chooser used to select the picture to add.
protected  boolean loaded
          Defines if the picture has been successfully loaded.
 
Fields inherited from class net.sf.latexdraw.actions.ShapeAction
shape
 
Fields inherited from class net.sf.latexdraw.actions.DrawingAction
drawing
 
Fields inherited from class org.malai.action.Action
status
 
Constructor Summary
InsertPicture()
          Creates the action.
 
Method Summary
 boolean canDo()
           
protected  void doActionBody()
          This method contains the core code to execute when the action is executed.
 boolean hadEffect()
           
 void redo()
          Redoes the cancelled action.
 void setFileChooser(javax.swing.JFileChooser fileChooser)
           
 
Methods inherited from class net.sf.latexdraw.actions.AddShape
getUndoName, isRegisterable, undo
 
Methods inherited from class net.sf.latexdraw.actions.ShapeAction
flush, getShape, setShape
 
Methods inherited from class net.sf.latexdraw.actions.DrawingAction
getDrawing, setDrawing
 
Methods inherited from class org.malai.action.Action
abort, cancelledBy, doIt, done, getStatus, isDone, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fileChooser

protected javax.swing.JFileChooser fileChooser
The file chooser used to select the picture to add.


loaded

protected boolean loaded
Defines if the picture has been successfully loaded.

Constructor Detail

InsertPicture

public InsertPicture()
Creates the action.

Since:
3.0
Method Detail

doActionBody

protected void doActionBody()
Description copied from class: Action
This method contains the core code to execute when the action is executed.

Overrides:
doActionBody in class AddShape

redo

public void redo()
Description copied from interface: Undoable
Redoes the cancelled action.

Specified by:
redo in interface Undoable
Overrides:
redo in class AddShape

hadEffect

public boolean hadEffect()
Overrides:
hadEffect in class Action
Returns:
True if the execution of the action had effects on the target. By default this function return the result of isDone. Should be overridden.

canDo

public boolean canDo()
Overrides:
canDo in class ShapeAction<IShape>
Returns:
True if the action can be executed.

setFileChooser

public void setFileChooser(javax.swing.JFileChooser fileChooser)
Parameters:
fileChooser - The file chooser used to select the picture to load.
Since:
3.0