diff --git a/sdk/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/actions/AbstractStatefulGLToolAction.java b/sdk/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/actions/AbstractStatefulGLToolAction.java index 647abf5fe..322c2386a 100644 --- a/sdk/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/actions/AbstractStatefulGLToolAction.java +++ b/sdk/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/actions/AbstractStatefulGLToolAction.java @@ -62,9 +62,15 @@ public abstract class AbstractStatefulGLToolAction { } public void doActionPerformed(final AbstractSceneExplorerNode rootNode, final DataObject dataObject) { + doActionPerformed(rootNode, dataObject, true); + } + + public void doActionPerformed(final AbstractSceneExplorerNode rootNode, final DataObject dataObject, boolean recordUndo) { final Object object = doApplyTool(rootNode); - if (object!=null) { + + if (object!=null && recordUndo) { + Lookup lookup = Lookup.getDefault() ; SceneUndoRedoManager manager = lookup.lookup(SceneUndoRedoManager.class); diff --git a/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/Bundle.properties b/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/Bundle.properties index 89be45313..5ac2494c0 100644 --- a/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/Bundle.properties +++ b/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/Bundle.properties @@ -89,8 +89,6 @@ TerrainEditorTopComponent.remainingTexturesLabel.text=\ TerrainEditorTopComponent.textureTable.columnModel.title4=Normal TerrainEditorTopComponent.eraseButton.toolTipText=Erase a texture from the terrain TerrainEditorTopComponent.eraseButton.text= -TerrainEditorTopComponent.paintButton.toolTipText=Paint a texture onto the terrain -TerrainEditorTopComponent.paintButton.text= TerrainEditorTopComponent.paintingPanel.border.title=Painting TerrainEditorTopComponent.triPlanarCheckBox.toolTipText=Enable if you have a lot of vertical surfaces. It will look nice but lower performance TerrainEditorTopComponent.triPlanarCheckBox.text=Tri-planar diff --git a/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainCameraController.java b/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainCameraController.java index a60118776..e4deb552c 100644 --- a/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainCameraController.java +++ b/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainCameraController.java @@ -105,32 +105,43 @@ public class TerrainCameraController extends AbstractCameraController { @Override protected void checkClick(int button, boolean pressed) { + checkMouseButtonState(button, pressed); + } + + @Override + protected void checkDragged(int button, boolean pressed) { + checkMouseButtonState(button, pressed); + } + + private void checkMouseButtonState(int button, boolean pressed) { + if (isTerrainEditButtonEnabled() && !forceCameraControls) { + if (terrainEditToolActivated != pressed) + toolController.doTerrainEditToolActionEnded(); // button state change, trigger undo action + terrainEditToolActivated = pressed; + } - /*if (button == 0) { + + if (button == 0) { if (isTerrainEditButtonEnabled() && !forceCameraControls) { - terrainEditToolActivated = true; + toolController.setPrimary(pressed); + System.out.println("primary "+pressed); } } - - if (button == 1) { - if (isTerrainEditButtonEnabled() && !forceCameraControls) { - toolController.doTerrainEditToolAlternateActivated(); - } - }*/ - + if (button == 1) { if (isTerrainEditButtonEnabled() && !forceCameraControls) { - toolController.doTerrainEditToolAlternateActivated(); + toolController.setAlternate(pressed); + System.out.println("alternate "+pressed); } } } - @Override + /*@Override protected void checkDragged(int button, boolean pressed) { - if (button == 0 && !forceCameraControls) { + if ( (button == 0 || button == 1) && !forceCameraControls) { terrainEditToolActivated = true; } - } + }*/ @Override protected void checkMoved() { @@ -151,8 +162,9 @@ public class TerrainCameraController extends AbstractCameraController { lastModifyTime = 0; if (terrainEditToolActivated) { toolController.doTerrainEditToolActivated(); + toolController.doTerrainEditToolAlternateActivated(); } - terrainEditToolActivated = false; + //terrainEditToolActivated = false; lastModifyTime = app.getContext().getTimer().getTime(); } } diff --git a/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainEditorTopComponent.form b/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainEditorTopComponent.form index 60b096578..b07ee78a3 100644 --- a/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainEditorTopComponent.form +++ b/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainEditorTopComponent.form @@ -1,4 +1,4 @@ - +