From: plaa Date: Mon, 13 Jul 2009 16:48:41 +0000 (+0000) Subject: updates for 0.9.2 X-Git-Tag: upstream/1.0.0~26 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=3300ab50b96876523862913e63fe168a0fcdb2bd;hp=9e2f62cc62abb3588551d840ea92170918415843;p=debian%2Fopenrocket updates for 0.9.2 git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@13 180e2498-e6e9-4542-8430-84ac67f01cd8 --- diff --git a/ChangeLog b/ChangeLog index d5a8941f..ded3fbdc 100644 --- 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 diff --git a/ReleaseNotes b/ReleaseNotes index 2703d971..4b6bce52 100644 --- a/ReleaseNotes +++ b/ReleaseNotes @@ -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): diff --git a/build.properties b/build.properties index 9fd21c5a..99150c0f 100644 --- a/build.properties +++ b/build.properties @@ -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 index 00000000..102847f6 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 index 00000000..42912210 Binary files /dev/null and b/dists/OpenRocket-0.9.2.jar differ diff --git a/src/net/sf/openrocket/gui/components/DescriptionArea.java b/src/net/sf/openrocket/gui/components/DescriptionArea.java index 264953f7..ac26ae83 100644 --- a/src/net/sf/openrocket/gui/components/DescriptionArea.java +++ b/src/net/sf/openrocket/gui/components/DescriptionArea.java @@ -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
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("")) - txt = "" + 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)); } } diff --git a/src/net/sf/openrocket/gui/configdialog/NoseConeConfig.java b/src/net/sf/openrocket/gui/configdialog/NoseConeConfig.java index f1b6daf2..14ccb9e4 100644 --- a/src/net/sf/openrocket/gui/configdialog/NoseConeConfig.java +++ b/src/net/sf/openrocket/gui/configdialog/NoseConeConfig.java @@ -35,7 +35,7 @@ public class NoseConeConfig extends RocketComponentConfig { private JSlider shapeSlider; // Prepended to the description from NoseCone.DESCRIPTIONS - private static final String PREDESC = "

"; + private static final String PREDESC = ""; public NoseConeConfig(RocketComponent c) { super(c); diff --git a/src/net/sf/openrocket/gui/configdialog/RingComponentConfig.java b/src/net/sf/openrocket/gui/configdialog/RingComponentConfig.java index c658de91..f589dedc 100644 --- a/src/net/sf/openrocket/gui/configdialog/RingComponentConfig.java +++ b/src/net/sf/openrocket/gui/configdialog/RingComponentConfig.java @@ -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("An engine block stops the motor from moving forwards " + "in the motor mount tube.

In order to add a motor, create a " + "body tube or inner tube and mark it as a motor mount in " + "the Motor tab."); - sub.add(desc, "growx"); + sub.add(desc, "width 1px, growx, wrap"); } panel.add(sub,"cell 4 0, gapleft paragraph, aligny 0%, spany"); diff --git a/src/net/sf/openrocket/gui/configdialog/TransitionConfig.java b/src/net/sf/openrocket/gui/configdialog/TransitionConfig.java index 3a908ee8..8f4660b1 100644 --- a/src/net/sf/openrocket/gui/configdialog/TransitionConfig.java +++ b/src/net/sf/openrocket/gui/configdialog/TransitionConfig.java @@ -34,7 +34,7 @@ public class TransitionConfig extends RocketComponentConfig { // Prepended to the description from Transition.DESCRIPTIONS - private static final String PREDESC = "

"; + private static final String PREDESC = ""; 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); diff --git a/src/net/sf/openrocket/gui/main/BasicFrame.java b/src/net/sf/openrocket/gui/main/BasicFrame.java index fc523d92..ebd86276 100644 --- a/src/net/sf/openrocket/gui/main/BasicFrame.java +++ b/src/net/sf/openrocket/gui/main/BasicFrame.java @@ -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

" + "Simulation listeners is an advanced feature that allows "+ "user-written code to listen to and interact with the simulation. " + diff --git a/src/net/sf/openrocket/util/ConcurrentProgressMonitorInputStream.java b/src/net/sf/openrocket/util/ConcurrentProgressMonitorInputStream.java index abe83978..6c45a6cc 100644 --- a/src/net/sf/openrocket/util/ConcurrentProgressMonitorInputStream.java +++ b/src/net/sf/openrocket/util/ConcurrentProgressMonitorInputStream.java @@ -1,7 +1,3 @@ -/* - * TODO: CRITICAL: Licensing - */ - package net.sf.openrocket.util; import java.awt.Component;