Ignore:
Timestamp:
2017-06-02T23:21:03+02:00 (7 years ago)
Author:
michael2402
Message:

Javadoc for public methods / classes in gui.util and gui.widgets

Location:
trunk/src/org/openstreetmap/josm/gui/widgets
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/widgets/BoundingBoxSelectionPanel.java

    r11893 r12304  
    2323
    2424/**
    25  *
    26  *
     25 * A panel that allows the user to input the coordinates of a lat/lon box
    2726 */
    2827public class BoundingBoxSelectionPanel extends JPanel {
     
    8584    }
    8685
     86    /**
     87     * Sets the bounding box to the given area
     88     * @param area The new input values
     89     */
    8790    public void setBoundingBox(Bounds area) {
    8891        updateBboxFields(area);
    8992    }
    9093
     94    /**
     95     * Get the bounding box the user selected
     96     * @return The box or <code>null</code> if no valid data was input.
     97     */
    9198    public Bounds getBoundingBox() {
    9299        double minlon, minlat, maxlon, maxlat;
  • trunk/src/org/openstreetmap/josm/gui/widgets/DateEditorWithSlider.java

    r11878 r12304  
    9090    }
    9191
     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     */
    9297    public void setRange(Date dateMin, Date dateMax) {
    9398        this.dateMin = DateUtils.cloneDate(dateMin);
     
    95100    }
    96101
     102    /**
     103     * Sets the slider to the given value
     104     * @param date The date
     105     */
    97106    public void setDate(Date date) {
    98107        spinner.setValue(DateUtils.cloneDate(date));
    99108    }
    100109
     110    /**
     111     * Gets the date that was selected by the user
     112     * @return The date
     113     */
    101114    public Date getDate() {
    102115        return DateUtils.cloneDate((Date) spinner.getValue());
    103116    }
    104117
     118    /**
     119     * Adds a change listener to this date editor.
     120     * @param l The listener
     121     */
    105122    public void addDateListener(ChangeListener l) {
    106123        listeners.add(l);
    107124    }
    108125
     126    /**
     127     * Removes a change listener from this date editor.
     128     * @param l The listener
     129     */
    109130    public void removeDateListener(ChangeListener l) {
    110131        listeners.remove(l);
  • trunk/src/org/openstreetmap/josm/gui/widgets/EditableList.java

    r11198 r12304  
    2525public class EditableList extends JPanel {
    2626
     27    /**
     28     * The title displayed in input dialog
     29     */
    2730    public final String title;
     31    /**
     32     * The list items
     33     */
    2834    public final JList<String> sourcesList = new JList<>(new DefaultListModel<String>());
     35    /**
     36     * The add button
     37     */
    2938    public final JButton addSrcButton = new JButton(tr("Add"));
     39    /**
     40     * The edit button displayed nex to the list
     41     */
    3042    public final JButton editSrcButton = new JButton(tr("Edit"));
     43    /**
     44     * The delete button
     45     */
    3146    public final JButton deleteSrcButton = new JButton(tr("Delete"));
    3247
     
    115130    }
    116131
     132    /**
     133     * Sets the list items by a given list of strings
     134     * @param items The items that should be set
     135     */
    117136    public void setItems(final Iterable<String> items) {
    118137        for (String source : items) {
     
    121140    }
    122141
     142    /**
     143     * Gets all items that are currently displayed
     144     * @return All items as list of strings
     145     */
    123146    public List<String> getItems() {
    124147        final List<String> items = new ArrayList<>(sourcesList.getModel().getSize());
  • trunk/src/org/openstreetmap/josm/gui/widgets/HistoryComboBox.java

    r10179 r12304  
    1515    private final ComboBoxHistory model;
    1616
     17    /**
     18     * The default size of the search history.
     19     */
    1720    public static final int DEFAULT_SEARCH_HISTORY_SIZE = 15;
    1821
  • trunk/src/org/openstreetmap/josm/gui/widgets/ListPopupMenu.java

    r11747 r12304  
    99
    1010/**
     11 * A popup menu for one or more lists. If actions are added to this menu, a ListSelectionListener is registered automatically.
    1112 * @author Vincent
    12  *
    1313 */
    1414public class ListPopupMenu extends JPopupMenu {
     
    1616    private final JList<?>[] lists;
    1717
     18    /**
     19     * Create a new ListPopupMenu
     20     * @param lists The lists to which listeners should be appended
     21     */
    1822    public ListPopupMenu(JList<?>... lists) {
    1923        this.lists = lists;
  • trunk/src/org/openstreetmap/josm/gui/widgets/OsmPrimitivesTableModel.java

    r8512 r12304  
    66import org.openstreetmap.josm.data.osm.OsmPrimitive;
    77
     8/**
     9 * A table model that displays OSM primitives in it's rows
     10 */
    811public interface OsmPrimitivesTableModel extends TableModel {
    912
     13    /**
     14     * Gets the primitive at a given row index
     15     * @param idx The row
     16     * @return The primitive in that row
     17     */
    1018    OsmPrimitive getReferredPrimitive(int idx);
    1119}
  • trunk/src/org/openstreetmap/josm/gui/widgets/SearchTextResultListPanel.java

    r10217 r12304  
    2020import javax.swing.event.ListSelectionListener;
    2121
     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 */
    2226public abstract class SearchTextResultListPanel<T> extends JPanel {
    2327
     
    125129    }
    126130
     131    /**
     132     * Initializes and clears the panel.
     133     */
    127134    public synchronized void init() {
    128135        listSelectionListeners.clear();
     
    142149    }
    143150
     151    /**
     152     * Clear the selected result
     153     */
    144154    public synchronized void clearSelection() {
    145155        lsResult.clearSelection();
    146156    }
    147157
     158    /**
     159     * Get the number of items available
     160     * @return The number of search result items available
     161     */
    148162    public synchronized int getItemCount() {
    149163        return lsResultModel.getSize();
    150164    }
    151165
     166    /**
     167     * Sets a listener to be invoked on double click
     168     * @param dblClickListener The double click listener
     169     */
    152170    public void setDblClickListener(ActionListener dblClickListener) {
    153171        this.dblClickListener = dblClickListener;
    154172    }
    155173
     174    /**
     175     * Sets a listener to be invoked on ssingle click
     176     * @param clickListener The click listener
     177     */
    156178    public void setClickListener(ActionListener clickListener) {
    157179        this.clickListener = clickListener;
  • trunk/src/org/openstreetmap/josm/gui/widgets/SelectAllOnFocusGainedDecorator.java

    r9059 r12304  
    88import javax.swing.text.JTextComponent;
    99
     10/**
     11 * A helper class that selects all text as soon as a {@link JTextComponent} receives focus.
     12 */
    1013public class SelectAllOnFocusGainedDecorator extends FocusAdapter {
    1114
     15    /**
     16     * Add the listener to a given text component.
     17     * @param tc The text component.
     18     */
    1219    public static void decorate(JTextComponent tc) {
    1320        if (tc == null) return;
  • trunk/src/org/openstreetmap/josm/gui/widgets/VerticallyScrollablePanel.java

    r11941 r12304  
    1212import org.openstreetmap.josm.gui.util.GuiHelper;
    1313
     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 */
    1419public class VerticallyScrollablePanel extends JPanel implements Scrollable {
    1520
Note: See TracChangeset for help on using the changeset viewer.