Exemplo n.º 1
0
  /*
   * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
   */
  public void actionPerformed(ActionEvent event) {
    super.actionPerformed(event);
    if (ImporterManager.getInstance().hasImporters()) {
      new Import(ArgoFrame.getInstance());
    } else {

      ExceptionDialog ed =
          new ExceptionDialog(
              ArgoFrame.getInstance(),
              Translator.localize("dialog.title.problem"),
              Translator.localize("dialog.import.no-importers.intro"),
              Translator.localize("dialog.import.no-importers.message"));
      ed.setModal(true);
      ed.setVisible(true);
    }
  }
 /*
  * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
  */
 @Override
 public void actionPerformed(ActionEvent e) {
   super.actionPerformed(e);
   UMLAddDialog dialog =
       new UMLAddDialog(
           getChoices(), getSelected(), getDialogTitle(), isMultiSelect(), isExclusive());
   int result = dialog.showDialog(ArgoFrame.getFrame());
   if (result == JOptionPane.OK_OPTION) {
     doIt(dialog.getSelected());
   }
 }
Exemplo n.º 3
0
  /**
   * This should take its inspiration from {@link org.tigris.gef.base.CmdSpawn}.
   *
   * <p>The spawned/cloned tab will be a JFrame. Currently this feature is disabled for ArgoUML,
   * except for the find dialog. Code should behave though as if spawning might work at a later
   * stage.
   *
   * @return a copy of the frame or null if not clone-able.
   */
  public AbstractArgoJPanel spawn() {

    JDialog f = new JDialog(ArgoFrame.getInstance());
    f.getContentPane().setLayout(new BorderLayout());
    // TODO: Once we have fixed all subclasses the title will
    // always be localized so this localization can be removed.
    f.setTitle(Translator.localize(title));
    AbstractArgoJPanel newPanel = (AbstractArgoJPanel) clone();
    if (newPanel == null) {
      return null; // failed to clone
    }

    //        if (newPanel instanceof TabToDo) {
    //            TabToDo me = (TabToDo) this;
    //            TabToDo it = (TabToDo) newPanel;
    //            it.setTarget(me.getTarget());
    //        } else if (newPanel instanceof TabModelTarget) {
    //            TabModelTarget me = (TabModelTarget) this;
    //            TabModelTarget it = (TabModelTarget) newPanel;
    //            it.setTarget(me.getTarget());
    //        } else if (newPanel instanceof TabDiagram) {
    //            TabDiagram me = (TabDiagram) this;
    //            TabDiagram it = (TabDiagram) newPanel;
    //            it.setTarget(me.getTarget());
    //        }

    // TODO: Once we have fixed all subclasses the title will
    // always be localized so this localization can be removed.
    newPanel.setTitle(Translator.localize(title));

    f.getContentPane().add(newPanel, BorderLayout.CENTER);
    Rectangle bounds = getBounds();
    bounds.height += OVERLAPP * 2;
    f.setBounds(bounds);

    Point loc = new Point(0, 0);
    SwingUtilities.convertPointToScreen(loc, this);
    loc.y -= OVERLAPP;
    f.setLocation(loc);
    f.setVisible(true);

    if (tear && (getParent() instanceof JTabbedPane)) {
      ((JTabbedPane) getParent()).remove(this);
    }

    return newPanel;
  }
 /*
  * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
  */
 public void actionPerformed(ActionEvent ae) {
   Frame frame = ArgoFrame.getFrame();
   AboutBox box = new AboutBox(frame, true);
   box.setLocationRelativeTo(frame);
   box.setVisible(true);
 }