summaryrefslogtreecommitdiffstats
path: root/logo/src/xlogo/kernel/perspective/LightDialog.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-09-07 03:49:04 +0200
committerSven Gothel <[email protected]>2020-09-07 17:34:48 +0200
commitb7e7dd4b38b89242982d0b7304a1de3b194456ee (patch)
tree660cc6d88da7e9f09714dd09ca7975ac6e18d8ad /logo/src/xlogo/kernel/perspective/LightDialog.java
parent135579a8367e4c8398dfd1a017272ae9d7502ca5 (diff)
JogAmp: Change Java3D + vecmath packages to jogamp.* ; Fix Color3f ctor passing AWT Color.getRGBColorComponents(null), lost AWT Color arg ctor variant
Diffstat (limited to 'logo/src/xlogo/kernel/perspective/LightDialog.java')
-rw-r--r--logo/src/xlogo/kernel/perspective/LightDialog.java30
1 files changed, 16 insertions, 14 deletions
diff --git a/logo/src/xlogo/kernel/perspective/LightDialog.java b/logo/src/xlogo/kernel/perspective/LightDialog.java
index bd54658..8d7a016 100644
--- a/logo/src/xlogo/kernel/perspective/LightDialog.java
+++ b/logo/src/xlogo/kernel/perspective/LightDialog.java
@@ -36,10 +36,9 @@ import java.awt.Color;
import xlogo.Logo;
-import javax.vecmath.Color3f;
-import javax.vecmath.Tuple3f;
-import javax.vecmath.Point3f;
-import javax.vecmath.Vector3f;
+import org.jogamp.vecmath.Color3f;
+import org.jogamp.vecmath.Tuple3f;
+import org.jogamp.vecmath.Point3f;
import org.jogamp.vecmath.Vector3f;
import javax.swing.BorderFactory;
import javax.swing.JDialog;
@@ -97,12 +96,15 @@ public class LightDialog extends JDialog implements ActionListener
labelType = new JLabel(Logo.messages.getString("3d.light.type"));
comboType = new JComboBox(type);
comboType.setSelectedIndex(light.getType());
-
- Color3f col = light.getColor();
- if (null != col)
- panelColor = new PanelColor(col.get());
- else
+
+ final Color3f col = light.getColor();
+ if (null != col) {
+ final float[] t = new float[3];
+ col.get(t);
+ panelColor = new PanelColor(new Color(t[0], t[1], t[2]));
+ } else {
panelColor = new PanelColor(Color.white);
+ }
panelColor.setBackground(comboType.getBackground());
panelPosition = new PanelPosition(Logo.messages.getString("3d.light.position"), light.getPosition());
@@ -183,11 +185,11 @@ public class LightDialog extends JDialog implements ActionListener
private void updateLight()
{
- int t = comboType.getSelectedIndex();
- Color3f c = new Color3f(panelColor.getValue());
- Point3f p = panelPosition.getPosition();
- Vector3f d = panelDirection.getDirection();
- float a = panelAngle.getAngleValue();
+ final int t = comboType.getSelectedIndex();
+ final Color3f c = new Color3f(panelColor.getValue().getRGBColorComponents(null));
+ final Point3f p = panelPosition.getPosition();
+ final Vector3f d = panelDirection.getDirection();
+ final float a = panelAngle.getAngleValue();
light.setType(t);
light.setColor(c);
light.setPosition(p);