Branch: refs/heads/master
Home: https://github.com/Starlink/starjava
Commit: f2b7b9c8b292ca134466e9a99c90f50df7120a31
https://github.com/Starlink/starjava/commit/f2b7b9c8b292ca134466e9a99c90f50df7120a31
Author: Mark Taylor <[log in to unmask]>
Date: 2013-11-15 (Fri, 15 Nov 2013)
Changed paths:
M jniast/src/main/uk/ac/starlink/ast/Plot.java
M jniast/src/main/uk/ac/starlink/ast/grf/DefaultGrf.java
M jniast/src/perl/Plot.pl
Log Message:
-----------
jniast: fix DefaultGrf/Plot to work headless
As spotted by Satoshi Eguchi (NAOJ), the Plot class cannot be used in
a headless environment because it constructs a JFrame instance.
The reason it does this is to be able to supply a suitably initialised
JComponent instance to DefaultGrf as required by the DefaultGrf constructor.
There are various ways around this, but it looks like DefaultGrf
doesn't really need a JComponent in any case, it just wants a
FontRenderContext. This change gives DefaultGrf a new constructor
that only needs a FontRenderContext, which means that Plot no longer
needs to construct a JFrame.
|