updates for 0.9.2
This commit is contained in:
parent
fc97f776fa
commit
2afc34303f
@ -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
|
||||
|
@ -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):
|
||||
|
@ -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!
|
||||
|
BIN
dists/OpenRocket-0.9.2-src.zip
Normal file
BIN
dists/OpenRocket-0.9.2-src.zip
Normal file
Binary file not shown.
BIN
dists/OpenRocket-0.9.2.jar
Normal file
BIN
dists/OpenRocket-0.9.2.jar
Normal file
Binary file not shown.
@ -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;
|
||||
// Calculate correct height
|
||||
editorPane.setText("abc");
|
||||
Dimension oneline = editorPane.getPreferredSize();
|
||||
editorPane.setText("abc<br>def");
|
||||
Dimension twolines = editorPane.getPreferredSize();
|
||||
editorPane.setText("");
|
||||
|
||||
int lineheight = twolines.height - oneline.height;
|
||||
int extraheight = oneline.height - lineheight;
|
||||
|
||||
Dimension dim = editorPane.getPreferredSize();
|
||||
dim.height = lineheight * rows + extraheight + 2;
|
||||
this.setPreferredSize(dim);
|
||||
|
||||
panel.add(text, "growx");
|
||||
|
||||
this.setViewportView(panel);
|
||||
this.revalidate();
|
||||
this.setViewportView(editorPane);
|
||||
}
|
||||
|
||||
public void setText(String txt) {
|
||||
if (!txt.startsWith("<html>"))
|
||||
txt = "<html>" + txt;
|
||||
text.setText(txt);
|
||||
}
|
||||
editorPane.setText(txt);
|
||||
editorPane.revalidate();
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
editorPane.scrollRectToVisible(new Rectangle(0,0,1,1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate() {
|
||||
|
||||
Rectangle dim = this.getViewportBorderBounds();
|
||||
layout.setComponentConstraints(text, "width "+ dim.width + ", growx");
|
||||
super.validate();
|
||||
text.validate();
|
||||
|
||||
});
|
||||
editorPane.scrollRectToVisible(new Rectangle(0,0,1,1));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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");
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
||||
public static void main(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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
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,18 +957,21 @@ 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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. " +
|
||||
|
@ -1,7 +1,3 @@
|
||||
/*
|
||||
* TODO: CRITICAL: Licensing
|
||||
*/
|
||||
|
||||
package net.sf.openrocket.util;
|
||||
|
||||
import java.awt.Component;
|
||||
|
Loading…
x
Reference in New Issue
Block a user