- improved ModelImporter with failed assets list, better workflow and lots of information and help based on import results git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9470 75d07b2b-3a1a-0410-a2c5-0572b91ccdca3.0
parent
d54451f334
commit
1f4e666955
@ -0,0 +1,237 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||||
|
|
||||||
|
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> |
||||||
|
<AuxValues> |
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/> |
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> |
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> |
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/> |
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/> |
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> |
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> |
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> |
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> |
||||||
|
</AuxValues> |
||||||
|
|
||||||
|
<Layout> |
||||||
|
<DimensionLayout dim="0"> |
||||||
|
<Group type="103" groupAlignment="0" attributes="0"> |
||||||
|
<Group type="102" attributes="0"> |
||||||
|
<Group type="103" groupAlignment="0" attributes="0"> |
||||||
|
<Group type="102" attributes="0"> |
||||||
|
<Group type="103" groupAlignment="1" max="-2" attributes="0"> |
||||||
|
<Component id="jToolBar1" alignment="1" max="32767" attributes="1"/> |
||||||
|
<Component id="jPanel1" alignment="1" min="-2" pref="320" max="-2" attributes="1"/> |
||||||
|
</Group> |
||||||
|
<EmptySpace max="-2" attributes="0"/> |
||||||
|
<Group type="103" groupAlignment="0" attributes="0"> |
||||||
|
<Component id="jScrollPane2" max="32767" attributes="0"/> |
||||||
|
<Component id="jLabel1" max="32767" attributes="0"/> |
||||||
|
<Component id="jScrollPane3" alignment="0" pref="0" max="32767" attributes="0"/> |
||||||
|
<Component id="jLabel2" alignment="1" pref="168" max="32767" attributes="0"/> |
||||||
|
</Group> |
||||||
|
</Group> |
||||||
|
<Group type="102" attributes="0"> |
||||||
|
<EmptySpace max="-2" attributes="0"/> |
||||||
|
<Component id="jScrollPane1" max="32767" attributes="0"/> |
||||||
|
</Group> |
||||||
|
</Group> |
||||||
|
<EmptySpace max="-2" attributes="0"/> |
||||||
|
</Group> |
||||||
|
<Group type="102" alignment="1" attributes="0"> |
||||||
|
<EmptySpace max="-2" attributes="0"/> |
||||||
|
<Component id="statusLabel" max="32767" attributes="0"/> |
||||||
|
</Group> |
||||||
|
</Group> |
||||||
|
</DimensionLayout> |
||||||
|
<DimensionLayout dim="1"> |
||||||
|
<Group type="103" groupAlignment="0" attributes="0"> |
||||||
|
<Group type="102" alignment="0" attributes="0"> |
||||||
|
<Group type="103" groupAlignment="1" max="-2" attributes="0"> |
||||||
|
<Group type="102" attributes="0"> |
||||||
|
<Component id="jLabel1" min="-2" max="-2" attributes="0"/> |
||||||
|
<EmptySpace max="-2" attributes="0"/> |
||||||
|
<Component id="jScrollPane2" min="-2" pref="152" max="-2" attributes="0"/> |
||||||
|
<EmptySpace max="-2" attributes="0"/> |
||||||
|
<Component id="jLabel2" min="-2" max="-2" attributes="0"/> |
||||||
|
<EmptySpace max="-2" attributes="0"/> |
||||||
|
<Component id="jScrollPane3" max="32767" attributes="0"/> |
||||||
|
</Group> |
||||||
|
<Group type="102" attributes="0"> |
||||||
|
<Component id="jPanel1" min="-2" pref="320" max="-2" attributes="1"/> |
||||||
|
<EmptySpace max="-2" attributes="0"/> |
||||||
|
<Component id="jToolBar1" min="-2" pref="22" max="-2" attributes="0"/> |
||||||
|
</Group> |
||||||
|
</Group> |
||||||
|
<EmptySpace max="-2" attributes="0"/> |
||||||
|
<Component id="statusLabel" min="-2" pref="17" max="-2" attributes="0"/> |
||||||
|
<EmptySpace max="-2" attributes="0"/> |
||||||
|
<Component id="jScrollPane1" pref="108" max="32767" attributes="0"/> |
||||||
|
<EmptySpace max="-2" attributes="0"/> |
||||||
|
</Group> |
||||||
|
</Group> |
||||||
|
</DimensionLayout> |
||||||
|
</Layout> |
||||||
|
<SubComponents> |
||||||
|
<Container class="javax.swing.JPanel" name="jPanel1"> |
||||||
|
<Properties> |
||||||
|
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> |
||||||
|
<Dimension value="[320, 320]"/> |
||||||
|
</Property> |
||||||
|
</Properties> |
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout"/> |
||||||
|
</Container> |
||||||
|
<Container class="javax.swing.JToolBar" name="jToolBar1"> |
||||||
|
<Properties> |
||||||
|
<Property name="floatable" type="boolean" value="false"/> |
||||||
|
<Property name="rollover" type="boolean" value="true"/> |
||||||
|
</Properties> |
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout"/> |
||||||
|
<SubComponents> |
||||||
|
<Component class="javax.swing.JButton" name="jButton1"> |
||||||
|
<Properties> |
||||||
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> |
||||||
|
<ResourceString bundle="com/jme3/gde/modelimporter/Bundle.properties" key="ModelImporterVisualPanel3.jButton1.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> |
||||||
|
</Property> |
||||||
|
<Property name="focusable" type="boolean" value="false"/> |
||||||
|
<Property name="horizontalTextPosition" type="int" value="0"/> |
||||||
|
<Property name="verticalTextPosition" type="int" value="3"/> |
||||||
|
</Properties> |
||||||
|
<Events> |
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> |
||||||
|
</Events> |
||||||
|
</Component> |
||||||
|
<Component class="javax.swing.JButton" name="jButton2"> |
||||||
|
<Properties> |
||||||
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> |
||||||
|
<ResourceString bundle="com/jme3/gde/modelimporter/Bundle.properties" key="ModelImporterVisualPanel3.jButton2.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> |
||||||
|
</Property> |
||||||
|
<Property name="focusable" type="boolean" value="false"/> |
||||||
|
<Property name="horizontalTextPosition" type="int" value="0"/> |
||||||
|
<Property name="verticalTextPosition" type="int" value="3"/> |
||||||
|
</Properties> |
||||||
|
<Events> |
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/> |
||||||
|
</Events> |
||||||
|
</Component> |
||||||
|
<Component class="javax.swing.JToolBar$Separator" name="jSeparator1"> |
||||||
|
</Component> |
||||||
|
<Component class="javax.swing.JButton" name="jButton3"> |
||||||
|
<Properties> |
||||||
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> |
||||||
|
<ResourceString bundle="com/jme3/gde/modelimporter/Bundle.properties" key="ModelImporterVisualPanel3.jButton3.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> |
||||||
|
</Property> |
||||||
|
<Property name="focusable" type="boolean" value="false"/> |
||||||
|
<Property name="horizontalTextPosition" type="int" value="0"/> |
||||||
|
<Property name="verticalTextPosition" type="int" value="3"/> |
||||||
|
</Properties> |
||||||
|
<Events> |
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton3ActionPerformed"/> |
||||||
|
</Events> |
||||||
|
</Component> |
||||||
|
<Component class="javax.swing.JButton" name="jButton4"> |
||||||
|
<Properties> |
||||||
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> |
||||||
|
<ResourceString bundle="com/jme3/gde/modelimporter/Bundle.properties" key="ModelImporterVisualPanel3.jButton4.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> |
||||||
|
</Property> |
||||||
|
<Property name="focusable" type="boolean" value="false"/> |
||||||
|
<Property name="horizontalTextPosition" type="int" value="0"/> |
||||||
|
<Property name="verticalTextPosition" type="int" value="3"/> |
||||||
|
</Properties> |
||||||
|
<Events> |
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton4ActionPerformed"/> |
||||||
|
</Events> |
||||||
|
</Component> |
||||||
|
<Container class="javax.swing.JPanel" name="jPanel3"> |
||||||
|
|
||||||
|
<Layout> |
||||||
|
<DimensionLayout dim="0"> |
||||||
|
<Group type="103" groupAlignment="0" attributes="0"> |
||||||
|
<EmptySpace min="0" pref="220" max="32767" attributes="0"/> |
||||||
|
</Group> |
||||||
|
</DimensionLayout> |
||||||
|
<DimensionLayout dim="1"> |
||||||
|
<Group type="103" groupAlignment="0" attributes="0"> |
||||||
|
<EmptySpace min="0" pref="18" max="32767" attributes="0"/> |
||||||
|
</Group> |
||||||
|
</DimensionLayout> |
||||||
|
</Layout> |
||||||
|
</Container> |
||||||
|
</SubComponents> |
||||||
|
</Container> |
||||||
|
<Component class="javax.swing.JLabel" name="jLabel2"> |
||||||
|
<Properties> |
||||||
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> |
||||||
|
<ResourceString bundle="com/jme3/gde/modelimporter/Bundle.properties" key="ModelImporterVisualPanel3.jLabel2.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> |
||||||
|
</Property> |
||||||
|
</Properties> |
||||||
|
</Component> |
||||||
|
<Container class="javax.swing.JScrollPane" name="jScrollPane2"> |
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> |
||||||
|
<SubComponents> |
||||||
|
<Component class="javax.swing.JList" name="jList1"> |
||||||
|
<Properties> |
||||||
|
<Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.editors2.ListModelEditor"> |
||||||
|
<StringArray count="1"> |
||||||
|
<StringItem index="0" value="No assets loaded"/> |
||||||
|
</StringArray> |
||||||
|
</Property> |
||||||
|
</Properties> |
||||||
|
</Component> |
||||||
|
</SubComponents> |
||||||
|
</Container> |
||||||
|
<Container class="javax.swing.JScrollPane" name="jScrollPane3"> |
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> |
||||||
|
<SubComponents> |
||||||
|
<Component class="javax.swing.JList" name="jList2"> |
||||||
|
<Properties> |
||||||
|
<Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.editors2.ListModelEditor"> |
||||||
|
<StringArray count="0"/> |
||||||
|
</Property> |
||||||
|
</Properties> |
||||||
|
</Component> |
||||||
|
</SubComponents> |
||||||
|
</Container> |
||||||
|
<Component class="javax.swing.JLabel" name="statusLabel"> |
||||||
|
<Properties> |
||||||
|
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> |
||||||
|
<Font name="Lucida Grande" size="14" style="1"/> |
||||||
|
</Property> |
||||||
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> |
||||||
|
<ResourceString bundle="com/jme3/gde/modelimporter/Bundle.properties" key="ModelImporterVisualPanel3.statusLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> |
||||||
|
</Property> |
||||||
|
</Properties> |
||||||
|
</Component> |
||||||
|
<Component class="javax.swing.JLabel" name="jLabel1"> |
||||||
|
<Properties> |
||||||
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> |
||||||
|
<ResourceString bundle="com/jme3/gde/modelimporter/Bundle.properties" key="ModelImporterVisualPanel3.jLabel1.text_1" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> |
||||||
|
</Property> |
||||||
|
</Properties> |
||||||
|
</Component> |
||||||
|
<Container class="javax.swing.JScrollPane" name="jScrollPane1"> |
||||||
|
<AuxValues> |
||||||
|
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> |
||||||
|
</AuxValues> |
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> |
||||||
|
<SubComponents> |
||||||
|
<Component class="javax.swing.JTextArea" name="infoTextArea"> |
||||||
|
<Properties> |
||||||
|
<Property name="columns" type="int" value="20"/> |
||||||
|
<Property name="lineWrap" type="boolean" value="true"/> |
||||||
|
<Property name="rows" type="int" value="5"/> |
||||||
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> |
||||||
|
<ResourceString bundle="com/jme3/gde/modelimporter/Bundle.properties" key="ModelImporterVisualPanel3.infoTextArea.text_1" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> |
||||||
|
</Property> |
||||||
|
<Property name="wrapStyleWord" type="boolean" value="true"/> |
||||||
|
</Properties> |
||||||
|
</Component> |
||||||
|
</SubComponents> |
||||||
|
</Container> |
||||||
|
</SubComponents> |
||||||
|
</Form> |
@ -0,0 +1,315 @@ |
|||||||
|
/* |
||||||
|
* To change this template, choose Tools | Templates |
||||||
|
* and open the template in the editor. |
||||||
|
*/ |
||||||
|
package com.jme3.gde.modelimporter; |
||||||
|
|
||||||
|
import com.jme3.asset.AssetKey; |
||||||
|
import com.jme3.gde.core.assets.AssetData; |
||||||
|
import com.jme3.gde.core.assets.ProjectAssetManager; |
||||||
|
import com.jme3.gde.core.scene.OffScenePanel; |
||||||
|
import com.jme3.math.Vector3f; |
||||||
|
import com.jme3.scene.Spatial; |
||||||
|
import java.util.List; |
||||||
|
import javax.swing.JPanel; |
||||||
|
import org.openide.DialogDisplayer; |
||||||
|
import org.openide.NotifyDescriptor; |
||||||
|
import org.openide.WizardDescriptor; |
||||||
|
import org.openide.util.Exceptions; |
||||||
|
|
||||||
|
@SuppressWarnings({"unchecked", "serial"}) |
||||||
|
public final class ModelImporterVisualPanel3 extends JPanel { |
||||||
|
|
||||||
|
private ModelImporterWizardPanel3 panel; |
||||||
|
private OffScenePanel offPanel; |
||||||
|
private ProjectAssetManager manager; |
||||||
|
private AssetData data; |
||||||
|
private AssetKey mainKey; |
||||||
|
private Spatial currentModel; |
||||||
|
private List<AssetKey> assets; |
||||||
|
private List<AssetKey> failed; |
||||||
|
|
||||||
|
/** |
||||||
|
* Creates new form ModelImporterVisualPanel1 |
||||||
|
*/ |
||||||
|
public ModelImporterVisualPanel3(ModelImporterWizardPanel3 panel) { |
||||||
|
initComponents(); |
||||||
|
this.panel = panel; |
||||||
|
offPanel = new OffScenePanel(320, 320); |
||||||
|
offPanel.startPreview(); |
||||||
|
jPanel1.add(offPanel); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String getName() { |
||||||
|
return "Preview Model"; |
||||||
|
} |
||||||
|
|
||||||
|
public void loadSettings(WizardDescriptor wiz) { |
||||||
|
manager = (ProjectAssetManager) wiz.getProperty("manager"); |
||||||
|
mainKey = (AssetKey) wiz.getProperty("mainkey"); |
||||||
|
data = (AssetData) wiz.getProperty("assetdata"); |
||||||
|
loadModel(mainKey); |
||||||
|
if (currentModel != null) { |
||||||
|
offPanel.attach(currentModel); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public void applySettings(WizardDescriptor wiz) { |
||||||
|
wiz.putProperty("assetlist", assets); |
||||||
|
wiz.putProperty("failedlist", failed); |
||||||
|
wiz.putProperty("model", currentModel); |
||||||
|
if (currentModel != null) { |
||||||
|
offPanel.detach(currentModel); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public boolean checkValid() { |
||||||
|
return currentModel != null; |
||||||
|
} |
||||||
|
|
||||||
|
public void cleanup() { |
||||||
|
if (currentModel != null) { |
||||||
|
offPanel.detach(currentModel); |
||||||
|
} |
||||||
|
offPanel.stopPreview(); |
||||||
|
} |
||||||
|
|
||||||
|
public synchronized void loadModel(AssetKey modelKey) { |
||||||
|
try { |
||||||
|
currentModel = (Spatial) data.loadAsset(); |
||||||
|
if (currentModel != null) { |
||||||
|
assets = data.getAssetKeyList(); |
||||||
|
failed = data.getFailedList(); |
||||||
|
jList1.setListData(assets.toArray()); |
||||||
|
jList2.setListData(failed.toArray()); |
||||||
|
if (failed.size() > 0) { |
||||||
|
statusLabel.setText("Model loaded, some assets could not be loaded."); |
||||||
|
infoTextArea.setText("Check if the model looks as expected," |
||||||
|
+ " some textures fail to load, make sure they are in the same folder or a subfolder of the model." |
||||||
|
+ " Textures that can not be found will be replaced with a red material." |
||||||
|
+ "\nWith the buttons above you can move the camera."); |
||||||
|
} else { |
||||||
|
statusLabel.setText("Model loaded successfully."); |
||||||
|
infoTextArea.setText("Check if the model looks as expected." |
||||||
|
+ "\nWith the buttons above you can move the camera."); |
||||||
|
} |
||||||
|
} else { |
||||||
|
statusLabel.setText("Model cannot be loaded."); |
||||||
|
infoTextArea.setText("This file can not be loaded, it is either in an unsupported format or is incompatible." |
||||||
|
+ "\n Check the bottom right corner of the SDK for a little warning sign. If it is there" |
||||||
|
+ " double-click it and report the contained stack trace at jmonkeyengine.org"); |
||||||
|
// Message msg = new NotifyDescriptor.Message(
|
||||||
|
// "Cannot import this file!",
|
||||||
|
// NotifyDescriptor.ERROR_MESSAGE);
|
||||||
|
// DialogDisplayer.getDefault().notifyLater(msg);
|
||||||
|
} |
||||||
|
} catch (Exception e) { |
||||||
|
statusLabel.setText("Error importing file"); |
||||||
|
NotifyDescriptor.Message msg = new NotifyDescriptor.Message( |
||||||
|
"Error importing file!\n" |
||||||
|
+ "(" + e + ")", |
||||||
|
NotifyDescriptor.ERROR_MESSAGE); |
||||||
|
DialogDisplayer.getDefault().notifyLater(msg); |
||||||
|
Exceptions.printStackTrace(e); |
||||||
|
} |
||||||
|
manager.clearCache(); |
||||||
|
panel.fireChangeEvent(); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* This method is called from within the constructor to initialize the form. |
||||||
|
* WARNING: Do NOT modify this code. The content of this method is always |
||||||
|
* regenerated by the Form Editor. |
||||||
|
*/ |
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
|
private void initComponents() { |
||||||
|
|
||||||
|
jPanel1 = new javax.swing.JPanel(); |
||||||
|
jToolBar1 = new javax.swing.JToolBar(); |
||||||
|
jButton1 = new javax.swing.JButton(); |
||||||
|
jButton2 = new javax.swing.JButton(); |
||||||
|
jSeparator1 = new javax.swing.JToolBar.Separator(); |
||||||
|
jButton3 = new javax.swing.JButton(); |
||||||
|
jButton4 = new javax.swing.JButton(); |
||||||
|
jPanel3 = new javax.swing.JPanel(); |
||||||
|
jLabel2 = new javax.swing.JLabel(); |
||||||
|
jScrollPane2 = new javax.swing.JScrollPane(); |
||||||
|
jList1 = new javax.swing.JList(); |
||||||
|
jScrollPane3 = new javax.swing.JScrollPane(); |
||||||
|
jList2 = new javax.swing.JList(); |
||||||
|
statusLabel = new javax.swing.JLabel(); |
||||||
|
jLabel1 = new javax.swing.JLabel(); |
||||||
|
jScrollPane1 = new javax.swing.JScrollPane(); |
||||||
|
infoTextArea = new javax.swing.JTextArea(); |
||||||
|
|
||||||
|
jPanel1.setPreferredSize(new java.awt.Dimension(320, 320)); |
||||||
|
jPanel1.setLayout(new javax.swing.BoxLayout(jPanel1, javax.swing.BoxLayout.LINE_AXIS)); |
||||||
|
|
||||||
|
jToolBar1.setFloatable(false); |
||||||
|
jToolBar1.setRollover(true); |
||||||
|
|
||||||
|
org.openide.awt.Mnemonics.setLocalizedText(jButton1, org.openide.util.NbBundle.getMessage(ModelImporterVisualPanel3.class, "ModelImporterVisualPanel3.jButton1.text")); // NOI18N
|
||||||
|
jButton1.setFocusable(false); |
||||||
|
jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); |
||||||
|
jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); |
||||||
|
jButton1.addActionListener(new java.awt.event.ActionListener() { |
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) { |
||||||
|
jButton1ActionPerformed(evt); |
||||||
|
} |
||||||
|
}); |
||||||
|
jToolBar1.add(jButton1); |
||||||
|
|
||||||
|
org.openide.awt.Mnemonics.setLocalizedText(jButton2, org.openide.util.NbBundle.getMessage(ModelImporterVisualPanel3.class, "ModelImporterVisualPanel3.jButton2.text")); // NOI18N
|
||||||
|
jButton2.setFocusable(false); |
||||||
|
jButton2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); |
||||||
|
jButton2.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); |
||||||
|
jButton2.addActionListener(new java.awt.event.ActionListener() { |
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) { |
||||||
|
jButton2ActionPerformed(evt); |
||||||
|
} |
||||||
|
}); |
||||||
|
jToolBar1.add(jButton2); |
||||||
|
jToolBar1.add(jSeparator1); |
||||||
|
|
||||||
|
org.openide.awt.Mnemonics.setLocalizedText(jButton3, org.openide.util.NbBundle.getMessage(ModelImporterVisualPanel3.class, "ModelImporterVisualPanel3.jButton3.text")); // NOI18N
|
||||||
|
jButton3.setFocusable(false); |
||||||
|
jButton3.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); |
||||||
|
jButton3.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); |
||||||
|
jButton3.addActionListener(new java.awt.event.ActionListener() { |
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) { |
||||||
|
jButton3ActionPerformed(evt); |
||||||
|
} |
||||||
|
}); |
||||||
|
jToolBar1.add(jButton3); |
||||||
|
|
||||||
|
org.openide.awt.Mnemonics.setLocalizedText(jButton4, org.openide.util.NbBundle.getMessage(ModelImporterVisualPanel3.class, "ModelImporterVisualPanel3.jButton4.text")); // NOI18N
|
||||||
|
jButton4.setFocusable(false); |
||||||
|
jButton4.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); |
||||||
|
jButton4.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); |
||||||
|
jButton4.addActionListener(new java.awt.event.ActionListener() { |
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) { |
||||||
|
jButton4ActionPerformed(evt); |
||||||
|
} |
||||||
|
}); |
||||||
|
jToolBar1.add(jButton4); |
||||||
|
|
||||||
|
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); |
||||||
|
jPanel3.setLayout(jPanel3Layout); |
||||||
|
jPanel3Layout.setHorizontalGroup( |
||||||
|
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
||||||
|
.addGap(0, 220, Short.MAX_VALUE) |
||||||
|
); |
||||||
|
jPanel3Layout.setVerticalGroup( |
||||||
|
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
||||||
|
.addGap(0, 18, Short.MAX_VALUE) |
||||||
|
); |
||||||
|
|
||||||
|
jToolBar1.add(jPanel3); |
||||||
|
|
||||||
|
org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(ModelImporterVisualPanel3.class, "ModelImporterVisualPanel3.jLabel2.text")); // NOI18N
|
||||||
|
|
||||||
|
jList1.setModel(new javax.swing.AbstractListModel() { |
||||||
|
String[] strings = { "No assets loaded" }; |
||||||
|
public int getSize() { return strings.length; } |
||||||
|
public Object getElementAt(int i) { return strings[i]; } |
||||||
|
}); |
||||||
|
jScrollPane2.setViewportView(jList1); |
||||||
|
|
||||||
|
jScrollPane3.setViewportView(jList2); |
||||||
|
|
||||||
|
statusLabel.setFont(new java.awt.Font("Lucida Grande", 1, 14)); // NOI18N
|
||||||
|
org.openide.awt.Mnemonics.setLocalizedText(statusLabel, org.openide.util.NbBundle.getMessage(ModelImporterVisualPanel3.class, "ModelImporterVisualPanel3.statusLabel.text")); // NOI18N
|
||||||
|
|
||||||
|
org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(ModelImporterVisualPanel3.class, "ModelImporterVisualPanel3.jLabel1.text_1")); // NOI18N
|
||||||
|
|
||||||
|
infoTextArea.setColumns(20); |
||||||
|
infoTextArea.setLineWrap(true); |
||||||
|
infoTextArea.setRows(5); |
||||||
|
infoTextArea.setText(org.openide.util.NbBundle.getMessage(ModelImporterVisualPanel3.class, "ModelImporterVisualPanel3.infoTextArea.text_1")); // NOI18N
|
||||||
|
infoTextArea.setWrapStyleWord(true); |
||||||
|
jScrollPane1.setViewportView(infoTextArea); |
||||||
|
|
||||||
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); |
||||||
|
this.setLayout(layout); |
||||||
|
layout.setHorizontalGroup( |
||||||
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
||||||
|
.addGroup(layout.createSequentialGroup() |
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
||||||
|
.addGroup(layout.createSequentialGroup() |
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) |
||||||
|
.addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) |
||||||
|
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 320, javax.swing.GroupLayout.PREFERRED_SIZE)) |
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) |
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
||||||
|
.addComponent(jScrollPane2) |
||||||
|
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) |
||||||
|
.addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) |
||||||
|
.addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 168, Short.MAX_VALUE))) |
||||||
|
.addGroup(layout.createSequentialGroup() |
||||||
|
.addContainerGap() |
||||||
|
.addComponent(jScrollPane1))) |
||||||
|
.addContainerGap()) |
||||||
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() |
||||||
|
.addContainerGap() |
||||||
|
.addComponent(statusLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) |
||||||
|
); |
||||||
|
layout.setVerticalGroup( |
||||||
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
||||||
|
.addGroup(layout.createSequentialGroup() |
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) |
||||||
|
.addGroup(layout.createSequentialGroup() |
||||||
|
.addComponent(jLabel1) |
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) |
||||||
|
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 152, javax.swing.GroupLayout.PREFERRED_SIZE) |
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) |
||||||
|
.addComponent(jLabel2) |
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) |
||||||
|
.addComponent(jScrollPane3)) |
||||||
|
.addGroup(layout.createSequentialGroup() |
||||||
|
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 320, javax.swing.GroupLayout.PREFERRED_SIZE) |
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) |
||||||
|
.addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE))) |
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) |
||||||
|
.addComponent(statusLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE) |
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) |
||||||
|
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 108, Short.MAX_VALUE) |
||||||
|
.addContainerGap()) |
||||||
|
); |
||||||
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
|
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
|
||||||
|
offPanel.zoomCamera(-.1f); |
||||||
|
}//GEN-LAST:event_jButton2ActionPerformed
|
||||||
|
|
||||||
|
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
|
||||||
|
offPanel.zoomCamera(.1f); |
||||||
|
}//GEN-LAST:event_jButton1ActionPerformed
|
||||||
|
|
||||||
|
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
|
||||||
|
offPanel.rotateCamera(Vector3f.UNIT_Y, .1f); |
||||||
|
}//GEN-LAST:event_jButton3ActionPerformed
|
||||||
|
|
||||||
|
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
|
||||||
|
offPanel.rotateCamera(Vector3f.UNIT_Y, -.1f); |
||||||
|
}//GEN-LAST:event_jButton4ActionPerformed
|
||||||
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
|
private javax.swing.JTextArea infoTextArea; |
||||||
|
private javax.swing.JButton jButton1; |
||||||
|
private javax.swing.JButton jButton2; |
||||||
|
private javax.swing.JButton jButton3; |
||||||
|
private javax.swing.JButton jButton4; |
||||||
|
private javax.swing.JLabel jLabel1; |
||||||
|
private javax.swing.JLabel jLabel2; |
||||||
|
private javax.swing.JList jList1; |
||||||
|
private javax.swing.JList jList2; |
||||||
|
private javax.swing.JPanel jPanel1; |
||||||
|
private javax.swing.JPanel jPanel3; |
||||||
|
private javax.swing.JScrollPane jScrollPane1; |
||||||
|
private javax.swing.JScrollPane jScrollPane2; |
||||||
|
private javax.swing.JScrollPane jScrollPane3; |
||||||
|
private javax.swing.JToolBar.Separator jSeparator1; |
||||||
|
private javax.swing.JToolBar jToolBar1; |
||||||
|
private javax.swing.JLabel statusLabel; |
||||||
|
// End of variables declaration//GEN-END:variables
|
||||||
|
} |
@ -0,0 +1,91 @@ |
|||||||
|
/* |
||||||
|
* To change this template, choose Tools | Templates |
||||||
|
* and open the template in the editor. |
||||||
|
*/ |
||||||
|
package com.jme3.gde.modelimporter; |
||||||
|
|
||||||
|
import java.awt.Component; |
||||||
|
import java.util.HashSet; |
||||||
|
import java.util.Iterator; |
||||||
|
import java.util.Set; |
||||||
|
import javax.swing.event.ChangeEvent; |
||||||
|
import javax.swing.event.ChangeListener; |
||||||
|
import org.openide.WizardDescriptor; |
||||||
|
import org.openide.util.HelpCtx; |
||||||
|
|
||||||
|
public class ModelImporterWizardPanel3 implements WizardDescriptor.Panel { |
||||||
|
|
||||||
|
/** |
||||||
|
* The visual component that displays this panel. If you need to access the |
||||||
|
* component from this class, just use getComponent(). |
||||||
|
*/ |
||||||
|
private ModelImporterVisualPanel3 component; |
||||||
|
|
||||||
|
// Get the visual component for the panel. In this template, the component
|
||||||
|
// is kept separate. This can be more efficient: if the wizard is created
|
||||||
|
// but never displayed, or not all panels are displayed, it is better to
|
||||||
|
// create only those which really need to be visible.
|
||||||
|
public Component getComponent() { |
||||||
|
if (component == null) { |
||||||
|
component = new ModelImporterVisualPanel3(this); |
||||||
|
} |
||||||
|
return component; |
||||||
|
} |
||||||
|
|
||||||
|
public HelpCtx getHelp() { |
||||||
|
// Show no Help button for this panel:
|
||||||
|
return new HelpCtx("sdk.model_loader_and_viewer"); |
||||||
|
// If you have context help:
|
||||||
|
// return new HelpCtx(SampleWizardPanel1.class);
|
||||||
|
} |
||||||
|
|
||||||
|
public boolean isValid() { |
||||||
|
// If it is always OK to press Next or Finish, then:
|
||||||
|
return component.checkValid(); |
||||||
|
// If it depends on some condition (form filled out...), then:
|
||||||
|
// return someCondition();
|
||||||
|
// and when this condition changes (last form field filled in...) then:
|
||||||
|
// fireChangeEvent();
|
||||||
|
// and uncomment the complicated stuff below.
|
||||||
|
} |
||||||
|
private final Set<ChangeListener> listeners = new HashSet<ChangeListener>(1); // or can use ChangeSupport in NB 6.0
|
||||||
|
|
||||||
|
public final void addChangeListener(ChangeListener l) { |
||||||
|
synchronized (listeners) { |
||||||
|
listeners.add(l); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public final void removeChangeListener(ChangeListener l) { |
||||||
|
synchronized (listeners) { |
||||||
|
listeners.remove(l); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
protected final void fireChangeEvent() { |
||||||
|
Iterator<ChangeListener> it; |
||||||
|
synchronized (listeners) { |
||||||
|
it = new HashSet<ChangeListener>(listeners).iterator(); |
||||||
|
} |
||||||
|
ChangeEvent ev = new ChangeEvent(this); |
||||||
|
while (it.hasNext()) { |
||||||
|
it.next().stateChanged(ev); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
// You can use a settings object to keep track of state. Normally the
|
||||||
|
// settings object will be the WizardDescriptor, so you can use
|
||||||
|
// WizardDescriptor.getProperty & putProperty to store information entered
|
||||||
|
// by the user.
|
||||||
|
public void readSettings(Object settings) { |
||||||
|
component.loadSettings((WizardDescriptor) settings); |
||||||
|
} |
||||||
|
|
||||||
|
public void storeSettings(Object settings) { |
||||||
|
component.applySettings((WizardDescriptor) settings); |
||||||
|
} |
||||||
|
|
||||||
|
public void cleanup() { |
||||||
|
component.cleanup(); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue