From a59339054a92d13c39210f28ff7c629b5d25b362 Mon Sep 17 00:00:00 2001 From: "bre..ns" Date: Tue, 17 Jan 2012 01:36:13 +0000 Subject: [PATCH] moved some of the terrain utils into tool options in the scene explorer git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9080 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../jme3/terrain/geomipmap/TerrainQuad.java | 5 + .../jme3/gde/terraineditor/Bundle.properties | 4 - .../TerrainEditorTopComponent.form | 95 ++++++------------- .../TerrainEditorTopComponent.java | 84 +++++----------- 4 files changed, 54 insertions(+), 134 deletions(-) diff --git a/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainQuad.java b/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainQuad.java index 567edde02..0b9b21845 100644 --- a/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainQuad.java +++ b/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainQuad.java @@ -351,6 +351,11 @@ public class TerrainQuad extends Node implements Terrain { return 0; } + /** + * Generate the entropy values for the terrain for the "perspective" LOD + * calculator. This routine can take a long time to run! + * @param progressMonitor optional + */ public void generateEntropy(ProgressMonitor progressMonitor) { // only check this on the root quad if (isRootQuad()) 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 0176905f0..87ca6b029 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 @@ -60,10 +60,7 @@ TerrainEditorTopComponent.smoothTerrainButton.actionCommand=Smooth TerrainEditorTopComponent.roughTerrainButton.toolTipText=Rough terrain (not implemented) TerrainEditorTopComponent.roughTerrainButton.actionCommand=Rough TerrainEditorTopComponent.createTerrainButton.toolTipText=Add Terrain -TerrainEditorTopComponent.genEntropiesButton.toolTipText=Pre-calculate the terrain entropy values. This will improve launch startup time -TerrainEditorTopComponent.genEntropiesButton.text=Generate Entropies TerrainEditorTopComponent.hintPanel.border.title=Hints -TerrainEditorTopComponent.terrainOpsPanel.border.title=Terrain Operations TerrainEditorTopComponent.toolSettingsPanel.border.title=Tool Settings TerrainEditorTopComponent.jTable1.columnModel.title3=Title 4 TerrainEditorTopComponent.jTable1.columnModel.title2=Title 3 @@ -97,7 +94,6 @@ 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 -TerrainEditorTopComponent.jButton1.text=Create Skybox TerrainEditorTopComponent.levelTerrainButton.text= TerrainEditorTopComponent.levelTerrainButton.toolTipText=Level terrain 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 4f8bd6483..c209e4416 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 @@ -13,7 +13,7 @@ - + @@ -24,6 +24,11 @@ + + + + + @@ -44,8 +49,6 @@ - - @@ -62,7 +65,6 @@ - @@ -77,6 +79,7 @@ + @@ -92,6 +95,7 @@ + @@ -223,6 +227,7 @@ + @@ -240,6 +245,7 @@ + @@ -309,6 +315,7 @@ + @@ -326,6 +333,7 @@ + @@ -336,17 +344,21 @@ + + + + - + - + @@ -365,6 +377,7 @@ + @@ -377,6 +390,7 @@ + @@ -472,6 +486,7 @@ + @@ -489,7 +504,7 @@ - + @@ -546,64 +561,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -616,6 +573,7 @@ + @@ -625,7 +583,7 @@ - + @@ -708,17 +666,18 @@ + - + - + diff --git a/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainEditorTopComponent.java b/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainEditorTopComponent.java index 67b3d1451..194fe2807 100644 --- a/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainEditorTopComponent.java +++ b/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainEditorTopComponent.java @@ -260,9 +260,6 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce textureTable = new javax.swing.JTable(); remainingTexTitleLabel = new javax.swing.JLabel(); remainingTexturesLabel = new javax.swing.JLabel(); - terrainOpsPanel = new javax.swing.JPanel(); - genEntropiesButton = new javax.swing.JButton(); - jButton1 = new javax.swing.JButton(); jPanel2 = new javax.swing.JPanel(); wardIsoCheckBox = new javax.swing.JCheckBox(); shininessField = new javax.swing.JTextField(); @@ -273,17 +270,21 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce hintTextArea = new javax.swing.JTextArea(); textureFileChooser.setApproveButtonText(org.openide.util.NbBundle.getMessage(TerrainEditorTopComponent.class, "TerrainEditorTopComponent.textureFileChooser.approveButtonText_1")); // NOI18N - textureFileChooser.setCurrentDirectory(new java.io.File("/Assets/Textures")); + textureFileChooser.setCurrentDirectory(new java.io.File("C:\\Assets\\Textures")); textureFileChooser.setDialogTitle(org.openide.util.NbBundle.getMessage(TerrainEditorTopComponent.class, "TerrainEditorTopComponent.textureFileChooser.dialogTitle_1")); // NOI18N textureFileChooser.setFileFilter(new ImageFilter()); + setBackground(java.awt.Color.gray); + jToolBar1.setBackground(new java.awt.Color(204, 204, 204)); jToolBar1.setFloatable(false); jToolBar1.setRollover(true); + jToolBar1.setOpaque(false); createTerrainButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/terraineditor/icon_terrain-new.png"))); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(createTerrainButton, org.openide.util.NbBundle.getMessage(TerrainEditorTopComponent.class, "TerrainEditorTopComponent.createTerrainButton.text")); // NOI18N createTerrainButton.setToolTipText(org.openide.util.NbBundle.getMessage(TerrainEditorTopComponent.class, "TerrainEditorTopComponent.createTerrainButton.toolTipText")); // NOI18N + createTerrainButton.setOpaque(false); createTerrainButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { createTerrainButtonActionPerformed(evt); @@ -359,6 +360,7 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce org.openide.awt.Mnemonics.setLocalizedText(addTextureButton, org.openide.util.NbBundle.getMessage(TerrainEditorTopComponent.class, "TerrainEditorTopComponent.addTextureButton.text")); // NOI18N addTextureButton.setToolTipText(org.openide.util.NbBundle.getMessage(TerrainEditorTopComponent.class, "TerrainEditorTopComponent.addTextureButton.toolTipText")); // NOI18N addTextureButton.setBorderPainted(false); + addTextureButton.setOpaque(false); addTextureButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { addTextureButtonActionPerformed(evt); @@ -370,6 +372,7 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce org.openide.awt.Mnemonics.setLocalizedText(removeTextureButton, org.openide.util.NbBundle.getMessage(TerrainEditorTopComponent.class, "TerrainEditorTopComponent.removeTextureButton.text")); // NOI18N removeTextureButton.setToolTipText(org.openide.util.NbBundle.getMessage(TerrainEditorTopComponent.class, "TerrainEditorTopComponent.removeTextureButton.toolTipText")); // NOI18N removeTextureButton.setBorderPainted(false); + removeTextureButton.setOpaque(false); removeTextureButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { removeTextureButtonActionPerformed(evt); @@ -416,6 +419,7 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce radiusSlider.setSnapToTicks(true); radiusSlider.setToolTipText(org.openide.util.NbBundle.getMessage(TerrainEditorTopComponent.class, "TerrainEditorTopComponent.radiusSlider.toolTipText")); // NOI18N radiusSlider.setValue(5); + radiusSlider.setOpaque(false); radiusSlider.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { radiusSliderStateChanged(evt); @@ -429,6 +433,7 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce heightSlider.setMajorTickSpacing(20); heightSlider.setMaximum(200); heightSlider.setPaintTicks(true); + heightSlider.setOpaque(false); heightSlider.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { heightSliderStateChanged(evt); @@ -437,25 +442,29 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce jToolBar1.add(heightSlider); jPanel3.setBackground(new java.awt.Color(204, 204, 204)); + jPanel3.setForeground(new java.awt.Color(240, 240, 240)); + jPanel3.setOpaque(false); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 0, Short.MAX_VALUE) + .addGap(0, 57, Short.MAX_VALUE) ); jPanel3Layout.setVerticalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 23, Short.MAX_VALUE) + .addGap(0, 25, Short.MAX_VALUE) ); jToolBar1.add(jPanel3); toolSettingsPanel.setBackground(new java.awt.Color(204, 204, 204)); toolSettingsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(TerrainEditorTopComponent.class, "TerrainEditorTopComponent.toolSettingsPanel.border.title"))); // NOI18N + toolSettingsPanel.setOpaque(false); toolSettingsPanel.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 0, 0)); fractalBrushPanel.setBackground(new java.awt.Color(204, 204, 204)); + fractalBrushPanel.setOpaque(false); fractalBrushPanel.setLayout(new java.awt.GridLayout(3, 2)); org.openide.awt.Mnemonics.setLocalizedText(jLabel3, org.openide.util.NbBundle.getMessage(TerrainEditorTopComponent.class, "TerrainEditorTopComponent.jLabel3.text")); // NOI18N @@ -516,6 +525,7 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce paintingPanel.setBackground(new java.awt.Color(204, 204, 204)); paintingPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(TerrainEditorTopComponent.class, "TerrainEditorTopComponent.paintingPanel.border.title"))); // NOI18N + paintingPanel.setOpaque(false); textureTable.setModel(new TextureTableModel()); textureTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF); @@ -544,49 +554,16 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce paintingPanelLayout.setVerticalGroup( paintingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, paintingPanelLayout.createSequentialGroup() - .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 76, Short.MAX_VALUE) + .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 81, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(paintingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(remainingTexTitleLabel) .addComponent(remainingTexturesLabel))) ); - terrainOpsPanel.setBackground(new java.awt.Color(204, 204, 204)); - terrainOpsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(TerrainEditorTopComponent.class, "TerrainEditorTopComponent.terrainOpsPanel.border.title"))); // NOI18N - - org.openide.awt.Mnemonics.setLocalizedText(genEntropiesButton, org.openide.util.NbBundle.getMessage(TerrainEditorTopComponent.class, "TerrainEditorTopComponent.genEntropiesButton.text")); // NOI18N - genEntropiesButton.setToolTipText(org.openide.util.NbBundle.getMessage(TerrainEditorTopComponent.class, "TerrainEditorTopComponent.genEntropiesButton.toolTipText")); // NOI18N - genEntropiesButton.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - genEntropiesButtonActionPerformed(evt); - } - }); - - org.openide.awt.Mnemonics.setLocalizedText(jButton1, org.openide.util.NbBundle.getMessage(TerrainEditorTopComponent.class, "TerrainEditorTopComponent.jButton1.text")); // NOI18N - jButton1.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - jButton1ActionPerformed(evt); - } - }); - - javax.swing.GroupLayout terrainOpsPanelLayout = new javax.swing.GroupLayout(terrainOpsPanel); - terrainOpsPanel.setLayout(terrainOpsPanelLayout); - terrainOpsPanelLayout.setHorizontalGroup( - terrainOpsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(genEntropiesButton) - .addComponent(jButton1) - ); - terrainOpsPanelLayout.setVerticalGroup( - terrainOpsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(terrainOpsPanelLayout.createSequentialGroup() - .addComponent(genEntropiesButton) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jButton1) - .addContainerGap(38, Short.MAX_VALUE)) - ); - jPanel2.setBackground(new java.awt.Color(204, 204, 204)); jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(TerrainEditorTopComponent.class, "TerrainEditorTopComponent.jPanel2.border.title"))); // NOI18N + jPanel2.setOpaque(false); org.openide.awt.Mnemonics.setLocalizedText(wardIsoCheckBox, org.openide.util.NbBundle.getMessage(TerrainEditorTopComponent.class, "TerrainEditorTopComponent.wardIsoCheckBox.text")); // NOI18N wardIsoCheckBox.addActionListener(new java.awt.event.ActionListener() { @@ -627,7 +604,7 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(shininessField, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 66, Short.MAX_VALUE)) .addComponent(triPlanarCheckBox, javax.swing.GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE) ); jPanel2Layout.setVerticalGroup( @@ -645,6 +622,7 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce hintPanel.setBackground(new java.awt.Color(204, 204, 204)); hintPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(TerrainEditorTopComponent.class, "TerrainEditorTopComponent.hintPanel.border.title"))); // NOI18N + hintPanel.setOpaque(false); hintTextArea.setColumns(20); hintTextArea.setEditable(false); @@ -660,11 +638,11 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce hintPanel.setLayout(hintPanelLayout); hintPanelLayout.setHorizontalGroup( hintPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 88, Short.MAX_VALUE) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 244, Short.MAX_VALUE) ); hintPanelLayout.setVerticalGroup( hintPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 101, Short.MAX_VALUE) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); @@ -676,8 +654,6 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(paintingPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(terrainOpsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(hintPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) @@ -692,7 +668,6 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce .addComponent(hintPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(paintingPanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(toolSettingsPanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 128, Short.MAX_VALUE) - .addComponent(terrainOpsPanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, 128, Short.MAX_VALUE))) ); }// //GEN-END:initComponents @@ -726,14 +701,6 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce } }//GEN-LAST:event_lowerTerrainButtonActionPerformed - private void genEntropiesButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_genEntropiesButtonActionPerformed - if (editorController != null) { - setHintText("Run entropy generation when you are finished modifying the terrain's height. It is a slow process but required for some LOD operations."); - EntropyCalcProgressMonitor monitor = new EntropyCalcProgressMonitor(); - editorController.generateEntropies(monitor); - } - }//GEN-LAST:event_genEntropiesButtonActionPerformed - private void paintButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_paintButtonActionPerformed if (paintButton.isSelected()) { PaintTerrainTool tool = new PaintTerrainTool(); @@ -803,10 +770,6 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce } }//GEN-LAST:event_triPlanarCheckBoxActionPerformed - private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed - addSpatial("Skybox"); - }//GEN-LAST:event_jButton1ActionPerformed - private void levelTerrainButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_levelTerrainButtonActionPerformed if (levelTerrainButton.isSelected()) { LevelTerrainTool tool = new LevelTerrainTool(); @@ -903,12 +866,10 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce private javax.swing.JButton createTerrainButton; private javax.swing.JToggleButton eraseButton; private javax.swing.JPanel fractalBrushPanel; - private javax.swing.JButton genEntropiesButton; private javax.swing.JLabel heightLabel; private javax.swing.JSlider heightSlider; private javax.swing.JPanel hintPanel; private javax.swing.JTextArea hintTextArea; - private javax.swing.JButton jButton1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; @@ -938,7 +899,6 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce private javax.swing.JTextField shininessField; private javax.swing.JToggleButton smoothTerrainButton; private javax.swing.ButtonGroup terrainModButtonGroup; - private javax.swing.JPanel terrainOpsPanel; private javax.swing.JFileChooser textureFileChooser; private javax.swing.JTable textureTable; private javax.swing.JPanel toolSettingsPanel;