visad.bom
Class CutAndPasteFields

java.lang.Object
  extended by visad.bom.CutAndPasteFields
All Implemented Interfaces:
ActionListener, EventListener

public class CutAndPasteFields
extends Object
implements ActionListener

CutAndPasteFields is the VisAD class for cutting and pasting regions of fields.

Construct a CutAndPasteFields object linked to a 2-D grid [a FlatField with MathType ((x, y) -> range)]) or a sequence of 2-D grids {a FieldImpl with MathType (t -> ((x, y) -> range))], a DisplayImpl, and an optional integer blend region width. The grid or grids must all have the same Linear domain Set (Linear2DSet or LinearNDSet with domain dimension = 2), and the domain must be mapped to two of XAxis, YAxis and ZAxis. If a sequence of grids, the sequence domain must be mapped to Animation. The grid may have any number of range RealTypes. The CutAndPasteFields object operates in a sequence: 1. Invokes its start() method to start. 2. User drags a grid sector rectangle with the right mouse button. This rectangle must lie inside the grid. 3. When the user releases, the rectangle appears fixed over the grid. 4. The user can change to a different time step, and drag the rectangle by one of its corners. On release, it must lie inside the grid. 5. The source grid sector is pasted into the destination, within blending over a certain width near the destination border. 6. The user can change time step or drag the rectangle any number of times: each time the previous paste is undone and the source grid sector is pasted into the new time and location. 7. At any point after start(), the application can invoke stop() to stop the process. 8. After a source rectangle has been pasted, the application can invoke undo() to undo the paste and stop the process. 9. The process can be restarted by invoking start(), any number of times. 10. At any point, the application can invoke setBlend() to change the width of the blend region. The main() method illustrates a simple GUI and test case with a sequnece of grids. Run 'java visad.bom.CutAndPasteFields' to test with contour values, and run 'java visad.bom.CutAndPasteFields 1' to test with color values.


Constructor Summary
CutAndPasteFields(Field gs, DisplayImplJ3D d)
           
CutAndPasteFields(Field gs, DisplayImplJ3D d, int b)
           gs has MathType (t -> ((x, y) -> v)) or ((x, y) -> v) conditions on gs and display: 1. x and y mapped to XAxis, YAxis, ZAxis 2.
 
Method Summary
 void actionPerformed(ActionEvent e)
           
static void main(String[] args)
           
 void setBlend(int b)
           
 void start()
           
 void stop()
           
 void undo()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CutAndPasteFields

public CutAndPasteFields(Field gs,
                         DisplayImplJ3D d)
                  throws VisADException,
                         RemoteException
Throws:
VisADException
RemoteException

CutAndPasteFields

public CutAndPasteFields(Field gs,
                         DisplayImplJ3D d,
                         int b)
                  throws VisADException,
                         RemoteException
     gs has MathType (t -> ((x, y) -> v)) or ((x, y) -> v)
     conditions on gs and display:
     1. x and y mapped to XAxis, YAxis, ZAxis
     2. (x, y) domain LinearSet
     3. if (t -> ...), then t is mapped to Animation
     b is width of blend region

Throws:
VisADException
RemoteException
Method Detail

start

public void start()
           throws VisADException,
                  RemoteException
Throws:
VisADException
RemoteException

stop

public void stop()
          throws VisADException,
                 RemoteException
Throws:
VisADException
RemoteException

undo

public void undo()
          throws VisADException,
                 RemoteException
Throws:
VisADException
RemoteException

setBlend

public void setBlend(int b)

main

public static void main(String[] args)
                 throws VisADException,
                        RemoteException
Throws:
VisADException
RemoteException

actionPerformed

public void actionPerformed(ActionEvent e)
Specified by:
actionPerformed in interface ActionListener