Example #1
0
 /**
  * Constructs an image edit mode with specified manager.
  *
  * @param modeManager the mode manager for this mode.
  */
 public ImageEditMode(ModeManager modeManager, PixelsView pixels, float vnull, float[][] v) {
   super(modeManager);
   setName("Edit");
   // setIcon(loadIcon(ImageEditMode.class,"resources/ImageEdit16.gif"));
   // setIcon(loadIcon(MouseTrackMode.class,"resources/Track24.gif"));
   setMnemonicKey(KeyEvent.VK_E);
   setAcceleratorKey(KeyStroke.getKeyStroke(KeyEvent.VK_E, 0));
   setShortDescription("Edit points");
   _tile = pixels.getTile();
   _pixels = pixels;
   fill(vnull, v);
   _vnull = vnull;
   _n1 = v[0].length;
   _n2 = v.length;
   _v = v;
   _is2 = new ImageSampler2(_v);
   _ns = 0;
   _x1 = new float[0][0];
   _x2 = new float[0][0];
   _vx = new float[0][0];
   _points = new PointsView(_x1, _x2);
   if (pixels.getOrientation() == PixelsView.Orientation.X1RIGHT_X2UP) {
     _points.setOrientation(PointsView.Orientation.X1RIGHT_X2UP);
   } else {
     _points.setOrientation(PointsView.Orientation.X1DOWN_X2RIGHT);
   }
   _points.setStyle("w-o");
 }