示例#1
0
 private float x2(int x, int y) {
   Transcaler ts = _tile.getTranscaler();
   PointsView.Orientation pvo = _points.getOrientation();
   if (pvo == PointsView.Orientation.X1RIGHT_X2UP) {
     Projector p = _tile.getHorizontalProjector();
     return (float) p.v(ts.y(y));
   } else {
     Projector p = _tile.getVerticalProjector();
     return (float) p.v(ts.x(x));
   }
 }
示例#2
0
 private int y(float x1, float x2) {
   Transcaler ts = _tile.getTranscaler();
   PointsView.Orientation pvo = _points.getOrientation();
   if (pvo == PointsView.Orientation.X1RIGHT_X2UP) {
     Projector p = _tile.getHorizontalProjector();
     return ts.y(p.u(x2));
   } else {
     Projector p = _tile.getVerticalProjector();
     return ts.y(p.u(x1));
   }
 }
示例#3
0
 protected void setActive(Component component, boolean active) {
   if (component instanceof Tile) {
     Tile tile = (Tile) component;
     if (active) {
       tile.addTiledView(_points);
       tile.addMouseListener(_ml);
       tile.addMouseWheelListener(_mwl);
       InputMap im = tile.getInputMap();
       ActionMap am = tile.getActionMap();
       im.put(KS_BACK_SPACE, "backspace");
       im.put(KS_UP, "up");
       im.put(KS_DOWN, "down");
       am.put("backspace", _bsa);
       am.put("up", _uaa);
       am.put("down", _daa);
     } else {
       tile.removeTiledView(_points);
       tile.removeMouseListener(_ml);
       tile.removeMouseWheelListener(_mwl);
       InputMap im = tile.getInputMap();
       ActionMap am = tile.getActionMap();
       im.remove(KS_BACK_SPACE);
       im.remove(KS_UP);
       im.remove(KS_DOWN);
       am.remove("backspace");
       am.remove("up");
       am.remove("down");
     }
   }
 }
示例#4
0
 private void removeMotionListener() {
   _tile.removeMouseMotionListener(_mml);
   _hasMotionListener = false;
 }
示例#5
0
 private void addMotionListener() {
   _tile.addMouseMotionListener(_mml);
   _hasMotionListener = true;
 }