- Made toggle buttons instead of check boxes for Snap to grid/scene, select terrain
- Added a Select Geometries toggle

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9648 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
rem..om 12 years ago
parent 9179c9e401
commit 32152741cc
  1. 14
      sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/Bundle.properties
  2. 11
      sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/SceneComposerToolController.java
  3. 149
      sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/SceneComposerTopComponent.form
  4. 139
      sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/SceneComposerTopComponent.java
  5. BIN
      sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/selectGeometry.png
  6. BIN
      sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/selectTerrain.png
  7. BIN
      sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/snapGrid.png
  8. BIN
      sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/snapScene.png
  9. 2
      sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/tools/SelectTool.java

@ -55,9 +55,11 @@ SceneComposerTopComponent.jButton2.text=
SceneComposerTopComponent.jButton3.text=
SceneComposerTopComponent.jButton2.toolTipText=start the physics simulation and add all objects to the physics space
SceneComposerTopComponent.jButton3.toolTipText=stop the physics simulation and remove all objects from the physics space
SceneComposerTopComponent.snapToSceneCheckbox.text=Snap to Scene
SceneComposerTopComponent.snapToGridCheckbox.text=Snap to Grid
SceneComposerTopComponent.snapToGridCheckbox.toolTipText=Moving an object will snap to the unit grid coordinates
SceneComposerTopComponent.snapToSceneCheckbox.toolTipText=When moving an object, it will snap to whatever is under the mouse
SceneComposerTopComponent.selectTerrainCheckbox.text=Select Terrain
SceneComposerTopComponent.selectTerrainCheckbox.toolTipText=If selected, terrain can be selected, otherwise it will be ignored by the mouse
SceneComposerTopComponent.jToggleScene.text=
SceneComposerTopComponent.jToggleGrid.text=
SceneComposerTopComponent.jToggleSelectGeom.text=
SceneComposerTopComponent.jToggleSelectTerrain.text=
SceneComposerTopComponent.jToggleScene.toolTipText=Snap to Scene
SceneComposerTopComponent.jToggleGrid.toolTipText=Snap to Grid
SceneComposerTopComponent.jToggleSelectGeom.toolTipText=Select Geometries
SceneComposerTopComponent.jToggleSelectTerrain.toolTipText=Select Terrain

