Ignore:
Timestamp:
2012-03-08T10:04:21+01:00 (12 years ago)
Author:
akks
Message:

UrlLabel class simplification by Zverik, better label layout in VersionInfoPanel (see #7450, #7326)

Location:
trunk/src/org/openstreetmap/josm/actions
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/AboutAction.java

    r4982 r5050  
    7171        info.add(GBC.glue(0,10), GBC.eol());
    7272        info.add(new JLabel(tr("Homepage")), GBC.std().insets(10,0,10,0));
    73         info.add(new UrlLabel("http://josm.openstreetmap.de"), GBC.eol().fill(GBC.HORIZONTAL));
     73        info.add(new UrlLabel("http://josm.openstreetmap.de",2), GBC.eol().fill(GBC.HORIZONTAL));
     74        info.add(GBC.glue(0,5), GBC.eol());
    7475        info.add(new JLabel(tr("Bug Reports")), GBC.std().insets(10,0,10,0));
    75         info.add(new UrlLabel("http://josm.openstreetmap.de/newticket"), GBC.eol().fill(GBC.HORIZONTAL));
     76        info.add(new UrlLabel("http://josm.openstreetmap.de/newticket",2), GBC.eol().fill(GBC.HORIZONTAL));
    7677
    7778        JTextArea revision = new JTextArea();
  • trunk/src/org/openstreetmap/josm/actions/Map_Rectifier_WMSmenuAction.java

    r4973 r5050  
    137137            if(!s.url.equals("")) {
    138138                panel.add(serviceBtn, GBC.std());
    139                 panel.add(new UrlLabel(s.url, tr("Visit Homepage")), GBC.eol().anchor(GridBagConstraints.EAST));
     139                panel.add(new UrlLabel(s.url, tr("Visit Homepage")), GBC.eol().anchor(GridBagConstraints.EAST), 2);
    140140            } else {
    141141                panel.add(serviceBtn, GBC.eol().anchor(GridBagConstraints.WEST));
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java

    r4982 r5050  
    1212import java.awt.BasicStroke;
    1313import java.awt.Color;
     14import java.awt.Component;
    1415import java.awt.Cursor;
    1516import java.awt.Graphics2D;
     17import java.awt.KeyboardFocusManager;
    1618import java.awt.MenuItem;
    1719import java.awt.Point;
     
    3941
    4042import java.util.TreeSet;
    41 import javax.swing.AbstractAction;
    42 import javax.swing.JOptionPane;
    43 
    44 import javax.swing.JPopupMenu;
    45 import javax.swing.Timer;
     43import javax.swing.*;
    4644import org.openstreetmap.josm.Main;
    4745import org.openstreetmap.josm.actions.JosmAction;
     
    224222            return;
    225223        if (event instanceof KeyEvent) {
     224            Component focused = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
     225            Component wantedFocus = Main.map.mapView.getParent();
     226            boolean foundMapViewAncestor=false;
     227            while (focused!=null) {
     228                if (focused==wantedFocus) {
     229                    foundMapViewAncestor=true;
     230                }
     231                focused = focused.getParent();
     232            }
     233            // we accept only events that come from map or toggle dialogs, not from menu and dialogs
     234            if (!foundMapViewAncestor) return;
    226235            processKeyEvent((KeyEvent) event);
    227236        } //  toggle angle snapping
     
    238247    private Timer timer;
    239248    void processKeyEvent(KeyEvent e) {
    240         if (!snappingShortcut.isEvent(e))
     249        if (!snappingShortcut.isEvent(e) && !getShortcut().isEvent(e))
    241250            return;
    242251
     
    261270
    262271    private void doKeyPressEvent(KeyEvent e) {
    263         if (!snappingShortcut.isEvent(e))
    264             return;
    265272        snapHelper.setFixedMode();
    266273        computeHelperLine();
     
    268275    }
    269276    private void doKeyReleaseEvent(KeyEvent e) {
    270         if (!snappingShortcut.isEvent(e))
    271             return;
    272277        snapHelper.unFixOrTurnOff();
    273278        computeHelperLine();
Note: See TracChangeset for help on using the changeset viewer.