HiRISE

HiRISE.HiPlan.Shapes
Class EventPoints

java.lang.Object
  extended by HiRISE.HiPlan.Shapes.EventPoints
All Implemented Interfaces:
edu.asu.jmars.layer.util.features.FeatureProvider

public class EventPoints
extends Object
implements edu.asu.jmars.layer.util.features.FeatureProvider

A JMARS shape layer feature provider for events as discrete points in time. The features provided show the location of MRO at a given input collection of times. This provider uses the MTT JSPICE package, and it assumes the MRO Planning layer is loaded with a state file appropriate for the range of events in the input file.

Note that, because this provider returns true with isFileBased(), it is accessed via the Load File... menu item of the shape layer's File menu. It does not appear as a separate menu item. In the resulting file load dialog box, select getDescription() from the Files of Type popup.

The input event file (FILE.events) consists of one or more lines of comma-separated items: a label and a spacecraft event time. Commas in the label may be escaped with a backslash; a literal backslash may also be escaped. The time is assumed to be in day-of-year format (2016-047T00:00:00.000). A line that starts with a hashmark is ignored completely, as are blank lines. Hashmarks appearing anywhere else on a line are treated as normal characters.

Version:
1.2
Author:
Christian Schaller - UA/PIRL

Field Summary
static String COMMENT_MARKER
          Indicates a line of input is to be treated as a comment and ignored.
static String FILE_EXTENSION
          The file extension for an event points file.
static String ID
          Class identification name with source code version and date.
static String SERVICE_DESCRIPTION
          The name of this feature provider.
 
Constructor Summary
EventPoints()
          Creates a new event point feature provider for the JMARS shape layer.
 
Method Summary
 String getDescription()
          Gets a description of this feature provider.
 File[] getExistingSaveToFiles(edu.asu.jmars.layer.util.features.FeatureCollection featureCollection, String basename)
          Gets the names of the files output by a save with the given base name and feature collection.
 String getExtension()
          Gets the file extension.
 boolean isFileBased()
          Tests whether this provider pulls data from a file.
 boolean isRepresentable(edu.asu.jmars.layer.util.features.FeatureCollection featureCollection)
          Tests whether the given collection can be completely represented in the source format of this provider.
 edu.asu.jmars.layer.util.features.FeatureCollection load(String filename)
          Gets a new feature collection from the input filename.
 int save(edu.asu.jmars.layer.util.features.FeatureCollection featureCollection, String filename)
          Writes the specified features to the source from which the feature provider was constructed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final String ID
Class identification name with source code version and date.

See Also:
Constant Field Values

SERVICE_DESCRIPTION

public static final String SERVICE_DESCRIPTION
The name of this feature provider. It is the value returned by the getDescription() method.

See Also:
Constant Field Values

FILE_EXTENSION

public static final String FILE_EXTENSION
The file extension for an event points file. events.

See Also:
Constant Field Values

COMMENT_MARKER

public static final String COMMENT_MARKER
Indicates a line of input is to be treated as a comment and ignored. This symbol must be the first character on the line; comments cannot occur mid-line.

See Also:
Constant Field Values
Constructor Detail

EventPoints

public EventPoints()
Creates a new event point feature provider for the JMARS shape layer.

Method Detail

getDescription

public String getDescription()
Gets a description of this feature provider. This value appears in the shape layer's menu.

Specified by:
getDescription in interface edu.asu.jmars.layer.util.features.FeatureProvider
Returns:
"MRO Event Points"
See Also:
SERVICE_DESCRIPTION

getExistingSaveToFiles

public File[] getExistingSaveToFiles(edu.asu.jmars.layer.util.features.FeatureCollection featureCollection,
                                     String basename)
Gets the names of the files output by a save with the given base name and feature collection.

Specified by:
getExistingSaveToFiles in interface edu.asu.jmars.layer.util.features.FeatureProvider
Parameters:
featureCollection - the feature collection in question.
basename - the base name in question.
Returns:
the names of the output files.

getExtension

public String getExtension()
Gets the file extension.

Specified by:
getExtension in interface edu.asu.jmars.layer.util.features.FeatureProvider
Returns:
the events file extension, events.
See Also:
FILE_EXTENSION

isFileBased

public boolean isFileBased()
Tests whether this provider pulls data from a file. It does.

Specified by:
isFileBased in interface edu.asu.jmars.layer.util.features.FeatureProvider
Returns:
true.

isRepresentable

public boolean isRepresentable(edu.asu.jmars.layer.util.features.FeatureCollection featureCollection)
Tests whether the given collection can be completely represented in the source format of this provider. It cannot.

Specified by:
isRepresentable in interface edu.asu.jmars.layer.util.features.FeatureProvider
Parameters:
featureCollection - the collection to be tested.
Returns:
false.

load

public edu.asu.jmars.layer.util.features.FeatureCollection load(String filename)
Gets a new feature collection from the input filename. If the MRO Planning layer is not loaded, an error dialog is presented and this method returns an empty collection. Note that the test for the existence of the MRO Planning layer happens after the operator attempts to load the events file, not before. This method is not called until after the Shape layer's file chooser has been approved.

Specified by:
load in interface edu.asu.jmars.layer.util.features.FeatureProvider
Parameters:
filename - the input file's filename, supplied from the Shape layer's file chooser.
Returns:
a collection of features, which may be empty.

save

public int save(edu.asu.jmars.layer.util.features.FeatureCollection featureCollection,
                String filename)
Writes the specified features to the source from which the feature provider was constructed. This method is unsupported, so an UnsupportedOperationException is thrown if this method is called.

Specified by:
save in interface edu.asu.jmars.layer.util.features.FeatureProvider
Parameters:
featureCollection - the collection of features in question.
filename - a filename.
Returns:
the number of features saved.

HiRISE

Copyright (C) Arizona Board of Regents on behalf of the Planetary Image Research Laboratory, Lunar and Planetary Laboratory at the University of Arizona