Ejemplo n.º 1
0
    CursorPanel(Cursor value) {
      setLayout(new java.awt.GridBagLayout());
      java.awt.GridBagConstraints gridBagConstraints1;
      list = new JList(new java.util.Vector(CURSOR_TYPES.keySet()));
      list.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
      if (value != null) list.setSelectedValue(value.getName(), true);

      gridBagConstraints1 = new java.awt.GridBagConstraints();
      gridBagConstraints1.gridx = 0;
      gridBagConstraints1.gridy = 1;
      gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH;
      gridBagConstraints1.insets = new java.awt.Insets(8, 8, 8, 8);
      gridBagConstraints1.weightx = 1.0;
      gridBagConstraints1.weighty = 1.0;
      add(list, gridBagConstraints1);

      gridBagConstraints1 = new java.awt.GridBagConstraints();
      gridBagConstraints1.gridx = 0;
      gridBagConstraints1.gridy = 0;
      gridBagConstraints1.insets = new java.awt.Insets(8, 8, 0, 8);
      gridBagConstraints1.anchor = java.awt.GridBagConstraints.WEST;
      add(
          new JLabel(
              org.openide.util.NbBundle.getBundle(CursorEditor.class)
                  .getString("CTL_SelectCursorName")),
          gridBagConstraints1);
    }
Ejemplo n.º 2
0
  @Override
  public void actionPerformed(ActionEvent evt) {
    startButton.setEnabled(false);
    setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));

    this.task = new Task();
    this.task.addPropertyChangeListener(this);
    this.task.execute();
  }
Ejemplo n.º 3
0
 public String getJavaInitializationString() {
   if (current == null) return null; // no code to generate
   String cursorName = (String) CURSOR_CONSTANTS.get(new Integer(current.getType()));
   if (cursorName != null) return "new java.awt.Cursor (" + cursorName + ")"; // NOI18N
   return "new java.awt.Cursor (" + current.getType() + ")"; // NOI18N
 }
Ejemplo n.º 4
0
 public String getAsText() {
   if (current == null) return "null"; // NOI18N
   else return current.getName();
 }
Ejemplo n.º 5
0
  /** Invoked when the user presses the start button. */
  public void actionPerformed(ActionEvent evt) {
    if (evt.getActionCommand().equals("start")) {
      StartButton.setEnabled(false);
      cancelButton.setEnabled(true);
      setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
      // Instances of javax.swing.SwingWorker are not reusuable, so
      // we create new instances as needed.
      DownloadMessage theMessage =
          new DownloadMessage() {
            public void setProgress(int Progress) {
              if (myState.equals("SPLIT")) {
                progressBar.setValue(Progress);

              } else if (myState.equals("DOWNLOADREMOTE")) {
                progressBar.setValue(Progress);

              } else if (myState.equals("DOWNLOADLOCALBASE")) {
                progressBar3.setValue(Progress);

              } else if (myState.equals("TOTAL")) {
                progressBar4.setValue(Progress);
                progressBar3.setValue(0);
                progressBar2.setValue(0);
                progressBar.setValue(0);
              }
            }

            public void messageChanged(int Progress, String message) {
              setProgress(Progress);

              taskOutput.append(message + "\n");
              taskOutput.setCaretPosition(taskOutput.getDocument().getLength());

              // TODO Auto-generated method stub

            }

            public void stateChanged(String theState) {

              myState = theState;
              // TODO Auto-generated method stub

            }

            public void messageChanged(String theMessage) {
              taskOutput.append(theMessage + "\n");
              taskOutput.setCaretPosition(taskOutput.getDocument().getLength());
              // TODO Auto-generated method stub
              // TODO Auto-generated method stub

            }
          };

      task = new Task(theMessage, (String) myDownloadOptions.getSelectedItem());
      task.addPropertyChangeListener(this);
      task.execute();
    } else if (evt.getActionCommand().equals("cancel")) {
      task.cancel(false);
      //	startButton.setEnabled(true);
      //	cancelButton.setEnabled(false);

    }
  }
Ejemplo n.º 6
0
  protected void enterLogin() {
    char[] password = m_passwordField.getPassword();
    String strUser = (String) m_cmbUser.getSelectedItem();
    setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    boolean blogin = WUserUtil.isOperatorNameok(strUser, false);
    if (blogin) {
      blogin = vnmrjPassword(strUser, password);
      if (!blogin) blogin = unixPassword(strUser, password);
    }
    if (blogin) {
      m_lblLogin.setForeground(Color.black);
      m_lblLogin.setText("Login Successful");
      m_lblLogin.setVisible(true);
      // Get the Email column string for access to the operator data
      String emStr = vnmr.util.Util.getLabel("_admin_Email");
      String stremail = WUserUtil.getOperatordata(strUser, emStr);

      // Get the Panel Level column string for access to the operator data
      String plStr = vnmr.util.Util.getLabel("_admin_Panel_Level");
      String strPanel = WUserUtil.getOperatordata(strUser, plStr);

      if (stremail == null || stremail.equals("null")) stremail = "";
      try {
        Integer.parseInt(strPanel);
      } catch (Exception e) {
        strPanel = WGlobal.PANELLEVEL;
      }
      m_trayTimer.stop();
      Messages.postDebug(" Login: "******"appdir('reset','")
                .append(strUser)
                .append("','")
                .append(stremail)
                .append("',")
                .append(strPanel)
                .append(")")
                .toString());
        exp.sendToVnmr("vnmrjcmd('util', 'bgReady')\n");
      }
      setVisible(false);

      // Save the current position and size of this panel in case it
      // was changed
      Dimension size = getSize();
      width = size.width;
      height = size.height;
      position = getLocation();
      writePersistence();

      // Call the macro to update this operator's
      // ExperimentSelector_operatorName.xml file
      // from the protocols themselves.  This macro will
      // cause an update of the ES when it is finished

      // Util.getAppIF().sendToVnmr("updateExpSelector");

      // I am not sure why we need to force updates since updateExpSelector
      // should have caused an update by writing to ES_op.xml file.
      // However, it works better if we do the force update.
      // ExpSelector.setForceUpdate(true);
    } else {
      m_lblLogin.setForeground(DisplayOptions.getColor("Error"));
      // m_lblLogin.setText("<HTML>Incorrect username/password <p> Please try again </HTML>");
      m_lblLogin.setVisible(true);
    }
    setCursor(Cursor.getDefaultCursor());
  }