org.simbrain.network
Class Clipboard

java.lang.Object
  extended by org.simbrain.network.Clipboard

public class Clipboard
extends Object

Buffer which holds network objects.


Constructor Summary
Clipboard()
           
 
Method Summary
static void add(ArrayList objects)
          Add objects to the clipboard.
static void addClipboardListener(ClipboardListener l)
          Add the specified clipboard listener.
static boolean canBeCopied(PNode node, NetworkPanel netPanel)
          Determines whether or not a pnode can be copied.
static void clear()
          Clear the clipboard.
static void fireClipboardChanged()
          Fire a clipboard changed event to all registered model listeners.
static boolean isEmpty()
           
static void paste(NetworkPanel net)
          Paste objects into the netPanel.
static void translateObjects(ArrayList clip, NetworkPanel net)
          Move the designated objects over based on number of pastes that have occurred in the specified network.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Clipboard

public Clipboard()
Method Detail

clear

public static void clear()
Clear the clipboard.


add

public static void add(ArrayList objects)
Add objects to the clipboard.

Parameters:
objects - objects to add

paste

public static void paste(NetworkPanel net)
Paste objects into the netPanel.

Parameters:
net - the network to paste into

isEmpty

public static boolean isEmpty()
Returns:
true if there's nothing in the clipboard, false otherwise

translateObjects

public static void translateObjects(ArrayList clip,
                                    NetworkPanel net)
Move the designated objects over based on number of pastes that have occurred in the specified network.

Parameters:
clip - the list of things to paste
net - reference to the NetworkPanel

canBeCopied

public static boolean canBeCopied(PNode node,
                                  NetworkPanel netPanel)
Determines whether or not a pnode can be copied. Free-floating weights, for example, cannot be copied.

Parameters:
node - node to be checked
netPanel - reference to NetworkPanel to be copied from
Returns:
true if this node can be copied, false otherwise

addClipboardListener

public static void addClipboardListener(ClipboardListener l)
Add the specified clipboard listener.

Parameters:
l - listener to add

fireClipboardChanged

public static void fireClipboardChanged()
Fire a clipboard changed event to all registered model listeners.