* 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
This commit is contained in:
parent
e46e696838
commit
1cea8d81fc
@ -1285,6 +1285,19 @@ public class TerrainEditorController {
|
||||
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 class="javax.swing.JToggleButton" name="levelTerrainButton">
|
||||
<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">
|
||||
<Image iconType="3" name="/com/jme3/gde/terraineditor/icon_terrain-level.png"/>
|
||||
</Property>
|
||||
<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, "{key}")"/>
|
||||
</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, "{key}")"/>
|
||||
</Property>
|
||||
<Property name="focusable" type="boolean" value="false"/>
|
||||
<Property name="horizontalTextPosition" type="int" value="0"/>
|
||||
<Property name="verticalTextPosition" type="int" value="3"/>
|
||||
|
@ -481,8 +481,10 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce
|
||||
roughTerrainButton.setEnabled(false);
|
||||
jToolBar1.add(roughTerrainButton);
|
||||
|
||||
terrainModButtonGroup.add(levelTerrainButton);
|
||||
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
|
||||
levelTerrainButton.setToolTipText(org.openide.util.NbBundle.getMessage(TerrainEditorTopComponent.class, "TerrainEditorTopComponent.levelTerrainButton.toolTipText")); // NOI18N
|
||||
levelTerrainButton.setFocusable(false);
|
||||
levelTerrainButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
|
||||
levelTerrainButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
||||
|
@ -69,6 +69,7 @@ public class TerrainToolController extends SceneToolController {
|
||||
private float heightToolRadius;
|
||||
private float heightAmount;
|
||||
private float levelAmount;
|
||||
private float smoothAmount;
|
||||
private float paintAmount;
|
||||
private int selectedTextureIndex = -1;
|
||||
|
||||
@ -257,7 +258,7 @@ public class TerrainToolController extends SceneToolController {
|
||||
editorController.doModifyTerrainHeight(getMarkerLocation(), heightToolRadius, -heightAmount);
|
||||
}
|
||||
else if (TerrainEditButton.smoothTerrain == getCurrentEditButtonState() ) {
|
||||
|
||||
editorController.doSmoothTerrain(getMarkerLocation(), heightToolRadius, smoothAmount);
|
||||
}
|
||||
else if (TerrainEditButton.levelTerrain == getCurrentEditButtonState() ) {
|
||||
if (editorController.doGetLevelTerrainDesiredHeight() == null) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user