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
.layers
;
9 import gov
.nasa
.worldwind
.*;
11 import java
.util
.concurrent
.ConcurrentLinkedQueue
;
17 public class IconLayer
extends AbstractLayer
19 private final java
.util
.Collection
<WWIcon
> icons
= new ConcurrentLinkedQueue
<WWIcon
>();
20 private IconRenderer iconRenderer
= new IconRenderer();
21 private Pedestal pedestal
;
27 public void addIcon(WWIcon icon
)
31 String msg
= WorldWind
.retrieveErrMsg("nullValue.Icon");
32 WorldWind
.logger().log(java
.util
.logging
.Level
.FINE
, msg
);
33 throw new IllegalArgumentException(msg
);
39 public void removeIcon(WWIcon icon
)
43 String msg
= WorldWind
.retrieveErrMsg("nullValue.Icon");
44 WorldWind
.logger().log(java
.util
.logging
.Level
.FINE
, msg
);
45 throw new IllegalArgumentException(msg
);
48 this.icons
.remove(icon
);
51 public java
.util
.Collection
<WWIcon
> getIcons()
58 this.iconRenderer
.dispose();
61 public Pedestal
getPedestal()
66 public void setPedestal(Pedestal pedestal
)
68 this.pedestal
= pedestal
;
72 protected void doPick(DrawContext dc
, java
.awt
.Point pickPoint
)
74 this.iconRenderer
.setPedestal(this.pedestal
);
75 this.iconRenderer
.pick(dc
, this.icons
, pickPoint
, this);
79 protected void doRender(DrawContext dc
)
81 this.iconRenderer
.setPedestal(this.pedestal
);
82 this.iconRenderer
.render(dc
, this.icons
);
86 public String
toString()
88 return WorldWind
.retrieveErrMsg("layers.IconLayer.Name");