[Git][java-team/sweethome3d-furniture-editor][master] 7 commits: Declare compliance with Debian Policy 4.6.1.

Markus Koschany (@apo) gitlab at salsa.debian.org
Thu Aug 11 12:01:16 BST 2022



Markus Koschany pushed to branch master at Debian Java Maintainers / sweethome3d-furniture-editor


Commits:
5fcbadb5 by Markus Koschany at 2022-08-11T01:46:15+02:00
Declare compliance with Debian Policy 4.6.1.

- - - - -
28eaf6e7 by Markus Koschany at 2022-08-11T01:49:21+02:00
New upstream version 1.30
- - - - -
39d2c756 by Markus Koschany at 2022-08-11T01:49:21+02:00
Update upstream source from tag 'upstream/1.30'

Update to upstream version '1.30'
with Debian dir 7522f00ff194714d78403f97cdfb513aac42ba64
- - - - -
295467b9 by Markus Koschany at 2022-08-11T01:49:56+02:00
Update changelog

- - - - -
58c3fd4b by Markus Koschany at 2022-08-11T12:57:21+02:00
Tighten dependency on sweethome3d.

- - - - -
3539a4fe by Markus Koschany at 2022-08-11T12:58:18+02:00
Update copyright years

- - - - -
41a845d0 by Markus Koschany at 2022-08-11T12:58:53+02:00
Remove options file because xz is the default now.

- - - - -


13 changed files:

- LICENSE.TXT
- README.TXT
- build.xml
- debian/changelog
- debian/control
- debian/copyright
- − debian/source/options
- src/com/eteks/furniturelibraryeditor/io/FurnitureLibraryFileRecorder.java
- src/com/eteks/furniturelibraryeditor/swing/FurniturePanel.java
- src/com/eteks/furniturelibraryeditor/swing/ImportFurnitureTaskPanel.java
- src/com/eteks/furniturelibraryeditor/swing/package.properties
- src/com/eteks/furniturelibraryeditor/swing/package_fr.properties
- src/com/eteks/furniturelibraryeditor/viewcontroller/FurnitureController.java


Changes:

=====================================
LICENSE.TXT
=====================================
@@ -1,4 +1,4 @@
-Furniture Library Editor, Copyright (c) 2010-2021 Emmanuel PUYBARET / eTeks
+Furniture Library Editor, Copyright (c) 2010-2022 Emmanuel PUYBARET / eTeks
 
 This software is licensed by eTeks under GNU General Public License.
 Please, read COPYING.TXT file for more details about GNU General Public License.


=====================================
README.TXT
=====================================
@@ -1,18 +1,18 @@
-FURNITURE LIBRARY EDITOR v 1.28
+FURNITURE LIBRARY EDITOR v 1.30
 -------------------------------
 
 This archive contains source code of the Furniture Library Editor for Sweet Home 3D.
 
 You may also download this source code with the following SVN command:
 
-svn checkout https://svn.code.sf.net/p/sweethome3d/code/tags/V_1_28/FurnitureLibraryEditor FurnitureLibraryEditor
+svn checkout https://svn.code.sf.net/p/sweethome3d/code/tags/V_1_30/FurnitureLibraryEditor FurnitureLibraryEditor
 
 
 As this project depends on Sweet Home 3D, download and install also Sweet Home 3D source code from 
-http://prdownloads.sourceforge.net/sweethome3d/SweetHome3D-6.6-src.zip 
+http://prdownloads.sourceforge.net/sweethome3d/SweetHome3D-7.0.2-src.zip 
 or with the following SVN command: 
 
-svn checkout https://svn.code.sf.net/p/sweethome3d/code/tags/V_6_6/SweetHome3D SweetHome3D
+svn checkout https://svn.code.sf.net/p/sweethome3d/code/tags/V_7_0_2/SweetHome3D SweetHome3D
 
 
 HOW TO USE THIS SOURCE CODE
@@ -57,4 +57,4 @@ Read LICENSE.TXT file for more details about licenses applicable to this softwar
 and included materials developed by third parties.
     
     
-Copyright (c) 2010-2021 Emmanuel Puybaret / eTeks. Distributed under GNU General Public License    
\ No newline at end of file
+Copyright (c) 2010-2022 Emmanuel Puybaret / eTeks. Distributed under GNU General Public License    
\ No newline at end of file


=====================================
build.xml
=====================================
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <!-- build.xml
 
-     Furniture Library Editor, Copyright (c) 2010-2021 Emmanuel PUYBARET / eTeks <info at eteks.com>
+     Furniture Library Editor, Copyright (c) 2010-2022 Emmanuel PUYBARET / eTeks <info at eteks.com>
      
      Ant build file. Available targets :
      - furnitureLibraryEditor              : Builds FurnitureLibraryEditor.jar file in build directory
@@ -10,7 +10,7 @@
 -->
 <project basedir="." default="furnitureLibraryEditorJarExecutable" name="FurnitureLibraryEditor">
   <!-- The current version of the Furniture Library Editor -->
