updates for 0.9.2
authorplaa <plaa@180e2498-e6e9-4542-8430-84ac67f01cd8>
Mon, 13 Jul 2009 16:48:41 +0000 (16:48 +0000)
committerplaa <plaa@180e2498-e6e9-4542-8430-84ac67f01cd8>
Mon, 13 Jul 2009 16:48:41 +0000 (16:48 +0000)
git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@13 180e2498-e6e9-4542-8430-84ac67f01cd8

12 files changed:
ChangeLog
ReleaseNotes
build.properties
dists/OpenRocket-0.9.2-src.zip [new file with mode: 0644]
dists/OpenRocket-0.9.2.jar [new file with mode: 0644]
src/net/sf/openrocket/gui/components/DescriptionArea.java
src/net/sf/openrocket/gui/configdialog/NoseConeConfig.java
src/net/sf/openrocket/gui/configdialog/RingComponentConfig.java
src/net/sf/openrocket/gui/configdialog/TransitionConfig.java
src/net/sf/openrocket/gui/main/BasicFrame.java
src/net/sf/openrocket/gui/main/SimulationEditDialog.java
src/net/sf/openrocket/util/ConcurrentProgressMonitorInputStream.java

index d5a8941f5d1c9dd542009f831054812c79847ee2..ded3fbdcd87a27b7ef8356b3cd3e6ea8e2a2269e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-07-13  Sampo Niskanen
+
+       * Release 0.9.2
+
+2009-07-12  Sampo Niskanen
+
+       * [BUG] Better DescriptionArea based on JEditorPane
+
 2009-07-09  Sampo Niskanen
 
        * [BUG] Fixed imperial unit conversions
index 2703d97174849b44667f461d92492ed5ba5dca17..4b6bce529631e6eec6e8c29a3f35a099062d2ad0 100644 (file)
@@ -1,9 +1,10 @@
 
-OpenRocket 0.9.2  (future):
----------------------------
+OpenRocket 0.9.2  (2009-07-13):
+-------------------------------
 
-- a new and enhanced "Edit motor configurations" dialog
-- a search field in the motor selection dialog
+Fixed imperial unit conversions.  Significant UI enhancements to the
+motor configuration edit dialog, motor selection dialog and file
+open/save.
 
 
 OpenRocket 0.9.1  (2009-06-09):
index 9fd21c5aa379a87cad4903d1633183b8f463a250..99150c0ffd4009389163906f6a060624e1d091c5 100644 (file)
@@ -1,6 +1,6 @@
 
 # The OpenRocket build version
-build.version=0.9.2pre
+build.version=0.9.2
 
 # The source of the package.  When building a package for a specific
 # distribution (Debian, Fedora etc.), this should be changed appropriately!
diff --git a/dists/OpenRocket-0.9.2-src.zip b/dists/OpenRocket-0.9.2-src.zip
new file mode 100644 (file)
index 0000000..102847f
Binary files /dev/null and b/dists/OpenRocket-0.9.2-src.zip differ
diff --git a/dists/OpenRocket-0.9.2.jar b/dists/OpenRocket-0.9.2.jar
new file mode 100644 (file)
index 0000000..4291221
Binary files /dev/null and b/dists/OpenRocket-0.9.2.jar differ
index 264953f7c9c2c6d676e38c8740c33e3114642692..ac26ae837d7c01737c9e7c853d0fd8de1e84805d 100644 (file)
@@ -1,58 +1,60 @@
 package net.sf.openrocket.gui.components;
 
 import java.awt.Dimension;
+import java.awt.Font;
 import java.awt.Rectangle;
 
-import javax.swing.JPanel;
+import javax.swing.JEditorPane;
 import javax.swing.JScrollPane;
 import javax.swing.ScrollPaneConstants;
