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

Markus Koschany gitlab at salsa.debian.org
Sun Oct 14 12:46:43 BST 2018


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


Commits:
7216ca15 by Markus Koschany at 2018-10-14T11:26:58Z
Declare compliance with Debian Policy 4.2.1.

- - - - -
c626820a by Markus Koschany at 2018-10-14T11:28:15Z
New upstream version 1.23
- - - - -
f2139f02 by Markus Koschany at 2018-10-14T11:28:19Z
Update upstream source from tag 'upstream/1.23'

Update to upstream version '1.23'
with Debian dir 9b884e490140eee0048e949d7d7024d0e949158b
- - - - -
6e434469 by Markus Koschany at 2018-10-14T11:30:11Z
Update changelog

- - - - -
14c3a31b by Markus Koschany at 2018-10-14T11:33:52Z
Refresh no-MacOS-support.patch and build.patch

- - - - -
2e61d172 by Markus Koschany at 2018-10-14T11:43:55Z
Update changelog

- - - - -


9 changed files:

- .settings/org.eclipse.jdt.core.prefs
- README.TXT
- build.xml
- debian/changelog
- debian/control
- debian/patches/build.patch
- debian/patches/no-MacOS-support.patch
- src/com/eteks/furniturelibraryeditor/swing/ImportFurnitureTaskPanel.java
- src/com/eteks/furniturelibraryeditor/swing/package.properties


Changes:

=====================================
.settings/org.eclipse.jdt.core.prefs
=====================================
@@ -9,6 +9,7 @@ org.eclipse.jdt.core.compiler.debug.sourceFile=generate
 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
 org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
 org.eclipse.jdt.core.formatter.align_type_members_on_columns=true
 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
@@ -22,8 +23,10 @@ org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
 org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=49
 org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
 org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=20
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0
 org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
 org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0
 org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=18
 org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=18
 org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
@@ -33,6 +36,8 @@ org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration
 org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=2
 org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
 org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0
+org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0
 org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
 org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
 org.eclipse.jdt.core.formatter.blank_lines_after_package=1
@@ -53,6 +58,7 @@ org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
 org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
 org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
 org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
 org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
 org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
 org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
@@ -68,7 +74,7 @@ org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
 org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
 org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=do not insert
 org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
-org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.comment.line_length=120
 org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
 org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
 org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
@@ -90,6 +96,7 @@ org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
 org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
 org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
 org.eclipse.jdt.core.formatter.indentation.size=8
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert
 org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
 org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
 org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
@@ -99,6 +106,7 @@ org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do
 org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
 org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
 org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
 org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
 org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
 org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
@@ -146,6 +154,7 @@ org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=inser
 org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
 org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
 org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
 org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
 org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
 org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
@@ -223,6 +232,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do n
 org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
 org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
 org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
 org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
 org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
 org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
@@ -277,16 +287,28 @@ org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
 org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
 org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
 org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.lineSplit=120
+org.eclipse.jdt.core.formatter.lineSplit=500
 org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
 org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
 org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
 org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines
 org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
 org.eclipse.jdt.core.formatter.tabulation.char=space
 org.eclipse.jdt.core.formatter.tabulation.size=2
 org.eclipse.jdt.core.formatter.use_on_off_tags=false
 org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false
 org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true
 org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
 org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true


=====================================
README.TXT
=====================================
@@ -1,18 +1,18 @@
-FURNITURE LIBRARY EDITOR v 1.22
+FURNITURE LIBRARY EDITOR v 1.23
 -------------------------------
 
 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_22/FurnitureLibraryEditor FurnitureLibraryEditor
+svn checkout https://svn.code.sf.net/p/sweethome3d/code/tags/V_1_23/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-5.7-src.zip 
+http://prdownloads.sourceforge.net/sweethome3d/SweetHome3D-6.0-src.zip 
 or with the following SVN command: 
 
-svn checkout https://svn.code.sf.net/p/sweethome3d/code/tags/V_5_7/SweetHome3D SweetHome3D
+svn checkout https://svn.code.sf.net/p/sweethome3d/code/tags/V_6_0/SweetHome3D SweetHome3D
 
 
 HOW TO USE THIS SOURCE CODE


=====================================
build.xml
=====================================
@@ -10,7 +10,7 @@
 -->
 <project basedir="." default="furnitureLibraryEditorJarExecutable" name="FurnitureLibraryEditor">
   <!-- The current version of the Furniture Library Editor -->
-  <property name="version" value="1.22"/>
+  <property name="version" value="1.23"/>
 
   <target name="furnitureLibraryEditor" 
           description="Builds build/FurnitureLibraryEditor.jar with all its classes">
