From 085445ab9cc37a58634f108280bf74359ec9340d Mon Sep 17 00:00:00 2001 From: kruland2607 Date: Mon, 4 Nov 2013 14:45:48 -0600 Subject: [PATCH 1/2] Fixed tool tip to accomodate sorting. --- swing/src/net/sf/openrocket/gui/main/SimulationPanel.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/swing/src/net/sf/openrocket/gui/main/SimulationPanel.java b/swing/src/net/sf/openrocket/gui/main/SimulationPanel.java index 4f0dbf9b5..4a238463a 100644 --- a/swing/src/net/sf/openrocket/gui/main/SimulationPanel.java +++ b/swing/src/net/sf/openrocket/gui/main/SimulationPanel.java @@ -608,6 +608,8 @@ public class SimulationPanel extends JPanel { if (row < 0 || row >= document.getSimulationCount()) return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); + + row = table.getRowSorter().convertRowIndexToModel(row); // A JLabel is self-contained and has set its own tool tip if (value instanceof JLabel) { From a1944b765f13bd9ab1d0c184b85cc4acd6f9baa0 Mon Sep 17 00:00:00 2001 From: kruland2607 Date: Mon, 4 Nov 2013 14:49:20 -0600 Subject: [PATCH 2/2] Added workaround for problem introduced in Java 1.7.0_45-b18 with DataFlavor being loaded in a different classloader. We cannot refer to singletons in the RocketComponent class. --- .../rocketcomponent/RocketComponent.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/core/src/net/sf/openrocket/rocketcomponent/RocketComponent.java b/core/src/net/sf/openrocket/rocketcomponent/RocketComponent.java index 9580b4644..422f110f9 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/RocketComponent.java +++ b/core/src/net/sf/openrocket/rocketcomponent/RocketComponent.java @@ -8,7 +8,6 @@ import java.util.NoSuchElementException; import net.sf.openrocket.appearance.Appearance; import net.sf.openrocket.appearance.Decal; -import net.sf.openrocket.l10n.Translator; import net.sf.openrocket.preset.ComponentPreset; import net.sf.openrocket.startup.Application; import net.sf.openrocket.util.ArrayList; @@ -31,7 +30,12 @@ import org.slf4j.LoggerFactory; public abstract class RocketComponent implements ChangeSource, Cloneable, Iterable, Visitable { private static final Logger log = LoggerFactory.getLogger(RocketComponent.class); - private static final Translator trans = Application.getTranslator(); + + // Because of changes to Java 1.7.0-45's mechanism to construct DataFlavor objects (used in Drag and Drop) + // We cannot access static members of the Application object in this class. Instead of holding + // on to the Translator object, we'll just use when we need it. + //private static final Translator trans = Application.getTranslator(); + /* * Text is suitable to the form @@ -40,19 +44,19 @@ public abstract class RocketComponent implements ChangeSource, Cloneable, Iterab public enum Position { /** Position relative to the top of the parent component. */ //// Top of the parent component - TOP(trans.get("RocketComponent.Position.TOP")), + TOP(Application.getTranslator().get("RocketComponent.Position.TOP")), /** Position relative to the middle of the parent component. */ //// Middle of the parent component - MIDDLE(trans.get("RocketComponent.Position.MIDDLE")), + MIDDLE(Application.getTranslator().get("RocketComponent.Position.MIDDLE")), /** Position relative to the bottom of the parent component. */ //// Bottom of the parent component - BOTTOM(trans.get("RocketComponent.Position.BOTTOM")), + BOTTOM(Application.getTranslator().get("RocketComponent.Position.BOTTOM")), /** Position after the parent component (for body components). */ //// After the parent component - AFTER(trans.get("RocketComponent.Position.AFTER")), + AFTER(Application.getTranslator().get("RocketComponent.Position.AFTER")), /** Specify an absolute X-coordinate position. */ //// Tip of the nose cone - ABSOLUTE(trans.get("RocketComponent.Position.ABSOLUTE")); + ABSOLUTE(Application.getTranslator().get("RocketComponent.Position.ABSOLUTE")); private String title;