Updated to worldwind release 20070817
[worldwind-tracker.git] / gov / nasa / worldwind / layers / IconLayer.java
blob790bcb58f10fa616a5b90188c5c8563acdb93f07
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.render.*;
10 import gov.nasa.worldwind.util.Logging;
12 import java.util.concurrent.ConcurrentLinkedQueue;
14 /**
15 * @author tag
16 * @version $Id$
18 public class IconLayer extends AbstractLayer
20 private final java.util.Collection<WWIcon> icons = new ConcurrentLinkedQueue<WWIcon>();
21 private IconRenderer iconRenderer = new IconRenderer();
22 private Pedestal pedestal;
24 public IconLayer()
28 public void addIcon(WWIcon icon)
30 if (icon == null)
32 String msg = Logging.getMessage("nullValue.Icon");
33 Logging.logger().severe(msg);
34 throw new IllegalArgumentException(msg);
37 this.icons.add(icon);
40 public void removeIcon(WWIcon icon)
42 if (icon == null)
44 String msg = Logging.getMessage("nullValue.Icon");
45 Logging.logger().severe(msg);
46 throw new IllegalArgumentException(msg);
49 this.icons.remove(icon);
52 public java.util.Collection<WWIcon> getIcons()
54 return this.icons;
57 public Pedestal getPedestal()
59 return pedestal;
62 public void setPedestal(Pedestal pedestal)
64 this.pedestal = pedestal;
67 @Override
68 protected void doPick(DrawContext dc, java.awt.Point pickPoint)
70 this.iconRenderer.setPedestal(this.pedestal);
71 this.iconRenderer.pick(dc, this.icons, pickPoint, this);
74 @Override
75 protected void doRender(DrawContext dc)
77 this.iconRenderer.setPedestal(this.pedestal);
78 this.iconRenderer.render(dc, this.icons);
81 @Override
82 public String toString()
84 return Logging.getMessage("layers.IconLayer.Name");