Changeset 34394 in osm for applications/editors/josm/plugins/MicrosoftStreetside/src
- Timestamp:
- 2018-07-04T06:15:49+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/gui/imageinfo/ImageInfoPanel.java
r34390 r34394 5 5 import java.awt.GridBagConstraints; 6 6 import java.awt.GridBagLayout; 7 import java.awt.Image; 7 8 import java.awt.Insets; 8 9 import java.awt.datatransfer.StringSelection; … … 11 12 12 13 import javax.swing.ImageIcon; 14 import javax.swing.JCheckBox; 13 15 import javax.swing.JLabel; 14 16 import javax.swing.JPanel; … … 18 20 import org.openstreetmap.josm.data.osm.DataSelectionListener; 19 21 import org.openstreetmap.josm.data.osm.OsmPrimitive; 22 import org.openstreetmap.josm.data.osm.Tag; 20 23 import org.openstreetmap.josm.data.osm.event.SelectionEventManager; 21 24 import org.openstreetmap.josm.data.preferences.AbstractProperty.ValueChangeListener; … … 26 29 import org.openstreetmap.josm.plugins.streetside.gui.boilerplate.SelectableLabel; 27 30 import org.openstreetmap.josm.plugins.streetside.gui.boilerplate.StreetsideButton; 31 import org.openstreetmap.josm.plugins.streetside.model.UserProfile; 28 32 import org.openstreetmap.josm.plugins.streetside.utils.StreetsideProperties; 29 33 import org.openstreetmap.josm.plugins.streetside.utils.StreetsideURL; … … 39 43 40 44 private final JLabel numDetectionsLabel; 41 //private final JCheckBox showDetectionsCheck; 42 private final JLabel placeholder1Label; 45 private final JCheckBox showDetectionsCheck; 43 46 private final JLabel usernameLabel; 44 47 private final JTextPane imgKeyValue; 45 48 private final WebLinkAction imgLinkAction; 46 49 private final ClipboardAction copyImgKeyAction; 47 //private final AddTagToPrimitiveAction addStreetsideTagAction;50 private final AddTagToPrimitiveAction addStreetsideTagAction; 48 51 private final JTextPane seqKeyValue; 49 52 … … 63 66 numDetectionsLabel.setFont(numDetectionsLabel.getFont().deriveFont(Font.PLAIN)); 64 67 65 placeholder1Label = new JLabel(); 66 67 //showDetectionsCheck = new JCheckBox(I18n.tr("Show detections on top of image")); 68 //showDetectionsCheck.setSelected(StreetsideProperties.SHOW_DETECTED_SIGNS.get()); 69 /*showDetectionsCheck.addActionListener( 68 showDetectionsCheck = new JCheckBox(I18n.tr("Show detections on top of image")); 69 showDetectionsCheck.setSelected(StreetsideProperties.SHOW_DETECTED_SIGNS.get()); 70 showDetectionsCheck.addActionListener( 70 71 action -> StreetsideProperties.SHOW_DETECTED_SIGNS.put(showDetectionsCheck.isSelected()) 71 72 ); 72 73 StreetsideProperties.SHOW_DETECTED_SIGNS.addListener( 73 74 valueChange -> showDetectionsCheck.setSelected(StreetsideProperties.SHOW_DETECTED_SIGNS.get()) 74 ); */75 ); 75 76 76 77 usernameLabel = new JLabel(); … … 85 86 copyImgKeyAction.setPopupParent(copyButton); 86 87 87 //addStreetsideTagAction = new AddTagToPrimitiveAction(I18n.tr("Add Streetside tag"));88 addStreetsideTagAction = new AddTagToPrimitiveAction(I18n.tr("Add Streetside tag")); 88 89 89 90 JPanel imgKey = new JPanel(); … … 92 93 JPanel imgButtons = new JPanel(); 93 94 imgButtons.add(new StreetsideButton(imgLinkAction, true)); 94 //imgButtons.add(new StreetsideButton(addStreetsideTagAction, true));95 imgButtons.add(new StreetsideButton(null/*addStreetsideTagAction*/, true)); 95 96 seqKeyValue = new SelectableLabel(); 96 97 … … 105 106 gbc.gridwidth = 1; 106 107 gbc.gridheight = 2; 107 root.add(new JLabel( ("Placeholder2 label")), gbc);108 root.add(new JLabel(I18n.tr("Image detections")), gbc); 108 109 gbc.gridy += 2; 109 110 gbc.gridheight = 1; 110 root.add(new JLabel( ("Blah")), gbc);111 gbc.gridy++; 112 root.add(new JLabel( ("Blee")), gbc);111 root.add(new JLabel(I18n.tr("User")), gbc); 112 gbc.gridy++; 113 root.add(new JLabel(I18n.tr("Image actions")), gbc); 113 114 gbc.gridy++; 114 115 root.add(new JLabel(I18n.tr("Image key")), gbc); … … 123 124 root.add(numDetectionsLabel, gbc); 124 125 gbc.gridy++; 125 //root.add(showDetectionsCheck, gbc); 126 //gbc.gridy++; 127 root.add(placeholder1Label, gbc); 128 gbc.gridy++; 126 root.add(showDetectionsCheck, gbc); 127 gbc.gridy++; 129 128 root.add(usernameLabel, gbc); 130 129 gbc.gridy++; … … 185 184 )); 186 185 187 //numDetectionsLabel.setText(I18n.tr("{0} detections", newImage instanceof StreetsideImage ? ((StreetsideImage) newImage).getDetections().size(): 0));186 numDetectionsLabel.setText(I18n.tr("{0} detections", newImage instanceof StreetsideImage ? /*((StreetsideImage) newImage).getDetections().size()*/0 : 0)); 188 187 imgKeyValue.setEnabled(newImage instanceof StreetsideImage); 189 188 final String newImageKey = newImage instanceof StreetsideImage ? ((StreetsideImage) newImage).getId(): null; … … 199 198 imgKeyValue.setText(newImageKey); 200 199 copyImgKeyAction.setContents(new StringSelection(newImageKey)); 201 //addStreetsideTagAction.setTag(new Tag("streetside", newImageKey));200 addStreetsideTagAction.setTag(new Tag("streetside", newImageKey)); 202 201 } else { 203 202 if (imageLinkChangeListener != null) { … … 209 208 imgKeyValue.setText('‹' + I18n.tr("image has no key") + '›'); 210 209 copyImgKeyAction.setContents(null); 211 //addStreetsideTagAction.setTag(null);212 } 213 214 /*final UserProfile user = newImage instanceof StreetsideImage ? ((StreetsideImage) newImage).getUser() : null;210 addStreetsideTagAction.setTag(null); 211 } 212 213 final UserProfile user = newImage instanceof StreetsideImage ? ((StreetsideImage) newImage).getUser() : null; 215 214 usernameLabel.setEnabled(user != null); 216 215 if (user != null) { … … 220 219 usernameLabel.setText("‹" + I18n.tr("unknown user") + "›"); 221 220 usernameLabel.setIcon(EMPTY_USER_AVATAR); 222 } */221 } 223 222 224 223 final boolean partOfSequence = newImage != null && newImage.getSequence() != null && newImage.getSequence().getId() != null; … … 240 239 logger.debug(String.format("Selection changed. %d primitives are selected.", sel == null ? 0 : sel.size())); 241 240 } 242 //addStreetsideTagAction.setTarget(sel != null && sel.size() == 1 ? sel.iterator().next() : null);241 addStreetsideTagAction.setTarget(sel != null && sel.size() == 1 ? sel.iterator().next() : null); 243 242 } 244 243 }
Note:
See TracChangeset
for help on using the changeset viewer.