private static final float PLOT_STROKE_WIDTH = 1.5f;
private static final Translator trans = Application.getTranslator();
-
+
private static final Color DEFAULT_EVENT_COLOR = new Color(0, 0, 0);
private static final Map<FlightEvent.Type, Color> EVENT_COLORS =
new HashMap<FlightEvent.Type, Color>();
}
}
- final double xcoord;
+ double xcoord;
if (a == 0) {
xcoord = domain.get(tindex);
} else {
FlightDataType type = config.getType(index);
List<Double> range = branch.get(type);
- final double ycoord;
+ // Image annotations are not supported on the right-side axis
+ // TODO: LOW: Can this be achieved by JFreeChart?
+ if (filled.getAxis(index) != SimulationPlotPanel.LEFT) {
+ continue;
+ }
+
+ double ycoord;
if (a == 0) {
ycoord = range.get(tindex);
} else {
ycoord = a * range.get(tindex) + (1 - a) * range.get(tindex + 1);
}
+ // Convert units
+ xcoord = config.getDomainAxisUnit().toUnit(xcoord);
+ ycoord = config.getUnit(index).toUnit(ycoord);
+
XYImageAnnotation annotation =
- new XYImageAnnotation(xcoord, ycoord, image, RectangleAnchor.CENTER);
+ new XYImageAnnotation(xcoord, ycoord, image, RectangleAnchor.CENTER);
annotation.setToolTipText(event);
plot.addAnnotation(annotation);
}
GUIUtil.setDisposableDialogOptions(this, button);
}
-
private String getLabel(FlightDataType type, Unit unit) {
String name = type.getName();
if (unit != null && !UnitGroup.UNITS_NONE.contains(unit) &&