@ -50,6 +50,7 @@ public class SceneComposerToolController extends SceneToolController {
private boolean snapToGrid = false;
private boolean snapToScene = false;
private boolean selectTerrain = false;
private boolean selectGeometries = false;
public SceneComposerToolController(final Node toolsNode, AssetManager manager, JmeNode rootNode) {
super(toolsNode, manager);
@ -326,6 +327,16 @@ public class SceneComposerToolController extends SceneToolController {
this.selectTerrain = selectTerrain;
}
public boolean isSelectGeometries() {
return selectGeometries;
}
public void setSelectGeometries(boolean selectGeometries) {
this.selectGeometries = selectGeometries;
}
/**
* A marker on the screen that shows where a point light or
* a spot light is. This marker is not part of the scene,

@ -399,6 +399,86 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton3ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JToolBar$Separator" name="jSeparator7">
</Component>
<Component class="javax.swing.JToggleButton" name="jToggleScene">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/jme3/gde/scenecomposer/snapScene.png"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jme3/gde/scenecomposer/Bundle.properties" key="SceneComposerTopComponent.jToggleScene.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jme3/gde/scenecomposer/Bundle.properties" key="SceneComposerTopComponent.jToggleScene.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="focusable" type="boolean" value="false"/>
<Property name="horizontalTextPosition" type="int" value="0"/>
<Property name="verticalTextPosition" type="int" value="3"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jToggleSceneActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JToggleButton" name="jToggleGrid">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/jme3/gde/scenecomposer/snapGrid.png"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jme3/gde/scenecomposer/Bundle.properties" key="SceneComposerTopComponent.jToggleGrid.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jme3/gde/scenecomposer/Bundle.properties" key="SceneComposerTopComponent.jToggleGrid.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="focusable" type="boolean" value="false"/>
<Property name="horizontalTextPosition" type="int" value="0"/>
<Property name="verticalTextPosition" type="int" value="3"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jToggleGridActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JToolBar$Separator" name="jSeparator8">
</Component>
<Component class="javax.swing.JToggleButton" name="jToggleSelectGeom">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/jme3/gde/scenecomposer/selectGeometry.png"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jme3/gde/scenecomposer/Bundle.properties" key="SceneComposerTopComponent.jToggleSelectGeom.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jme3/gde/scenecomposer/Bundle.properties" key="SceneComposerTopComponent.jToggleSelectGeom.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="focusable" type="boolean" value="false"/>
<Property name="horizontalTextPosition" type="int" value="0"/>
<Property name="verticalTextPosition" type="int" value="3"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jToggleSelectGeomActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JToggleButton" name="jToggleSelectTerrain">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/jme3/gde/scenecomposer/selectTerrain.png"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jme3/gde/scenecomposer/Bundle.properties" key="SceneComposerTopComponent.jToggleSelectTerrain.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jme3/gde/scenecomposer/Bundle.properties" key="SceneComposerTopComponent.jToggleSelectTerrain.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="focusable" type="boolean" value="false"/>
<Property name="horizontalTextPosition" type="int" value="0"/>
<Property name="verticalTextPosition" type="int" value="3"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jToggleSelectTerrainActionPerformed"/>
</Events>
</Component>
<Container class="javax.swing.JPanel" name="jPanel3">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
@ -409,7 +489,7 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="272" max="32767" attributes="0"/>
<EmptySpace min="0" pref="168" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
@ -446,22 +526,11 @@
<Component id="jSeparator6" alignment="0" pref="357" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="10" pref="10" max="10" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="snapToSceneCheckbox" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="snapToGridCheckbox" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="selectTerrainCheckbox" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="emitButton" pref="302" max="32767" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
@ -479,13 +548,7 @@
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="emitButton" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="snapToSceneCheckbox" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="snapToGridCheckbox" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="selectTerrainCheckbox" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="15" max="32767" attributes="0"/>
<EmptySpace pref="40" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -618,54 +681,6 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="emitButtonActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JCheckBox" name="snapToSceneCheckbox">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="cc" green="cc" red="cc" type="rgb"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jme3/gde/scenecomposer/Bundle.properties" key="SceneComposerTopComponent.snapToSceneCheckbox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jme3/gde/scenecomposer/Bundle.properties" key="SceneComposerTopComponent.snapToSceneCheckbox.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="snapToSceneCheckboxActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JCheckBox" name="snapToGridCheckbox">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="cc" green="cc" red="cc" type="rgb"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jme3/gde/scenecomposer/Bundle.properties" key="SceneComposerTopComponent.snapToGridCheckbox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jme3/gde/scenecomposer/Bundle.properties" key="SceneComposerTopComponent.snapToGridCheckbox.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="snapToGridCheckboxActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JCheckBox" name="selectTerrainCheckbox">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="cc" green="cc" red="cc" type="rgb"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jme3/gde/scenecomposer/Bundle.properties" key="SceneComposerTopComponent.selectTerrainCheckbox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jme3/gde/scenecomposer/Bundle.properties" key="SceneComposerTopComponent.selectTerrainCheckbox.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="selectTerrainCheckboxActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>

@ -117,6 +117,12 @@ public final class SceneComposerTopComponent extends TopComponent implements Sce
jLabel6 = new javax.swing.JLabel();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jSeparator7 = new javax.swing.JToolBar.Separator();
jToggleScene = new javax.swing.JToggleButton();
jToggleGrid = new javax.swing.JToggleButton();
jSeparator8 = new javax.swing.JToolBar.Separator();
jToggleSelectGeom = new javax.swing.JToggleButton();
jToggleSelectTerrain = new javax.swing.JToggleButton();
jPanel3 = new javax.swing.JPanel();
jPanel4 = new javax.swing.JPanel();
jToolBar2 = new javax.swing.JToolBar();
@ -132,9 +138,6 @@ public final class SceneComposerTopComponent extends TopComponent implements Sce
jSeparator6 = new javax.swing.JSeparator();
jLabel5 = new javax.swing.JLabel();
emitButton = new javax.swing.JButton();
snapToSceneCheckbox = new javax.swing.JCheckBox();
snapToGridCheckbox = new javax.swing.JCheckBox();
selectTerrainCheckbox = new javax.swing.JCheckBox();
setBackground(new java.awt.Color(204, 204, 204));
@ -346,6 +349,60 @@ public final class SceneComposerTopComponent extends TopComponent implements Sce
}
});
jToolBar1.add(jButton3);
jToolBar1.add(jSeparator7);
jToggleScene.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/scenecomposer/snapScene.png"))); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(jToggleScene, org.openide.util.NbBundle.getMessage(SceneComposerTopComponent.class, "SceneComposerTopComponent.jToggleScene.text")); // NOI18N
jToggleScene.setToolTipText(org.openide.util.NbBundle.getMessage(SceneComposerTopComponent.class, "SceneComposerTopComponent.jToggleScene.toolTipText")); // NOI18N
jToggleScene.setFocusable(false);
jToggleScene.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
jToggleScene.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
jToggleScene.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jToggleSceneActionPerformed(evt);
}
});
jToolBar1.add(jToggleScene);
jToggleGrid.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/scenecomposer/snapGrid.png"))); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(jToggleGrid, org.openide.util.NbBundle.getMessage(SceneComposerTopComponent.class, "SceneComposerTopComponent.jToggleGrid.text")); // NOI18N
jToggleGrid.setToolTipText(org.openide.util.NbBundle.getMessage(SceneComposerTopComponent.class, "SceneComposerTopComponent.jToggleGrid.toolTipText")); // NOI18N
jToggleGrid.setFocusable(false);
jToggleGrid.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
jToggleGrid.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
jToggleGrid.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jToggleGridActionPerformed(evt);
}
});
jToolBar1.add(jToggleGrid);
jToolBar1.add(jSeparator8);
jToggleSelectGeom.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/scenecomposer/selectGeometry.png"))); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(jToggleSelectGeom, org.openide.util.NbBundle.getMessage(SceneComposerTopComponent.class, "SceneComposerTopComponent.jToggleSelectGeom.text")); // NOI18N
jToggleSelectGeom.setToolTipText(org.openide.util.NbBundle.getMessage(SceneComposerTopComponent.class, "SceneComposerTopComponent.jToggleSelectGeom.toolTipText")); // NOI18N
jToggleSelectGeom.setFocusable(false);
jToggleSelectGeom.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
jToggleSelectGeom.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
jToggleSelectGeom.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jToggleSelectGeomActionPerformed(evt);
}
});
jToolBar1.add(jToggleSelectGeom);
jToggleSelectTerrain.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/scenecomposer/selectTerrain.png"))); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(jToggleSelectTerrain, org.openide.util.NbBundle.getMessage(SceneComposerTopComponent.class, "SceneComposerTopComponent.jToggleSelectTerrain.text")); // NOI18N
jToggleSelectTerrain.setToolTipText(org.openide.util.NbBundle.getMessage(SceneComposerTopComponent.class, "SceneComposerTopComponent.jToggleSelectTerrain.toolTipText")); // NOI18N
jToggleSelectTerrain.setFocusable(false);
jToggleSelectTerrain.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
jToggleSelectTerrain.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
jToggleSelectTerrain.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jToggleSelectTerrainActionPerformed(evt);
}
});
jToolBar1.add(jToggleSelectTerrain);
jPanel3.setBackground(new java.awt.Color(204, 204, 204));
@ -353,7 +410,7 @@ public final class SceneComposerTopComponent extends TopComponent implements Sce
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 272, Short.MAX_VALUE)
.addGap(0, 168, Short.MAX_VALUE)
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -424,33 +481,6 @@ public final class SceneComposerTopComponent extends TopComponent implements Sce
}
});
snapToSceneCheckbox.setBackground(new java.awt.Color(204, 204, 204));
org.openide.awt.Mnemonics.setLocalizedText(snapToSceneCheckbox, org.openide.util.NbBundle.getMessage(SceneComposerTopComponent.class, "SceneComposerTopComponent.snapToSceneCheckbox.text")); // NOI18N
snapToSceneCheckbox.setToolTipText(org.openide.util.NbBundle.getMessage(SceneComposerTopComponent.class, "SceneComposerTopComponent.snapToSceneCheckbox.toolTipText")); // NOI18N
snapToSceneCheckbox.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
snapToSceneCheckboxActionPerformed(evt);
}
});
snapToGridCheckbox.setBackground(new java.awt.Color(204, 204, 204));
org.openide.awt.Mnemonics.setLocalizedText(snapToGridCheckbox, org.openide.util.NbBundle.getMessage(SceneComposerTopComponent.class, "SceneComposerTopComponent.snapToGridCheckbox.text")); // NOI18N
snapToGridCheckbox.setToolTipText(org.openide.util.NbBundle.getMessage(SceneComposerTopComponent.class, "SceneComposerTopComponent.snapToGridCheckbox.toolTipText")); // NOI18N
snapToGridCheckbox.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
snapToGridCheckboxActionPerformed(evt);
}
});
selectTerrainCheckbox.setBackground(new java.awt.Color(204, 204, 204));
org.openide.awt.Mnemonics.setLocalizedText(selectTerrainCheckbox, org.openide.util.NbBundle.getMessage(SceneComposerTopComponent.class, "SceneComposerTopComponent.selectTerrainCheckbox.text")); // NOI18N
selectTerrainCheckbox.setToolTipText(org.openide.util.NbBundle.getMessage(SceneComposerTopComponent.class, "SceneComposerTopComponent.selectTerrainCheckbox.toolTipText")); // NOI18N
selectTerrainCheckbox.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
selectTerrainCheckboxActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
jPanel4.setLayout(jPanel4Layout);
jPanel4Layout.setHorizontalGroup(
@ -463,17 +493,9 @@ public final class SceneComposerTopComponent extends TopComponent implements Sce
.addComponent(jSeparator6, javax.swing.GroupLayout.DEFAULT_SIZE, 357, Short.MAX_VALUE)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGap(10, 10, 10)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addComponent(snapToSceneCheckbox)
.addGap(18, 18, 18)
.addComponent(snapToGridCheckbox)
.addGap(18, 18, 18)
.addComponent(selectTerrainCheckbox))
.addGroup(jPanel4Layout.createSequentialGroup()
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(emitButton, javax.swing.GroupLayout.DEFAULT_SIZE, 302, Short.MAX_VALUE)))))
.addComponent(emitButton, javax.swing.GroupLayout.DEFAULT_SIZE, 302, Short.MAX_VALUE)))
.addContainerGap())
);
jPanel4Layout.setVerticalGroup(
@ -488,12 +510,7 @@ public final class SceneComposerTopComponent extends TopComponent implements Sce
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(emitButton))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(snapToSceneCheckbox)
.addComponent(snapToGridCheckbox)
.addComponent(selectTerrainCheckbox))
.addContainerGap(15, Short.MAX_VALUE))
.addContainerGap(40, Short.MAX_VALUE))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
@ -615,18 +632,21 @@ private void scaleButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-F
toolController.showEditTool(tool);
}//GEN-LAST:event_rotateButtonActionPerformed
private void snapToSceneCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_snapToSceneCheckboxActionPerformed
toolController.setSnapToScene(snapToSceneCheckbox.isSelected());
}//GEN-LAST:event_snapToSceneCheckboxActionPerformed
private void jToggleSceneActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleSceneActionPerformed
toolController.setSnapToScene(jToggleScene.isSelected());
}//GEN-LAST:event_jToggleSceneActionPerformed
private void snapToGridCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_snapToGridCheckboxActionPerformed
toolController.setSnapToGrid(snapToGridCheckbox.isSelected());
}//GEN-LAST:event_snapToGridCheckboxActionPerformed
private void jToggleGridActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleGridActionPerformed
toolController.setSnapToGrid(jToggleGrid.isSelected());
}//GEN-LAST:event_jToggleGridActionPerformed
private void selectTerrainCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_selectTerrainCheckboxActionPerformed
toolController.setSelectTerrain(selectTerrainCheckbox.isSelected());
}//GEN-LAST:event_selectTerrainCheckboxActionPerformed
private void jToggleSelectTerrainActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleSelectTerrainActionPerformed
toolController.setSelectTerrain(jToggleSelectTerrain.isSelected());
}//GEN-LAST:event_jToggleSelectTerrainActionPerformed
private void jToggleSelectGeomActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleSelectGeomActionPerformed
toolController.setSelectGeometries(jToggleSelectGeom.isSelected());
}//GEN-LAST:event_jToggleSelectGeomActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton camToCursorSelectionButton;
private javax.swing.JButton createPhysicsMeshButton;
@ -652,7 +672,13 @@ private void scaleButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-F
private javax.swing.JToolBar.Separator jSeparator4;
private javax.swing.JToolBar.Separator jSeparator5;
private javax.swing.JSeparator jSeparator6;
private javax.swing.JToolBar.Separator jSeparator7;
private javax.swing.JToolBar.Separator jSeparator8;
private javax.swing.JTextField jTextField1;
private javax.swing.JToggleButton jToggleGrid;
private javax.swing.JToggleButton jToggleScene;
private javax.swing.JToggleButton jToggleSelectGeom;
private javax.swing.JToggleButton jToggleSelectTerrain;
private javax.swing.JToolBar jToolBar1;
private javax.swing.JToolBar jToolBar2;
private javax.swing.JToolBar jToolBar3;
@ -666,11 +692,8 @@ private void scaleButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-F
private javax.swing.JLabel sceneInfoLabel2;
private javax.swing.JPanel sceneInfoPanel;
private javax.swing.JToggleButton selectButton;
private javax.swing.JCheckBox selectTerrainCheckbox;
private javax.swing.JToggleButton showGridToggleButton;
private javax.swing.JToggleButton showSelectionToggleButton;
private javax.swing.JCheckBox snapToGridCheckbox;
private javax.swing.JCheckBox snapToSceneCheckbox;
private javax.swing.ButtonGroup spatialModButtonGroup;
// End of variables declaration//GEN-END:variables

Binary file not shown.

After

Width:  |  Height:  |  Size: 483 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 732 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 435 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 786 B

@ -454,12 +454,14 @@ public class SelectTool extends SceneEditTool {
} else {
// climb up and find the Model Node (parent) and select that, don't select the geom
if (!toolController.isSelectGeometries()) {
Spatial linkNodeParent = findModelNodeParent(s);
if (linkNodeParent != null) {
s = linkNodeParent;
} else {
return;
}
}
final Spatial selec = s;
selected = selec;
java.awt.EventQueue.invokeLater(new Runnable() {

Loading…
Cancel
Save