hooked in key events to terrain editor tools

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9575 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
bre..ns 13 years ago
parent f3d56b3ee6
commit 22f0410e78
  1. 1
      sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainCameraController.java
  2. 6
      sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainToolController.java
  3. 6
      sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/tools/TerrainTool.java

@ -170,6 +170,7 @@ public class TerrainCameraController extends AbstractCameraController {
forceCameraControls = false; forceCameraControls = false;
} }
} }
toolController.doKeyPressed(kie);
} }
/** /**

@ -38,6 +38,7 @@ import com.jme3.gde.core.scene.controller.SceneToolController;
import com.jme3.gde.core.sceneexplorer.nodes.JmeNode; import com.jme3.gde.core.sceneexplorer.nodes.JmeNode;
import com.jme3.gde.core.sceneexplorer.nodes.JmeSpatial; import com.jme3.gde.core.sceneexplorer.nodes.JmeSpatial;
import com.jme3.gde.terraineditor.tools.TerrainTool; import com.jme3.gde.terraineditor.tools.TerrainTool;
import com.jme3.input.event.KeyInputEvent;
import com.jme3.math.Vector3f; import com.jme3.math.Vector3f;
import com.jme3.scene.Node; import com.jme3.scene.Node;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;
@ -208,4 +209,9 @@ public class TerrainToolController extends SceneToolController {
return terrainTool; return terrainTool;
} }
void doKeyPressed(KeyInputEvent kie) {
if (terrainTool != null) {
terrainTool.keyPressed(kie);
}
}
} }

@ -34,6 +34,7 @@ package com.jme3.gde.terraineditor.tools;
import com.jme3.asset.AssetManager; import com.jme3.asset.AssetManager;
import com.jme3.gde.core.sceneexplorer.nodes.AbstractSceneExplorerNode; import com.jme3.gde.core.sceneexplorer.nodes.AbstractSceneExplorerNode;
import com.jme3.gde.terraineditor.ExtraToolParams; import com.jme3.gde.terraineditor.ExtraToolParams;
import com.jme3.input.event.KeyInputEvent;
import com.jme3.material.Material; import com.jme3.material.Material;
import com.jme3.math.ColorRGBA; import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f; import com.jme3.math.Vector3f;
@ -84,6 +85,11 @@ public abstract class TerrainTool {
*/ */
public abstract void actionSecondary(Vector3f point, int textureIndex, AbstractSceneExplorerNode rootNode, DataObject dataObject); public abstract void actionSecondary(Vector3f point, int textureIndex, AbstractSceneExplorerNode rootNode, DataObject dataObject);
/**
* Key was pressed.
*/
public void keyPressed(KeyInputEvent kie) {}
/** /**
* Location of the primary editor marker * Location of the primary editor marker
*/ */

Loading…
Cancel
Save