- Timestamp:
- 2016-03-07T21:45:35+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/gpx/GpxTrack.java
r8510 r9949 9 9 /** 10 10 * Read-only gpx track. Implementations doesn't have to be immutable, but should always be thread safe. 11 * 11 * @since 444 12 12 */ 13 13 public interface GpxTrack extends IWithAttributes { 14 14 15 /** 16 * Returns the track segments. 17 * @return the track segments 18 */ 15 19 Collection<GpxTrackSegment> getSegments(); 16 20 21 /** 22 * Returns the track attributes. 23 * @return the track attributes 24 */ 17 25 Map<String, Object> getAttributes(); 18 26 27 /** 28 * Returns the track bounds. 29 * @return the track bounds 30 */ 19 31 Bounds getBounds(); 20 32 33 /** 34 * Returns the track length. 35 * @return the track length 36 */ 21 37 double length(); 22 38 23 39 /** 24 * 40 * Returns the number of times this track has been changed. 25 41 * @return Number of times this track has been changed. Always 0 for read-only tracks 26 42 */ -
trunk/src/org/openstreetmap/josm/data/gpx/GpxTrackSegment.java
r8510 r9949 8 8 /** 9 9 * Read-only gpx track segments. Implementations doesn't have to be immutable, but should always be thread safe. 10 * 10 * @since 2907 11 11 */ 12 12 public interface GpxTrackSegment { 13 13 14 /** 15 * Returns the segment bounds. 16 * @return the segment bounds 17 */ 14 18 Bounds getBounds(); 15 19 20 /** 21 * Returns the segment waypoints. 22 * @return the segment waypoints 23 */ 16 24 Collection<WayPoint> getWayPoints(); 17 25 26 /** 27 * Returns the segment length. 28 * @return the segment length 29 */ 18 30 double length(); 19 31 20 32 /** 21 * 33 * Returns the number of times this track has been changed 22 34 * @return Number of times this track has been changed. Always 0 for read-only segments 23 35 */ -
trunk/src/org/openstreetmap/josm/data/gpx/ImmutableGpxTrack.java
r8510 r9949 11 11 import org.openstreetmap.josm.data.Bounds; 12 12 13 /** 14 * Immutable GPX track. 15 * @since 2907 16 */ 13 17 public class ImmutableGpxTrack extends WithAttributes implements GpxTrack { 14 18 … … 17 21 private final Bounds bounds; 18 22 23 /** 24 * Constructs a new {@code ImmutableGpxTrack}. 25 * @param trackSegs track segments 26 * @param attributes track attributes 27 */ 19 28 public ImmutableGpxTrack(Collection<Collection<WayPoint>> trackSegs, Map<String, Object> attributes) { 20 29 List<GpxTrackSegment> newSegments = new ArrayList<>(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListPopup.java
r8855 r9949 67 67 } 68 68 69 /** 70 * Constructs a new {@code LayerListPopup}. 71 * @param selectedLayers list of selected layers 72 */ 69 73 public LayerListPopup(List<Layer> selectedLayers) { 70 74 -
trunk/src/org/openstreetmap/josm/gui/layer/CustomizeColor.java
r8513 r9949 23 23 24 24 public class CustomizeColor extends AbstractAction implements LayerAction, MultiLayerAction { 25 private transient List<Layer> layers;25 private final transient List<Layer> layers; 26 26 27 /** 28 * Constructs a new {@code CustomizeColor} for a given list of layers. 29 * @param l list of layers 30 */ 27 31 public CustomizeColor(List<Layer> l) { 28 this(); 32 super(tr("Customize Color"), ImageProvider.get("colorchooser")); 33 putValue("help", ht("/Action/LayerCustomizeColor")); 29 34 layers = l; 30 35 } 31 36 37 /** 38 * Constructs a new {@code CustomizeColor} for a single layer. 39 * @param l layer 40 */ 32 41 public CustomizeColor(Layer l) { 33 this(); 34 layers = new LinkedList<>(); 42 this(new LinkedList<Layer>()); 35 43 layers.add(l); 36 }37 38 private CustomizeColor() {39 super(tr("Customize Color"), ImageProvider.get("colorchooser"));40 putValue("help", ht("/Action/LayerCustomizeColor"));41 44 } 42 45 … … 63 66 public void actionPerformed(ActionEvent e) { 64 67 Color cl = layers.get(0).getColor(false); 65 if (cl == null) cl = Color.gray; 68 if (cl == null) 69 cl = Color.gray; 66 70 JColorChooser c = new JColorChooser(cl); 67 71 Object[] options = new Object[]{tr("OK"), tr("Cancel"), tr("Default")}; -
trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java
r9461 r9949 52 52 public class GpxLayer extends Layer { 53 53 54 /** GPX data */ 54 55 public GpxData data; 55 private boolean isLocalFile;56 private final boolean isLocalFile; 56 57 // used by ChooseTrackVisibilityAction to determine which tracks to show/hide 57 58 public boolean[] trackVisibility = new boolean[0]; … … 62 63 private final GpxDrawHelper drawHelper; 63 64 65 /** 66 * Constructs a new {@code GpxLayer} without name. 67 * @param d GPX data 68 */ 64 69 public GpxLayer(GpxData d) { 70 this(d, null, false); 71 } 72 73 /** 74 * Constructs a new {@code GpxLayer} with a given name. 75 * @param d GPX data 76 * @param name layer name 77 */ 78 public GpxLayer(GpxData d, String name) { 79 this(d, name, false); 80 } 81 82 /** 83 * Constructs a new {@code GpxLayer} with a given name, thah can be attached to a local file. 84 * @param d GPX data 85 * @param name layer name 86 * @param isLocal whether data is attached to a local file 87 */ 88 public GpxLayer(GpxData d, String name, boolean isLocal) { 65 89 super(d.getString(GpxConstants.META_NAME)); 66 90 data = d; 67 91 drawHelper = new GpxDrawHelper(data); 68 92 ensureTrackVisibilityLength(); 69 } 70 71 public GpxLayer(GpxData d, String name) { 72 this(d); 73 this.setName(name); 74 } 75 76 public GpxLayer(GpxData d, String name, boolean isLocal) { 77 this(d); 78 this.setName(name); 79 this.isLocalFile = isLocal; 93 setName(name); 94 isLocalFile = isLocal; 80 95 } 81 96 … … 204 219 } 205 220 221 /** 222 * Determines if data is attached to a local file. 223 * @return {@code true} if data is attached to a local file, {@code false} otherwise 224 */ 206 225 public boolean isLocalFile() { 207 226 return isLocalFile; -
trunk/src/org/openstreetmap/josm/gui/layer/ImageryLayer.java
r9078 r9949 52 52 import org.openstreetmap.josm.tools.GBC; 53 53 import org.openstreetmap.josm.tools.ImageProvider; 54 import org.openstreetmap.josm.tools.ImageProvider.ImageSizes; 54 55 import org.openstreetmap.josm.tools.Utils; 55 56 … … 91 92 if (info.getIcon() != null) { 92 93 icon = new ImageProvider(info.getIcon()).setOptional(true). 93 setMax Height(ICON_SIZE).setMaxWidth(ICON_SIZE).get();94 setMaxSize(ImageSizes.LAYER).get(); 94 95 } 95 96 if (icon == null) { -
trunk/src/org/openstreetmap/josm/gui/layer/Layer.java
r9848 r9949 50 50 public abstract class Layer implements Destroyable, MapViewPaintable, ProjectionChangeListener { 51 51 52 /** 53 * Action related to a single layer. 54 */ 52 55 public interface LayerAction { 56 57 /** 58 * Determines if this action supports a given list of layers. 59 * @param layers list of layers 60 * @return {@code true} if this action supports the given list of layers, {@code false} otherwise 61 */ 53 62 boolean supportLayers(List<Layer> layers); 54 63 64 /** 65 * Creates and return the menu component. 66 * @return the menu component 67 */ 55 68 Component createMenuComponent(); 56 69 } 57 70 71 /** 72 * Action related to several layers. 73 */ 58 74 public interface MultiLayerAction { 75 76 /** 77 * Returns the action for a given list of layers. 78 * @param layers list of layers 79 * @return the action for the given list of layers 80 */ 59 81 Action getMultiLayerAction(List<Layer> layers); 60 82 } … … 64 86 */ 65 87 public static class SeparatorLayerAction extends AbstractAction implements LayerAction { 88 /** Unique instance */ 66 89 public static final SeparatorLayerAction INSTANCE = new SeparatorLayerAction(); 67 90 … … 86 109 public static final String NAME_PROP = Layer.class.getName() + ".name"; 87 110 public static final String FILTER_STATE_PROP = Layer.class.getName() + ".filterstate"; 88 89 public static final int ICON_SIZE = 16;90 111 91 112 /** -
trunk/src/org/openstreetmap/josm/tools/HttpClient.java
r9935 r9949 11 11 import java.net.CookieHandler; 12 12 import java.net.CookieManager; 13 import java.net.HttpRetryException;14 13 import java.net.HttpURLConnection; 15 14 import java.net.URL; … … 522 521 523 522 /** 524 * This method is used to enable streaming of a HTTP request body without internal buffering,525 * when the content length is known in advance.526 * <p>527 * An exception will be thrown if the application attempts to write more data than the indicated content-length,528 * or if the application closes the OutputStream before writing the indicated amount.529 * <p>530 * When output streaming is enabled, authentication and redirection cannot be handled automatically.531 * A {@linkplain HttpRetryException} will be thrown when reading the response if authentication or redirection532 * are required. This exception can be queried for the details of the error.533 *534 * @param contentLength The number of bytes which will be written to the OutputStream535 * @return {@code this}536 * @see HttpURLConnection#setFixedLengthStreamingMode(long)537 * @since 9178538 * @deprecated Submitting data via POST, PUT, DELETE automatically sets this property on the connection539 */540 @Deprecated541 public HttpClient setFixedLengthStreamingMode(long contentLength) {542 return this;543 }544 545 /**546 523 * Sets the {@code Accept} header. 547 524 * @param accept header value -
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r9827 r9949 132 132 */ 133 133 public enum ImageSizes { 134 /** SMALL_ICON value of on Action */134 /** SMALL_ICON value of an Action */ 135 135 SMALLICON(Main.pref.getInteger("iconsize.smallicon", 16)), 136 /** LARGE_ICON_KEY value of on Action */136 /** LARGE_ICON_KEY value of an Action */ 137 137 LARGEICON(Main.pref.getInteger("iconsize.largeicon", 24)), 138 138 /** map icon */ … … 375 375 overlayInfo.add(overlay); 376 376 return this; 377 }378 379 /**380 * Convert enumerated size values to real numbers381 * @param size the size enumeration382 * @return dimension of image in pixels383 * @since 7687384 * @deprecated Use {@link ImageSizes#getImageDimension()} instead385 */386 @Deprecated387 public static Dimension getImageSizes(ImageSizes size) {388 return (size == null ? ImageSizes.DEFAULT : size).getImageDimension();389 377 } 390 378
Note:
See TracChangeset
for help on using the changeset viewer.