Last change
on this file since 7337 was 6992, checked in by Don-vip, 10 years ago |
cleanup/refactor of NavigatableComponent
|
File size:
1.0 KB
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.data;
|
---|
3 |
|
---|
4 | import org.openstreetmap.josm.data.coor.EastNorth;
|
---|
5 |
|
---|
6 | /**
|
---|
7 | * Simple data class that keeps map center and scale in one object.
|
---|
8 | * @since 5670 (creation)
|
---|
9 | * @since 6992 (extraction in this package)
|
---|
10 | */
|
---|
11 | public class ViewportData {
|
---|
12 | private EastNorth center;
|
---|
13 | private Double scale;
|
---|
14 |
|
---|
15 | /**
|
---|
16 | * Constructs a new {@code ViewportData}.
|
---|
17 | * @param center Projected coordinates of the map center
|
---|
18 | * @param scale Scale factor in east-/north-units per pixel
|
---|
19 | */
|
---|
20 | public ViewportData(EastNorth center, Double scale) {
|
---|
21 | this.center = center;
|
---|
22 | this.scale = scale;
|
---|
23 | }
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * Return the projected coordinates of the map center
|
---|
27 | * @return the center
|
---|
28 | */
|
---|
29 | public EastNorth getCenter() {
|
---|
30 | return center;
|
---|
31 | }
|
---|
32 |
|
---|
33 | /**
|
---|
34 | * Return the scale factor in east-/north-units per pixel.
|
---|
35 | * @return the scale
|
---|
36 | */
|
---|
37 | public Double getScale() {
|
---|
38 | return scale;
|
---|
39 | }
|
---|
40 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.