org.objectweb.fractal.gui.clipboard.model
Interface Clipboard

All Known Implementing Classes:
BasicClipboard

public interface Clipboard

A model for the clipboard.


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.
 

Method Detail

canCut

public boolean canCut(Component srcComponent)
Returns true if the given component can be cut.

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)
Cuts the given component.

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)
Returns true if the given component can be copied.

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)
Copies the given component.

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)
Returns true if the clipboard's content can be pasted into the given component.

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)
Pastes the clipboard's content into the given component.

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)
Returns true if the clipboard's content can be pasted into the given component as a shared component.

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)
Pastes the clipboard's content into the given component, as a shared component.

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.