Exemplo n.º 1
0
  /** @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) */
  @Override
  public void actionPerformed(final ActionEvent aEvent) {
    final Window parent = SwingComponentUtils.getOwningWindow(aEvent);

    final ClientController controller = getController();

    // Issue #62: in case the user does NOT confirm to lose its changes, we
    // should bail out immediately, otherwise continue normally...
    if (controller.isProjectChanged()
        && //
        !SwingComponentUtils.askConfirmation(
            parent,
            "Current project has been changed.\nDo you really want to lose your changes?")) {
      return;
    }

    controller.createNewProject();
  }
Exemplo n.º 2
0
 /**
  * Creates a new RepeatCaptureAction instance.
  *
  * @param aController the controller to use for this action.
  */
 public RepeatCaptureAction(final ClientController aController) {
   super(
       ID,
       aController,
       ICON_RECAPTURE_DATA,
       "Repeat capture",
       "Repeat capture with current device settings");
   putValue(ACCELERATOR_KEY, SwingComponentUtils.createMenuKeyMask(KeyEvent.VK_R));
   putValue(MNEMONIC_KEY, Integer.valueOf(KeyEvent.VK_R));
 }
Exemplo n.º 3
0
  /** @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) */
  @Override
  public void actionPerformed(final ActionEvent aEvent) {
    final Window owner = SwingComponentUtils.getOwningWindow(aEvent);

    if (!getController().isDeviceSelected()) {
      JOptionPane.showMessageDialog(
          owner, "No capturing device found!", "Capture error", JOptionPane.ERROR_MESSAGE);
      return;
    }
    if (!getController().isDeviceSetup()) {
      JOptionPane.showMessageDialog(
          owner, "Capturing device is not setup!", "Capture error", JOptionPane.ERROR_MESSAGE);
      return;
    }

    getController().repeatCaptureData();
  }
Exemplo n.º 4
0
 /**
  * Creates a new NewProjectAction instance.
  *
  * @param aController the client controller to use.
  */
 public NewProjectAction(final ClientController aController) {
   super(ID, aController, "New project ...", "Create a new project");
   putValue(ACCELERATOR_KEY, SwingComponentUtils.createMenuKeyMask(KeyEvent.VK_N));
   putValue(MNEMONIC_KEY, Integer.valueOf(KeyEvent.VK_N));
 }
Exemplo n.º 5
0
 /** @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) */
 @Override
 public void actionPerformed(final ActionEvent aEvent) {
   final Window owner = SwingComponentUtils.getOwningWindow(aEvent);
   getController().showBundlesDialog(owner);
 }