public class MapMaker
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected org.jfree.data.xy.XYSeriesCollection |
collection
the collection to which series data will be added
|
protected boolean |
debug
If true, enable debug output
|
protected static java.lang.String |
DEFAULT_CATEGORY
Category name for values, if none is provided
|
protected static int |
DEFAULT_HEIGHT
Default output height in pixels
|
protected static int |
DEFAULT_WIDTH
Default output width in pixels
|
protected java.awt.Dimension |
gridSize
rows, cols for multiple plots
|
protected int |
height
Output height in pixels
|
static java.lang.String |
ID
CVS ID
|
protected java.awt.Image |
image
background image to lay the chart over
|
protected boolean |
l180
should -180 to 180 longitude be used instead of 0 to 360?
|
protected boolean |
legend
Should a legend be shown?
|
protected boolean |
multiple
If true, separate plots for each series
|
protected java.lang.String |
title
title for the plot, null for none
|
protected int |
width
Output width in pixels
|
Constructor and Description |
---|
MapMaker() |
Modifier and Type | Method and Description |
---|---|
org.jfree.chart.JFreeChart |
createChart()
Create a chart object, using the data collected and the user's options
|
org.jfree.chart.JFreeChart |
createChart(org.jfree.data.xy.XYSeriesCollection data,
java.lang.String title,
java.awt.Image image,
boolean legend)
Create a chart for a combined or multiple plot.
|
java.awt.image.BufferedImage |
createSeparateCharts()
Create the grid of plots, rendered into a BufferedImage.
|
java.awt.Dimension |
getBestGridSize()
Get the grid size given the number of series in the collection.
|
java.awt.Dimension |
getGridSize()
Get the grid-size for multi-map display
|
static void |
main(java.lang.String[] args)
Command-line interface
|
void |
parseData(java.io.File data)
Parse the data in a file
|
void |
parseText(java.io.InputStream in)
Parses the data the user provides via a specified input stream
|
void |
parseXls(java.io.File xls)
Parse spreadsheet data
|
void |
saveChartToFile(java.io.File output)
Write the plot to a PNG file
|
void |
setDebug(boolean debug)
Enable debugging.
|
void |
setGridSize(java.awt.Dimension gridSize)
Set the grid-size for multi-map display
|
void |
setHeight(int height)
Set the height for output
|
void |
setImage(java.awt.Image image)
Set a background image.
|
void |
setL180(boolean l180)
If true, show west longitude from -180 to 0, otherwise, show as 180 to
360.
|
void |
setLegend(boolean legend)
If true, show a legend
|
void |
setMarker(java.awt.image.BufferedImage marker)
Set the marker (plot symbol)
|
void |
setMultiple(boolean multiple)
If true, show multiple plots.
|
void |
setTitle(java.lang.String title)
Set the plot title.
|
void |
setWidth(int width)
Set the width for output
|
public static final java.lang.String ID
protected static final int DEFAULT_WIDTH
protected static final int DEFAULT_HEIGHT
protected static final java.lang.String DEFAULT_CATEGORY
protected org.jfree.data.xy.XYSeriesCollection collection
protected boolean l180
protected boolean legend
protected boolean debug
protected boolean multiple
protected int width
protected int height
protected java.awt.Image image
protected java.lang.String title
protected java.awt.Dimension gridSize
public void setDebug(boolean debug)
debug
- true to debugpublic void setMarker(java.awt.image.BufferedImage marker)
marker
- image datapublic java.awt.Dimension getBestGridSize()
public void setGridSize(java.awt.Dimension gridSize)
gridSize
- grid rows and colspublic java.awt.Dimension getGridSize()
public void setL180(boolean l180)
l180
- to show west longitude as negativepublic void setLegend(boolean legend)
legend
- Enable legendpublic void setMultiple(boolean multiple)
multiple
- Multiple (separate) plotspublic void setImage(java.awt.Image image)
image
- the imagepublic void setWidth(int width)
width
- pixelspublic void setHeight(int height)
height
- pPixelspublic void setTitle(java.lang.String title)
title
- textpublic void parseData(java.io.File data) throws java.io.IOException
data
- the filejava.io.IOException
- File could not be parsedpublic void parseXls(java.io.File xls) throws java.io.IOException
xls
- the spreadsheetjava.io.IOException
- File could not be parsedpublic void parseText(java.io.InputStream in) throws java.io.IOException
in
- The data streamjava.io.IOException
- Failure to read datapublic org.jfree.chart.JFreeChart createChart()
public org.jfree.chart.JFreeChart createChart(org.jfree.data.xy.XYSeriesCollection data, java.lang.String title, java.awt.Image image, boolean legend)
data
- The data collection to usetitle
- Title for plotimage
- Background imagelegend
- True to show legendpublic java.awt.image.BufferedImage createSeparateCharts()
public void saveChartToFile(java.io.File output) throws java.io.IOException
output
- The filejava.io.IOException
- Failure to write plotpublic static void main(java.lang.String[] args)
args
- InputCopyright \ (C) Arizona Board of Regents on behalf of the \ Planetary Image Research Laboratory, Lunar and \ Planetary Laboratory at the University of Arizona