|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectucar.unidata.ui.WindowHolder
ucar.unidata.idv.IdvManager
ucar.unidata.idv.ArgsManager
edu.wisc.ssec.mcidasv.ArgumentManager
public class ArgumentManager
McIDAS-V needs to handle a few command line flags/options that the IDV does not. Only the ability to force the Aqua look and feel currently exists.
Field Summary | |
---|---|
static String |
ARG_JYTHONARGS
McIDAS-V flag that signifies everything that follows is a Jython argument. |
(package private) String |
defaultUserDirectory
Given by the "-user" argument. |
private List<String> |
jythonArguments
Jython arguments, if any. |
private String |
jythonScript
Jython script to execute, or "<none>" if one was not given. |
static String |
USAGE_MESSAGE
usage message |
Fields inherited from class ucar.unidata.idv.ArgsManager |
---|
argDisplayB64Xml, argXidvFiles, b64Bundles, fileMappingFiles, fileMappingIds, installPlugins, jythonCode, listResources, noGui, persistentCommandLineArgs, plugins, printJnlpBundles, RUNNABLE_MAX_TRIES, scriptingFiles, testArchive, testDir, testEval, testMode |
Fields inherited from class ucar.unidata.ui.WindowHolder |
---|
contents, dialog, frame, window |
Constructor Summary | |
---|---|
ArgumentManager(IntegratedDataViewer idv,
String[] args)
Just bubblin' on up the inheritance hierarchy. |
Method Summary | |
---|---|
private static List<String> |
extractJythonArgs(int index,
String[] args)
|
List<PatternFileFilter> |
getBundleFileFilters()
|
List<PatternFileFilter> |
getBundleFilters(boolean fromOpen)
Returns a list of PatternFileFilter s that can be used to determine
if a file is a bundle. |
List<String> |
getJythonArguments()
Returns Jython arguments. |
String |
getJythonScript()
Returns the name of the Jython script the user has provided. |
protected String |
getUsageMessage()
Append some McIDAS-V specific command line options to the default IDV usage message. |
PatternFileFilter |
getXidvFileFilter()
|
PatternFileFilter |
getXidvZidvFileFilter()
|
PatternFileFilter |
getZidvFileFilter()
|
boolean |
hasJythonArguments()
Determine whether or not the user has provided any arguments for a Jython script. |
static boolean |
isBundle(String name)
Tests name to see if it has a known bundle extension. |
boolean |
isXidvFile(String name)
|
static boolean |
isXmlBundle(String name)
Tests to see if name has a known XML bundle extension. |
boolean |
isZidvFile(String name)
|
static boolean |
isZippedBundle(String name)
Tests to see if name has a known zipped bundle extension. |
protected int |
parseArg(String arg,
String[] args,
int idx)
Currently we're only handling the -forceaqua flag so we can
mitigate some overlay issues we've been seeing on OS X Leopard. |
protected void |
processInitialBundles()
Gets called by the IDV to process the set of initial files, e.g., default bundles, command line bundles, jnlp files, etc. |
void |
usage(String err)
Print out the command line usage message and exit |
Methods inherited from class ucar.unidata.idv.ArgsManager |
---|
checkArg, getCollabHostName, getCollabPort, getDoCollabServer, getFixedTimeString, getInitCatalogs, getIslInteractive, getIsOffScreen, getNoGui, getOriginalArgs, initDone, isBundleFile, isDisplayXmlFile, isIslFile, isJnlpFile, isRbiFile, isScriptingMode, msg, parseArgs, parseArgs, preprocessArgs, processInstanceArgs, setIsOffScreen |
Methods inherited from class ucar.unidata.ui.WindowHolder |
---|
actionPerformed, close, doMakeContents, getContents, getDialog, getFrame, getWindow, getWindowTitle, isShowing, removeAll, setMenuBar, setWindowTitle, shouldMakeDialog, show, show, showModal, toFront, windowIsClosing |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ARG_JYTHONARGS
public static final String USAGE_MESSAGE
private List<String> jythonArguments
private String jythonScript
String defaultUserDirectory
Constructor Detail |
---|
public ArgumentManager(IntegratedDataViewer idv, String[] args)
idv
- The IDV instance.args
- The command line arguments that were given.Method Detail |
---|
private static List<String> extractJythonArgs(int index, String[] args)
protected int parseArg(String arg, String[] args, int idx) throws Exception
-forceaqua
flag so we can
mitigate some overlay issues we've been seeing on OS X Leopard.
parseArg
in class ArgsManager
arg
- The current argument we're examining.args
- The actual array of arguments.idx
- The index of arg
within args
.
Exception
- Throw bad things off to something that can handle 'em!public void usage(String err)
usage
in class ArgsManager
err
- The usage messageprotected String getUsageMessage()
getUsageMessage
in class ArgsManager
public boolean hasJythonArguments()
true
if the user has provided Jython arguments,
false
otherwise.public List<String> getJythonArguments()
List
of Strings
containing the
arguments or an empty List
if there were no arguments given.public String getJythonScript()
protected void processInitialBundles() throws VisADException, RemoteException
Overridden by McIDAS-V to remove bundle file paths that are zero
characters long. This was happening because runMcV.bat
was
always passing '-bundle ""' on the command line (for Windows).
processInitialBundles
in class ArgsManager
VisADException
- When something untoward happens
RemoteException
- When something untoward happenspublic List<PatternFileFilter> getBundleFileFilters()
getBundleFileFilters
in class ArgsManager
ArgsManager.getBundleFileFilters()
public List<PatternFileFilter> getBundleFilters(boolean fromOpen)
PatternFileFilter
s that can be used to determine
if a file is a bundle.
If fromOpen
is true
, the
returned list will contain PatternFileFilter
s for bundles as
well as JNLP and ISL files. If false
, the returned list will
only contain filters for XML and zipped bundles.
fromOpen
- Whether or not this has been called from an
"open file" dialog.
public PatternFileFilter getXidvFileFilter()
getXidvFileFilter
in class ArgsManager
ArgsManager.getXidvFileFilter()
public PatternFileFilter getZidvFileFilter()
getZidvFileFilter
in class ArgsManager
ArgsManager.getZidvFileFilter()
public PatternFileFilter getXidvZidvFileFilter()
getXidvZidvFileFilter
in class ArgsManager
ArgsManager.getXidvZidvFileFilter()
public boolean isZidvFile(String name)
isZidvFile
in class ArgsManager
public boolean isXidvFile(String name)
isXidvFile
in class ArgsManager
public static boolean isXmlBundle(String name)
name
has a known XML bundle extension.
name
- Name of the bundle.
name
has an XML bundle suffix.public static boolean isZippedBundle(String name)
name
has a known zipped bundle extension.
name
- Name of the bundle.
name
has zipped bundle suffix.public static boolean isBundle(String name)
name
to see if it has a known bundle extension.
name
- Name of the bundle.
name
has a bundle suffix.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |