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)); } }
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)); } }
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"); } } }
private void removeMotionListener() { _tile.removeMouseMotionListener(_mml); _hasMotionListener = false; }
private void addMotionListener() { _tile.addMouseMotionListener(_mml); _hasMotionListener = true; }