Changeset 3057 in josm for trunk


Ignore:
Timestamp:
2010-02-27T23:24:25+01:00 (10 years ago)
Author:
bastiK
Message:

applied #4617 - new design for download dialog (patch by Radomír Černoch)

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java

    r2990 r3057  
    1111import java.awt.FlowLayout;
    1212import java.awt.Font;
     13import java.awt.GridBagConstraints;
    1314import java.awt.GridBagLayout;
    1415import java.awt.Toolkit;
     
    2526
    2627import javax.swing.AbstractAction;
    27 import javax.swing.BorderFactory;
    2828import javax.swing.JCheckBox;
    2929import javax.swing.JComponent;
     
    8888
    8989    public JPanel buildMainPanel() {
     90        // generic constraints used by different components
     91        GridBagConstraints gridBagConstraints;
     92
    9093        JPanel pnl = new JPanel();
    9194        pnl.setLayout(new GridBagLayout());
    92         pnl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
    9395
    9496        // adding the download tasks
    95         pnl.add(new JLabel(tr("Data Sources and Types")), GBC.eol().insets(0,5,0,0));
     97        pnl.add(new JLabel(tr("Data Sources and Types:")), GBC.std().insets(5,5,1,5));
    9698        cbDownloadOsmData = new JCheckBox(tr("OpenStreetMap data"), true);
    9799        cbDownloadOsmData.setToolTipText(tr("Select to download OSM data in the selected download area."));
    98         pnl.add(cbDownloadOsmData,  GBC.eol().insets(20,0,0,0));
     100        pnl.add(cbDownloadOsmData,  GBC.std().insets(1,5,1,5));
    99101        cbDownloadGpxData = new JCheckBox(tr("Raw GPS data"));
    100102        cbDownloadGpxData.setToolTipText(tr("Select to download GPS traces in the selected download area."));
    101         pnl.add(cbDownloadGpxData,  GBC.eol().insets(20,0,0,0));
     103        pnl.add(cbDownloadGpxData,  GBC.eol().insets(5,5,1,5));
    102104
    103105        // predefined download selections
     
    118120        }
    119121
    120         cbNewLayer = new JCheckBox(tr("Download as new layer"));
    121         cbNewLayer.setToolTipText(tr("<html>Select to download data into a new data layer.<br>"
    122                 +"Unselect to download into the currently active data layer.</html>"));
    123         pnl.add(cbNewLayer, GBC.eol().insets(0,5,0,0));
    124 
    125         pnl. add(new JLabel(tr("Download Area")), GBC.eol().insets(0,5,0,0));
    126122        pnl.add(tpDownloadAreaSelectors, GBC.eol().fill());
    127123
     
    134130        Font labelFont = sizeCheck.getFont();
    135131        sizeCheck.setFont(labelFont.deriveFont(Font.PLAIN, labelFont.getSize()));
    136         pnl.add(sizeCheck, GBC.eop().insets(0,5,5,10));
     132       
     133        cbNewLayer = new JCheckBox(tr("Download as new layer"));
     134        cbNewLayer.setToolTipText(tr("<html>Select to download data into a new data layer.<br>"
     135                +"Unselect to download into the currently active data layer.</html>"));
     136
     137        pnl.add(cbNewLayer, GBC.std().anchor(GBC.WEST).insets(5,5,5,5));
     138        pnl.add(sizeCheck,  GBC.eol().anchor(GBC.EAST).insets(5,5,5,5));
     139
    137140        return pnl;
    138141    }
  • trunk/src/org/openstreetmap/josm/gui/download/SlippyMapChooser.java

    r2689 r3057  
    1414import java.util.Vector;
    1515
    16 import javax.swing.JLabel;
    1716import javax.swing.JPanel;
    1817
     
    117116        slipyyMapTabPanel.setLayout(new BorderLayout());
    118117        slipyyMapTabPanel.add(this, BorderLayout.CENTER);
    119         String labelText = tr("<b>Zoom:</b> Mousewheel, double click or Ctrl + Up/Down "
    120                 + "<b>Move map:</b> Hold right mousebutton and move mouse or use cursor keys. <b>Select:</b> Hold left mousebutton and draw a frame.");
    121         slipyyMapTabPanel.add(new JLabel("<html>" + labelText + "</html>"), BorderLayout.SOUTH);
    122118        iGui.addDownloadAreaSelector(slipyyMapTabPanel, tr("Slippy map"));
    123119        new OsmMapControl(this, slipyyMapTabPanel, iSizeButton, iSourceButton);
  • trunk/src/org/openstreetmap/josm/tools/GBC.java

    r1169 r3057  
    9797
    9898    /**
     99     * Specifies how to distribute extra horizontal space.
     100     * @param weidhtx   Weight in horizontal direction
     101     * @param weighty   Weight in vertical direction
     102     * @return This constraint for chaining.
     103     */
     104    public GBC weight(int weightx, int weighty) {
     105        this.weightx = weightx;
     106        this.weighty = weighty;
     107        return this;
     108    }
     109
     110    /**
    99111     * This is a helper to easily create a glue with a minimum default value.
    100112     * @param x If higher than 0, this will be a horizontal glue with x as minimum
Note: See TracChangeset for help on using the changeset viewer.