Search
Clipboard Operations

A single diagram item or a selection of items can be copied or cut to the system clipboard. This is done programmatically using the copyToClipboard and cutToClipboard methods. To paste the clipboard contents into the current diagram call pasteFromClipboard.

If you create a custom item type, its instances can be copied to the clipboard only if they are registered for serialization using registerItemClass and provide a copy constructor. If the class defines additional fields, they must be serialized by the respective save / load method overrides to allow copying their values to the clipboard.

JDiagram does not provide keyboard interface to clipboard operations. You might assign the standard CTRL+C, CTRL+X and CTRL+V shortcuts to menu items and handle them by calling the respective methods.