2 Copyright (C) 2001, 2006 United States Government
3 as represented by the Administrator of the
4 National Aeronautics and Space Administration.
7 package gov
.nasa
.worldwind
.render
;
9 import gov
.nasa
.worldwind
.geom
.*;
10 import gov
.nasa
.worldwind
.util
.Logging
;
13 import java
.util
.ArrayList
;
17 * @version $Id: SurfaceSector.java 2570 2007-08-16 22:31:33Z tgaskins $
19 public class SurfaceSector
extends SurfacePolygon
21 public SurfaceSector(Sector sector
, Color color
, Color borderColor
)
23 super(makePositions(sector
), color
, borderColor
);
26 public SurfaceSector(Sector sector
)
28 super(makePositions(sector
), null, null);
31 public SurfaceSector(Sector sector
, Color color
, Color borderColor
, Dimension textureSize
)
33 super(makePositions(sector
), color
, borderColor
, textureSize
);
36 public void setSector(Sector sector
)
38 this.setPositions(makePositions(sector
));
41 private static Iterable
<LatLon
> makePositions(Sector sector
)
45 String message
= Logging
.getMessage("nullValue.SectorIsNull");
46 Logging
.logger().severe(message
);
47 throw new IllegalArgumentException(message
);
50 ArrayList
<LatLon
> positions
= new ArrayList
<LatLon
>(5);
52 positions
.add(new LatLon(sector
.getMinLatitude(), sector
.getMinLongitude()));
53 positions
.add(new LatLon(sector
.getMinLatitude(), sector
.getMaxLongitude()));
54 positions
.add(new LatLon(sector
.getMaxLatitude(), sector
.getMaxLongitude()));
55 positions
.add(new LatLon(sector
.getMaxLatitude(), sector
.getMinLongitude()));
56 positions
.add(new LatLon(sector
.getMinLatitude(), sector
.getMinLongitude()));