Saros
Distributed Collaborative Editing and Distributed Party Programming
de.fu_berlin.inf.dpp.whiteboard.gef.commands.PasteRecordCommand Class Reference
Inheritance diagram for de.fu_berlin.inf.dpp.whiteboard.gef.commands.PasteRecordCommand:
de.fu_berlin.inf.dpp.whiteboard.gef.commands.SXECommand

List of all members.

Public Member Functions

 PasteRecordCommand (int shiftCount)
List< IRecordgetRecords ()
List< IRecordgetUndoRecords ()
List< IRecordgetRedoRecords ()
DocumentRecord getDocumentRecord ()
void dispose ()

Static Public Attributes

static final int SHIFT_FOR_COPY = 50

Protected Member Functions

boolean canExecuteSXECommand ()
boolean canUndoSXECommand ()
IRecord mergeAttribute (AttributeRecord attribute, List< IRecord > layout)
List< IRecordgetMergedAttributes (List< AttributeRecord > attributes, List< IRecord > layout)
List< IRecordcreateCopyRecords (LayoutElementRecord toCopy)

Detailed Description

Achieves a list of LayoutElementRecord from the Clipboard. The list should be obtained by the root records of a HierarichalRecordList and thus not contain any descendant of any other contained element.

For the execution, the records and all their descendants are copied while the position (all concerning layout attributes) are shifted SHIFT_FOR_COPY points to the right bottom to give feedback about successful execution.

Note, that copies inserted on the same place would just hide the originals, making it difficult to see any effect.

An undo corresponds to a delete, a redo to an undo-delet. For better reuse a DeleteRecordsCommand is used as member.

Author:
jurke

Constructor & Destructor Documentation

de.fu_berlin.inf.dpp.whiteboard.gef.commands.PasteRecordCommand.PasteRecordCommand ( int  shiftCount)
Parameters:
shiftCounthow many times the nodes have been pasted already

Member Function Documentation

boolean de.fu_berlin.inf.dpp.whiteboard.gef.commands.PasteRecordCommand.canExecuteSXECommand ( ) [protected, virtual]
boolean de.fu_berlin.inf.dpp.whiteboard.gef.commands.PasteRecordCommand.canUndoSXECommand ( ) [protected, virtual]
List<IRecord> de.fu_berlin.inf.dpp.whiteboard.gef.commands.PasteRecordCommand.createCopyRecords ( LayoutElementRecord  toCopy) [protected]

Copies the passed LayoutElementRecord, shifts the layout records and copies all other descendants (attributes, child elements and their child nodes) to finally return them all as a single list.

Parameters:
toCopy
Returns:
a list of copies of the passes record plus copies if its descendants
void de.fu_berlin.inf.dpp.whiteboard.gef.commands.PasteRecordCommand.dispose ( )
DocumentRecord de.fu_berlin.inf.dpp.whiteboard.gef.commands.PasteRecordCommand.getDocumentRecord ( ) [virtual]
List<IRecord> de.fu_berlin.inf.dpp.whiteboard.gef.commands.PasteRecordCommand.getMergedAttributes ( List< AttributeRecord attributes,
List< IRecord layout 
) [protected]

Returns the layout records plus all the records of the AttributeSet that are no layout records.

List<IRecord> de.fu_berlin.inf.dpp.whiteboard.gef.commands.PasteRecordCommand.getRecords ( ) [virtual]
List<IRecord> de.fu_berlin.inf.dpp.whiteboard.gef.commands.PasteRecordCommand.getRedoRecords ( )
List<IRecord> de.fu_berlin.inf.dpp.whiteboard.gef.commands.PasteRecordCommand.getUndoRecords ( ) [virtual]
IRecord de.fu_berlin.inf.dpp.whiteboard.gef.commands.PasteRecordCommand.mergeAttribute ( AttributeRecord  attribute,
List< IRecord layout 
) [protected]

Short helper that returns that checks whether the passed AttributeRecord attribute is a layout record (contained by the layout records) if so, it will return the layout record els the passed AttributeRecord itself.

Parameters:
attribute
layoutlayout attributes
Returns:
the attribute if it's name is not beyond the AttributeRecords of the layout attributes else the respective layout Attribute.

Member Data Documentation

 All Classes Namespaces Files Functions Variables Enumerations