Changeset 31397 in osm for applications/editors/josm
- Timestamp:
- 2015-07-21T16:34:33+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryFilterDialog.java
r31389 r31397 18 18 import javax.swing.JOptionPane; 19 19 import javax.swing.JPanel; 20 import javax.swing.JSpinner; 20 21 import javax.swing.JTextField; 22 import javax.swing.SpinnerModel; 23 import javax.swing.SpinnerNumberModel; 24 import javax.swing.SwingUtilities; 21 25 22 26 import org.openstreetmap.josm.Main; … … 44 48 private static MapillaryFilterDialog INSTANCE; 45 49 46 private final static String[] TIME_LIST = { tr("All time"), tr("This year"),47 tr(" This month"), tr("This week") };48 49 private final static int ROWS = 0;50 private final static int COLUMNS = 3; 51 52 p rivate final JPanel panel = new JPanel(new GridLayout(ROWS, COLUMNS));50 private final static String[] TIME_LIST = { tr("All"), tr("Years"), 51 tr("Months"), tr("Days") }; 52 53 private final JPanel panel = new JPanel(); 54 55 /** Spinner to choose the range of dates. */ 56 public SpinnerNumberModel spinner; 53 57 54 58 private final JCheckBox imported = new JCheckBox("Imported images"); … … 96 100 JPanel fromPanel = new JPanel(); 97 101 fromPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); 98 fromPanel.add(new JLabel("From")); 102 fromPanel.add(new JLabel("Not older than: ")); 103 spinner = new SpinnerNumberModel(1, 0, 10000, 1); 104 fromPanel.add(new JSpinner(spinner)); 99 105 time = new JComboBox<>(TIME_LIST); 100 106 fromPanel.add(time); … … 110 116 downloaded.setSelected(true); 111 117 112 panel.add(downloaded); 113 panel.add(imported); 114 panel.add(onlySigns); 115 panel.add(fromPanel); 116 panel.add(userSearchPanel); 117 panel.add(signChooserPanel); 118 JPanel col1 = new JPanel(new GridLayout(2,1)); 119 col1.add(downloaded); 120 col1.add(fromPanel); 121 panel.add(col1); 122 JPanel col2 = new JPanel(new GridLayout(2,1)); 123 col2.add(imported); 124 col2.add(userSearchPanel); 125 panel.add(col2); 126 JPanel col3 = new JPanel(new GridLayout(2,1)); 127 col3.add(onlySigns); 128 col3.add(signChooserPanel); 129 panel.add(col3); 118 130 119 131 createLayout(panel, true, … … 152 164 user.setText(""); 153 165 time.setSelectedItem(TIME_LIST[0]); 166 spinner.setValue(1); 154 167 refresh(); 155 168 } … … 193 206 Long currentTime = currentTime(); 194 207 if (time.getSelectedItem() == TIME_LIST[1]) { 195 if ((currentTime - img.getCapturedAt()) / (24 * 60 * 60 * 1000) > 365) { 208 if (img.getCapturedAt() < currentTime - ((Integer) spinner.getValue()).longValue() 209 * 365 * 24 * 60 * 60 * 1000) { 196 210 img.setVisible(false); 197 211 continue; … … 199 213 } 200 214 if (time.getSelectedItem() == TIME_LIST[2]) { 201 if ((currentTime - img.getCapturedAt()) / (24 * 60 * 60 * 1000) > 30) { 215 if (img.getCapturedAt() < currentTime - ((Integer) spinner.getValue()).longValue() * 30 * 24 216 * 60 * 60 * 1000) { 202 217 img.setVisible(false); 203 218 continue; … … 205 220 } 206 221 if (time.getSelectedItem() == TIME_LIST[3]) { 207 if ((currentTime - img.getCapturedAt()) / (24 * 60 * 60 * 1000) > 7) { 222 if (img.getCapturedAt() < currentTime - ((Integer) spinner.getValue()).longValue() * 60 223 * 60 * 1000) { 208 224 img.setVisible(false); 209 225 continue;
Note:
See TracChangeset
for help on using the changeset viewer.