Worldwind public release 0.2.1
[worldwind-tracker.git] / gov / nasa / worldwind / layers / IconLayer.java
blobba555bd375e341d54dd3492653ec3781b424869a
1 /*
2 Copyright (C) 2001, 2006 United States Government
3 as represented by the Administrator of the
4 National Aeronautics and Space Administration.
5 All Rights Reserved.
6 */
7 package gov.nasa.worldwind.layers;
9 import gov.nasa.worldwind.*;
11 import java.util.concurrent.ConcurrentLinkedQueue;
13 /**
14 * @author tag
15 * @version $Id$
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;
23 public IconLayer()
27 public void addIcon(WWIcon icon)
29 if (icon == null)
31 String msg = WorldWind.retrieveErrMsg("nullValue.Icon");
32 WorldWind.logger().log(java.util.logging.Level.FINE, msg);
33 throw new IllegalArgumentException(msg);
36 this.icons.add(icon);
39 public void removeIcon(WWIcon icon)
41 if (icon == null)
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()
53 return this.icons;
56 public void dispose()
58 this.iconRenderer.dispose();
61 public Pedestal getPedestal()
63 return pedestal;
66 public void setPedestal(Pedestal pedestal)
68 this.pedestal = pedestal;
71 @Override
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);
78 @Override
79 protected void doRender(DrawContext dc)
81 this.iconRenderer.setPedestal(this.pedestal);
82 this.iconRenderer.render(dc, this.icons);
85 @Override
86 public String toString()
88 return WorldWind.retrieveErrMsg("layers.IconLayer.Name");