-  <property name="version" value="1.28"/>
+  <property name="version" value="1.30"/>
 
   <!-- Java source and target compatiblity (Java 9 and higher doesn't support 1.5) -->
   <condition property="classSource" value="1.5" else="1.7">


=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+sweethome3d-furniture-editor (1.30-1) unstable; urgency=medium
+
+  * New upstream version 1.30.
+  * Declare compliance with Debian Policy 4.6.1.
+
+ -- Markus Koschany <apo at debian.org>  Thu, 11 Aug 2022 01:49:38 +0200
+
 sweethome3d-furniture-editor (1.28-1) unstable; urgency=medium
 
   * New upstream version 1.28.


=====================================
debian/control
=====================================
@@ -10,9 +10,9 @@ Build-Depends:
  debhelper-compat (= 13),
  default-jdk,
  imagemagick,
- sweethome3d (>= 5.7),
+ sweethome3d (>= 7.0.2),
  unzip
-Standards-Version: 4.6.0
+Standards-Version: 4.6.1
 Homepage: http://www.sweethome3d.com
 Vcs-Git: https://salsa.debian.org/java-team/sweethome3d-furniture-editor.git
 Vcs-Browser: https://salsa.debian.org/java-team/sweethome3d-furniture-editor


=====================================
debian/copyright
=====================================
@@ -3,7 +3,7 @@ Upstream-Name: Sweet Home 3D Furniture Library Editor
 Source: http://www.sweethome3d.com
 
 Files: *
-Copyright: 2010-2021, Emmanuel Puybaret, eTeks <info at eteks.com>
+Copyright: 2010-2022, Emmanuel Puybaret, eTeks <info at eteks.com>
 License: GPL-2+
 
 Files: src/com/eteks/sweethome3d/swing/resources/icons/tango/*
@@ -16,7 +16,7 @@ License: public-domain
 
 Files: debian/*
 Copyright: 2012,      Gabriele Giacone <1o5g4r8o at gmail.com>
-           2016-2021, Markus Koschany <apo at debian.org>
+           2016-2022, Markus Koschany <apo at debian.org>
 License: GPL-2+
 
 License: GPL-2+


=====================================
debian/source/options deleted
=====================================
@@ -1 +0,0 @@
-compression=xz


=====================================
src/com/eteks/furniturelibraryeditor/io/FurnitureLibraryFileRecorder.java
=====================================
@@ -596,6 +596,10 @@ public class FurnitureLibraryFileRecorder implements FurnitureLibraryRecorder {
           writeProperty(writer, DefaultFurnitureCatalog.PropertyKey.LIGHT_SOURCE_COLOR, i, lightSourceColor);
           writeProperty(writer, DefaultFurnitureCatalog.PropertyKey.LIGHT_SOURCE_DIAMETER, i, lightSourceDiameter);
         }
+        String [] lightSourceMaterialNames = light.getLightSourceMaterialNames();
+        if (lightSourceMaterialNames.length > 0) {
+          writeProperty(writer, DefaultFurnitureCatalog.PropertyKey.LIGHT_SOURCE_MATERIAL_NAME, i, lightSourceMaterialNames);
+        }
       }
       if (piece.getElevation() > 0) {
         writeProperty(writer, DefaultFurnitureCatalog.PropertyKey.ELEVATION, i, piece.getElevation());
@@ -608,6 +612,9 @@ public class FurnitureLibraryFileRecorder implements FurnitureLibraryRecorder {
       if (!"1 0 0 0 1 0 0 0 1".equals(modelRotationString)) {
         writeProperty(writer, DefaultFurnitureCatalog.PropertyKey.MODEL_ROTATION, i, modelRotationString);
       }
+      if (piece.getModelFlags() != 0) {
+        writeProperty(writer, DefaultFurnitureCatalog.PropertyKey.MODEL_FLAGS, i, piece.getModelFlags());
+      }
       if (piece.getStaircaseCutOutShape() != null) {
         writeProperty(writer, DefaultFurnitureCatalog.PropertyKey.STAIRCASE_CUT_OUT_SHAPE, i, piece.getStaircaseCutOutShape());
       }


=====================================
src/com/eteks/furniturelibraryeditor/swing/FurniturePanel.java
=====================================
@@ -90,6 +90,7 @@ import com.eteks.sweethome3d.model.Camera;
 import com.eteks.sweethome3d.model.CatalogPieceOfFurniture;
 import com.eteks.sweethome3d.model.Content;
 import com.eteks.sweethome3d.model.FurnitureCategory;
+import com.eteks.sweethome3d.model.HomeMaterial;
 import com.eteks.sweethome3d.model.HomePieceOfFurniture;
 import com.eteks.sweethome3d.model.UserPreferences;
 import com.eteks.sweethome3d.swing.AutoCommitSpinner;
@@ -154,6 +155,7 @@ public class FurniturePanel extends JPanel implements DialogView {
   private JLabel                    staircaseCutOutShapeLabel;
   private JTextField                staircaseCutOutShapeTextField;
   private NullableCheckBox          backFaceShownCheckBox;
+  private NullableCheckBox          edgeColorMaterialHiddenCheckBox;
   private NullableCheckBox          resizableCheckBox;
   private NullableCheckBox          deformableCheckBox;
   private NullableCheckBox          texturableCheckBox;
@@ -1010,6 +1012,49 @@ public class FurniturePanel extends JPanel implements DialogView {
         });
     }
 
+    if (this.controller.isPropertyEditable(FurnitureController.Property.EDGE_COLOR_MATERIAL_HIDDEN)) {
+      // Create edge color hidden check box bound to EDGE_COLOR_MATERIAL_HIDDEN controller property
+      this.edgeColorMaterialHiddenCheckBox = new NullableCheckBox(SwingTools.getLocalizedLabelText(preferences,
+          FurniturePanel.class, "edgeColorMaterialHiddenCheckBox.text"));
+      this.edgeColorMaterialHiddenCheckBox.setNullable(controller.getEdgeColorMaterialHidden() == null);
+      this.edgeColorMaterialHiddenCheckBox.setValue(controller.getEdgeColorMaterialHidden());
+      final PropertyChangeListener edgeColorMaterialHiddenChangeListener = new PropertyChangeListener() {
+        public void propertyChange(PropertyChangeEvent ev) {
+          edgeColorMaterialHiddenCheckBox.setNullable(ev.getNewValue() == null);
+          edgeColorMaterialHiddenCheckBox.setValue((Boolean)ev.getNewValue());
+        }
+      };
+      controller.addPropertyChangeListener(FurnitureController.Property.EDGE_COLOR_MATERIAL_HIDDEN, edgeColorMaterialHiddenChangeListener);
+      this.edgeColorMaterialHiddenCheckBox.addChangeListener(new ChangeListener() {
+          public void stateChanged(ChangeEvent ev) {
+            controller.removePropertyChangeListener(FurnitureController.Property.EDGE_COLOR_MATERIAL_HIDDEN, edgeColorMaterialHiddenChangeListener);
+            controller.setEdgeColorMaterialHidden(edgeColorMaterialHiddenCheckBox.getValue());
+            resetIcon(false);
+            controller.addPropertyChangeListener(FurnitureController.Property.EDGE_COLOR_MATERIAL_HIDDEN, edgeColorMaterialHiddenChangeListener);
+          }
+        });
+
+      PropertyChangeListener modelChangeListener = new PropertyChangeListener () {
+        public void propertyChange(PropertyChangeEvent ev) {
+          ModelManager.getInstance().loadModel(controller.getModel(), new ModelManager.ModelObserver() {
+              public void modelUpdated(BranchGroup modelRoot) {
+                edgeColorMaterialHiddenCheckBox.setVisible(false);
+                for (HomeMaterial material : ModelManager.getInstance().getMaterials(modelRoot)) {
+                  if (material.getName().startsWith(ModelManager.EDGE_COLOR_MATERIAL_PREFIX)) {
+                    edgeColorMaterialHiddenCheckBox.setVisible(true);
+                  }
+                }
+              }
+
+              public void modelError(Exception ex) {
+              }
+            });
+        }
+      };
+      controller.addPropertyChangeListener(FurnitureController.Property.MODEL, modelChangeListener);
+      modelChangeListener.propertyChange(null);
+    }
+
     if (this.controller.isPropertyEditable(FurnitureController.Property.RESIZABLE)) {
       // Create resizable check box bound to RESIZABLE controller property
       this.resizableCheckBox = new NullableCheckBox(SwingTools.getLocalizedLabelText(preferences,
@@ -1338,6 +1383,10 @@ public class FurniturePanel extends JPanel implements DialogView {
         this.backFaceShownCheckBox.setMnemonic(KeyStroke.getKeyStroke(preferences.getLocalizedString(
             FurniturePanel.class, "backFaceShownCheckBox.mnemonic")).getKeyCode());
       }
+      if (this.edgeColorMaterialHiddenCheckBox != null) {
+        this.edgeColorMaterialHiddenCheckBox.setMnemonic(KeyStroke.getKeyStroke(preferences.getLocalizedString(
+            FurniturePanel.class, "edgeColorMaterialHiddenCheckBox.mnemonic")).getKeyCode());
+      }
       if (this.resizableCheckBox != null) {
         this.resizableCheckBox.setMnemonic(KeyStroke.getKeyStroke(preferences.getLocalizedString(
             FurniturePanel.class, "resizableCheckBox.mnemonic")).getKeyCode());
@@ -1549,6 +1598,11 @@ public class FurniturePanel extends JPanel implements DialogView {
           1, 11, 2, 1, 0, 0, GridBagConstraints.LINE_START,
           GridBagConstraints.NONE, componentInsets, 0, 0));
     }
+    if (this.controller.isPropertyEditable(FurnitureController.Property.EDGE_COLOR_MATERIAL_HIDDEN)) {
+      add(this.edgeColorMaterialHiddenCheckBox, new GridBagConstraints(
+          4, 11, 1, 1, 0, 0, GridBagConstraints.LINE_START,
+          GridBagConstraints.NONE, componentInsets, 0, 0));
+    }
     if (this.controller.isPropertyEditable(FurnitureController.Property.DOOR_OR_WINDOW)) {
       add(this.doorOrWindowCheckBox, new GridBagConstraints(
           1, 12, 1, 1, 0, 0, GridBagConstraints.LINE_START,
@@ -1602,27 +1656,6 @@ public class FurniturePanel extends JPanel implements DialogView {
     final Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
     if (SwingTools.showConfirmDialog((JComponent)parentView,
             this, this.dialogTitle, this.nameTextField) == JOptionPane.OK_OPTION) {
-      if (this.controller.getBackFaceShown() != null
-          && this.controller.getBackFaceShown()) {
-        JRootPane rootPane = SwingUtilities.getRootPane((JComponent)parentView);
-        Cursor defaultCursor = rootPane.getCursor();
-        try {
-          rootPane.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
-          // Generate a modified model with back face (modifying the model is required because this information isn't stored in a SH3F file)
-          HomePieceOfFurniture3D piece3D = new HomePieceOfFurniture3D(new HomePieceOfFurniture(
-              new CatalogPieceOfFurniture(this.controller.getName(), null,
-                  this.controller.getModel(), this.controller.getWidth(), this.controller.getDepth(), this.controller.getHeight(),
-                  0, false, null, null, this.controller.getBackFaceShown(), 0, false)), null, true, true);
-          this.controller.setModel(ImportFurnitureTaskPanel.copyToTemporaryOBJContent(piece3D, this.controller.getModel()));
-        } catch (IOException e) {
-          JOptionPane.showMessageDialog(rootPane,
-              preferences.getLocalizedString(FurniturePanel.class, "backFaceShownError"),
-              preferences.getLocalizedString(FurniturePanel.class, "errorTitle"),
-              JOptionPane.ERROR_MESSAGE);
-        } finally {
-          rootPane.setCursor(defaultCursor);
-        }
-      }
       this.controller.modifyFurniture();
     }
     if (focusOwner != null) {
@@ -1647,10 +1680,13 @@ public class FurniturePanel extends JPanel implements DialogView {
         addModelListener(controller, preferences);
         addSizeListeners(controller);
         addRotationListener(controller);
-        addBackFaceShownListener(controller);
+        addModelFlagsListener(controller);
         setBackground(UIManager.getColor("window"));
         if (controller.getModel() != null) {
-          setModel(controller.getModel(), controller.getModelRotation(),
+          setModel(controller.getModel(),
+              controller.getBackFaceShown() != null ? controller.getBackFaceShown() : false,
+              controller.getEdgeColorMaterialHidden() != null ? controller.getEdgeColorMaterialHidden() : false,
+              controller.getModelRotation(),
               controller.getWidth(), controller.getDepth(), controller.getHeight(), preferences);
         } else {
           setModel(null);
@@ -1755,10 +1791,10 @@ public class FurniturePanel extends JPanel implements DialogView {
     }
 
     /**
-     * Adds listeners to <code>controller</code> to update the face culling of the piece model
+     * Adds listeners to <code>controller</code> to update the face and color edge culling of the piece model
      * displayed by this component.
      */
-    private void addBackFaceShownListener(final FurnitureController controller) {
+    private void addModelFlagsListener(final FurnitureController controller) {
       controller.addPropertyChangeListener(FurnitureController.Property.BACK_FACE_SHOWN,
           new PropertyChangeListener() {
             public void propertyChange(PropertyChangeEvent ev) {
@@ -1767,6 +1803,14 @@ public class FurniturePanel extends JPanel implements DialogView {
               }
             }
           });
+      controller.addPropertyChangeListener(FurnitureController.Property.EDGE_COLOR_MATERIAL_HIDDEN,
+          new PropertyChangeListener() {
+            public void propertyChange(PropertyChangeEvent ev) {
+              if (controller.getEdgeColorMaterialHidden() != null) {
+                setEdgeColorMaterialHidden(controller.getEdgeColorMaterialHidden());
+              }
+            }
+          });
     }
 
     /**
@@ -1778,7 +1822,10 @@ public class FurniturePanel extends JPanel implements DialogView {
       controller.addPropertyChangeListener(FurnitureController.Property.MODEL,
           new PropertyChangeListener () {
             public void propertyChange(PropertyChangeEvent ev) {
-              setModel(controller.getModel(), controller.getModelRotation(),
+              setModel(controller.getModel(),
+                  controller.getBackFaceShown() != null ? controller.getBackFaceShown() : false,
+                  controller.getEdgeColorMaterialHidden() != null ? controller.getEdgeColorMaterialHidden() : false,
+                  controller.getModelRotation(),
                   controller.getWidth(), controller.getDepth(), controller.getHeight(), preferences);
             }
           });
@@ -1787,8 +1834,8 @@ public class FurniturePanel extends JPanel implements DialogView {
     /**
      * Sets the 3D model viewed by this model
      */
-    public void setModel(final Content model, final float [][] modelRotation,
-                         final Float width, final Float depth, final Float height,
+    public void setModel(final Content model, final boolean backFaceShown, final boolean edgeColorMaterialHidden,
+                         final float [][] modelRotation, final Float width, final Float depth, final Float height,
                          final UserPreferences preferences) {
       if (model == null) {
         setModel(null);
@@ -1798,6 +1845,8 @@ public class FurniturePanel extends JPanel implements DialogView {
               setModel(model);
               if (width != null && depth != null && height != null) {
                 setModelRotationAndSize(modelRotation, width, depth, height);
+                setBackFaceShown(backFaceShown);
+                setEdgeColorMaterialHidden(edgeColorMaterialHidden);
               }
             }
 


=====================================
src/com/eteks/furniturelibraryeditor/swing/ImportFurnitureTaskPanel.java
=====================================
@@ -47,6 +47,8 @@ import com.eteks.sweethome3d.model.CatalogPieceOfFurniture;
 import com.eteks.sweethome3d.model.Content;
 import com.eteks.sweethome3d.model.FurnitureCatalog;
 import com.eteks.sweethome3d.model.FurnitureCategory;
+import com.eteks.sweethome3d.model.HomeMaterial;
+import com.eteks.sweethome3d.model.PieceOfFurniture;
 import com.eteks.sweethome3d.swing.ModelPreviewComponent;
 import com.eteks.sweethome3d.swing.ThreadedTaskPanel;
 import com.eteks.sweethome3d.tools.TemporaryURLContent;
@@ -92,9 +94,10 @@ public class ImportFurnitureTaskPanel extends ThreadedTaskPanel implements Impor
     try {
       String modelName = "model";
       final AtomicReference<BranchGroup> modelNode = new AtomicReference<BranchGroup>();
+      ModelManager modelManager = ModelManager.getInstance();
       try {
         // Load model without ModelManager cache in case its content changed
-        modelNode.set(ModelManager.getInstance().loadModel(model));
+        modelNode.set(modelManager.loadModel(model));
       } catch (IOException ex) {
         // modelNode not set
       }
@@ -115,7 +118,7 @@ public class ImportFurnitureTaskPanel extends ThreadedTaskPanel implements Impor
           modelName = modelName.substring(0, dotIndex);
         }
         // Load copied content in current thread using cache to make it accessible by preview components without waiting in EDT
-        ModelManager.getInstance().loadModel(model, true, new ModelManager.ModelObserver() {
+        modelManager.loadModel(model, true, new ModelManager.ModelObserver() {
             public void modelUpdated(BranchGroup modelRoot) {
             }
 
@@ -148,7 +151,7 @@ public class ImportFurnitureTaskPanel extends ThreadedTaskPanel implements Impor
                     + URLEncoder.encode(entryName, "UTF-8").replace("+", "%20").replace("%2F", "/"));
                 final Content entryContent = new TemporaryURLContent(entryUrl);
                 // Load content using cache to make it accessible by preview components without waiting in EDT
-                ModelManager.getInstance().loadModel(entryContent, true, new ModelManager.ModelObserver() {
+                modelManager.loadModel(entryContent, true, new ModelManager.ModelObserver() {
                     public void modelUpdated(BranchGroup modelRoot) {
                       modelNode.set(modelRoot);
                     }
@@ -191,12 +194,21 @@ public class ImportFurnitureTaskPanel extends ThreadedTaskPanel implements Impor
         return null;
       }
 
-      Vector3f size = ModelManager.getInstance().getSize(modelNode.get());
+      Vector3f size = modelManager.getSize(modelNode.get());
+      HomeMaterial [] modelMaterials = modelManager.getMaterials(modelNode.get());
+      boolean edgeColorMaterialHidden = false;
+      for (HomeMaterial material : modelMaterials) {
+        if (material.getName().startsWith(ModelManager.EDGE_COLOR_MATERIAL_PREFIX)) {
+          edgeColorMaterialHidden = true;
+        }
+      }
       // Generate icon image
       final Content previewModel = pieceModel;
+      final int modelFlags = edgeColorMaterialHidden ? PieceOfFurniture.HIDE_EDGE_COLOR_MATERIAL : 0;
       EventQueue.invokeAndWait(new Runnable() {
           public void run() {
             iconPreviewComponent.setModel(previewModel);
+            iconPreviewComponent.setModelFlags(modelFlags);
           }
         });
       Thread.sleep(this.firstRendering ? 1000 : 100);
@@ -226,8 +238,8 @@ public class ImportFurnitureTaskPanel extends ThreadedTaskPanel implements Impor
 
       CatalogPieceOfFurniture piece = new CatalogPieceOfFurniture(key,
           getPieceOfFurnitureName(modelName), null, null, new String [0], null, null, iconContent.get(), null, pieceModel,
-          size.x, size.z, size.y, 0f, 1f, true, null, null, false, pieceModel.getSize(),
-          this.preferences.getDefaultCreator(), true, true, true, true, null, null, null);
+          size.x, size.z, size.y, 0f, 1f, true, null, null, modelFlags, pieceModel.getSize(),
+          this.preferences.getDefaultCreator(), true, true, true, true, null, null, null, null);
       FurnitureCategory defaultCategory = new FurnitureCategory(
           this.preferences.getLocalizedString(ImportFurnitureTaskPanel.class, "defaultCategory"));
       new FurnitureCatalog().add(defaultCategory , piece);


=====================================
src/com/eteks/furniturelibraryeditor/swing/package.properties
=====================================
@@ -1,6 +1,6 @@
 # package.properties
 #
-# Furniture Library Editor, Copyright (c) 2009-2021 Emmanuel PUYBARET / eTeks <info at eteks.com>
+# Furniture Library Editor, Copyright (c) 2009-2022 Emmanuel PUYBARET / eTeks <info at eteks.com>
 #
 # This program is free software; you can redistribute it and/or modify it under
 # the terms of the GNU General Public License as published by the Free Software
@@ -119,10 +119,10 @@ EditorPane.about.message=<html><font face="sanssherif"><center><font size="+2"><
     <br><font size="-1">SVG path compilation provided by Batik</font>\
     <p>Please, visit http://www.sweethome3d.com/\
     <br>for software updates and bug report.\
-    </p><p><font size="-2">\u00a9 Copyrights 2010-2021 eTeks  info at eteks.com\
+    </p><p><font size="-2">\u00a9 Copyrights 2010-2022 eTeks  info at eteks.com\
     <br>Distributed under GNU General Public License</font>
 # Note to translators: dot not copy the 2 following keys in localized file
-EditorPane.about.version=1.28
+EditorPane.about.version=1.30
 EditorPane.about.icon=/com/eteks/furniturelibraryeditor/swing/resources/aboutIcon.png
 
 
@@ -229,12 +229,13 @@ FurniturePanel.valueAddedTaxPercentageLabel.text=VAT %:
 FurniturePanel.valueAddedTaxPercentageLabel.mnemonic=V
 FurniturePanel.backFaceShownCheckBox.text=Invert back and front faces
 FurniturePanel.backFaceShownCheckBox.mnemonic=B
+FurniturePanel.edgeColorMaterialHiddenCheckBox.text=Hide model edges
+FurniturePanel.edgeColorMaterialHiddenCheckBox.mnemonic=L
 FurniturePanel.homeFurniture.title=Modify furniture
 
 FurniturePanel.errorTitle=Error
 FurniturePanel.modelError=Can't read 3D model
 FurniturePanel.modelChoiceDialog.title=Choose model
-FurniturePanel.backFaceShownError=Can't invert faces
 
 FurniturePanel.ENLARGE_TEN_TIMES.Name=\u00d7 10
 FurniturePanel.ENLARGE_TEN_TIMES.ShortDescriptio=Multiply size by 10


=====================================
src/com/eteks/furniturelibraryeditor/swing/package_fr.properties
=====================================
@@ -79,7 +79,7 @@ EditorPane.about.message=<html><font face="sanssherif"><center><font size="+2"><
     <br><font size="-1">Compilation SVG path fournie par Batik</font>\
     <p>Rendez-vous sur http://www.sweethome3d.com/fr/\
     <br>pour mettre  jour ce logiciel ou faire des suggestions.\
-    </p><p><font size="-2">\u00a9 Copyrights 2010-2021 eTeks  info at eteks.com\
+    </p><p><font size="-2">\u00a9 Copyrights 2010-2022 eTeks  info at eteks.com\
     <br>Distribu sous licence GNU General Public License</font>
 
 FurnitureLanguageComboBox.defaultLanguage=Langue par dfaut
@@ -185,12 +185,13 @@ FurniturePanel.valueAddedTaxPercentageLabel.text=% TVA :
 FurniturePanel.valueAddedTaxPercentageLabel.mnemonic=V
 FurniturePanel.backFaceShownCheckBox.text=Inverser faces avant et arrire
 FurniturePanel.backFaceShownCheckBox.mnemonic=T
+FurniturePanel.edgeColorMaterialHiddenCheckBox.text=Cacher les artes
+FurniturePanel.edgeColorMaterialHiddenCheckBox.mnemonic=S
 FurniturePanel.homeFurniture.title=Modifier le mobilier
 
 FurniturePanel.errorTitle=Erreur
 FurniturePanel.modelError=Impossible de lire le modle 3D
 FurniturePanel.modelChoiceDialog.title=Choisir modle
-FurniturePanel.backFaceShownError=Impossible d'inverser les faces
 
 FurniturePanel.ENLARGE_TEN_TIMES.Name=\u00d7 10
 FurniturePanel.ENLARGE_TEN_TIMES.ShortDescriptio=Multiplier la taille par 10


=====================================
src/com/eteks/furniturelibraryeditor/viewcontroller/FurnitureController.java
=====================================
@@ -45,6 +45,7 @@ import com.eteks.sweethome3d.model.CatalogPieceOfFurniture;
 import com.eteks.sweethome3d.model.Content;
 import com.eteks.sweethome3d.model.FurnitureCatalog;
 import com.eteks.sweethome3d.model.FurnitureCategory;
+import com.eteks.sweethome3d.model.PieceOfFurniture;
 import com.eteks.sweethome3d.model.Sash;
 import com.eteks.sweethome3d.viewcontroller.ContentManager;
 import com.eteks.sweethome3d.viewcontroller.Controller;
@@ -62,7 +63,8 @@ public class FurnitureController implements Controller {
   public enum Property {ID, NAME, DESCRIPTION, INFORMATION, TAGS, GRADE, CREATION_DATE, CATEGORY, MODEL, ICON,
       WIDTH, DEPTH,  HEIGHT, ELEVATION, MOVABLE, RESIZABLE, DEFORMABLE, TEXTURABLE,
       DOOR_OR_WINDOW, DOOR_OR_WINDOW_CUT_OUT_SHAPE, STAIRCASE, STAIRCASE_CUT_OUT_SHAPE,
-      MODEL_ROTATION, MODEL_SIZE, CREATOR, PROPORTIONAL, BACK_FACE_SHOWN, PRICE, VALUE_ADDED_TAX_PERCENTAGE}
+      MODEL_ROTATION, MODEL_SIZE, CREATOR, PROPORTIONAL, BACK_FACE_SHOWN, EDGE_COLOR_MATERIAL_HIDDEN,
+      PRICE, VALUE_ADDED_TAX_PERCENTAGE}
 
   private static final Map<String, Property> PROPERTIES_MAP = new HashMap<String, Property>();
 
@@ -129,6 +131,7 @@ public class FurnitureController implements Controller {
   private Boolean           staircase;
   private String            staircaseCutOutShape;
   private Boolean           backFaceShown;
+  private Boolean           edgeColorMaterialHidden;
   private Long              modelSize;
   private Boolean           resizable;
   private Boolean           deformable;
@@ -308,11 +311,12 @@ public class FurnitureController implements Controller {
       setDoorOrWindowCutOutShape(null);
       setStaircase(null);
       setStaircaseCutOutShape(null);
-      setBackFaceShown(null);
       setResizable(null);
       setDeformable(null);
       setTexturable(null);
       setModelRotation(null);
+      setBackFaceShown(null);
+      setEdgeColorMaterialHidden(null);
       setCreator(null);
       setPrice(null);
       setValueAddedTaxPercentage(null);
@@ -320,12 +324,12 @@ public class FurnitureController implements Controller {
     } else {
       CatalogPieceOfFurniture firstPiece = this.modifiedFurniture.get(0);
 
-      setBackFaceShown(false);
       if (this.modifiedFurniture.size() == 1) {
         setIcon(firstPiece.getIcon());
         setModel(firstPiece.getModel());
         setModelSize(firstPiece.getModelSize());
         this.editableProperties.add(Property.BACK_FACE_SHOWN);
+        this.editableProperties.add(Property.EDGE_COLOR_MATERIAL_HIDDEN);
       } else {
         setIcon(null);
         setModel((Content)null);
@@ -572,6 +576,24 @@ public class FurnitureController implements Controller {
       }
       setModelRotation(modelRotation);
 
+      Boolean backFaceShown = firstPiece.isBackFaceShown();
+      for (int i = 1; i < this.modifiedFurniture.size(); i++) {
+        if (backFaceShown.booleanValue() != this.modifiedFurniture.get(i).isBackFaceShown()) {
+          backFaceShown = null;
+          break;
+        }
+      }
+      setBackFaceShown(backFaceShown);
+
+      Boolean edgeColorMaterialHidden = (firstPiece.getModelFlags() & PieceOfFurniture.HIDE_EDGE_COLOR_MATERIAL) != 0;
+      for (int i = 1; i < this.modifiedFurniture.size(); i++) {
+        if (edgeColorMaterialHidden.booleanValue() != ((this.modifiedFurniture.get(i).getModelFlags() & PieceOfFurniture.HIDE_EDGE_COLOR_MATERIAL) != 0)) {
+          edgeColorMaterialHidden = null;
+          break;
+        }
+      }
+      setEdgeColorMaterialHidden(edgeColorMaterialHidden);
+
       String creator = firstPiece.getCreator();
       if (creator != null) {
         for (int i = 1; i < this.modifiedFurniture.size(); i++) {
@@ -1116,24 +1138,6 @@ public class FurnitureController implements Controller {
     return this.staircaseCutOutShape;
   }
 
-  /**
-   * Sets whether the back face of the furniture model should be shown or not.
-   */
-  public void setBackFaceShown(Boolean backFaceShown) {
-    if (backFaceShown != this.backFaceShown) {
-      Boolean oldBackFaceShown = this.backFaceShown;
-      this.backFaceShown = backFaceShown;
-      this.propertyChangeSupport.firePropertyChange(Property.BACK_FACE_SHOWN.name(), oldBackFaceShown, backFaceShown);
-    }
-  }
-
-  /**
-   * Returns whether the back face of the furniture model should be shown or not.
-   */
-  public Boolean getBackFaceShown() {
-    return this.backFaceShown;
-  }
-
   /**
    * Sets whether furniture model can be resized or not.
    */
@@ -1206,6 +1210,42 @@ public class FurnitureController implements Controller {
     return this.modelRotation;
   }
 
+  /**
+   * Sets whether the back face of the furniture model should be shown or not.
+   */
+  public void setBackFaceShown(Boolean backFaceShown) {
+    if (backFaceShown != this.backFaceShown) {
+      Boolean oldBackFaceShown = this.backFaceShown;
+      this.backFaceShown = backFaceShown;
+      this.propertyChangeSupport.firePropertyChange(Property.BACK_FACE_SHOWN.name(), oldBackFaceShown, backFaceShown);
+    }
+  }
+
+  /**
+   * Returns whether the back face of the furniture model should be shown or not.
+   */
+  public Boolean getBackFaceShown() {
+    return this.backFaceShown;
+  }
+
+  /**
+   * Sets whether edge color materials should be hidden or not.
+   */
+  public void setEdgeColorMaterialHidden(Boolean edgeColorMaterialHidden) {
+    if (edgeColorMaterialHidden != this.edgeColorMaterialHidden) {
+      Boolean oldEdgeColorMaterialHidden = this.edgeColorMaterialHidden;
+      this.edgeColorMaterialHidden = edgeColorMaterialHidden;
+      this.propertyChangeSupport.firePropertyChange(Property.EDGE_COLOR_MATERIAL_HIDDEN.name(), oldEdgeColorMaterialHidden, edgeColorMaterialHidden);
+    }
+  }
+
+  /**
+   * Returns whether edge color materials should be hidden or not.
+   */
+  public Boolean getEdgeColorMaterialHidden() {
+    return this.edgeColorMaterialHidden;
+  }
+
   /**
    * Sets the edited creator.
    */
@@ -1288,6 +1328,8 @@ public class FurnitureController implements Controller {
       Boolean staircase = getStaircase();
       String staircaseCutOutShape = getStaircaseCutOutShape();
       float [][] modelRotation = getModelRotation();
+      Boolean backFaceShown = getBackFaceShown();
+      Boolean edgeColorMaterialHidden = getEdgeColorMaterialHidden();
       Long modelSize = getModelSize();
       String creator = getCreator();
       BigDecimal price = getPrice();
@@ -1317,11 +1359,11 @@ public class FurnitureController implements Controller {
         float pieceElevation = piece.getElevation();
         boolean pieceMovable = piece.isMovable();
         float [][] pieceModelRotation = piece.getModelRotation();
+        int pieceModelFlags = piece.getModelFlags();
         String pieceDoorOrWindowCutOutShape = piece instanceof CatalogDoorOrWindow
             ? ((CatalogDoorOrWindow)piece).getCutOutShape()
             : null;
         String pieceStaircaseCutOutShape = piece.getStaircaseCutOutShape();
-        boolean pieceBackFaceShown = piece.isBackFaceShown();
         Long pieceModelSize = piece.getModelSize();
         String pieceCreator = piece.getCreator();
         boolean pieceResizable = piece.isResizable();
@@ -1388,6 +1430,14 @@ public class FurnitureController implements Controller {
         if (modelRotation != null || piecesCount == 1) {
           pieceModelRotation = modelRotation;
         }
+        if (backFaceShown != null) {
+          pieceModelFlags = (pieceModelFlags & ~PieceOfFurniture.SHOW_BACK_FACE)
+              | (backFaceShown ? PieceOfFurniture.SHOW_BACK_FACE : 0);
+        }
+        if (edgeColorMaterialHidden != null) {
+          pieceModelFlags = (pieceModelFlags & ~PieceOfFurniture.HIDE_EDGE_COLOR_MATERIAL)
+              | (edgeColorMaterialHidden ? PieceOfFurniture.HIDE_EDGE_COLOR_MATERIAL : 0);
+        }
         if (pieceDoorOrWindowCutOutShape != null || piecesCount == 1) {
           pieceDoorOrWindowCutOutShape = doorOrWindowCutOutShape;
         }
@@ -1479,7 +1529,7 @@ public class FurnitureController implements Controller {
               pieceElevation, pieceDropOnTopElevation, pieceMovable,
               pieceDoorOrWindowCutOutShape, opening.getWallThickness(), opening.getWallDistance(),
               opening.isWallCutOutOnBothSides(), opening.isWidthDepthDeformable(), opening.getSashes(),
-              pieceModelRotation, pieceBackFaceShown, pieceModelSize,
+              pieceModelRotation, pieceModelFlags, pieceModelSize,
               pieceCreator, pieceResizable, pieceDeformable, pieceTexturable,
               piecePrice, pieceValueAddedTaxPercentage, pieceCurrency, pieceProperties);
         } else if (piece instanceof CatalogLight) {
@@ -1488,8 +1538,8 @@ public class FurnitureController implements Controller {
               pieceInformation, pieceTags, pieceCreationDate, pieceGrade,
               pieceIcon, piecePlanIcon, pieceModel, pieceWidth, pieceDepth, pieceHeight,
               pieceElevation, pieceDropOnTopElevation, pieceMovable,
-              light.getLightSources(), pieceStaircaseCutOutShape,
-              pieceModelRotation, pieceBackFaceShown, pieceModelSize,
+              light.getLightSources(), light.getLightSourceMaterialNames(), pieceStaircaseCutOutShape,
+              pieceModelRotation, pieceModelFlags, pieceModelSize,
               pieceCreator, pieceResizable, pieceDeformable, pieceTexturable, piece.isHorizontallyRotatable(),
               piecePrice, pieceValueAddedTaxPercentage, pieceCurrency, pieceProperties);
         } else {
@@ -1499,7 +1549,7 @@ public class FurnitureController implements Controller {
                 pieceIcon, piecePlanIcon, pieceModel, pieceWidth, pieceDepth, pieceHeight,
                 pieceElevation, pieceDropOnTopElevation, pieceMovable,
                 pieceDoorOrWindowCutOutShape, 1, 0, true, true, new Sash [0],
-                pieceModelRotation, pieceBackFaceShown, pieceModelSize,
+                pieceModelRotation, pieceModelFlags, pieceModelSize,
                 pieceCreator, pieceResizable, pieceDeformable, pieceTexturable,
                 piecePrice, pieceValueAddedTaxPercentage, pieceCurrency, pieceProperties);
           } else {
@@ -1507,7 +1557,7 @@ public class FurnitureController implements Controller {
                 pieceInformation, pieceTags, pieceCreationDate, pieceGrade,
                 pieceIcon, piecePlanIcon, pieceModel, pieceWidth, pieceDepth, pieceHeight,
                 pieceElevation, pieceDropOnTopElevation, pieceMovable,
-                pieceStaircaseCutOutShape, pieceModelRotation, pieceBackFaceShown, pieceModelSize,
+                pieceStaircaseCutOutShape, pieceModelRotation, pieceModelFlags, pieceModelSize,
                 pieceCreator, pieceResizable, pieceDeformable, pieceTexturable, piece.isHorizontallyRotatable(),
                 piecePrice, pieceValueAddedTaxPercentage, pieceCurrency, pieceProperties);
           }



View it on GitLab: https://salsa.debian.org/java-team/sweethome3d-furniture-editor/-/compare/aa9a639dea5899cb504e0f011cda6065d028fe6c...41a845d085bd4ba90b5a89bd41f36a92302c43a8

-- 
View it on GitLab: https://salsa.debian.org/java-team/sweethome3d-furniture-editor/-/compare/aa9a639dea5899cb504e0f011cda6065d028fe6c...41a845d085bd4ba90b5a89bd41f36a92302c43a8
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20220811/96540b32/attachment.htm>


More information about the pkg-java-commits mailing list