SDK SceneComposer : clean up in the RotateTool, changed the name of the UndoableSceneEdit
from ScaleUndo to RotateUndo
This commit is contained in:
parent
1f4ee34de8
commit
e9b1972aca
@ -25,7 +25,6 @@ import org.openide.util.Lookup;
|
|||||||
public class RotateTool extends SceneEditTool {
|
public class RotateTool extends SceneEditTool {
|
||||||
|
|
||||||
private Vector3f pickedMarker;
|
private Vector3f pickedMarker;
|
||||||
private Vector2f lastScreenCoord;
|
|
||||||
private Quaternion startRotate;
|
private Quaternion startRotate;
|
||||||
private Quaternion lastRotate;
|
private Quaternion lastRotate;
|
||||||
private boolean wasDragging = false;
|
private boolean wasDragging = false;
|
||||||
@ -48,9 +47,8 @@ public class RotateTool extends SceneEditTool {
|
|||||||
if (!pressed) {
|
if (!pressed) {
|
||||||
setDefaultAxisMarkerColors();
|
setDefaultAxisMarkerColors();
|
||||||
pickedMarker = null; // mouse released, reset selection
|
pickedMarker = null; // mouse released, reset selection
|
||||||
lastScreenCoord = null;
|
|
||||||
if (wasDragging) {
|
if (wasDragging) {
|
||||||
actionPerformed(new ScaleUndo(toolController.getSelectedSpatial(), startRotate, lastRotate));
|
actionPerformed(new RotateUndo(toolController.getSelectedSpatial(), startRotate, lastRotate));
|
||||||
wasDragging = false;
|
wasDragging = false;
|
||||||
}
|
}
|
||||||
pickManager.reset();
|
pickManager.reset();
|
||||||
@ -100,10 +98,9 @@ public class RotateTool extends SceneEditTool {
|
|||||||
if (!pressed) {
|
if (!pressed) {
|
||||||
setDefaultAxisMarkerColors();
|
setDefaultAxisMarkerColors();
|
||||||
pickedMarker = null; // mouse released, reset selection
|
pickedMarker = null; // mouse released, reset selection
|
||||||
lastScreenCoord = null;
|
|
||||||
|
|
||||||
if (wasDragging) {
|
if (wasDragging) {
|
||||||
actionPerformed(new ScaleUndo(toolController.getSelectedSpatial(), startRotate, lastRotate));
|
actionPerformed(new RotateUndo(toolController.getSelectedSpatial(), startRotate, lastRotate));
|
||||||
wasDragging = false;
|
wasDragging = false;
|
||||||
}
|
}
|
||||||
pickManager.reset();
|
pickManager.reset();
|
||||||
@ -138,12 +135,12 @@ public class RotateTool extends SceneEditTool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class ScaleUndo extends AbstractUndoableSceneEdit {
|
private class RotateUndo extends AbstractUndoableSceneEdit {
|
||||||
|
|
||||||
private Spatial spatial;
|
private Spatial spatial;
|
||||||
private Quaternion before, after;
|
private Quaternion before, after;
|
||||||
|
|
||||||
ScaleUndo(Spatial spatial, Quaternion before, Quaternion after) {
|
RotateUndo(Spatial spatial, Quaternion before, Quaternion after) {
|
||||||
this.spatial = spatial;
|
this.spatial = spatial;
|
||||||
this.before = before;
|
this.before = before;
|
||||||
this.after = after;
|
this.after = after;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user