improved terrain editor wizard

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9235 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
bre..ns 13 years ago
parent d2b727cfd8
commit 694b61cf58
  1. 3
      sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/AddTerrainAction.java
  2. 4
      sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/Bundle.properties
  3. 239
      sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/CreateTerrainVisualPanel2.form
  4. 245
      sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/CreateTerrainVisualPanel2.java
  5. 24
      sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/CreateTerrainWizardPanel2.java
  6. 5
      sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainEditorTopComponent.form
  7. 5
      sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainEditorTopComponent.java
  8. 5
      sdk/nbproject/build-impl.xml
  9. 7
      sdk/nbproject/genfiles.properties

@ -91,6 +91,9 @@ public class AddTerrainAction extends AbstractNewSpatialWizardAction {
heightmap = (AbstractHeightMap) wizardDescriptor.getProperty("abstractHeightMap"); heightmap = (AbstractHeightMap) wizardDescriptor.getProperty("abstractHeightMap");
if (heightmap != null) { if (heightmap != null) {
heightmap.load(); // can take a while heightmap.load(); // can take a while
Float smooth = (Float) wizardDescriptor.getProperty("heightMapSmooth");
if (smooth > 0)
heightmap.smooth(smooth, 2);
heightmapData = heightmap.getHeightMap(); heightmapData = heightmap.getHeightMap();
} }

@ -115,3 +115,7 @@ TerrainEditorTopComponent.scaleField.text=0.1
TerrainEditorTopComponent.jLabel3.toolTipText=How steep the slopes are. Lower is steeper (must be greater than 1.0) TerrainEditorTopComponent.jLabel3.toolTipText=How steep the slopes are. Lower is steeper (must be greater than 1.0)
TerrainEditorTopComponent.jLabel4.toolTipText=Hill area in terms of octaves. Larger is smaller hill, values of 8 or lower are wide hills. TerrainEditorTopComponent.jLabel4.toolTipText=Hill area in terms of octaves. Larger is smaller hill, values of 8 or lower are wide hills.
TerrainEditorTopComponent.scaleLabel.toolTipText=How close together the bumps are. Larger is closer. TerrainEditorTopComponent.scaleLabel.toolTipText=How close together the bumps are. Larger is closer.
CreateTerrainVisualPanel2.smoothIterationsLabel.text=Rough
CreateTerrainVisualPanel2.jLabel6.text=Smooth
CreateTerrainVisualPanel2.jLabel7.text=Height Scale:
CreateTerrainVisualPanel2.heightScale.text=1

@ -34,7 +34,10 @@
<Layout> <Layout>
<DimensionLayout dim="0"> <DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Component id="jPanel2" min="-2" max="-2" attributes="0"/> <Group type="102" alignment="0" attributes="0">
<Component id="jPanel2" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
<DimensionLayout dim="1"> <DimensionLayout dim="1">
@ -50,16 +53,20 @@
<DimensionLayout dim="0"> <DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="30" max="-2" attributes="0"/> <EmptySpace min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0"> <Group type="103" groupAlignment="1" attributes="0">
<Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/> <Component id="_imagePanel" alignment="0" min="0" pref="455" max="32767" attributes="1"/>
<Component id="_hillPanel" alignment="0" max="32767" attributes="1"/> <Group type="103" alignment="0" groupAlignment="0" max="-2" attributes="0">
<Component id="_imagePanel" alignment="0" max="32767" attributes="1"/> <Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="_flatPanel" alignment="0" max="32767" attributes="1"/> <Component id="_flatPanel" alignment="0" min="-2" max="-2" attributes="1"/>
<Component id="heightmapTypeComboBox" alignment="0" pref="428" max="32767" attributes="1"/> <Component id="heightmapTypeComboBox" alignment="0" max="32767" attributes="1"/>
<Component id="_faultPanel" alignment="0" max="32767" attributes="1"/> </Group>
</Group> </Group>
<EmptySpace max="32767" attributes="0"/> <EmptySpace min="-2" pref="34" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="_hillPanel" max="32767" attributes="1"/>
<EmptySpace min="-2" pref="24" max="-2" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
@ -73,12 +80,10 @@
<EmptySpace type="separate" max="-2" attributes="0"/> <EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="_flatPanel" min="-2" max="-2" attributes="0"/> <Component id="_flatPanel" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/> <EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="_imagePanel" min="-2" max="-2" attributes="0"/> <Component id="_imagePanel" min="-2" pref="192" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="_hillPanel" min="-2" max="-2" attributes="0"/> <Component id="_hillPanel" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/> <EmptySpace max="32767" attributes="0"/>
<Component id="_faultPanel" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="27" max="32767" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
@ -116,7 +121,7 @@
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="_flatDescriptionLabel" min="-2" max="-2" attributes="0"/> <Component id="_flatDescriptionLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="267" max="32767" attributes="0"/> <EmptySpace pref="269" max="32767" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
@ -145,17 +150,45 @@
<Layout> <Layout>
<DimensionLayout dim="0"> <DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0"> <Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="_imageDescriptionLabel" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<Component id="_imageBrowseTextField" min="-2" pref="246" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
<Component id="_imageBrowseButton" min="-2" max="-2" attributes="1"/>
<EmptySpace min="-2" pref="606" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<Component id="_imageBrowseTextField" min="-2" pref="246" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="_imageBrowseButton" min="-2" max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="heightScale" min="-2" pref="45" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="smoothIterationsLabel" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="smoothSlider" min="-2" pref="113" max="-2" attributes="1"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="119" max="-2" attributes="0"/>
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
</Group> </Group>
<Component id="_imageDescriptionLabel" alignment="0" min="-2" max="-2" attributes="0"/>
</Group> </Group>
<EmptySpace pref="99" max="32767" attributes="0"/> <EmptySpace max="32767" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
@ -169,7 +202,20 @@
<Component id="_imageBrowseTextField" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="_imageBrowseTextField" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="_imageBrowseButton" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="_imageBrowseButton" alignment="3" min="-2" max="-2" attributes="0"/>
</Group> </Group>
<EmptySpace pref="44" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="smoothSlider" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="103" alignment="0" groupAlignment="3" attributes="0">
<Component id="smoothIterationsLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" pref="35" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="heightScale" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="64" max="-2" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
@ -184,6 +230,7 @@
</Component> </Component>
<Component class="javax.swing.JTextField" name="_imageBrowseTextField"> <Component class="javax.swing.JTextField" name="_imageBrowseTextField">
<Properties> <Properties>
<Property name="editable" type="boolean" value="false"/>
<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="CreateTerrainVisualPanel2._imageBrowseTextField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="com/jme3/gde/terraineditor/Bundle.properties" key="CreateTerrainVisualPanel2._imageBrowseTextField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
@ -199,6 +246,41 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="_imageBrowseButtonActionPerformed"/> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="_imageBrowseButtonActionPerformed"/>
</Events> </Events>
</Component> </Component>
<Component class="javax.swing.JLabel" name="smoothIterationsLabel">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jme3/gde/terraineditor/Bundle.properties" key="CreateTerrainVisualPanel2.smoothIterationsLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JSlider" name="smoothSlider">
<Properties>
<Property name="minorTickSpacing" type="int" value="10"/>
<Property name="paintLabels" type="boolean" value="true"/>
<Property name="paintTicks" type="boolean" value="true"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel6">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jme3/gde/terraineditor/Bundle.properties" key="CreateTerrainVisualPanel2.jLabel6.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel7">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jme3/gde/terraineditor/Bundle.properties" key="CreateTerrainVisualPanel2.jLabel7.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="heightScale">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jme3/gde/terraineditor/Bundle.properties" key="CreateTerrainVisualPanel2.heightScale.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
</SubComponents> </SubComponents>
</Container> </Container>
<Container class="javax.swing.JPanel" name="_hillPanel"> <Container class="javax.swing.JPanel" name="_hillPanel">
@ -209,34 +291,39 @@
<Group type="102" attributes="0"> <Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Component id="_hillDescriptionLabel" alignment="1" min="-2" max="-2" attributes="0"/> <Group type="102" attributes="0">
<Group type="102" alignment="1" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="103" groupAlignment="1" max="-2" attributes="0"> <Component id="_hillDescriptionLabel" alignment="1" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="1">
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="_hillFlatteningTextField" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0"> <Group type="102" alignment="1" attributes="0">
<Component id="jLabel2" min="-2" max="-2" attributes="0"/> <Group type="103" groupAlignment="1" max="-2" attributes="0">
<EmptySpace type="unrelated" max="-2" attributes="0"/> <Group type="102" alignment="0" attributes="1">
<Component id="_hillIterationsTextField" min="-2" pref="59" max="-2" attributes="0"/> <Component id="jLabel5" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="_hillFlatteningTextField" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="_hillIterationsTextField" min="-2" pref="59" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" pref="70" max="-2" attributes="0"/>
</Group> </Group>
</Group> </Group>
<EmptySpace min="-2" pref="70" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="_hillMinRadiusTextField" max="32767" attributes="1"/>
<Component id="_hillMaxRadiusTextField" alignment="0" pref="55" max="32767" attributes="1"/>
</Group>
</Group> </Group>
<Component id="_faultPanel" alignment="0" max="32767" attributes="1"/>
</Group> </Group>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="_hillMinRadiusTextField" max="32767" attributes="1"/>
<Component id="_hillMaxRadiusTextField" alignment="0" pref="55" max="32767" attributes="1"/>
</Group>
<EmptySpace pref="23" max="32767" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
@ -259,7 +346,9 @@
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="_hillMaxRadiusTextField" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="_hillMaxRadiusTextField" alignment="3" min="-2" max="-2" attributes="0"/>
</Group> </Group>
<EmptySpace pref="31" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="_faultPanel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
@ -328,38 +417,38 @@
</Property> </Property>
</Properties> </Properties>
</Component> </Component>
</SubComponents> <Container class="javax.swing.JPanel" name="_faultPanel">
</Container>
<Container class="javax.swing.JPanel" name="_faultPanel">
<Layout> <Layout>
<DimensionLayout dim="0"> <DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="_faultDescriptionLabel" min="-2" max="-2" attributes="0"/> <Component id="_faultDescriptionLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="37" max="32767" attributes="0"/> <EmptySpace pref="64" max="32767" attributes="0"/>
</Group>
</Group> </Group>
</Group> </DimensionLayout>
</DimensionLayout> <DimensionLayout dim="1">
<DimensionLayout dim="1"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/> <Component id="_faultDescriptionLabel" min="-2" max="-2" attributes="0"/>
<Component id="_faultDescriptionLabel" min="-2" max="-2" attributes="0"/> <EmptySpace pref="75" max="32767" attributes="0"/>
<EmptySpace pref="75" max="32767" attributes="0"/> </Group>
</Group> </Group>
</Group> </DimensionLayout>
</DimensionLayout> </Layout>
</Layout> <SubComponents>
<SubComponents> <Component class="javax.swing.JLabel" name="_faultDescriptionLabel">
<Component class="javax.swing.JLabel" name="_faultDescriptionLabel"> <Properties>
<Properties> <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="CreateTerrainVisualPanel2._faultDescriptionLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
<ResourceString bundle="com/jme3/gde/terraineditor/Bundle.properties" key="CreateTerrainVisualPanel2._faultDescriptionLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> </Property>
</Property> </Properties>
</Properties> </Component>
</Component> </SubComponents>
</Container>
</SubComponents> </SubComponents>
</Container> </Container>
</SubComponents> </SubComponents>

@ -4,9 +4,9 @@
*/ */
package com.jme3.gde.terraineditor; package com.jme3.gde.terraineditor;
import java.io.File; import com.jme3.gde.core.properties.TexturePropertyEditor;
import java.io.FileReader; import com.jme3.texture.Texture;
import java.io.IOException; import java.awt.Component;
import javax.swing.JComboBox; import javax.swing.JComboBox;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JTextField; import javax.swing.JTextField;
@ -14,7 +14,8 @@ import javax.swing.JTextField;
public final class CreateTerrainVisualPanel2 extends JPanel { public final class CreateTerrainVisualPanel2 extends JPanel {
//String[] types = {"Flat", "Image Based", "Hill", "Fault Fractal"}; //String[] types = {"Flat", "Image Based", "Hill", "Fault Fractal"};
private Texture browsedTexture;
private CreateTerrainWizardPanel2 wizardPanel;
/** Creates new form CreateTerrainVisualPanel2 */ /** Creates new form CreateTerrainVisualPanel2 */
public CreateTerrainVisualPanel2() { public CreateTerrainVisualPanel2() {
@ -50,6 +51,11 @@ public final class CreateTerrainVisualPanel2 extends JPanel {
_imageDescriptionLabel = new javax.swing.JLabel(); _imageDescriptionLabel = new javax.swing.JLabel();
_imageBrowseTextField = new javax.swing.JTextField(); _imageBrowseTextField = new javax.swing.JTextField();
_imageBrowseButton = new javax.swing.JButton(); _imageBrowseButton = new javax.swing.JButton();
smoothIterationsLabel = new javax.swing.JLabel();
smoothSlider = new javax.swing.JSlider();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
heightScale = new javax.swing.JTextField();
_hillPanel = new javax.swing.JPanel(); _hillPanel = new javax.swing.JPanel();
_hillDescriptionLabel = new javax.swing.JLabel(); _hillDescriptionLabel = new javax.swing.JLabel();
_hillIterationsTextField = new javax.swing.JTextField(); _hillIterationsTextField = new javax.swing.JTextField();
@ -65,7 +71,7 @@ public final class CreateTerrainVisualPanel2 extends JPanel {
imageFileChooser.setApproveButtonText(org.openide.util.NbBundle.getMessage(CreateTerrainVisualPanel2.class, "CreateTerrainVisualPanel2.imageFileChooser.approveButtonText")); // NOI18N imageFileChooser.setApproveButtonText(org.openide.util.NbBundle.getMessage(CreateTerrainVisualPanel2.class, "CreateTerrainVisualPanel2.imageFileChooser.approveButtonText")); // NOI18N
imageFileChooser.setApproveButtonToolTipText(org.openide.util.NbBundle.getMessage(CreateTerrainVisualPanel2.class, "CreateTerrainVisualPanel2.imageFileChooser.approveButtonToolTipText")); // NOI18N imageFileChooser.setApproveButtonToolTipText(org.openide.util.NbBundle.getMessage(CreateTerrainVisualPanel2.class, "CreateTerrainVisualPanel2.imageFileChooser.approveButtonToolTipText")); // NOI18N
imageFileChooser.setCurrentDirectory(new java.io.File("C:\\Java\\NetBeans 6.9.1")); imageFileChooser.setCurrentDirectory(new java.io.File("C:\\Program Files\\NetBeans 7.0"));
imageFileChooser.setDialogTitle(org.openide.util.NbBundle.getMessage(CreateTerrainVisualPanel2.class, "CreateTerrainVisualPanel2.imageFileChooser.dialogTitle")); // NOI18N imageFileChooser.setDialogTitle(org.openide.util.NbBundle.getMessage(CreateTerrainVisualPanel2.class, "CreateTerrainVisualPanel2.imageFileChooser.dialogTitle")); // NOI18N
jLabel1.setFont(new java.awt.Font("Tahoma", 1, 12)); jLabel1.setFont(new java.awt.Font("Tahoma", 1, 12));
@ -87,7 +93,7 @@ public final class CreateTerrainVisualPanel2 extends JPanel {
.addGroup(_flatPanelLayout.createSequentialGroup() .addGroup(_flatPanelLayout.createSequentialGroup()
.addContainerGap() .addContainerGap()
.addComponent(_flatDescriptionLabel) .addComponent(_flatDescriptionLabel)
.addContainerGap(267, Short.MAX_VALUE)) .addContainerGap(269, Short.MAX_VALUE))
); );
_flatPanelLayout.setVerticalGroup( _flatPanelLayout.setVerticalGroup(
_flatPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) _flatPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -99,6 +105,7 @@ public final class CreateTerrainVisualPanel2 extends JPanel {
org.openide.awt.Mnemonics.setLocalizedText(_imageDescriptionLabel, org.openide.util.NbBundle.getMessage(CreateTerrainVisualPanel2.class, "CreateTerrainVisualPanel2._imageDescriptionLabel.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(_imageDescriptionLabel, org.openide.util.NbBundle.getMessage(CreateTerrainVisualPanel2.class, "CreateTerrainVisualPanel2._imageDescriptionLabel.text")); // NOI18N
_imageBrowseTextField.setEditable(false);
_imageBrowseTextField.setText(org.openide.util.NbBundle.getMessage(CreateTerrainVisualPanel2.class, "CreateTerrainVisualPanel2._imageBrowseTextField.text")); // NOI18N _imageBrowseTextField.setText(org.openide.util.NbBundle.getMessage(CreateTerrainVisualPanel2.class, "CreateTerrainVisualPanel2._imageBrowseTextField.text")); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(_imageBrowseButton, org.openide.util.NbBundle.getMessage(CreateTerrainVisualPanel2.class, "CreateTerrainVisualPanel2._imageBrowseButton.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(_imageBrowseButton, org.openide.util.NbBundle.getMessage(CreateTerrainVisualPanel2.class, "CreateTerrainVisualPanel2._imageBrowseButton.text")); // NOI18N
@ -108,19 +115,50 @@ public final class CreateTerrainVisualPanel2 extends JPanel {
} }
}); });
org.openide.awt.Mnemonics.setLocalizedText(smoothIterationsLabel, org.openide.util.NbBundle.getMessage(CreateTerrainVisualPanel2.class, "CreateTerrainVisualPanel2.smoothIterationsLabel.text")); // NOI18N
smoothSlider.setMinorTickSpacing(10);
smoothSlider.setPaintLabels(true);
smoothSlider.setPaintTicks(true);
org.openide.awt.Mnemonics.setLocalizedText(jLabel6, org.openide.util.NbBundle.getMessage(CreateTerrainVisualPanel2.class, "CreateTerrainVisualPanel2.jLabel6.text")); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(jLabel7, org.openide.util.NbBundle.getMessage(CreateTerrainVisualPanel2.class, "CreateTerrainVisualPanel2.jLabel7.text")); // NOI18N
heightScale.setText(org.openide.util.NbBundle.getMessage(CreateTerrainVisualPanel2.class, "CreateTerrainVisualPanel2.heightScale.text")); // NOI18N
javax.swing.GroupLayout _imagePanelLayout = new javax.swing.GroupLayout(_imagePanel); javax.swing.GroupLayout _imagePanelLayout = new javax.swing.GroupLayout(_imagePanel);
_imagePanel.setLayout(_imagePanelLayout); _imagePanel.setLayout(_imagePanelLayout);
_imagePanelLayout.setHorizontalGroup( _imagePanelLayout.setHorizontalGroup(
_imagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) _imagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(_imagePanelLayout.createSequentialGroup() .addGroup(_imagePanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(_imagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(_imagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(_imagePanelLayout.createSequentialGroup() .addGroup(_imagePanelLayout.createSequentialGroup()
.addComponent(_imageBrowseTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 246, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(_imagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(_imageBrowseButton)) .addComponent(_imageDescriptionLabel)
.addComponent(_imageDescriptionLabel)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, _imagePanelLayout.createSequentialGroup()
.addContainerGap(99, Short.MAX_VALUE)) .addComponent(_imageBrowseTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 246, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(6, 6, 6)
.addComponent(_imageBrowseButton)
.addGap(606, 606, 606))))
.addGroup(_imagePanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(_imagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(_imagePanelLayout.createSequentialGroup()
.addComponent(jLabel7)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(heightScale, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(_imagePanelLayout.createSequentialGroup()
.addComponent(smoothIterationsLabel)
.addGroup(_imagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(_imagePanelLayout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(smoothSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(_imagePanelLayout.createSequentialGroup()
.addGap(119, 119, 119)
.addComponent(jLabel6)))))))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
); );
_imagePanelLayout.setVerticalGroup( _imagePanelLayout.setVerticalGroup(
_imagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) _imagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -131,7 +169,17 @@ public final class CreateTerrainVisualPanel2 extends JPanel {
.addGroup(_imagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addGroup(_imagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(_imageBrowseTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(_imageBrowseTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(_imageBrowseButton)) .addComponent(_imageBrowseButton))
.addContainerGap(44, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(_imagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(smoothSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(_imagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(smoothIterationsLabel)
.addComponent(jLabel6)))
.addGap(35, 35, 35)
.addGroup(_imagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel7)
.addComponent(heightScale, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(64, 64, 64))
); );
org.openide.awt.Mnemonics.setLocalizedText(_hillDescriptionLabel, org.openide.util.NbBundle.getMessage(CreateTerrainVisualPanel2.class, "CreateTerrainVisualPanel2._hillDescriptionLabel.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(_hillDescriptionLabel, org.openide.util.NbBundle.getMessage(CreateTerrainVisualPanel2.class, "CreateTerrainVisualPanel2._hillDescriptionLabel.text")); // NOI18N
@ -152,6 +200,25 @@ public final class CreateTerrainVisualPanel2 extends JPanel {
_hillMaxRadiusTextField.setText(org.openide.util.NbBundle.getMessage(CreateTerrainVisualPanel2.class, "CreateTerrainVisualPanel2._hillMaxRadiusTextField.text")); // NOI18N _hillMaxRadiusTextField.setText(org.openide.util.NbBundle.getMessage(CreateTerrainVisualPanel2.class, "CreateTerrainVisualPanel2._hillMaxRadiusTextField.text")); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(_faultDescriptionLabel, org.openide.util.NbBundle.getMessage(CreateTerrainVisualPanel2.class, "CreateTerrainVisualPanel2._faultDescriptionLabel.text")); // NOI18N
javax.swing.GroupLayout _faultPanelLayout = new javax.swing.GroupLayout(_faultPanel);
_faultPanel.setLayout(_faultPanelLayout);
_faultPanelLayout.setHorizontalGroup(
_faultPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(_faultPanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(_faultDescriptionLabel)
.addContainerGap(64, Short.MAX_VALUE))
);
_faultPanelLayout.setVerticalGroup(
_faultPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(_faultPanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(_faultDescriptionLabel)
.addContainerGap(75, Short.MAX_VALUE))
);
javax.swing.GroupLayout _hillPanelLayout = new javax.swing.GroupLayout(_hillPanel); javax.swing.GroupLayout _hillPanelLayout = new javax.swing.GroupLayout(_hillPanel);
_hillPanel.setLayout(_hillPanelLayout); _hillPanel.setLayout(_hillPanelLayout);
_hillPanelLayout.setHorizontalGroup( _hillPanelLayout.setHorizontalGroup(
@ -159,27 +226,30 @@ public final class CreateTerrainVisualPanel2 extends JPanel {
.addGroup(_hillPanelLayout.createSequentialGroup() .addGroup(_hillPanelLayout.createSequentialGroup()
.addContainerGap() .addContainerGap()
.addGroup(_hillPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(_hillPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(_hillDescriptionLabel, javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(_hillPanelLayout.createSequentialGroup()
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, _hillPanelLayout.createSequentialGroup() .addGroup(_hillPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(_hillPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(_hillDescriptionLabel, javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, _hillPanelLayout.createSequentialGroup() .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, _hillPanelLayout.createSequentialGroup()
.addComponent(jLabel5) .addGroup(_hillPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, _hillPanelLayout.createSequentialGroup()
.addComponent(_hillFlatteningTextField)) .addComponent(jLabel5)
.addGroup(_hillPanelLayout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel2) .addComponent(_hillFlatteningTextField))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(_hillPanelLayout.createSequentialGroup()
.addComponent(_hillIterationsTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE))) .addComponent(jLabel2)
.addGap(70, 70, 70))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(_hillIterationsTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(_hillPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGap(70, 70, 70)))
.addComponent(jLabel3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel4)) .addGroup(_hillPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabel3)
.addGroup(_hillPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel4))
.addComponent(_hillMinRadiusTextField) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(_hillMaxRadiusTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 55, Short.MAX_VALUE)) .addGroup(_hillPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addContainerGap(23, Short.MAX_VALUE)) .addComponent(_hillMinRadiusTextField)
.addComponent(_hillMaxRadiusTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 55, Short.MAX_VALUE)))
.addComponent(_faultPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
); );
_hillPanelLayout.setVerticalGroup( _hillPanelLayout.setVerticalGroup(
_hillPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) _hillPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -198,26 +268,9 @@ public final class CreateTerrainVisualPanel2 extends JPanel {
.addComponent(_hillFlatteningTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(_hillFlatteningTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4) .addComponent(jLabel4)
.addComponent(_hillMaxRadiusTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(_hillMaxRadiusTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(31, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
); .addComponent(_faultPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
org.openide.awt.Mnemonics.setLocalizedText(_faultDescriptionLabel, org.openide.util.NbBundle.getMessage(CreateTerrainVisualPanel2.class, "CreateTerrainVisualPanel2._faultDescriptionLabel.text")); // NOI18N
javax.swing.GroupLayout _faultPanelLayout = new javax.swing.GroupLayout(_faultPanel);
_faultPanel.setLayout(_faultPanelLayout);
_faultPanelLayout.setHorizontalGroup(
_faultPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(_faultPanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(_faultDescriptionLabel)
.addContainerGap(37, Short.MAX_VALUE))
);
_faultPanelLayout.setVerticalGroup(
_faultPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(_faultPanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(_faultDescriptionLabel)
.addContainerGap(75, Short.MAX_VALUE))
); );
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
@ -225,15 +278,17 @@ public final class CreateTerrainVisualPanel2 extends JPanel {
jPanel2Layout.setHorizontalGroup( jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createSequentialGroup()
.addGap(30, 30, 30) .addContainerGap()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel1) .addComponent(_imagePanel, javax.swing.GroupLayout.Alignment.LEADING, 0, 455, Short.MAX_VALUE)
.addComponent(_hillPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(_imagePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel1)
.addComponent(_flatPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(_flatPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(heightmapTypeComboBox, 0, 428, Short.MAX_VALUE) .addComponent(heightmapTypeComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addComponent(_faultPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(34, 34, 34))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(_hillPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(24, 24, 24))
); );
jPanel2Layout.setVerticalGroup( jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -245,19 +300,19 @@ public final class CreateTerrainVisualPanel2 extends JPanel {
.addGap(18, 18, 18) .addGap(18, 18, 18)
.addComponent(_flatPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(_flatPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(_imagePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(_imagePanel, javax.swing.GroupLayout.PREFERRED_SIZE, 192, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(_hillPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(_hillPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addComponent(_faultPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(27, Short.MAX_VALUE))
); );
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout); this.setLayout(layout);
layout.setHorizontalGroup( layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(layout.createSequentialGroup()
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
); );
layout.setVerticalGroup( layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -265,20 +320,21 @@ public final class CreateTerrainVisualPanel2 extends JPanel {
); );
}// </editor-fold>//GEN-END:initComponents }// </editor-fold>//GEN-END:initComponents
protected void setWizardPanel(CreateTerrainWizardPanel2 wizardPanel) {
this.wizardPanel = wizardPanel;
}
private void openFileActionPerformed(java.awt.event.ActionEvent evt) { private void openFileActionPerformed(java.awt.event.ActionEvent evt) {
int returnVal = imageFileChooser.showOpenDialog(this); TexturePropertyEditor editor = new TexturePropertyEditor();
if (returnVal == imageFileChooser.APPROVE_OPTION) { Component view = editor.getCustomEditor();
File file = imageFileChooser.getSelectedFile(); view.setVisible(true);
//try { Texture tex = (Texture) editor.getValue();
// What to do with the file, e.g. display it in a TextArea browsedTexture = tex;
_imageBrowseTextField.setText( file.getAbsolutePath() ); if (tex != null)
//} catch (IOException ex) { _imageBrowseTextField.setText(tex.getName());
// System.out.println("problem accessing file"+file.getAbsolutePath()); else
//} _imageBrowseTextField.setText("...");
} else { wizardPanel.fireChangeEvent();
System.out.println("File access cancelled by user.");
}
} }
private void heightmapTypeComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_heightmapTypeComboBoxActionPerformed private void heightmapTypeComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_heightmapTypeComboBoxActionPerformed
@ -306,7 +362,7 @@ public final class CreateTerrainVisualPanel2 extends JPanel {
_hillPanel.setVisible(false); _hillPanel.setVisible(false);
_faultPanel.setVisible(true); _faultPanel.setVisible(true);
} }
wizardPanel.fireChangeEvent();
this.validate(); this.validate();
}//GEN-LAST:event_heightmapTypeComboBoxActionPerformed }//GEN-LAST:event_heightmapTypeComboBoxActionPerformed
@ -329,6 +385,7 @@ public final class CreateTerrainVisualPanel2 extends JPanel {
private javax.swing.JTextField _imageBrowseTextField; private javax.swing.JTextField _imageBrowseTextField;
private javax.swing.JLabel _imageDescriptionLabel; private javax.swing.JLabel _imageDescriptionLabel;
private javax.swing.JPanel _imagePanel; private javax.swing.JPanel _imagePanel;
private javax.swing.JTextField heightScale;
private javax.swing.JComboBox heightmapTypeComboBox; private javax.swing.JComboBox heightmapTypeComboBox;
private javax.swing.JFileChooser imageFileChooser; private javax.swing.JFileChooser imageFileChooser;
private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel1;
@ -336,7 +393,11 @@ public final class CreateTerrainVisualPanel2 extends JPanel {
private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JPanel jPanel2; private javax.swing.JPanel jPanel2;
private javax.swing.JLabel smoothIterationsLabel;
private javax.swing.JSlider smoothSlider;
// End of variables declaration//GEN-END:variables // End of variables declaration//GEN-END:variables
public JComboBox getHeightmapTypeComboBox() { public JComboBox getHeightmapTypeComboBox() {
@ -359,9 +420,25 @@ public final class CreateTerrainVisualPanel2 extends JPanel {
return _hillMinRadiusTextField; return _hillMinRadiusTextField;
} }
public JTextField getImageBrowseTextField() { public Texture getImageBrowseTexture() {
return _imageBrowseTextField; return browsedTexture;
} }
public float getSmoothEffect() {
float smooth = smoothSlider.getValue()/100f;
if (smooth > 1.0f)
smooth = 1.0f;
if (smooth < 0)
smooth = 0;
return smooth;
}
public float getHeightScale() {
try {
Float scale = new Float(heightScale.getText());
return Math.abs(scale);
} catch (NumberFormatException e) {
return 1;
}
}
} }

@ -31,9 +31,6 @@
*/ */
package com.jme3.gde.terraineditor; package com.jme3.gde.terraineditor;
import com.jme3.asset.AssetManager;
import com.jme3.asset.TextureKey;
import com.jme3.gde.core.scene.SceneApplication;
import com.jme3.terrain.heightmap.AbstractHeightMap; import com.jme3.terrain.heightmap.AbstractHeightMap;
import com.jme3.terrain.heightmap.HillHeightMap; import com.jme3.terrain.heightmap.HillHeightMap;
import com.jme3.terrain.heightmap.ImageBasedHeightMap; import com.jme3.terrain.heightmap.ImageBasedHeightMap;
@ -66,6 +63,7 @@ public class CreateTerrainWizardPanel2 implements WizardDescriptor.Panel {
public Component getComponent() { public Component getComponent() {
if (component == null) { if (component == null) {
component = new CreateTerrainVisualPanel2(); component = new CreateTerrainVisualPanel2();
((CreateTerrainVisualPanel2)component).setWizardPanel(this);
} }
return component; return component;
} }
@ -82,7 +80,7 @@ public class CreateTerrainWizardPanel2 implements WizardDescriptor.Panel {
CreateTerrainVisualPanel2 comp = (CreateTerrainVisualPanel2) getComponent(); CreateTerrainVisualPanel2 comp = (CreateTerrainVisualPanel2) getComponent();
if ("Image Based".equals(comp.getHeightmapTypeComboBox().getSelectedItem())) { if ("Image Based".equals(comp.getHeightmapTypeComboBox().getSelectedItem())) {
//new File(comp.getImageBrowseTextField().getText()) return comp.getImageBrowseTexture() != null;
} }
return true; return true;
@ -104,6 +102,7 @@ public class CreateTerrainWizardPanel2 implements WizardDescriptor.Panel {
synchronized (listeners) { synchronized (listeners) {
listeners.add(l); listeners.add(l);
} }
System.out.println("############ Wizard panel listener added: "+l.toString());
} }
public final void removeChangeListener(ChangeListener l) { public final void removeChangeListener(ChangeListener l) {
synchronized (listeners) { synchronized (listeners) {
@ -135,13 +134,21 @@ public class CreateTerrainWizardPanel2 implements WizardDescriptor.Panel {
CreateTerrainVisualPanel2 comp = (CreateTerrainVisualPanel2) getComponent(); CreateTerrainVisualPanel2 comp = (CreateTerrainVisualPanel2) getComponent();
WizardDescriptor wiz = (WizardDescriptor) settings;
wiz.putProperty("abstractHeightMap", heightmap);
wiz.putProperty("heightMapSmooth", 0f);
if ("Flat".equals(comp.getHeightmapTypeComboBox().getSelectedItem()) ) { if ("Flat".equals(comp.getHeightmapTypeComboBox().getSelectedItem()) ) {
heightmap = new FlatHeightmap(terrainTotalSize); heightmap = new FlatHeightmap(terrainTotalSize);
} }
else if ("Image Based".equals(comp.getHeightmapTypeComboBox().getSelectedItem()) ) { else if ("Image Based".equals(comp.getHeightmapTypeComboBox().getSelectedItem()) ) {
AssetManager assetManager = SceneApplication.getApplication().getAssetManager(); Texture tex = comp.getImageBrowseTexture();
Texture tex = assetManager.loadTexture(new TextureKey(comp.getImageBrowseTextField().getText())); float heightScale = comp.getHeightScale();
heightmap = new ImageBasedHeightMap(tex.getImage()); if (tex != null) {
heightmap = new ImageBasedHeightMap(tex.getImage(), heightScale);
Float smooth = comp.getSmoothEffect();
wiz.putProperty("heightMapSmooth", smooth);
}
} }
else if ("Hill".equals(comp.getHeightmapTypeComboBox().getSelectedItem()) ) { else if ("Hill".equals(comp.getHeightmapTypeComboBox().getSelectedItem()) ) {
int iterations = new Integer(comp.getHillIterationsTextField().getText()); int iterations = new Integer(comp.getHillIterationsTextField().getText());
@ -155,7 +162,6 @@ public class CreateTerrainWizardPanel2 implements WizardDescriptor.Panel {
} }
} }
WizardDescriptor wiz = (WizardDescriptor) settings;
wiz.putProperty("abstractHeightMap", heightmap);
} }
} }

@ -306,9 +306,8 @@
</Component> </Component>
<Component class="javax.swing.JSlider" name="radiusSlider"> <Component class="javax.swing.JSlider" name="radiusSlider">
<Properties> <Properties>
<Property name="majorTickSpacing" type="int" value="5"/> <Property name="majorTickSpacing" type="int" value="10"/>
<Property name="maximum" type="int" value="20"/> <Property name="minorTickSpacing" type="int" value="5"/>
<Property name="minorTickSpacing" type="int" value="1"/>
<Property name="paintTicks" type="boolean" value="true"/> <Property name="paintTicks" type="boolean" value="true"/>
<Property name="snapToTicks" type="boolean" value="true"/> <Property name="snapToTicks" type="boolean" value="true"/>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">

@ -412,9 +412,8 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce
org.openide.awt.Mnemonics.setLocalizedText(radiusLabel, org.openide.util.NbBundle.getMessage(TerrainEditorTopComponent.class, "TerrainEditorTopComponent.radiusLabel.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(radiusLabel, org.openide.util.NbBundle.getMessage(TerrainEditorTopComponent.class, "TerrainEditorTopComponent.radiusLabel.text")); // NOI18N
jToolBar1.add(radiusLabel); jToolBar1.add(radiusLabel);
radiusSlider.setMajorTickSpacing(5); radiusSlider.setMajorTickSpacing(10);
radiusSlider.setMaximum(20); radiusSlider.setMinorTickSpacing(5);
radiusSlider.setMinorTickSpacing(1);
radiusSlider.setPaintTicks(true); radiusSlider.setPaintTicks(true);
radiusSlider.setSnapToTicks(true); radiusSlider.setSnapToTicks(true);
radiusSlider.setToolTipText(org.openide.util.NbBundle.getMessage(TerrainEditorTopComponent.class, "TerrainEditorTopComponent.radiusSlider.toolTipText")); // NOI18N radiusSlider.setToolTipText(org.openide.util.NbBundle.getMessage(TerrainEditorTopComponent.class, "TerrainEditorTopComponent.radiusSlider.toolTipText")); // NOI18N

@ -38,10 +38,11 @@
</not> </not>
</condition> </condition>
</fail> </fail>
<fail message="Cannot find NetBeans build harness. ${line.separator}Check that nbplatform.${nbplatform.active}.netbeans.dest.dir and nbplatform.${nbplatform.active}.harness.dir are defined. ${line.separator}On a developer machine these are normally defined in ${user.properties.file}=${netbeans.user}/build.properties ${line.separator}but for automated builds you should pass these properties to Ant explicitly."> <ant antfile="nbproject/platform.xml"/>
<fail message="Cannot find NetBeans build harness. ${line.separator}Check that nbplatform.${nbplatform.active}.netbeans.dest.dir and nbplatform.${nbplatform.active}.harness.dir are defined. ${line.separator}On a developer machine these are normally defined in ${user.properties.file}=${netbeans.user}/build.properties ${line.separator}but for automated builds you should pass these properties to Ant explicitly. ${line.separator}You may instead download the harness and platform: -Dbootstrap.url=.../tasks.jar -Dautoupdate.catalog.url=.../updates.xml">
<condition> <condition>
<not> <not>
<available type="dir" file="${harness.dir}"/> <available file="${harness.dir}/suite.xml"/>
</not> </not>
</condition> </condition>
</fail> </fail>

@ -4,5 +4,8 @@ build.xml.stylesheet.CRC32=531c622b@1.31.1.7
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=cbef27ca nbproject/build-impl.xml.data.CRC32=cbef27ca
nbproject/build-impl.xml.script.CRC32=ce1d717c nbproject/build-impl.xml.script.CRC32=6de91798
nbproject/build-impl.xml.stylesheet.CRC32=183e6ef3@1.42.2 nbproject/build-impl.xml.stylesheet.CRC32=0f381476@2.47.1
nbproject/platform.xml.data.CRC32=cbef27ca
nbproject/platform.xml.script.CRC32=db9e1f43
nbproject/platform.xml.stylesheet.CRC32=df8ac4dd@2.47.1

Loading…
Cancel
Save