Changeset 13959 in josm
- Timestamp:
- 2018-06-19T19:44:45+02:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/dialogs/properties
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/HelpAction.java
r13849 r13959 20 20 import javax.swing.KeyStroke; 21 21 22 import org.openstreetmap.josm.data.osm. Relation;22 import org.openstreetmap.josm.data.osm.IRelation; 23 23 import org.openstreetmap.josm.gui.MainApplication; 24 24 import org.openstreetmap.josm.spi.preferences.Config; … … 40 40 41 41 private final JTable membershipTable; 42 private final IntFunction< Relation> memberValueSupplier;42 private final IntFunction<IRelation<?>> memberValueSupplier; 43 43 44 44 /** … … 49 49 * @param membershipTable The membership table. Can be null 50 50 * @param memberValueSupplier Finds the parent relation from given row of membership table. Can be null 51 * @since 13959 (signature) 51 52 */ 52 53 public HelpAction(JTable tagTable, IntFunction<String> tagKeySupplier, IntFunction<Map<String, Integer>> tagValuesSupplier, 53 JTable membershipTable, IntFunction< Relation> memberValueSupplier) {54 JTable membershipTable, IntFunction<IRelation<?>> memberValueSupplier) { 54 55 this.tagTable = Objects.requireNonNull(tagTable); 55 56 this.tagKeySupplier = Objects.requireNonNull(tagKeySupplier); … … 128 129 * @throws URISyntaxException in case of internal error 129 130 * @since 13522 130 */ 131 public static List<URI> getRelationURIs(String base, String lang, Relation rel) throws URISyntaxException { 131 * @since 13959 (signature) 132 */ 133 public static List<URI> getRelationURIs(String base, String lang, IRelation<?> rel) throws URISyntaxException { 132 134 List<URI> uris = new ArrayList<>(); 133 135 String type = rel.get("type"); -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r13956 r13959 178 178 private final transient DataSetListenerAdapter dataChangedAdapter = new DataSetListenerAdapter(this); 179 179 private final HelpAction helpAction = new HelpAction(tagTable, editHelper::getDataKey, editHelper::getDataValues, 180 membershipTable, x -> ( Relation) membershipData.getValueAt(x, 0));180 membershipTable, x -> (IRelation<?>) membershipData.getValueAt(x, 0)); 181 181 private final TaginfoAction taginfoAction = new TaginfoAction(tagTable, editHelper::getDataKey, editHelper::getDataValues, 182 membershipTable, x -> ( Relation) membershipData.getValueAt(x, 0));182 membershipTable, x -> (IRelation<?>) membershipData.getValueAt(x, 0)); 183 183 private final PasteValueAction pasteValueAction = new PasteValueAction(); 184 184 private final CopyValueAction copyValueAction = new CopyValueAction( … … 378 378 protected int checkTableSelection(JTable table, Point p) { 379 379 int row = super.checkTableSelection(table, p); 380 List< Relation> rels = new ArrayList<>();380 List<IRelation<?>> rels = new ArrayList<>(); 381 381 for (int i: table.getSelectedRows()) { 382 rels.add(( Relation) table.getValueAt(i, 0));382 rels.add((IRelation<?>) table.getValueAt(i, 0)); 383 383 } 384 384 membershipMenuHandler.setPrimitives(rels); … … 569 569 Collection<? extends IPrimitive> newSel = Main.main.getInProgressISelection(); 570 570 String selectedTag; 571 RelationselectedRelation = null;571 IRelation<?> selectedRelation = null; 572 572 selectedTag = editHelper.getChangedKey(); // select last added or last edited key by default 573 573 if (selectedTag == null && tagTable.getSelectedRowCount() == 1) { … … 575 575 } 576 576 if (membershipTable.getSelectedRowCount() == 1) { 577 selectedRelation = ( Relation) membershipData.getValueAt(membershipTable.getSelectedRow(), 0);577 selectedRelation = (IRelation<?>) membershipData.getValueAt(membershipTable.getSelectedRow(), 0); 578 578 } 579 579 … … 775 775 if (c instanceof JLabel) { 776 776 JLabel label = (JLabel) c; 777 Relation r = (Relation) value;777 IRelation<?> r = (IRelation<?>) value; 778 778 label.setText(r.getDisplayName(DefaultNameFormatter.getInstance())); 779 779 if (r.isDisabledAndHidden()) { … … 792 792 return this; 793 793 Component c = super.getTableCellRendererComponent(table, value, isSelected, false, row, column); 794 boolean isDisabledAndHidden = (( Relation) table.getValueAt(row, 0)).isDisabledAndHidden();794 boolean isDisabledAndHidden = ((IRelation<?>) table.getValueAt(row, 0)).isDisabledAndHidden(); 795 795 if (c instanceof JLabel) { 796 796 JLabel label = (JLabel) c; … … 809 809 boolean isSelected, boolean hasFocus, int row, int column) { 810 810 Component c = super.getTableCellRendererComponent(table, value, isSelected, false, row, column); 811 boolean isDisabledAndHidden = (( Relation) table.getValueAt(row, 0)).isDisabledAndHidden();811 boolean isDisabledAndHidden = ((IRelation<?>) table.getValueAt(row, 0)).isDisabledAndHidden(); 812 812 if (c instanceof JLabel) { 813 813 JLabel label = (JLabel) c; -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TaginfoAction.java
r13849 r13959 12 12 13 13 import org.openstreetmap.josm.actions.JosmAction; 14 import org.openstreetmap.josm.data.osm. Relation;14 import org.openstreetmap.josm.data.osm.IRelation; 15 15 import org.openstreetmap.josm.data.preferences.StringProperty; 16 16 import org.openstreetmap.josm.tools.OpenBrowser; … … 30 30 31 31 private final JTable membershipTable; 32 private final IntFunction< Relation> memberValueSupplier;32 private final IntFunction<IRelation<?>> memberValueSupplier; 33 33 34 34 /** … … 39 39 * @param membershipTable The membership table. Can be null 40 40 * @param memberValueSupplier Finds the parent relation from given row of membership table. Can be null 41 * @since 13959 (signature) 41 42 */ 42 43 public TaginfoAction(JTable tagTable, IntFunction<String> tagKeySupplier, IntFunction<Map<String, Integer>> tagValuesSupplier, 43 JTable membershipTable, IntFunction< Relation> memberValueSupplier) {44 JTable membershipTable, IntFunction<IRelation<?>> memberValueSupplier) { 44 45 super(tr("Go to Taginfo"), "dialogs/taginfo", tr("Launch browser with Taginfo statistics for selected object"), null, false); 45 46 this.tagTable = Objects.requireNonNull(tagTable);
Note:
See TracChangeset
for help on using the changeset viewer.