@@ -30,6 +30,9 @@
     <!-- Compile Furniture Library Editor -->
     <javac srcdir="src" destdir="build/classes"
            encoding="ISO-8859-1" target="1.5">
+      <extdirs>
+        <pathelement location="../SweetHome3D/lib"/>
+      </extdirs>
       <classpath>
         <pathelement location="build/classes"/>
         <pathelement location="../SweetHome3D/lib/batik-svgpathparser-1.7.jar"/>
@@ -144,7 +147,7 @@
         <include name="*.jar"/>
         <include name="macosx/*.jar"/>
         <include name="java3d-1.6/*.jar"/>
-      	<exclude name="java3d-1.6/jogl-all.jar"/>
+        <exclude name="java3d-1.6/jogl-all.jar"/>
         <exclude name="freehep-vectorgraphics-svg-*.jar"/>
         <exclude name="iText-*.jar"/>
         <exclude name="sunflow-*.jar"/>


=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+sweethome3d-furniture-editor (1.23-1) unstable; urgency=medium
+
+  * New upstream version 1.23.
+    - Fix import error with OpenJDK 10 or later. (LP: #1773553)
+  * Declare compliance with Debian Policy 4.2.1.
+
+ -- Markus Koschany <apo at debian.org>  Sun, 14 Oct 2018 13:29:56 +0200
+
 sweethome3d-furniture-editor (1.22-1) unstable; urgency=medium
 
   * New upstream version 1.22.


=====================================
debian/control
=====================================
@@ -12,7 +12,7 @@ Build-Depends:
  imagemagick,
  sweethome3d (>= 5.7),
  unzip
-Standards-Version: 4.1.3
+Standards-Version: 4.2.1
 Homepage: http://www.sweethome3d.com
 Vcs-Git: https://anonscm.debian.org/git/pkg-java/sweethome3d-furniture-editor.git
 Vcs-Browser: https://anonscm.debian.org/cgit/pkg-java/sweethome3d-furniture-editor.git


=====================================
debian/patches/build.patch
=====================================
@@ -11,8 +11,6 @@ Forwarded: not-needed
  build.xml | 26 ++++++++++++++++----------
  1 file changed, 16 insertions(+), 10 deletions(-)
 
-diff --git a/build.xml b/build.xml
-index ac89274..567ade4 100644
 --- a/build.xml
 +++ b/build.xml
 @@ -16,9 +16,11 @@
@@ -28,15 +26,17 @@ index ac89274..567ade4 100644
        <extdirs>
          <pathelement location="../SweetHome3D/lib"/>
        </extdirs>
-@@ -26,13 +28,16 @@
+@@ -26,7 +28,7 @@
          <pathelement location="../SweetHome3D/libtest/AppleJavaExtensions.jar"/>
          <pathelement location="../SweetHome3D/libtest/jnlp.jar"/>
        </classpath>
 -    </javac>
-+    </javac>-->
++  </javac>-->
      <!-- Compile Furniture Library Editor -->
      <javac srcdir="src" destdir="build/classes"
             encoding="ISO-8859-1" target="1.5">
+@@ -35,7 +37,10 @@
+       </extdirs>
        <classpath>
          <pathelement location="build/classes"/>
 -        <pathelement location="../SweetHome3D/lib/batik-svgpathparser-1.7.jar"/>
@@ -47,7 +47,7 @@ index ac89274..567ade4 100644
          <pathelement location="../SweetHome3D/libtest/AppleJavaExtensions.jar"/>
        </classpath>
      </javac>
-@@ -45,12 +50,12 @@
+@@ -48,12 +53,12 @@
        </fileset>
      </copy>
      <copy todir="build/classes">
@@ -62,7 +62,7 @@ index ac89274..567ade4 100644
          <exclude name="com/eteks/sweethome3d/io/Contributed*.*"/>
          <exclude name="com/eteks/sweethome3d/io/DefaultTextures*.*"/>
          <exclude name="com/eteks/sweethome3d/io/resources/**"/>
-@@ -59,10 +64,10 @@
+@@ -62,10 +67,10 @@
        </fileset>
      </copy>
      <copy todir="build/classes">
@@ -75,7 +75,7 @@ index ac89274..567ade4 100644
          <exclude name="com/eteks/sweethome3d/io/Contributed*.*"/>
          <exclude name="com/eteks/sweethome3d/io/DefaultTextures*.*"/>
        </fileset>
-@@ -131,15 +136,16 @@
+@@ -134,15 +139,16 @@
      </zip>
    </target>
  
@@ -94,7 +94,7 @@ index ac89274..567ade4 100644
        <fileset dir="../SweetHome3D/lib">
          <include name="*.jar"/>
          <include name="macosx/*.jar"/>
-@@ -170,7 +176,7 @@
+@@ -173,7 +179,7 @@
          <include name="THIRDPARTY-LICENSE-JAVA3D.TXT"/>
          <include name="THIRDPARTY-LICENSE-TANGO.TXT"/>
          <include name="THIRDPARTY-LICENSE-CONTRIBUTIONS.TXT"/>


=====================================
debian/patches/no-MacOS-support.patch
=====================================
@@ -6,8 +6,6 @@ Subject: no MacOS support
  src/com/eteks/furniturelibraryeditor/FurnitureLibraryEditor.java | 6 +-----
  1 file changed, 1 insertion(+), 5 deletions(-)
 
-diff --git a/src/com/eteks/furniturelibraryeditor/FurnitureLibraryEditor.java b/src/com/eteks/furniturelibraryeditor/FurnitureLibraryEditor.java
-index 662f6f7..7365e3a 100644
 --- a/src/com/eteks/furniturelibraryeditor/FurnitureLibraryEditor.java
 +++ b/src/com/eteks/furniturelibraryeditor/FurnitureLibraryEditor.java
 @@ -44,9 +44,6 @@ import javax.swing.KeyStroke;


=====================================
src/com/eteks/furniturelibraryeditor/swing/ImportFurnitureTaskPanel.java
=====================================
@@ -31,7 +31,6 @@ import java.net.URL;
 import java.net.URLDecoder;
 import java.net.URLEncoder;
 import java.util.Arrays;
-import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipInputStream;
@@ -91,29 +90,16 @@ public class ImportFurnitureTaskPanel extends ThreadedTaskPanel implements Impor
    */
   public CatalogPieceOfFurniture readPieceOfFurniture(final Content model) throws InterruptedException {
     try {
-      final AtomicReference<BranchGroup> modelNode = new AtomicReference<BranchGroup>();
       String modelName = "model";
-      final CountDownLatch latch = new CountDownLatch(1);
-      EventQueue.invokeAndWait(new Runnable() {
-          public void run() {
-            // Load content using cache to make it accessible by preview components
-            ModelManager.getInstance().loadModel(model, new ModelManager.ModelObserver() {
-                public void modelUpdated(BranchGroup modelRoot) {
-                  latch.countDown();
-                  modelNode.set(modelRoot);
-                }
-                
-                public void modelError(Exception ex) {
-                  latch.countDown();
-                }
-              });
-          }
-        });
-      
-      latch.await();
+      final AtomicReference<BranchGroup> modelNode = new AtomicReference<BranchGroup>();
+      try {
+        // Load model without ModelManager cache in case its content changed 
+        modelNode.set(ModelManager.getInstance().loadModel(model));
+      } catch (IOException ex) {
+        // modelNode not set
+      }
       
       URLContent pieceModel = null;
-      Content previewModel = null;
       if (modelNode.get() != null) {
         // Copy model to a temporary OBJ content with materials and textures
         if (model instanceof URLContent) {
@@ -123,12 +109,19 @@ public class ImportFurnitureTaskPanel extends ThreadedTaskPanel implements Impor
           }
         } 
 
-        previewModel = model;
         pieceModel = copyToTemporaryOBJContent(modelNode.get(), model);
         int dotIndex = modelName.lastIndexOf('.');
         if (dotIndex != -1) {
           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() {
+            public void modelUpdated(BranchGroup modelRoot) {
+            }
+            
+            public void modelError(Exception ex) {
+            }
+          });
       } else {
         ZipInputStream zipIn = null;
         try {
@@ -154,26 +147,17 @@ public class ImportFurnitureTaskPanel extends ThreadedTaskPanel implements Impor
                 URL entryUrl = new URL("jar:" + urlContent.getURL() + "!/" 
                     + URLEncoder.encode(entryName, "UTF-8").replace("+", "%20").replace("%2F", "/"));
                 final Content entryContent = new TemporaryURLContent(entryUrl);
-                final CountDownLatch entryLatch = new CountDownLatch(1);
-                EventQueue.invokeAndWait(new Runnable() {
-                    public void run() {
-                      // Load content using cache to make it accessible by preview components
-                      ModelManager.getInstance().loadModel(entryContent, new ModelManager.ModelObserver() {
-                          public void modelUpdated(BranchGroup modelRoot) {
-                            modelNode.set(modelRoot);
-                            entryLatch.countDown();
-                          }
-                          
-                          public void modelError(Exception ex) {
-                            entryLatch.countDown();
-                          }
-                        });
+                // Load content using cache to make it accessible by preview components without waiting in EDT
+                ModelManager.getInstance().loadModel(entryContent, true, new ModelManager.ModelObserver() {
+                    public void modelUpdated(BranchGroup modelRoot) {
+                      modelNode.set(modelRoot);
+                    }
+                    
+                    public void modelError(Exception ex) {
                     }
                   });
                 
-                entryLatch.await();
                 if (modelNode.get() != null) {
-                  previewModel =
                   pieceModel = new TemporaryURLContent(entryUrl);
                   if (!entryFileName.toLowerCase().endsWith(".obj")
                       && (this.preferences.isModelContentAlwaysConvertedToOBJFormat()
@@ -209,10 +193,10 @@ public class ImportFurnitureTaskPanel extends ThreadedTaskPanel implements Impor
       
       Vector3f size = ModelManager.getInstance().getSize(modelNode.get());
       // Generate icon image        
-      final Content finalPreviewModel = previewModel;
+      final Content previewModel = pieceModel;
       EventQueue.invokeAndWait(new Runnable() {
           public void run() {
-            iconPreviewComponent.setModel(finalPreviewModel);
+            iconPreviewComponent.setModel(previewModel);
           }
         });
       Thread.sleep(this.firstRendering ? 1000 : 100);
@@ -238,24 +222,9 @@ public class ImportFurnitureTaskPanel extends ThreadedTaskPanel implements Impor
       } else {
         key = null;
       }
-      // Compute a more human readable name with spaces instead of hyphens and without camel case and trailing digit 
-      String pieceName = "" + Character.toUpperCase(modelName.charAt(0));
-      for (int i = 1; i < modelName.length(); i++) {
-        char c = modelName.charAt(i);
-        if (c == '-' || c == '_') {
-          pieceName += ' ';
-        } else if (!Character.isDigit(c) || i < modelName.length() - 1) {
-          // Remove camel case
-          if ((Character.isUpperCase(c) || Character.isDigit(c)) 
-              && Character.isLowerCase(modelName.charAt(i - 1))) {
-            pieceName += ' ';
-            c = Character.toLowerCase(c);
-          }
-          pieceName += c;
-        }
-      }
+      
       CatalogPieceOfFurniture piece = new CatalogPieceOfFurniture(key, 
-          pieceName, null, null, new String [0], null, null, iconContent.get(), null, pieceModel, 
+          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);
       FurnitureCategory defaultCategory = new FurnitureCategory(
@@ -273,6 +242,30 @@ public class ImportFurnitureTaskPanel extends ThreadedTaskPanel implements Impor
       return null;
     }
   }
+
+  /**
+   * Returns a human readable name matching the given model name with spaces instead of hyphens 
+   * and without camel case and trailing digit.
+   */
+  protected String getPieceOfFurnitureName(String modelName) {
+    // Compute a more human readable name with spaces instead of hyphens and without camel case and trailing digit 
+    String pieceName = "" + Character.toUpperCase(modelName.charAt(0));
+    for (int i = 1; i < modelName.length(); i++) {
+      char c = modelName.charAt(i);
+      if (c == '-' || c == '_') {
+        pieceName += ' ';
+      } else if (!Character.isDigit(c) || i < modelName.length() - 1) {
+        // Remove camel case
+        if ((Character.isUpperCase(c) || Character.isDigit(c)) 
+            && Character.isLowerCase(modelName.charAt(i - 1))) {
+          pieceName += ' ';
+          c = Character.toLowerCase(c);
+        }
+        pieceName += c;
+      }
+    }
+    return pieceName;
+  }
   
   /**
    * Returns a copy of a given <code>model</code> as a zip content at OBJ format.


=====================================
src/com/eteks/furniturelibraryeditor/swing/package.properties
=====================================
@@ -122,7 +122,7 @@ EditorPane.about.message=<html><font face="sanssherif"><center><font size="+2"><
     </p><p><font size="-2">\u00a9 Copyrights 2010-2018 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.22
+EditorPane.about.version=1.23
 EditorPane.about.icon=/com/eteks/furniturelibraryeditor/swing/resources/aboutIcon.png
 
 



View it on GitLab: https://salsa.debian.org/java-team/sweethome3d-furniture-editor/compare/c8bc268a70a42c3dca7de950aa3bd1e04ec4ee48...2e61d172217c9e43e9d5bca4f227dd963e4a431a

-- 
View it on GitLab: https://salsa.debian.org/java-team/sweethome3d-furniture-editor/compare/c8bc268a70a42c3dca7de950aa3bd1e04ec4ee48...2e61d172217c9e43e9d5bca4f227dd963e4a431a
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/20181014/ab971cc7/attachment.html>


More information about the pkg-java-commits mailing list