Changeset 12304 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2017-06-02T23:21:03+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java
r12279 r12304 87 87 } 88 88 89 /** 90 * Add a task to the main worker that will block the worker and run in the GUI thread. 91 * @param task The task to run 92 */ 89 93 public static void executeByMainWorkerInEDT(final Runnable task) { 90 94 Main.worker.submit(() -> runInEDTAndWait(task)); -
trunk/src/org/openstreetmap/josm/gui/util/ModifierListener.java
r10600 r12304 9 9 @FunctionalInterface 10 10 public interface ModifierListener { 11 /** 12 * Called when the modifiers are changed 13 * @param modifiers The new modifiers 14 */ 11 15 void modifiersChanged(int modifiers); 12 16 } -
trunk/src/org/openstreetmap/josm/gui/util/RedirectInputMap.java
r8378 r12304 20 20 private final InputMap target; 21 21 22 /** 23 * Create a new {@link RedirectInputMap} 24 * @param component The component the input map will be added to 25 * @param target The target input map that should be mirrored. 26 */ 22 27 public RedirectInputMap(JComponent component, InputMap target) { 23 28 super(component); … … 60 65 } 61 66 67 /** 68 * Redirects the key inputs from one component to an other component 69 * @param source The source component 70 * @param target The target component to send the keystrokes to. 71 */ 62 72 public static void redirect(JComponent source, JComponent target) { 63 73 InputMap lastParent = source.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); -
trunk/src/org/openstreetmap/josm/gui/widgets/BoundingBoxSelectionPanel.java
r11893 r12304 23 23 24 24 /** 25 * 26 * 25 * A panel that allows the user to input the coordinates of a lat/lon box 27 26 */ 28 27 public class BoundingBoxSelectionPanel extends JPanel { … … 85 84 } 86 85 86 /** 87 * Sets the bounding box to the given area 88 * @param area The new input values 89 */ 87 90 public void setBoundingBox(Bounds area) { 88 91 updateBboxFields(area); 89 92 } 90 93 94 /** 95 * Get the bounding box the user selected 96 * @return The box or <code>null</code> if no valid data was input. 97 */ 91 98 public Bounds getBoundingBox() { 92 99 double minlon, minlat, maxlon, maxlat; -
trunk/src/org/openstreetmap/josm/gui/widgets/DateEditorWithSlider.java
r11878 r12304 90 90 } 91 91 92 /** 93 * Sets the date range that is available using the slider 94 * @param dateMin The min date 95 * @param dateMax The max date 96 */ 92 97 public void setRange(Date dateMin, Date dateMax) { 93 98 this.dateMin = DateUtils.cloneDate(dateMin); … … 95 100 } 96 101 102 /** 103 * Sets the slider to the given value 104 * @param date The date 105 */ 97 106 public void setDate(Date date) { 98 107 spinner.setValue(DateUtils.cloneDate(date)); 99 108 } 100 109 110 /** 111 * Gets the date that was selected by the user 112 * @return The date 113 */ 101 114 public Date getDate() { 102 115 return DateUtils.cloneDate((Date) spinner.getValue()); 103 116 } 104 117 118 /** 119 * Adds a change listener to this date editor. 120 * @param l The listener 121 */ 105 122 public void addDateListener(ChangeListener l) { 106 123 listeners.add(l); 107 124 } 108 125 126 /** 127 * Removes a change listener from this date editor. 128 * @param l The listener 129 */ 109 130 public void removeDateListener(ChangeListener l) { 110 131 listeners.remove(l); -
trunk/src/org/openstreetmap/josm/gui/widgets/EditableList.java
r11198 r12304 25 25 public class EditableList extends JPanel { 26 26 27 /** 28 * The title displayed in input dialog 29 */ 27 30 public final String title; 31 /** 32 * The list items 33 */ 28 34 public final JList<String> sourcesList = new JList<>(new DefaultListModel<String>()); 35 /** 36 * The add button 37 */ 29 38 public final JButton addSrcButton = new JButton(tr("Add")); 39 /** 40 * The edit button displayed nex to the list 41 */ 30 42 public final JButton editSrcButton = new JButton(tr("Edit")); 43 /** 44 * The delete button 45 */ 31 46 public final JButton deleteSrcButton = new JButton(tr("Delete")); 32 47 … … 115 130 } 116 131 132 /** 133 * Sets the list items by a given list of strings 134 * @param items The items that should be set 135 */ 117 136 public void setItems(final Iterable<String> items) { 118 137 for (String source : items) { … … 121 140 } 122 141 142 /** 143 * Gets all items that are currently displayed 144 * @return All items as list of strings 145 */ 123 146 public List<String> getItems() { 124 147 final List<String> items = new ArrayList<>(sourcesList.getModel().getSize()); -
trunk/src/org/openstreetmap/josm/gui/widgets/HistoryComboBox.java
r10179 r12304 15 15 private final ComboBoxHistory model; 16 16 17 /** 18 * The default size of the search history. 19 */ 17 20 public static final int DEFAULT_SEARCH_HISTORY_SIZE = 15; 18 21 -
trunk/src/org/openstreetmap/josm/gui/widgets/ListPopupMenu.java
r11747 r12304 9 9 10 10 /** 11 * A popup menu for one or more lists. If actions are added to this menu, a ListSelectionListener is registered automatically. 11 12 * @author Vincent 12 *13 13 */ 14 14 public class ListPopupMenu extends JPopupMenu { … … 16 16 private final JList<?>[] lists; 17 17 18 /** 19 * Create a new ListPopupMenu 20 * @param lists The lists to which listeners should be appended 21 */ 18 22 public ListPopupMenu(JList<?>... lists) { 19 23 this.lists = lists; -
trunk/src/org/openstreetmap/josm/gui/widgets/OsmPrimitivesTableModel.java
r8512 r12304 6 6 import org.openstreetmap.josm.data.osm.OsmPrimitive; 7 7 8 /** 9 * A table model that displays OSM primitives in it's rows 10 */ 8 11 public interface OsmPrimitivesTableModel extends TableModel { 9 12 13 /** 14 * Gets the primitive at a given row index 15 * @param idx The row 16 * @return The primitive in that row 17 */ 10 18 OsmPrimitive getReferredPrimitive(int idx); 11 19 } -
trunk/src/org/openstreetmap/josm/gui/widgets/SearchTextResultListPanel.java
r10217 r12304 20 20 import javax.swing.event.ListSelectionListener; 21 21 22 /** 23 * A panel containing a search text field and a list of results for that search text. 24 * @param <T> The class of the things that are searched 25 */ 22 26 public abstract class SearchTextResultListPanel<T> extends JPanel { 23 27 … … 125 129 } 126 130 131 /** 132 * Initializes and clears the panel. 133 */ 127 134 public synchronized void init() { 128 135 listSelectionListeners.clear(); … … 142 149 } 143 150 151 /** 152 * Clear the selected result 153 */ 144 154 public synchronized void clearSelection() { 145 155 lsResult.clearSelection(); 146 156 } 147 157 158 /** 159 * Get the number of items available 160 * @return The number of search result items available 161 */ 148 162 public synchronized int getItemCount() { 149 163 return lsResultModel.getSize(); 150 164 } 151 165 166 /** 167 * Sets a listener to be invoked on double click 168 * @param dblClickListener The double click listener 169 */ 152 170 public void setDblClickListener(ActionListener dblClickListener) { 153 171 this.dblClickListener = dblClickListener; 154 172 } 155 173 174 /** 175 * Sets a listener to be invoked on ssingle click 176 * @param clickListener The click listener 177 */ 156 178 public void setClickListener(ActionListener clickListener) { 157 179 this.clickListener = clickListener; -
trunk/src/org/openstreetmap/josm/gui/widgets/SelectAllOnFocusGainedDecorator.java
r9059 r12304 8 8 import javax.swing.text.JTextComponent; 9 9 10 /** 11 * A helper class that selects all text as soon as a {@link JTextComponent} receives focus. 12 */ 10 13 public class SelectAllOnFocusGainedDecorator extends FocusAdapter { 11 14 15 /** 16 * Add the listener to a given text component. 17 * @param tc The text component. 18 */ 12 19 public static void decorate(JTextComponent tc) { 13 20 if (tc == null) return; -
trunk/src/org/openstreetmap/josm/gui/widgets/VerticallyScrollablePanel.java
r11941 r12304 12 12 import org.openstreetmap.josm.gui.util.GuiHelper; 13 13 14 /** 15 * A panel that can be scrolled vertically. It enhances the normal {@link JPanel} to allow for better scrolling. 16 * Scroll pane contents may extend this. 17 * Use {@link #getVerticalScrollPane()} once to embed it into a scroll pane. 18 */ 14 19 public class VerticallyScrollablePanel extends JPanel implements Scrollable { 15 20
Note:
See TracChangeset
for help on using the changeset viewer.