From 86ea7ba1acda24ede29ccfeec27aaa0f8655b4b7 Mon Sep 17 00:00:00 2001 From: rickard Date: Wed, 19 Apr 2023 21:52:31 +0200 Subject: [PATCH] makes most widgets resizable. center pane is still a bit greedy. the colorpanel isn't adjusting well for some reason. --- .../materials/MaterialPreviewRenderer.java | 116 +++++++----------- .../multiview/MaterialEditorTopComponent.form | 10 +- .../multiview/MaterialEditorTopComponent.java | 13 +- .../multiview/widgets/ColorPanel.form | 39 ++++-- .../multiview/widgets/ColorPanel.java | 25 ++-- .../multiview/widgets/FloatPanel.form | 5 +- .../multiview/widgets/FloatPanel.java | 4 +- .../materials/multiview/widgets/IntPanel.form | 2 +- .../materials/multiview/widgets/IntPanel.java | 3 +- .../widgets/MaterialPreviewWidget.java | 1 - .../multiview/widgets/SelectionPanel.form | 35 ++---- .../multiview/widgets/SelectionPanel.java | 31 ++--- .../multiview/widgets/TextPanel.form | 7 +- .../multiview/widgets/TextPanel.java | 5 +- .../multiview/widgets/TexturePanel.form | 13 +- .../multiview/widgets/TexturePanel.java | 11 +- 16 files changed, 156 insertions(+), 164 deletions(-) diff --git a/jme3-materialeditor/src/com/jme3/gde/materials/MaterialPreviewRenderer.java b/jme3-materialeditor/src/com/jme3/gde/materials/MaterialPreviewRenderer.java index d4d60fe7b..e8f356317 100644 --- a/jme3-materialeditor/src/com/jme3/gde/materials/MaterialPreviewRenderer.java +++ b/jme3-materialeditor/src/com/jme3/gde/materials/MaterialPreviewRenderer.java @@ -46,7 +46,6 @@ import com.jme3.math.Vector3f; import com.jme3.renderer.RendererException; import com.jme3.scene.Geometry; -import com.jme3.scene.Spatial; import com.jme3.scene.shape.Box; import com.jme3.scene.shape.Quad; import com.jme3.scene.shape.Sphere; @@ -59,8 +58,9 @@ import javax.swing.JLabel; /** - * Handles rendering of materials in preview widgets of Material and Shader Node editor. - * + * Handles rendering of materials in preview widgets of Material and Shader Node + * editor. + * * @author Nehon */ public class MaterialPreviewRenderer implements SceneListener { @@ -108,14 +108,14 @@ private void init() { quad = new Geometry("previewQuad", quadMesh); quad.setLocalTranslation(new Vector3f(-2.25f, -2.25f, 0)); MikktspaceTangentGenerator.generate(quad); - + teapot = (Geometry) SceneApplication.getApplication().getAssetManager() .loadModel("Models/Teapot/Teapot.obj"); teapot.scale(3.5f); teapot.rotate(FastMath.PI, -FastMath.QUARTER_PI * 0.5f, -0.0f); teapot.setLocalTranslation(new Vector3f(-0.5f, 1.75f, 0)); MikktspaceTangentGenerator.generate(teapot); - + currentGeom = sphere; init = true; } @@ -125,19 +125,14 @@ public void showMaterial(final ProjectAssetManager assetManager, final String ma if (!init) { init(); } - exec.execute(new Runnable() { - - @Override - public void run() { - MaterialKey key = new MaterialKey(assetManager.getRelativeAssetPath(materialFileName)); - assetManager.deleteFromCache(key); - Material mat = assetManager.loadAsset(key); - if (mat != null) { - showMaterial(mat); - } + exec.execute(() -> { + MaterialKey key = new MaterialKey(assetManager.getRelativeAssetPath(materialFileName)); + assetManager.deleteFromCache(key); + Material mat = assetManager.loadAsset(key); + if (mat != null) { + showMaterial(mat); } }); - } @@ -149,46 +144,36 @@ public void showMaterial(final Material m, final String techniqueName) { if (!init) { init(); } - SceneApplication.getApplication().enqueue(new Callable() { - - @Override - public Material call() throws Exception { - if (techniqueName != null) { + SceneApplication.getApplication().enqueue(() -> { + if (techniqueName != null) { + try { + m.selectTechnique(techniqueName, SceneApplication.getApplication().getRenderManager()); + } catch (Exception e) { + // + } + } + final Material mat = reloadMaterial(m); + if (mat != null) { + java.awt.EventQueue.invokeLater(() -> { + currentMaterial = mat; + currentGeom.setMaterial(mat); try { - m.selectTechnique(techniqueName, SceneApplication.getApplication().getRenderManager()); + if (currentGeom.getMaterial() != null) { + PreviewRequest request = new PreviewRequest(MaterialPreviewRenderer.this, currentGeom, label.getWidth(), label.getHeight()); + request.getCameraRequest().setLocation(new Vector3f(0, 0, 7)); + request.getCameraRequest().setLookAt(new Vector3f(0, 0, 0), Vector3f.UNIT_Y); + SceneApplication.getApplication().createPreview(request); + } } catch (Exception e) { - // + java.awt.EventQueue.invokeLater(() -> { + label.setIcon(Icons.error); + }); + smartLog("Error rendering material{0}", e.getMessage()); } - } - final Material mat = reloadMaterial(m); - if (mat != null) { - java.awt.EventQueue.invokeLater(new Runnable() { - @Override - public void run() { - currentMaterial = mat; - currentGeom.setMaterial(mat); - try { - if (currentGeom.getMaterial() != null) { - PreviewRequest request = new PreviewRequest(MaterialPreviewRenderer.this, currentGeom, label.getWidth(), label.getHeight()); - request.getCameraRequest().setLocation(new Vector3f(0, 0, 7)); - request.getCameraRequest().setLookAt(new Vector3f(0, 0, 0), Vector3f.UNIT_Y); - SceneApplication.getApplication().createPreview(request); - } - } catch (Exception e) { - java.awt.EventQueue.invokeLater(new Runnable() { - @Override - public void run() { - label.setIcon(Icons.error); - } - }); - smartLog("Error rendering material{0}", e.getMessage()); - } - } - }); + }); - } - return mat; } + return mat; }); } @@ -209,7 +194,7 @@ public Material reloadMaterial(Material mat) { //creating a dummy mat with the mat def of the mat to reload dummy = new Material(mat.getMaterialDef()); - + for (MatParam matParam : mat.getParams()) { dummy.setParam(matParam.getName(), matParam.getVarType(), matParam.getValue()); } @@ -231,12 +216,7 @@ public Material reloadMaterial(Material mat) { //Logger.getLogger(MaterialDebugAppState.class.getName()).log(Level.SEVERE, e.getMessage()); smartLog("{0}", e.getMessage()); - java.awt.EventQueue.invokeLater(new Runnable() { - @Override - public void run() { - label.setIcon(Icons.error); - } - }); + java.awt.EventQueue.invokeLater(() -> label.setIcon(Icons.error)); return null; } catch (NullPointerException npe) { //utterly bad, but for some reason I get random NPE here and can't figure out why so to avoid bigger issues, I just catch it. @@ -282,11 +262,8 @@ public void sceneClosed(SceneRequest request) { public void previewCreated(PreviewRequest request) { if (request.getRequester() == this) { final ImageIcon icon = new ImageIcon(request.getImage()); - java.awt.EventQueue.invokeLater(new Runnable() { - @Override - public void run() { - label.setIcon(icon); - } + java.awt.EventQueue.invokeLater(() -> { + label.setIcon(icon); }); previewRequested = false; } @@ -296,15 +273,16 @@ public void cleanUp() { SceneApplication.getApplication().removeSceneListener(this); exec.shutdownNow(); } - - public boolean isPreviewRequested(){ + + public boolean isPreviewRequested() { return previewRequested; } - + /** - * A more lightweight refresh than showMaterials that doesn't rebuild the material + * A more lightweight refresh than showMaterials that doesn't rebuild the + * material */ - public void refreshOnly(){ + public void refreshOnly() { previewRequested = true; SceneApplication.getApplication().enqueue((Callable) () -> { if (currentGeom.getMaterial() != null) { @@ -316,5 +294,5 @@ public void refreshOnly(){ return null; }); } - + } diff --git a/jme3-materialeditor/src/com/jme3/gde/materials/multiview/MaterialEditorTopComponent.form b/jme3-materialeditor/src/com/jme3/gde/materials/multiview/MaterialEditorTopComponent.form index 527285ccf..f062d4218 100644 --- a/jme3-materialeditor/src/com/jme3/gde/materials/multiview/MaterialEditorTopComponent.form +++ b/jme3-materialeditor/src/com/jme3/gde/materials/multiview/MaterialEditorTopComponent.form @@ -87,14 +87,14 @@ - + - + - + @@ -182,6 +182,7 @@ + @@ -374,8 +375,9 @@ + - + diff --git a/jme3-materialeditor/src/com/jme3/gde/materials/multiview/MaterialEditorTopComponent.java b/jme3-materialeditor/src/com/jme3/gde/materials/multiview/MaterialEditorTopComponent.java index d40807089..869077ac2 100644 --- a/jme3-materialeditor/src/com/jme3/gde/materials/multiview/MaterialEditorTopComponent.java +++ b/jme3-materialeditor/src/com/jme3/gde/materials/multiview/MaterialEditorTopComponent.java @@ -169,6 +169,7 @@ private void initComponents() { texturesAndColorsPane.addTab(org.openide.util.NbBundle.getMessage(MaterialEditorTopComponent.class, "MaterialEditorTopComponent.jScrollPane3.TabConstraints.tabTitle"), jScrollPane3); // NOI18N + jTabbedPane3.setTabLayoutPolicy(javax.swing.JTabbedPane.SCROLL_TAB_LAYOUT); jTabbedPane3.setMinimumSize(new java.awt.Dimension(380, 355)); jTabbedPane3.setPreferredSize(new java.awt.Dimension(500, 355)); @@ -180,7 +181,6 @@ private void initComponents() { jTabbedPane3.addTab(org.openide.util.NbBundle.getMessage(MaterialEditorTopComponent.class, "MaterialEditorTopComponent.jScrollPane2.TabConstraints.tabTitle_1"), jScrollPane2); // NOI18N - jToolBar2.setFloatable(false); jToolBar2.setRollover(true); jPanel3.setPreferredSize(new java.awt.Dimension(0, 21)); @@ -215,7 +215,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); jToolBar2.add(jComboBox1); - jToolBar3.setFloatable(false); + jToolBar3.setRollover(true); jPanel1.setPreferredSize(new java.awt.Dimension(140, 21)); @@ -256,7 +256,8 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); - additionalRenderStatePane.setMinimumSize(new java.awt.Dimension(150, 100)); + additionalRenderStatePane.setTabLayoutPolicy(javax.swing.JTabbedPane.SCROLL_TAB_LAYOUT); + additionalRenderStatePane.setMinimumSize(new java.awt.Dimension(100, 100)); additionalRenderStatePane.setPreferredSize(new java.awt.Dimension(380, 355)); jScrollPane10.setBorder(null); @@ -273,13 +274,13 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addGroup(editorPanelLayout.createSequentialGroup() .addGroup(editorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(materialPreviewWidget1, javax.swing.GroupLayout.PREFERRED_SIZE, 255, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jTabbedPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 477, Short.MAX_VALUE)) + .addComponent(jTabbedPane3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(editorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(editorPanelLayout.createSequentialGroup() - .addComponent(texturesAndColorsPane, javax.swing.GroupLayout.PREFERRED_SIZE, 496, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(texturesAndColorsPane, javax.swing.GroupLayout.DEFAULT_SIZE, 496, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(additionalRenderStatePane, javax.swing.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE) + .addComponent(additionalRenderStatePane, javax.swing.GroupLayout.DEFAULT_SIZE, 329, Short.MAX_VALUE) .addContainerGap(12, Short.MAX_VALUE)) .addGroup(editorPanelLayout.createSequentialGroup() .addGroup(editorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) diff --git a/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/ColorPanel.form b/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/ColorPanel.form index 972fb140c..28300f080 100644 --- a/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/ColorPanel.form +++ b/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/ColorPanel.form @@ -5,6 +5,9 @@ + + + @@ -28,9 +31,9 @@ - + - + @@ -58,6 +61,9 @@ + + + @@ -65,6 +71,9 @@ + + + @@ -74,23 +83,23 @@ - - + + - + - + - + - + @@ -101,7 +110,7 @@ - + @@ -119,6 +128,9 @@ + + + @@ -141,6 +153,9 @@ + + + @@ -162,6 +177,9 @@ + + + @@ -207,6 +225,9 @@ + + + diff --git a/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/ColorPanel.java b/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/ColorPanel.java index 58d2d5ef8..7c57d990f 100644 --- a/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/ColorPanel.java +++ b/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/ColorPanel.java @@ -49,15 +49,19 @@ private void initComponents() { jSeparator1 = new javax.swing.JSeparator(); setMaximumSize(new java.awt.Dimension(32767, 35)); + setMinimumSize(new java.awt.Dimension(20, 0)); setPreferredSize(new java.awt.Dimension(430, 35)); jLabel1.setText(org.openide.util.NbBundle.getMessage(ColorPanel.class, "ColorPanel.jLabel1.text")); // NOI18N + jLabel1.setMinimumSize(new java.awt.Dimension(20, 17)); jLabel1.setPreferredSize(new java.awt.Dimension(100, 16)); + jPanel2.setMinimumSize(new java.awt.Dimension(80, 0)); jPanel2.setPreferredSize(new java.awt.Dimension(377, 40)); rLabel.setText(org.openide.util.NbBundle.getMessage(ColorPanel.class, "ColorPanel.rLabel.text")); // NOI18N rLabel.setMaximumSize(new java.awt.Dimension(110, 2147483647)); + rLabel.setMinimumSize(new java.awt.Dimension(30, 23)); rLabel.setNextFocusableComponent(gLabel); rLabel.setPreferredSize(new java.awt.Dimension(110, 28)); rLabel.setVerifyInputWhenFocusTarget(false); @@ -77,6 +81,7 @@ public void focusLost(java.awt.event.FocusEvent evt) { gLabel.setText(org.openide.util.NbBundle.getMessage(ColorPanel.class, "ColorPanel.gLabel.text")); // NOI18N gLabel.setMaximumSize(new java.awt.Dimension(110, 2147483647)); + gLabel.setMinimumSize(new java.awt.Dimension(30, 23)); gLabel.setNextFocusableComponent(bLabel); gLabel.setPreferredSize(new java.awt.Dimension(110, 28)); gLabel.addActionListener(new java.awt.event.ActionListener() { @@ -95,6 +100,7 @@ public void focusLost(java.awt.event.FocusEvent evt) { bLabel.setText(org.openide.util.NbBundle.getMessage(ColorPanel.class, "ColorPanel.bLabel.text")); // NOI18N bLabel.setMaximumSize(new java.awt.Dimension(110, 2147483647)); + bLabel.setMinimumSize(new java.awt.Dimension(30, 23)); bLabel.setNextFocusableComponent(aLabel); bLabel.setPreferredSize(new java.awt.Dimension(110, 28)); bLabel.addActionListener(new java.awt.event.ActionListener() { @@ -120,6 +126,7 @@ public void focusLost(java.awt.event.FocusEvent evt) { aLabel.setText(org.openide.util.NbBundle.getMessage(ColorPanel.class, "ColorPanel.aLabel.text")); // NOI18N aLabel.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); aLabel.setMaximumSize(new java.awt.Dimension(110, 2147483647)); + aLabel.setMinimumSize(new java.awt.Dimension(30, 23)); aLabel.setPreferredSize(new java.awt.Dimension(110, 28)); aLabel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -154,23 +161,23 @@ public void mouseClicked(java.awt.event.MouseEvent evt) { jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() - .addComponent(colorPreview, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 51, Short.MAX_VALUE) + .addComponent(colorPreview, javax.swing.GroupLayout.DEFAULT_SIZE, 41, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(rLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(rLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 34, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(gLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(gLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 39, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel4) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(bLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(bLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 46, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel5) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(aLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(aLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 46, Short.MAX_VALUE)) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -179,7 +186,7 @@ public void mouseClicked(java.awt.event.MouseEvent evt) { .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel4) .addComponent(jLabel5) - .addComponent(rLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(rLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(gLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(bLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(aLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) @@ -194,9 +201,9 @@ public void mouseClicked(java.awt.event.MouseEvent evt) { .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createSequentialGroup() - .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 91, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 390, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, 327, Short.MAX_VALUE) .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap()) ); diff --git a/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/FloatPanel.form b/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/FloatPanel.form index 580a483f7..45de41524 100644 --- a/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/FloatPanel.form +++ b/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/FloatPanel.form @@ -49,6 +49,9 @@ + + + @@ -73,7 +76,7 @@ - + diff --git a/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/FloatPanel.java b/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/FloatPanel.java index 700b4ecd7..557fe55e7 100644 --- a/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/FloatPanel.java +++ b/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/FloatPanel.java @@ -40,18 +40,18 @@ private void initComponents() { setMinimumSize(new java.awt.Dimension(100, 27)); - jToolBar1.setFloatable(false); jToolBar1.setRollover(true); jToolBar1.setPreferredSize(new java.awt.Dimension(159, 27)); jLabel1.setText(org.openide.util.NbBundle.getMessage(FloatPanel.class, "FloatPanel.jLabel1.text")); // NOI18N jLabel1.setMaximumSize(new java.awt.Dimension(300, 16)); + jLabel1.setMinimumSize(new java.awt.Dimension(10, 17)); jToolBar1.add(jLabel1); jToolBar1.add(filler1); jSpinner1.setModel(new javax.swing.SpinnerNumberModel(0.0f, null, null, 1.0f)); jSpinner1.setMaximumSize(new java.awt.Dimension(100, 23)); - jSpinner1.setMinimumSize(new java.awt.Dimension(100, 23)); + jSpinner1.setMinimumSize(new java.awt.Dimension(30, 23)); jSpinner1.setPreferredSize(new java.awt.Dimension(100, 23)); jSpinner1.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { diff --git a/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/IntPanel.form b/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/IntPanel.form index 96551a2b7..fb5988707 100644 --- a/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/IntPanel.form +++ b/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/IntPanel.form @@ -69,7 +69,7 @@ - + diff --git a/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/IntPanel.java b/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/IntPanel.java index f9dcf7403..0bc679f6a 100644 --- a/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/IntPanel.java +++ b/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/IntPanel.java @@ -37,7 +37,6 @@ private void initComponents() { filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(20, 0), new java.awt.Dimension(32767, 0)); jSpinner1 = new javax.swing.JSpinner(); - jToolBar1.setFloatable(false); jToolBar1.setRollover(true); jToolBar1.setPreferredSize(new java.awt.Dimension(159, 27)); @@ -49,7 +48,7 @@ private void initComponents() { jSpinner1.setModel(new javax.swing.SpinnerNumberModel()); jSpinner1.setAlignmentX(1.0F); jSpinner1.setMaximumSize(new java.awt.Dimension(100, 23)); - jSpinner1.setMinimumSize(new java.awt.Dimension(100, 23)); + jSpinner1.setMinimumSize(new java.awt.Dimension(40, 23)); jSpinner1.setPreferredSize(new java.awt.Dimension(100, 23)); jSpinner1.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { diff --git a/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/MaterialPreviewWidget.java b/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/MaterialPreviewWidget.java index 7428bdbc9..d4cbdf1a7 100644 --- a/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/MaterialPreviewWidget.java +++ b/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/MaterialPreviewWidget.java @@ -37,7 +37,6 @@ package com.jme3.gde.materials.multiview.widgets; import com.jme3.gde.core.assets.ProjectAssetManager; -import com.jme3.gde.core.icons.IconList; import com.jme3.gde.core.scene.SceneApplication; import com.jme3.gde.core.scene.SceneRequest; import com.jme3.gde.materials.MaterialPreviewRenderer; diff --git a/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/SelectionPanel.form b/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/SelectionPanel.form index a1ed94755..87ca2f0fb 100644 --- a/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/SelectionPanel.form +++ b/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/SelectionPanel.form @@ -16,7 +16,7 @@ - + @@ -28,13 +28,13 @@ - + - + - + @@ -50,27 +50,16 @@ - + - - - + + - - - - - - - - - - - - - - + + + + @@ -85,7 +74,7 @@ - + diff --git a/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/SelectionPanel.java b/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/SelectionPanel.java index c213fb3c3..e4531c213 100644 --- a/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/SelectionPanel.java +++ b/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/SelectionPanel.java @@ -52,37 +52,22 @@ private void initComponents() { jToolBar1 = new javax.swing.JToolBar(); jLabel1 = new javax.swing.JLabel(); - jPanel1 = new javax.swing.JPanel(); + filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 0)); jComboBox1 = new javax.swing.JComboBox(); - jToolBar1.setFloatable(false); jToolBar1.setRollover(true); - jToolBar1.setMinimumSize(new java.awt.Dimension(212, 32)); - jToolBar1.setPreferredSize(new java.awt.Dimension(212, 32)); + jToolBar1.setAlignmentY(0.5F); + jToolBar1.setMinimumSize(new java.awt.Dimension(80, 32)); + jToolBar1.setPreferredSize(new java.awt.Dimension(385, 32)); jLabel1.setText(org.openide.util.NbBundle.getMessage(SelectionPanel.class, "SelectionPanel.jLabel1.text")); // NOI18N jLabel1.setPreferredSize(new java.awt.Dimension(100, 16)); jToolBar1.add(jLabel1); - - jPanel1.setOpaque(false); - jPanel1.setPreferredSize(new java.awt.Dimension(10, 0)); - - javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); - jPanel1.setLayout(jPanel1Layout); - jPanel1Layout.setHorizontalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 56, Short.MAX_VALUE) - ); - jPanel1Layout.setVerticalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 28, Short.MAX_VALUE) - ); - - jToolBar1.add(jPanel1); + jToolBar1.add(filler1); jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); jComboBox1.setMaximumSize(new java.awt.Dimension(200, 32767)); - jComboBox1.setMinimumSize(new java.awt.Dimension(0, 0)); + jComboBox1.setMinimumSize(new java.awt.Dimension(30, 0)); jComboBox1.setPreferredSize(new java.awt.Dimension(200, 27)); jComboBox1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -95,7 +80,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 364, Short.MAX_VALUE) + .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 185, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -125,9 +110,9 @@ public void run() { } // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.Box.Filler filler1; private javax.swing.JComboBox jComboBox1; private javax.swing.JLabel jLabel1; - private javax.swing.JPanel jPanel1; private javax.swing.JToolBar jToolBar1; // End of variables declaration//GEN-END:variables diff --git a/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/TextPanel.form b/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/TextPanel.form index f9c16c01a..5772e0b58 100644 --- a/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/TextPanel.form +++ b/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/TextPanel.form @@ -28,8 +28,8 @@ - + @@ -55,7 +55,7 @@ - + @@ -73,6 +73,9 @@ + + + diff --git a/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/TextPanel.java b/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/TextPanel.java index fa9c86eeb..8b6bf8110 100644 --- a/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/TextPanel.java +++ b/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/TextPanel.java @@ -39,8 +39,8 @@ private void initComponents() { jPanel1 = new javax.swing.JPanel(); jTextField1 = new javax.swing.JTextField(); - jToolBar1.setFloatable(false); jToolBar1.setRollover(true); + jToolBar1.setAlignmentY(0.5F); jLabel1.setText(org.openide.util.NbBundle.getMessage(TextPanel.class, "TextPanel.jLabel1.text")); // NOI18N jLabel1.setPreferredSize(new java.awt.Dimension(100, 16)); @@ -53,7 +53,7 @@ private void initComponents() { jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 5, Short.MAX_VALUE) + .addGap(0, 4, Short.MAX_VALUE) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -64,6 +64,7 @@ private void initComponents() { jTextField1.setText(org.openide.util.NbBundle.getMessage(TextPanel.class, "TextPanel.jTextField1.text")); // NOI18N jTextField1.setMaximumSize(new java.awt.Dimension(200, 2147483647)); + jTextField1.setMinimumSize(new java.awt.Dimension(34, 23)); jTextField1.setPreferredSize(new java.awt.Dimension(200, 28)); jTextField1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { diff --git a/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/TexturePanel.form b/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/TexturePanel.form index b57c94a45..f5f770f71 100644 --- a/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/TexturePanel.form +++ b/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/TexturePanel.form @@ -5,6 +5,9 @@ + + + @@ -43,9 +46,9 @@ - - - + + + @@ -84,7 +87,7 @@ - + @@ -101,7 +104,7 @@ - + diff --git a/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/TexturePanel.java b/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/TexturePanel.java index 5b4debe00..0c1178340 100644 --- a/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/TexturePanel.java +++ b/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/TexturePanel.java @@ -122,10 +122,11 @@ private void initComponents() { texturePreview = new javax.swing.JLabel(); setMaximumSize(new java.awt.Dimension(32767, 45)); + setMinimumSize(new java.awt.Dimension(80, 0)); setPreferredSize(new java.awt.Dimension(467, 45)); jLabel1.setText(org.openide.util.NbBundle.getMessage(TexturePanel.class, "TexturePanel.jLabel1.text")); // NOI18N - jLabel1.setMinimumSize(new java.awt.Dimension(70, 14)); + jLabel1.setMinimumSize(new java.awt.Dimension(20, 14)); jLabel1.setPreferredSize(new java.awt.Dimension(100, 16)); jPanel1.setPreferredSize(new java.awt.Dimension(10, 0)); @@ -134,7 +135,7 @@ private void initComponents() { jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 10, Short.MAX_VALUE) + .addGap(0, 4, Short.MAX_VALUE) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -209,9 +210,9 @@ public void mouseClicked(java.awt.event.MouseEvent evt) { .addContainerGap()) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() - .addGap(0, 238, Short.MAX_VALUE) - .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(0, 238, Short.MAX_VALUE))) + .addGap(0, 232, Short.MAX_VALUE) + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 4, Short.MAX_VALUE) + .addGap(0, 231, Short.MAX_VALUE))) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)