-
-import net.miginfocom.swing.MigLayout;
+import javax.swing.SwingUtilities;
 
 public class DescriptionArea extends JScrollPane {
 
-       private ResizeLabel text;
-       private MigLayout layout;
-       private JPanel panel;
+       private final JEditorPane editorPane;
        
        public DescriptionArea(int rows) {
-               this(rows, -2);
+               this(rows, -1);
        }
        
        public DescriptionArea(int rows, float size) {
                super(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
                                ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
                
-               layout = new MigLayout("ins 0 2px, fill");
-               panel = new JPanel(layout);
+               editorPane = new JEditorPane("text/html", "");
+               Font font = editorPane.getFont();
+               editorPane.setFont(font.deriveFont(font.getSize2D() + size));
+               editorPane.setEditable(false);
                
-               text = new ResizeLabel(" ",size);
-               text.validate();
-               Dimension dim = text.getPreferredSize();
-               dim.height = (dim.height+2)*rows + 2;
-               this.setPreferredSize(dim);
+               // Calculate correct height
+               editorPane.setText("abc");
+               Dimension oneline = editorPane.getPreferredSize();
+               editorPane.setText("abc<br>def");
+               Dimension twolines = editorPane.getPreferredSize();
+               editorPane.setText("");
                
-               panel.add(text, "growx");
+               int lineheight = twolines.height - oneline.height;
+               int extraheight = oneline.height - lineheight;
+               
+               Dimension dim = editorPane.getPreferredSize();
+               dim.height = lineheight * rows + extraheight + 2;
+               this.setPreferredSize(dim);
                
-               this.setViewportView(panel);
-               this.revalidate();
+               this.setViewportView(editorPane);
        }
        
        public void setText(String txt) {
-               if (!txt.startsWith("<html>"))
-                       txt = "<html>" + txt;
-               text.setText(txt);
-       }
-       
-       
-       @Override
-       public void validate() {
-               
-               Rectangle dim = this.getViewportBorderBounds();
-               layout.setComponentConstraints(text, "width "+ dim.width + ", growx");
-               super.validate();
-               text.validate();
+               editorPane.setText(txt);
+               editorPane.revalidate();
+               SwingUtilities.invokeLater(new Runnable() {
 
+                       @Override
+                       public void run() {
+                               editorPane.scrollRectToVisible(new Rectangle(0,0,1,1));
+                       }
+                       
+               });
+               editorPane.scrollRectToVisible(new Rectangle(0,0,1,1));
        }
        
 }
index f1b6daf24bf29fadce8bf2e3ad725e5a398e7afe..14ccb9e4819eda2afea5fd3457a6c44c7ccc9c4e 100644 (file)
@@ -35,7 +35,7 @@ public class NoseConeConfig extends RocketComponentConfig {
        private JSlider shapeSlider;
        
        // Prepended to the description from NoseCone.DESCRIPTIONS
-       private static final String PREDESC = "<html><p style=\"font-size: x-small\">";
+       private static final String PREDESC = "<html>";
        
        public NoseConeConfig(RocketComponent c) {
                super(c);
index c658de9103fc1be277216a4ee34d0032e5cfec39..f589dedc518903fd7c084536ccd943822fff403b 100644 (file)
@@ -147,12 +147,12 @@ public class RingComponentConfig extends RocketComponentConfig {
                JPanel sub = materialPanel(new JPanel(new MigLayout()), Material.Type.BULK);
                
                if (component instanceof EngineBlock) {
-                       DescriptionArea desc = new DescriptionArea(6,-1);
+                       final DescriptionArea desc = new DescriptionArea(6);
                        desc.setText("<html>An <b>engine block</b> stops the motor from moving forwards " +
                                        "in the motor mount tube.<br><br>In order to add a motor, create a " +
                                        "<b>body tube</b> or <b>inner tube</b> and mark it as a motor mount in " +
                                        "the <em>Motor</em> tab.");
-                       sub.add(desc, "growx");
+                       sub.add(desc, "width 1px, growx, wrap");
                }
                panel.add(sub,"cell 4 0, gapleft paragraph, aligny 0%, spany");
                
index 3a908ee850567714491e0d6a425c993ef37145c5..8f4660b1b23ef03757921f3478379decca55ab86 100644 (file)
@@ -34,7 +34,7 @@ public class TransitionConfig extends RocketComponentConfig {
        
 
        // Prepended to the description from Transition.DESCRIPTIONS
-       private static final String PREDESC = "<html><p style=\"font-size: x-small\">";
+       private static final String PREDESC = "<html>";
        
        
        public TransitionConfig(RocketComponent c) {
@@ -184,8 +184,6 @@ public class TransitionConfig extends RocketComponentConfig {
        
        
        
-       
-       
        private void updateEnabled() {
                boolean e = ((Transition)component).getType().usesParameter();
                shapeLabel.setEnabled(e);
index fc523d9223dd652d1277f1f80558dfb790c021b6..ebd86276b885925d47cc072030eaeb102f357ca9 100644 (file)
@@ -17,6 +17,7 @@ import java.awt.event.WindowEvent;
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.concurrent.ExecutionException;
@@ -919,8 +920,26 @@ public class BasicFrame extends JFrame {
        }
        
        
+       public static void main(final String[] args) {
+               
+               // Run the actual startup method in the EDT since it can use dialogs etc. 
+               try {
+                       SwingUtilities.invokeAndWait(new Runnable() {
+                               @Override
+                               public void run() {
+                                       runMain(args);
+                               }
+                       });
+               } catch (InterruptedException e) {
+                       e.printStackTrace();
+               } catch (InvocationTargetException e) {
+                       e.printStackTrace();
+               }
+               
+       }
        
-       public static void main(String[] args) {
+       
+       private static void runMain(String[] args) {
                
                /*
                 * Set the look-and-feel.  On Linux, Motif/Metal is sometimes incorrectly used 
@@ -928,12 +947,6 @@ public class BasicFrame extends JFrame {
                 * other alternatives.
                 */
                try {
-                       UIManager.LookAndFeelInfo[] info = UIManager.getInstalledLookAndFeels();
-//                     System.out.println("Available look-and-feels:");
-//                     for (int i=0; i<info.length; i++) {
-//                             System.out.println("  "+info[i]);
-//                     }
-
                        // Set system L&F
                        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                        
@@ -944,19 +957,22 @@ public class BasicFrame extends JFrame {
                                        laf.getName().matches(".*[mM][eE][tT][aA][lL].*")) {
                                
                                // Search for better LAF
-                               for (UIManager.LookAndFeelInfo l: info) {
-                                       if (l.getName().matches(".*[gG][tT][kK].*")) {
-                                               UIManager.setLookAndFeel(l.getClassName());
-                                               break;
-                                       }
-                                       if (l.getName().contains(".*[wW][iI][nN].*")) {
-                                               UIManager.setLookAndFeel(l.getClassName());
-                                               break;
-                                       }
-                                       if (l.getName().contains(".*[mM][aA][cC].*")) {
-                                               UIManager.setLookAndFeel(l.getClassName());
-                                               break;
-                                       }
+                               UIManager.LookAndFeelInfo[] info = UIManager.getInstalledLookAndFeels();
+                               String lafNames[] = {
+                                               ".*[gG][tT][kK].*",
+                                               ".*[wW][iI][nN].*",
+                                               ".*[mM][aA][cC].*",
+                                               ".*[aA][qQ][uU][aA].*",
+                                               ".*[nN][iI][mM][bB].*"
+                               };
+                               
+                               lf: for (String lafName: lafNames) {
+                                       for (UIManager.LookAndFeelInfo l: info) {
+                                               if (l.getName().matches(lafName)) {
+                                                       UIManager.setLookAndFeel(l.getClassName());
+                                                       break lf;
+                                               }
+                                       }                                       
                                }
                        }
                } catch (Exception e) {
index 5074d1120f00885ae7868da24ee5373893430f0b..d4774471a3aa784166dfa1b910c21312d13061cc 100644 (file)
@@ -649,7 +649,7 @@ public class SimulationEditDialog extends JDialog {
                panel.add(sub, "growx, growy");
                
                
-               DescriptionArea desc = new DescriptionArea(5, -1);
+               DescriptionArea desc = new DescriptionArea(5);
                desc.setText("<html><p>" +
                                "<i>Simulation listeners</i> is an advanced feature that allows "+
                                "user-written code to listen to and interact with the simulation.  " +
index abe83978171a229b4a116a107a83f61cc68602bb..6c45a6ccf206981980346ba6e34c1b696564e2de 100644 (file)
@@ -1,7 +1,3 @@
-/*
- * TODO: CRITICAL: Licensing
- */
-
 package net.sf.openrocket.util;
 
 import java.awt.Component;