From eaa98af52b0c483c03cc9958d8ccc97359752332 Mon Sep 17 00:00:00 2001 From: JoePfeiffer Date: Sun, 7 Jan 2024 14:37:09 -0700 Subject: [PATCH] Move abort message to lower left; set background color to white and put a red border around it. --- .../sf/openrocket/gui/plot/SimulationPlot.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/swing/src/net/sf/openrocket/gui/plot/SimulationPlot.java b/swing/src/net/sf/openrocket/gui/plot/SimulationPlot.java index 218f4dda2..540a43ee1 100644 --- a/swing/src/net/sf/openrocket/gui/plot/SimulationPlot.java +++ b/swing/src/net/sf/openrocket/gui/plot/SimulationPlot.java @@ -619,12 +619,20 @@ public class SimulationPlot { } } } + + if (abortString != "") { + TextTitle abortsTitle = new TextTitle(abortString, + new Font(Font.SANS_SERIF, Font.BOLD, 14), Color.RED, + RectangleEdge.TOP, + HorizontalAlignment.LEFT, VerticalAlignment.TOP, + new RectangleInsets(5, 5, 5, 5)); + abortsTitle.setBackgroundPaint(Color.WHITE); + BlockBorder abortsBorder = new BlockBorder(Color.RED); + abortsTitle.setFrame(abortsBorder); + XYTitleAnnotation abortsAnnotation = new XYTitleAnnotation(0.01, 0.01, abortsTitle, RectangleAnchor.BOTTOM_LEFT); - TextTitle abortsTitle = new TextTitle(abortString, new Font(Font.SANS_SERIF, Font.BOLD, 14), Color.RED, RectangleEdge.TOP, HorizontalAlignment.LEFT, - VerticalAlignment.TOP, RectangleInsets.ZERO_INSETS); - XYTitleAnnotation abortsAnnotation = new XYTitleAnnotation(0.98, 0.99, abortsTitle, RectangleAnchor.TOP_RIGHT); - - chart.getXYPlot().addAnnotation(abortsAnnotation); + chart.getXYPlot().addAnnotation(abortsAnnotation); + } } private static class LegendItems implements LegendItemSource {