@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); }
/** * 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; }
/** * 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); }
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()); }
public void setApiUrlInputEnabled(boolean enabled) { lblApiUrl.setEnabled(enabled); tfOsmServerUrl.setEnabled(enabled); lblValid.setEnabled(enabled); btnTest.setEnabled(enabled); }