Esempio n. 1
0
 public void actionPerformed(ActionEvent ae) {
   if (ae.getActionCommand() == "timer") {
     if (counter >= imagePaths.length) {
       timer.stop();
       counter = 0;
       PlayStopButton.setText("Play");
     } else {
       try {
         // if the array contains URLs
         if (imagePaths[counter].contains("http://")) {
           scrollPane.setToolTipText(imagePaths[counter]);
           imageIcon = new ImageIcon((new URL(imagePaths[counter++])));
           scrollPane.setViewportView(new JLabel(imageIcon));
         }
         // if the array contains local images
         else {
           image.setIcon(new ImageIcon(imagePaths[counter]));
           image.setToolTipText(imagePaths[counter++]);
         }
       } catch (MalformedURLException ex) {
         Logger.getLogger(Slideshow.class.getName()).log(Level.SEVERE, null, ex);
         image = new JLabel("?" + imagePaths);
       }
     }
   }
 }
 public void actionPerformed(ActionEvent e) {
   JMenuItem jmi = (JMenuItem) e.getSource();
   Iterator marks = mediator.getMarkerModel().getMarkersWithLabel(jmi.getText());
   if (marks.hasNext()) {
     ChronicleMarker marker = (ChronicleMarker) marks.next();
     Instant to = marker.getWhen();
     Instant from = mediator.getMajorMoment();
     viper.api.impl.Util.shiftDescriptors(new Descriptor[] {desc}, from, to);
   }
 }
  /** Handle ui components events. */
  public void actionPerformed(ActionEvent e) {
    if (e.getSource().equals(saveButton)) {

      // fileChooser.setTitle("Save File");
      // fileChooser.setFilenameFilter(new InputFilterAWT());
      // fileChooser.setVisible(true);
      // fileChooser.setMode(FileDialog.SAVE);
      // OutputComposer excelComp = OutputComposer.create(Network.FileType.EXCEL_FILE);

      saveEvent();
    } else if (e.getSource().equals(openINPButton)) {
      openEvent();
    } else if (e.getSource().equals(runSimulationButton)) {
      runSimulation();
    } else if (e.getSource() == logoB) {
      browse(AWARE_P_WEBLINK);
    }
    network.repaint();
  }
 public void actionPerformed(ActionEvent e) {
   Iterator toInterp = Collections.singleton(desc).iterator();
   JMenuItem jmi = (JMenuItem) e.getSource();
   Iterator marks = mediator.getMarkerModel().getMarkersWithLabel(jmi.getText());
   if (marks.hasNext()) {
     ChronicleMarker marker = (ChronicleMarker) marks.next();
     Instant to = marker.getWhen();
     Instant from = mediator.getMajorMoment();
     mediator.getPropagator().interpolateDescriptors(toInterp, from, to);
   }
 }
 /** Callback event handler to process clicks on any of the buttons. */
 public void actionPerformed(ActionEvent ae) {
   processCommand(ae.getActionCommand());
 }
Esempio n. 6
0
 /**
  * ************************************************************************ Action Listener
  *
  * @param e event
  */
 @Override
 public void actionPerformed(ActionEvent e) {
   if (e.getActionCommand().equals(ConfirmPanel.A_OK)) dispose();
 } //	actionPerformed
 /**
  * ************************************************************************ Action Listener
  *
  * @param e event
  */
 public void actionPerformed(ActionEvent e) {
   setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
   if (e.getSource() == bDisassociate) cmd_disassociate();
   else if (e.getSource() == bNewProduct) cmd_newProduct();
 } //  actionPerformed