@Override
 public void setVisible(boolean visible) {
   if (visible) {
     prepareGUIBeforeConflictResolutionStarts();
     setMinimumSize(new Dimension(400, 400));
     new WindowGeometry(
             getClass().getName() + ".geometry",
             WindowGeometry.centerInWindow(Main.parent, new Dimension(800, 600)))
         .applySafe(this);
     setApplied(false);
     btnApply.requestFocusInWindow();
   } else if (isShowing()) { // Avoid IllegalComponentStateException like in #8775
     new WindowGeometry(this).remember(getClass().getName() + ".geometry");
   }
   super.setVisible(visible);
 }
Exemplo n.º 2
0
 /**
  * Constructs a new <code>RecentRelationsAction</code>.
  *
  * @param editButton edit button
  */
 public RecentRelationsAction(SideButton editButton) {
   this.editButton = editButton;
   arrow = editButton.createArrow(this);
   arrow.setToolTipText(tr("List of recent relations"));
   Main.main.undoRedo.addCommandQueueListener(this);
   Main.getLayerManager().addLayerChangeListener(this);
   Main.getLayerManager().addActiveLayerChangeListener(this);
   enableArrow();
   shortcut =
       Shortcut.registerShortcut(
           "relationeditor:editrecentrelation",
           tr("Relation Editor: {0}", tr("Open recent relation")),
           KeyEvent.VK_ESCAPE,
           Shortcut.SHIFT);
   Main.registerActionShortcut(new LaunchEditorAction(), shortcut);
 }
  protected JPanel buildButtonPanel() {
    JPanel pnl = new JPanel(new FlowLayout(FlowLayout.CENTER));

    // -- apply button
    ApplyAction applyAction = buildApplyAction();
    pnlTagConflictResolver.getModel().addPropertyChangeListener(applyAction);
    pnlRelationMemberConflictResolver.getModel().addPropertyChangeListener(applyAction);
    btnApply = new SideButton(applyAction);
    btnApply.setFocusable(true);
    pnl.add(btnApply);

    // -- cancel button
    CancelAction cancelAction = new CancelAction();
    pnl.add(new SideButton(cancelAction));

    // -- help button
    helpAction = new ContextSensitiveHelpAction();
    pnl.add(new SideButton(helpAction));

    return pnl;
  }
Exemplo n.º 4
0
 /**
  * Constructs a new <code>RecentRelationsAction</code>.
  *
  * @param editButton edit button
  */
 public RecentRelationsAction(SideButton editButton) {
   this.editButton = editButton;
   arrow = editButton.createArrow(this);
   arrow.setToolTipText(tr("List of recent relations"));
   Main.main.undoRedo.addCommandQueueListener(this);
   MapView.addLayerChangeListener(this);
   enableArrow();
   shortcut =
       Shortcut.registerShortcut(
           "relationeditor:editrecentrelation",
           tr("Relation Editor: {0}", tr("Open recent relation")),
           KeyEvent.VK_ESCAPE,
           Shortcut.SHIFT);
   Main.registerActionShortcut(
       new AbstractAction() {
         @Override
         public void actionPerformed(ActionEvent e) {
           EditRelationAction.launchEditor(getLastRelation());
         }
       },
       shortcut);
 }
Exemplo n.º 5
0
 protected void makeButtonRespondToEnter(SideButton btn) {
   btn.setFocusable(true);
   btn.getInputMap(JComponent.WHEN_FOCUSED)
       .put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "enter");
   btn.getActionMap().put("enter", btn.getAction());
 }
Exemplo n.º 6
0
 public void setApiUrlInputEnabled(boolean enabled) {
   lblApiUrl.setEnabled(enabled);
   tfOsmServerUrl.setEnabled(enabled);
   lblValid.setEnabled(enabled);
   btnTest.setEnabled(enabled);
 }