public class StiltsPlotFormatter extends Object
Modifier and Type | Field and Description |
---|---|
static Suffixer[] |
LAYER_SUFFIXERS
List of suffixers suitable for per-layer parameters.
|
static Suffixer[] |
ZONE_SUFFIXERS
List of suffixers suitable for per-zone parameters.
|
Constructor and Description |
---|
StiltsPlotFormatter(CredibleString invocation,
Suffixer zoneSuffixer,
Suffixer layerSuffixer,
boolean includeDflts,
LineEnder lineEnder,
int levelIndent,
int cwidth,
TableNamer tableNamer)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static StyledDocument |
createBasicDocument(String txt)
Utility method returning a StyledDocument instance with some
supplied plain text.
|
Executable |
createExecutable(StiltsPlot plot)
Creates a task Executable based on the state of this PlotSpec.
|
PlotDisplay<?,?> |
createPlotComponent(StiltsPlot plot,
boolean caching)
Attempts to create a PlotDisplay that re-creates the plot
specified by this object.
|
StyledDocument |
createShellDocument(StiltsPlot plot)
Returns a Document, suitable for use with a JTextPane,
formatting the given plot specification.
|
CredibleString |
getInvocation()
Returns the invocation used to introduce the STILTS command.
|
Suffixer |
getLayerSuffixer()
Returns the policy for selecting per-layer parameter suffixes.
|
TableNamer |
getTableNamer()
Returns the file naming policy.
|
Suffixer |
getZoneSuffixer()
Returns the policy for selecting per-zone parameter suffixes.
|
void |
setForceError(boolean forceError)
Sets whether the generated stilts commands will be made to
produce a gratuitous error.
|
public static final Suffixer[] ZONE_SUFFIXERS
public static final Suffixer[] LAYER_SUFFIXERS
public StiltsPlotFormatter(CredibleString invocation, Suffixer zoneSuffixer, Suffixer layerSuffixer, boolean includeDflts, LineEnder lineEnder, int levelIndent, int cwidth, TableNamer tableNamer)
invocation
- display text to introduce the STILTS commandzoneSuffixer
- defines how per-zone parameter suffixes
are generatedlayerSuffixer
- defines how per-layer parameter suffixes
are generatedincludeDflts
- if true, all parameters are included;
if false, only those with non-default valueslineEnder
- line end presentation policylevelIndent
- number of spaces per indentation levelcwidth
- nominal formatting width in characters;
this affects line wrapping, but actual
wrapping may depend on other factors tootableNamer
- determines how tables are namedpublic CredibleString getInvocation()
public Suffixer getZoneSuffixer()
public Suffixer getLayerSuffixer()
public TableNamer getTableNamer()
public void setForceError(boolean forceError)
forceError
- true to force an error from generated commandspublic Executable createExecutable(StiltsPlot plot) throws TaskException
If this method returns without error there is a fair chance that the serializations prodiced from this object will produce a faithful reproduction of the specified plot.
TaskException
- if there is some other error in setting up
the executable; probably incorrect parameter
assignments of some kindpublic PlotDisplay<?,?> createPlotComponent(StiltsPlot plot, boolean caching) throws TaskException, IOException, InterruptedException
caching
- whether the plotted image is to be cachedTaskException
IOException
InterruptedException
AbstractPlot2Task.createPlotComponent(uk.ac.starlink.task.Environment, boolean)
public StyledDocument createShellDocument(StiltsPlot plot)
plot
- plot speicificationpublic static StyledDocument createBasicDocument(String txt)
txt
- text contentCopyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.