org.objectweb.fractal.gui.clipboard.model
Class BasicClipboard

java.lang.Object
  extended byorg.objectweb.fractal.gui.clipboard.model.BasicClipboard
All Implemented Interfaces:
Clipboard

public class BasicClipboard
extends java.lang.Object
implements Clipboard

Basic implementation of the Clipboard interface.


Constructor Summary
BasicClipboard()
          Constructs a new Clipboard component.
 
Method Summary
 boolean canCopy(Component srcComponent)
          Returns true if the given component can be copied.
 boolean canCut(Component srcComponent)
          Returns true if the given component can be cut.
 boolean canPaste(Component dstComponent)
          Returns true if the clipboard's content can be pasted into the given component.
 boolean canPasteAsShared(Component dstComponent)
          Returns true if the clipboard's content can be pasted into the given component as a shared component.
 void copy(Component srcComponent, GraphModel srcGraph, Factory srcFactory)
          Copies the given component.
 void cut(Component srcComponent, GraphModel srcGraph, Factory srcFactory)
          Cuts the given component.
 void paste(Component dstComponent, GraphModel dstGraph, Factory dstFactory)
          Pastes the clipboard's content into the given component.
 void pasteAsShared(Component dstComponent, GraphModel dstGraph, Factory dstFactory)
          Pastes the clipboard's content into the given component, as a shared component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicClipboard

public BasicClipboard()
Constructs a new Clipboard component.

Method Detail

canCut

public boolean canCut(Component srcComponent)
Description copied from interface: Clipboard
Returns true if the given component can be cut.

Specified by:
canCut in interface Clipboard
Parameters:
srcComponent - the component to be cut.
Returns:
true if the given component can be cut.

cut

public void cut(Component srcComponent,
                GraphModel srcGraph,
                Factory srcFactory)
Description copied from interface: Clipboard
Cuts the given component.

Specified by:
cut in interface Clipboard
Parameters:
srcComponent - the component to be cut.
srcGraph - the graph model that contains the coordinates of the component.
srcFactory - the factory to be used to create a clone of the given component. This clone is then stored in the clipboard.

canCopy

public boolean canCopy(Component srcComponent)
Description copied from interface: Clipboard
Returns true if the given component can be copied.

Specified by:
canCopy in interface Clipboard
Parameters:
srcComponent - the component to be copied.
Returns:
true if the given component can be copie.

copy

public void copy(Component srcComponent,
                 GraphModel srcGraph,
                 Factory srcFactory)
Description copied from interface: Clipboard
Copies the given component.

Specified by:
copy in interface Clipboard
Parameters:
srcComponent - the component to be copied.
srcGraph - the graph model that contains the coordinates of the component.
srcFactory - the factory to be used to create a clone of the given component. This clone is then stored in the clipboard.

canPaste

public boolean canPaste(Component dstComponent)
Description copied from interface: Clipboard
Returns true if the clipboard's content can be pasted into the given component.

Specified by:
canPaste in interface Clipboard
Parameters:
dstComponent - the component into which the clipboard's content must be pasted.
Returns:
true if the clipboard is not empty, and if its content can be pasted into the given component.

paste

public void paste(Component dstComponent,
                  GraphModel dstGraph,
                  Factory dstFactory)
Description copied from interface: Clipboard
Pastes the clipboard's content into the given component.

Specified by:
paste in interface Clipboard
Parameters:
dstComponent - the component into which the clipboard's content must be pasted.
dstGraph - the graph model into which the coordinates of the clipboard's component must be pasted.
dstFactory - the factory to be used to create a clone of the clipboard's content. This clone is then added as a sub component of the given component.

canPasteAsShared

public boolean canPasteAsShared(Component dstComponent)
Description copied from interface: Clipboard
Returns true if the clipboard's content can be pasted into the given component as a shared component.

Specified by:
canPasteAsShared in interface Clipboard
Parameters:
dstComponent - the component into which the clipboard's content must be pasted as a shared component.
Returns:
true if the clipboard is not empty, and if its content can be pasted into the given component as a shared component.

pasteAsShared

public void pasteAsShared(Component dstComponent,
                          GraphModel dstGraph,
                          Factory dstFactory)
Description copied from interface: Clipboard
Pastes the clipboard's content into the given component, as a shared component.

Specified by:
pasteAsShared in interface Clipboard
Parameters:
dstComponent - the component into which the clipboard's content must be pasted.
dstGraph - the graph model into which the coordinates of the clipboard's component must be pasted.
dstFactory - the factory to be used to create a slave component of the clipboard's content. This slave component is then added as a sub component of the given component.