Beispiel #1
0
 /**
  * Override the base class method to catch any events.
  *
  * @param e The action event.
  */
 public void actionPerformed(ActionEvent e) {
   String cmd = e.getActionCommand();
   try {
     if (cmd.equals(CMD_BARBSIZE)) {
       setFlowScale(GuiUtils.getBoxValue((JComboBox) e.getSource()));
     } else if (cmd.equals(CMD_INTERVAL)) {
       setVerticalInterval(GuiUtils.getBoxValue((JComboBox) e.getSource()));
     } else {
       super.actionPerformed(e);
     }
   } catch (NumberFormatException nfe) {
     userErrorMessage("Incorrect number format");
   }
 }
Beispiel #2
0
  /**
   * Make the control widgets
   *
   * @param controlWidgets list of control widgets
   * @throws RemoteException Java RMI error
   * @throws VisADException VisAD Error
   */
  public void getControlWidgets(List controlWidgets) throws VisADException, RemoteException {
    super.getControlWidgets(controlWidgets);

    JComponent barbSizeBox =
        GuiUtils.wrap(
            GuiUtils.createValueBox(
                this, CMD_BARBSIZE, (int) flowScaleValue, Misc.createIntervalList(1, 10, 1), true));

    // make possible another component(s) to put on same line w barbSizeBox
    JComponent extra = doMakeExtraComponent();

    JComponent rightPanel =
        GuiUtils.leftCenter(
            ((extra != null)
                ? (JComponent) GuiUtils.hflow(Misc.newList(barbSizeBox, extra))
                : (JComponent) barbSizeBox),
            GuiUtils.filler());
    controlWidgets.add(new WrapperWidget(this, GuiUtils.rLabel("Windbarb size: "), rightPanel));
  }
Beispiel #3
0
 /**
  * Utility method to notify the user with a message
  *
  * @param message The message
  */
 public void userMessage(String message) {
   if (displayControl == null) {
     return;
   }
   displayControl.userMessage(message);
 }
Beispiel #4
0
 /**
  * Utility method to log an exception.
  *
  * @param message The message
  * @param exc The exception
  */
 public void logException(String message, Exception exc) {
   if (displayControl == null) {
     return;
   }
   displayControl.logException(message, exc);
 }
Beispiel #5
0
 /**
  * Get the display conventions from the contol
  *
  * @return The {@link ucar.unidata.idv.DisplayConventions} to use.
  */
 public DisplayConventions getDisplayConventions() {
   if (displayControl == null) {
     return null;
   }
   return displayControl.getDisplayConventions();
 }
Beispiel #6
0
 /** Method called after initialization. */
 public void initDone() {
   super.initDone();
   setFlowScale(flowScaleValue);
   setVerticalInterval(verticalIntervalValue);
 }