diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/MaterialEditorTopComponent.form b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/MaterialEditorTopComponent.form
index 09bfb1f10..a396d0337 100644
--- a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/MaterialEditorTopComponent.form
+++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/MaterialEditorTopComponent.form
@@ -89,12 +89,12 @@
-
-
-
-
+
+
+
+
diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/MaterialEditorTopComponent.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/MaterialEditorTopComponent.java
index 3f3f9180b..b4b7f7579 100644
--- a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/MaterialEditorTopComponent.java
+++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/MaterialEditorTopComponent.java
@@ -248,11 +248,11 @@ public final class MaterialEditorTopComponent extends CloneableTopComponent impl
.addComponent(materialPreviewWidget1, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(32, 32, 32)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel4Layout.createSequentialGroup()
- .addGap(438, 438, 438)
- .addComponent(jCheckBox1))
.addComponent(jToolBar3, javax.swing.GroupLayout.DEFAULT_SIZE, 612, Short.MAX_VALUE)
- .addComponent(jToolBar2, javax.swing.GroupLayout.DEFAULT_SIZE, 612, Short.MAX_VALUE)))
+ .addComponent(jToolBar2, javax.swing.GroupLayout.DEFAULT_SIZE, 612, Short.MAX_VALUE)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
+ .addComponent(jCheckBox1)
+ .addContainerGap())))
.addGroup(jPanel4Layout.createSequentialGroup()
.addComponent(jTabbedPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 223, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/Bundle.properties b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/Bundle.properties
index 3a0e61c02..79e1ae73e 100644
--- a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/Bundle.properties
+++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/Bundle.properties
@@ -13,11 +13,10 @@ ColorRGBADialog.alphaLabel.text=Alpha:
# To change this template, choose Tools | Templates
# and open the template in the editor.
ColorPanel.jLabel1.text=jLabel1
-ColorPanel.jButton1.text=select..
+ColorPanel.jButton1.text=
TexturePanel.jLabel1.text=jLabel1
-TexturePanel.jButton1.text=set..
-TexturePanel.jLabel2.text=
-TexturePanel.jButton2.text=x
+TexturePanel.jButton1.text=set...
+TexturePanel.jButton2.text=
# To change this template, choose Tools | Templates
# and open the template in the editor.
FloatPanel.jLabel1.text=jLabel1
@@ -46,3 +45,6 @@ ColorPanel.rLabel.text=0.2545
ColorPanel.gLabel.text=0.2545
ColorPanel.bLabel.text=0.2545
ColorPanel.aLabel.text=0.2545
+TexturePanel.jButton2.toolTipText=Remove this texture
+TexturePanel.jLabel2.text=
+TexturePanel.texturePreview.text=
diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/ColorPanel.form b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/ColorPanel.form
index 7eee549cf..28b1cc5c6 100644
--- a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/ColorPanel.form
+++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/ColorPanel.form
@@ -29,13 +29,13 @@
-
+
-
+
-
-
+
+
@@ -45,13 +45,13 @@
-
+
+
-
-
+
@@ -103,7 +103,6 @@
-
@@ -112,6 +111,7 @@
+
@@ -258,6 +258,9 @@
+
+
+
diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/ColorPanel.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/ColorPanel.java
index 19b3b1eba..4bed7ae4d 100644
--- a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/ColorPanel.java
+++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/ColorPanel.java
@@ -173,7 +173,6 @@ public class ColorPanel extends MaterialPropertyWidget {
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(gLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 20, Short.MAX_VALUE)
.addComponent(bLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 20, Short.MAX_VALUE)
- .addComponent(aLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 20, Short.MAX_VALUE)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(jLabel4)
@@ -181,9 +180,11 @@ public class ColorPanel extends MaterialPropertyWidget {
.addComponent(jLabel2)
.addComponent(rLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 20, Short.MAX_VALUE))
.addComponent(colorPreview, javax.swing.GroupLayout.DEFAULT_SIZE, 20, Short.MAX_VALUE)
+ .addComponent(aLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 20, Short.MAX_VALUE)
);
jButton1.setBackground(new java.awt.Color(204, 204, 204));
+ jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/materials/multiview/widgets/icons/color_wheel.png"))); // NOI18N
jButton1.setText(org.openide.util.NbBundle.getMessage(ColorPanel.class, "ColorPanel.jButton1.text")); // NOI18N
jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
jButton1.setMaximumSize(new java.awt.Dimension(43, 15));
@@ -202,24 +203,24 @@ public class ColorPanel extends MaterialPropertyWidget {
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
- .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
+ .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 420, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
- .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 65, Short.MAX_VALUE)
+ .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 70, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
- .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(jButton1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
+ .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 4, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 9, Short.MAX_VALUE))
);
}// //GEN-END:initComponents
@@ -313,8 +314,7 @@ private void aLabelFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_a
public void run() {
jLabel1.setText(property.getName());
- jLabel1.setToolTipText(property.getName());
- System.out.println(property.getValue());
+ jLabel1.setToolTipText(property.getName());
String[] s = property.getValue().split(" ");
if (s.length == 4) {
try {
diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/ColorRGBADialog.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/ColorRGBADialog.java
index cd11a8cdd..c1ead2eb3 100644
--- a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/ColorRGBADialog.java
+++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/ColorRGBADialog.java
@@ -166,7 +166,8 @@ public class ColorRGBADialog extends javax.swing.JDialog {
public void setColor(Color color) {
this.color = color;
- jColorChooser1.setColor(color);
+ jColorChooser1.setColor(color);
+
alphaSlider.setValue((int) ((float) (color.getAlpha() / 255f) * 100));
}
diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/TexturePanel.form b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/TexturePanel.form
index f59fdd2bf..e0f18f585 100644
--- a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/TexturePanel.form
+++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/TexturePanel.form
@@ -5,6 +5,12 @@
+
+
+
+
+
+
@@ -21,139 +27,214 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/TexturePanel.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/TexturePanel.java
index 0ec73a392..5d08cd424 100644
--- a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/TexturePanel.java
+++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/TexturePanel.java
@@ -13,7 +13,13 @@ package com.jme3.gde.materials.multiview.widgets;
import com.jme3.gde.core.assets.ProjectAssetManager;
import com.jme3.gde.core.properties.TexturePropertyEditor;
import com.jme3.gde.materials.MaterialProperty;
+import com.jme3.texture.Texture;
import java.awt.Component;
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+import javax.swing.Icon;
+import jme3tools.converters.ImageToAwt;
+import org.openide.util.ImageUtilities;
/**
*
@@ -34,6 +40,19 @@ public class TexturePanel extends MaterialPropertyWidget {
initComponents();
}
+ private void displayPreview() {
+ if (!"".equals(textureName)) {
+ Texture tex = manager.loadTexture(textureName);
+ Icon newicon = null;
+ if (textureName.endsWith(".dds") || textureName.endsWith(".DDS")) {
+ texturePreview.setIcon(null);
+ } else {
+ newicon = ImageUtilities.image2Icon(resizeImage(ImageToAwt.convert(tex.getImage(), false, true, 0)));
+ }
+ texturePreview.setIcon(newicon);
+ }
+ }
+
private String getName(String path) {
int idx = path.lastIndexOf("/");
if (idx != -1 && path.length() > idx + 1) {
@@ -57,12 +76,28 @@ public class TexturePanel extends MaterialPropertyWidget {
jLabel2.setToolTipText("Repeat " + textureName);
} else {
property.setValue(textureName);
+ jLabel2.setToolTipText(textureName);
}
}
- private String getTextureName(String string) {
- string = string.replaceFirst("Flip ", "");
- return string.replaceFirst("Repeat ", "");
+
+
+ private static BufferedImage resizeImage(BufferedImage originalImage) {
+ int type = originalImage.getType() == 0 ? BufferedImage.TYPE_INT_ARGB : originalImage.getType();
+ float ratio = (float) originalImage.getWidth() / (float) originalImage.getHeight();
+ int width = 80;
+ int height = 25;
+ if (ratio <= 1) {
+ height = (int) ((float) width * ratio);
+ } else {
+ width = (int) ((float) height * (float) ratio);
+ }
+ BufferedImage resizedImage = new BufferedImage(width, height, type);
+ Graphics2D g = resizedImage.createGraphics();
+ g.drawImage(originalImage, 0, 0, width, height, null);
+ g.dispose();
+
+ return resizedImage;
}
/** This method is called from within the constructor to
@@ -74,26 +109,22 @@ public class TexturePanel extends MaterialPropertyWidget {
// //GEN-BEGIN:initComponents
private void initComponents() {
- jToolBar1 = new javax.swing.JToolBar();
jLabel1 = new javax.swing.JLabel();
jPanel1 = new javax.swing.JPanel();
- jLabel2 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
jCheckBox1 = new javax.swing.JCheckBox();
jCheckBox2 = new javax.swing.JCheckBox();
jButton2 = new javax.swing.JButton();
+ jLabel2 = new javax.swing.JLabel();
+ jSeparator1 = new javax.swing.JSeparator();
+ texturePreview = new javax.swing.JLabel();
setBackground(new java.awt.Color(204, 204, 204));
-
- jToolBar1.setBackground(new java.awt.Color(204, 204, 204));
- jToolBar1.setFloatable(false);
- jToolBar1.setRollover(true);
- jToolBar1.setMinimumSize(new java.awt.Dimension(212, 32));
- jToolBar1.setPreferredSize(new java.awt.Dimension(212, 32));
+ setMaximumSize(new java.awt.Dimension(32767, 45));
+ setPreferredSize(new java.awt.Dimension(467, 45));
jLabel1.setText(org.openide.util.NbBundle.getMessage(TexturePanel.class, "TexturePanel.jLabel1.text")); // NOI18N
jLabel1.setPreferredSize(new java.awt.Dimension(100, 16));
- jToolBar1.add(jLabel1);
jPanel1.setBackground(new java.awt.Color(204, 204, 204));
jPanel1.setPreferredSize(new java.awt.Dimension(10, 0));
@@ -102,32 +133,27 @@ public class TexturePanel extends MaterialPropertyWidget {
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGap(0, 1, Short.MAX_VALUE)
+ .addGap(0, 10, Short.MAX_VALUE)
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGap(0, 28, Short.MAX_VALUE)
+ .addGap(0, 0, Short.MAX_VALUE)
);
- jToolBar1.add(jPanel1);
-
- jLabel2.setFont(new java.awt.Font("Courier", 0, 13));
- jLabel2.setText(org.openide.util.NbBundle.getMessage(TexturePanel.class, "TexturePanel.jLabel2.text")); // NOI18N
- jLabel2.setMaximumSize(new java.awt.Dimension(200, 30));
- jLabel2.setPreferredSize(new java.awt.Dimension(200, 14));
- jToolBar1.add(jLabel2);
-
+ jButton1.setBackground(new java.awt.Color(204, 204, 204));
+ jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/materials/multiview/widgets/icons/picture_add.png"))); // NOI18N
jButton1.setText(org.openide.util.NbBundle.getMessage(TexturePanel.class, "TexturePanel.jButton1.text")); // NOI18N
jButton1.setFocusable(false);
- jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
- jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
+ jButton1.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
+ jButton1.setIconTextGap(2);
+ jButton1.setMargin(new java.awt.Insets(2, 5, 2, 5));
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
- jToolBar1.add(jButton1);
+ jCheckBox1.setBackground(new java.awt.Color(204, 204, 204));
jCheckBox1.setFont(new java.awt.Font("Lucida Grande", 0, 10));
jCheckBox1.setText(org.openide.util.NbBundle.getMessage(TexturePanel.class, "TexturePanel.jCheckBox1.text")); // NOI18N
jCheckBox1.setFocusable(false);
@@ -137,8 +163,8 @@ public class TexturePanel extends MaterialPropertyWidget {
jCheckBox1ActionPerformed(evt);
}
});
- jToolBar1.add(jCheckBox1);
+ jCheckBox2.setBackground(new java.awt.Color(204, 204, 204));
jCheckBox2.setFont(new java.awt.Font("Lucida Grande", 0, 10));
jCheckBox2.setText(org.openide.util.NbBundle.getMessage(TexturePanel.class, "TexturePanel.jCheckBox2.text")); // NOI18N
jCheckBox2.setFocusable(false);
@@ -148,9 +174,11 @@ public class TexturePanel extends MaterialPropertyWidget {
jCheckBox2ActionPerformed(evt);
}
});
- jToolBar1.add(jCheckBox2);
+ jButton2.setBackground(new java.awt.Color(204, 204, 204));
+ jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/materials/multiview/widgets/icons/picture_delete.png"))); // NOI18N
jButton2.setText(org.openide.util.NbBundle.getMessage(TexturePanel.class, "TexturePanel.jButton2.text")); // NOI18N
+ jButton2.setToolTipText(org.openide.util.NbBundle.getMessage(TexturePanel.class, "TexturePanel.jButton2.toolTipText")); // NOI18N
jButton2.setFocusable(false);
jButton2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
jButton2.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
@@ -159,17 +187,68 @@ public class TexturePanel extends MaterialPropertyWidget {
jButton2ActionPerformed(evt);
}
});
- jToolBar1.add(jButton2);
+
+ jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
+ jLabel2.setText(org.openide.util.NbBundle.getMessage(TexturePanel.class, "TexturePanel.jLabel2.text")); // NOI18N
+
+ texturePreview.setText(org.openide.util.NbBundle.getMessage(TexturePanel.class, "TexturePanel.texturePreview.text")); // NOI18N
+ texturePreview.setVerticalAlignment(javax.swing.SwingConstants.TOP);
+ texturePreview.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(153, 153, 153)));
+ texturePreview.setFocusable(false);
+ texturePreview.setIconTextGap(0);
+ texturePreview.setMaximumSize(new java.awt.Dimension(75, 25));
+ texturePreview.setMinimumSize(new java.awt.Dimension(75, 25));
+ texturePreview.setPreferredSize(new java.awt.Dimension(75, 25));
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 261, Short.MAX_VALUE)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
+ .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 559, Short.MAX_VALUE)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 192, Short.MAX_VALUE)
+ .addGap(2, 2, 2)
+ .addComponent(texturePreview, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(jButton1)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(jCheckBox2)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(jCheckBox1)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)))
+ .addContainerGap())
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addGap(0, 280, Short.MAX_VALUE)
+ .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGap(0, 279, Short.MAX_VALUE)))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
+ .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 25, Short.MAX_VALUE)
+ .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 25, Short.MAX_VALUE)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
+ .addComponent(jButton2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(jCheckBox2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(jCheckBox1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(texturePreview, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 12, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGap(85, 85, 85))
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addGap(0, 41, Short.MAX_VALUE)
+ .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGap(0, 24, Short.MAX_VALUE)))
);
}// //GEN-END:initComponents
@@ -178,7 +257,8 @@ public class TexturePanel extends MaterialPropertyWidget {
view.setVisible(true);
if (editor.getValue() != null) {
textureName = editor.getAsText();
- jLabel2.setText(getName(textureName));
+ displayPreview();
+ jLabel2.setText(getName(textureName));
updateFlipRepeat();
fireChanged();
}
@@ -186,6 +266,7 @@ public class TexturePanel extends MaterialPropertyWidget {
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
textureName = "";
+ texturePreview.setIcon(null);
jLabel2.setText("");
jLabel2.setToolTipText("");
property.setValue("");
@@ -230,6 +311,7 @@ public class TexturePanel extends MaterialPropertyWidget {
}
jLabel1.setText(property.getName());
jLabel1.setToolTipText(property.getName());
+ displayPreview();
jLabel2.setText(getName(textureName));
jLabel2.setToolTipText(property.getValue());
MaterialProperty prop = property;
@@ -248,6 +330,7 @@ public class TexturePanel extends MaterialPropertyWidget {
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JPanel jPanel1;
- private javax.swing.JToolBar jToolBar1;
+ private javax.swing.JSeparator jSeparator1;
+ private javax.swing.JLabel texturePreview;
// End of variables declaration//GEN-END:variables
}
diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/icons/color_wheel.png b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/icons/color_wheel.png
new file mode 100644
index 000000000..287a34458
Binary files /dev/null and b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/icons/color_wheel.png differ
diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/icons/picture_add.png b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/icons/picture_add.png
new file mode 100644
index 000000000..ef26343a5
Binary files /dev/null and b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/icons/picture_add.png differ
diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/icons/picture_delete.png b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/icons/picture_delete.png
new file mode 100644
index 000000000..19dd8b07c
Binary files /dev/null and b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/icons/picture_delete.png differ