public class NuView extends WindowAdapter implements CmdlineConsumer
Modifier and Type | Method and Description |
---|---|
int |
checkKeyword(String mainName,
int thisArg,
String[] args)
Handle subclass-specific command line options and their arguments.
|
int |
checkOption(String mainName,
char ch,
String arg)
Handle subclass-specific command line options and their arguments.
If -abc -d efg -h -1 -i is specified, this method will be called a maximum of 5 times: checkOption(mainName, 'a', "bc"); checkOption(mainName, 'd', "efg"); checkOption(mainName, 'h', "-1"); checkOption(mainName, '1', "-i"); checkOption(mainName, 'i', null); Note that either of the last two method calls may not happen if the preceeding method call claims to have used the following argument (by returning 2. For example, if the third call (where ch is set to 'h') returns 0 or 1, the next call will contain '1' and "-i". |
boolean |
finalizeArgs(String mainName)
Validate arguments after argument parsing has finished.
This is useful for verifying that all required keywords and options have been specified, that options don't conflict with one another, etc. |
void |
initializeArgs()
Method used to initialize any instance variables which may be
changed by a cmdline option.
This is needed when arguments are processed inside the constructor. |
String |
keywordUsage()
A short string included in the usage message to indicate
valid keywords.
An example might be "[username] [password]". |
static void |
main(String[] args) |
String |
optionUsage()
A short string included in the usage message to indicate
valid options.
|
void |
windowClosing(WindowEvent evt) |
windowActivated, windowClosed, windowDeactivated, windowDeiconified, windowGainedFocus, windowIconified, windowLostFocus, windowOpened, windowStateChanged
public NuView(String[] args) throws RemoteException, VisADException
RemoteException
VisADException
public int checkKeyword(String mainName, int thisArg, String[] args)
CmdlineConsumer
checkKeyword
in interface CmdlineConsumer
mainName
- The name of the main class (useful for
error messages.)thisArg
- The index of the current keyword.args
- The full list of arguments.public int checkOption(String mainName, char ch, String arg)
CmdlineConsumer
checkOption
in interface CmdlineConsumer
mainName
- The name of the main class (useful for
error messages.)ch
- Option character. If -a is specified
on the command line, 'a' would be passed to
this method.)arg
- The argument associated with this option.public boolean finalizeArgs(String mainName)
CmdlineConsumer
finalizeArgs
in interface CmdlineConsumer
mainName
- The name of the main class (useful for
error messages.)public void initializeArgs()
CmdlineConsumer
CmdlineParser
will be run
before any instance variables for the extending
class are initialized.initializeArgs
in interface CmdlineConsumer
public String keywordUsage()
CmdlineConsumer
keywordUsage
in interface CmdlineConsumer
public String optionUsage()
CmdlineConsumer
optionUsage
in interface CmdlineConsumer
public void windowClosing(WindowEvent evt)
windowClosing
in interface WindowListener
windowClosing
in class WindowAdapter
public static void main(String[] args) throws RemoteException, VisADException
RemoteException
VisADException
Copyright © 1996–2023 The SSEC Visualization Project. All rights reserved.