* hooked the level button to the toggle bar, added tool tip

* wired in smooth tool, not implemented yet however

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7651 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
bre..ns 14 years ago
parent e46e696838
commit 1cea8d81fc
  1. 13
      sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainEditorController.java
  2. 6
      sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainEditorTopComponent.form
  3. 2
      sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainEditorTopComponent.java
  4. 3
      sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainToolController.java

@ -1285,6 +1285,19 @@ public class TerrainEditorController {
return levelTerrainDesiredHeight; return levelTerrainDesiredHeight;
} }
/**
* Smooth bumps in the terrain by averaging the height in the tool radius.
* The smoothAmount affects how many neighbour points are averaged, The smaller
* the value, then only the smaller bumps will disappear. A large value will
* smooth larger hills
* @param markerLocation
* @param heightToolRadius
* @param smoothAmount
*/
protected void doSmoothTerrain(Vector3f markerLocation, float heightToolRadius, float smoothAmount) {
}

@ -538,12 +538,18 @@
</Component> </Component>
<Component class="javax.swing.JToggleButton" name="levelTerrainButton"> <Component class="javax.swing.JToggleButton" name="levelTerrainButton">
<Properties> <Properties>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="terrainModButtonGroup"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/jme3/gde/terraineditor/icon_terrain-level.png"/> <Image iconType="3" name="/com/jme3/gde/terraineditor/icon_terrain-level.png"/>
</Property> </Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jme3/gde/terraineditor/Bundle.properties" key="TerrainEditorTopComponent.levelTerrainButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="com/jme3/gde/terraineditor/Bundle.properties" key="TerrainEditorTopComponent.levelTerrainButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jme3/gde/terraineditor/Bundle.properties" key="TerrainEditorTopComponent.levelTerrainButton.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="focusable" type="boolean" value="false"/> <Property name="focusable" type="boolean" value="false"/>
<Property name="horizontalTextPosition" type="int" value="0"/> <Property name="horizontalTextPosition" type="int" value="0"/>
<Property name="verticalTextPosition" type="int" value="3"/> <Property name="verticalTextPosition" type="int" value="3"/>

@ -481,8 +481,10 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce
roughTerrainButton.setEnabled(false); roughTerrainButton.setEnabled(false);
jToolBar1.add(roughTerrainButton); jToolBar1.add(roughTerrainButton);
terrainModButtonGroup.add(levelTerrainButton);
levelTerrainButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/terraineditor/icon_terrain-level.png"))); // NOI18N levelTerrainButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/terraineditor/icon_terrain-level.png"))); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(levelTerrainButton, org.openide.util.NbBundle.getMessage(TerrainEditorTopComponent.class, "TerrainEditorTopComponent.levelTerrainButton.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(levelTerrainButton, org.openide.util.NbBundle.getMessage(TerrainEditorTopComponent.class, "TerrainEditorTopComponent.levelTerrainButton.text")); // NOI18N
levelTerrainButton.setToolTipText(org.openide.util.NbBundle.getMessage(TerrainEditorTopComponent.class, "TerrainEditorTopComponent.levelTerrainButton.toolTipText")); // NOI18N
levelTerrainButton.setFocusable(false); levelTerrainButton.setFocusable(false);
levelTerrainButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); levelTerrainButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
levelTerrainButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); levelTerrainButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);

@ -69,6 +69,7 @@ public class TerrainToolController extends SceneToolController {
private float heightToolRadius; private float heightToolRadius;
private float heightAmount; private float heightAmount;
private float levelAmount; private float levelAmount;
private float smoothAmount;
private float paintAmount; private float paintAmount;
private int selectedTextureIndex = -1; private int selectedTextureIndex = -1;
@ -257,7 +258,7 @@ public class TerrainToolController extends SceneToolController {
editorController.doModifyTerrainHeight(getMarkerLocation(), heightToolRadius, -heightAmount); editorController.doModifyTerrainHeight(getMarkerLocation(), heightToolRadius, -heightAmount);
} }
else if (TerrainEditButton.smoothTerrain == getCurrentEditButtonState() ) { else if (TerrainEditButton.smoothTerrain == getCurrentEditButtonState() ) {
editorController.doSmoothTerrain(getMarkerLocation(), heightToolRadius, smoothAmount);
} }
else if (TerrainEditButton.levelTerrain == getCurrentEditButtonState() ) { else if (TerrainEditButton.levelTerrain == getCurrentEditButtonState() ) {
if (editorController.doGetLevelTerrainDesiredHeight() == null) { if (editorController.doGetLevelTerrainDesiredHeight() == null) {

Loading…
Cancel
Save