Changeset 5128 in josm
- Timestamp:
- 2012-03-29T10:30:34+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/actionsupport/AlignImageryPanel.java
r5119 r5128 4 4 import java.awt.Color; 5 5 import java.awt.Font; 6 import java.awt.GridBagConstraints; 7 import java.awt.GridBagLayout; 6 8 import java.awt.Toolkit; 7 9 import java.awt.event.ActionEvent; … … 17 19 18 20 import org.openstreetmap.josm.Main; 21 import org.openstreetmap.josm.tools.GBC; 19 22 import static org.openstreetmap.josm.tools.I18n.tr; 20 23 import org.openstreetmap.josm.tools.ImageProvider; … … 30 33 private static final String PREF = "imagery.offsetnagging"; 31 34 32 public AlignImageryPanel() { 35 public AlignImageryPanel(boolean oneLine) { 33 36 super(); 34 37 … … 36 39 JLabel nagLabel = new JLabel(tr("Aerial imagery might be misaligned. Please check its offset using GPS tracks!")); 37 40 UrlLabel detailsList = new UrlLabel(tr("http://wiki.openstreetmap.org/wiki/Using_Imagery"), tr("Details...")); 38 double w = Toolkit.getDefaultToolkit().getScreenSize().getWidth();39 if (w<1300) detailsList.setDescription("Read more");40 41 nagLabel.setFont(font); 41 42 detailsList.setFont(font); … … 56 57 }); 57 58 58 BoxLayout box = new BoxLayout(this, BoxLayout.X_AXIS); 59 setLayout(box); 60 add(nagLabel); 61 add(Box.createHorizontalStrut(12)); 62 add(detailsList); 63 add(Box.createHorizontalGlue()); 64 add(closeButton); 59 setLayout(new GridBagLayout()); 60 if (!oneLine) { // tune for small screens 61 add(nagLabel, GBC.std(1, 1).fill()); 62 add(detailsList, GBC.std(1, 2).fill()); 63 add(closeButton, GBC.std(2, 1).span(1,2).anchor(GBC.EAST)); 64 } else { 65 add(nagLabel, GBC.std(1,1).fill()); 66 add(detailsList, GBC.std(2,1).fill()); 67 add(closeButton, GBC.std(3,1).anchor(GBC.EAST)); 68 } 65 69 // setBorder(new EmptyBorder(12, 12, 12, 12)); 66 70 setBorder(new CompoundBorder(new EtchedBorder(EtchedBorder.LOWERED), new EmptyBorder(12, 12, 12, 12))); … … 71 75 if( Main.map != null && !Main.pref.getBoolean("expert") && Main.pref.getBoolean(PREF, true) ) { 72 76 if (Main.map.getTopPanel(AlignImageryPanel.class) == null) { 73 AlignImageryPanel p = new AlignImageryPanel(); 77 double w = Toolkit.getDefaultToolkit().getScreenSize().getWidth(); 78 AlignImageryPanel p = new AlignImageryPanel(w>1300); 74 79 Main.map.addTopPanel(p); 75 80 }
Note:
See TracChangeset
for help on using the changeset viewer.