public Level2ProductLayer() { this.setName("S-1 Level-2 OCN"); theWWD = null; //dpHighlightAttrs = new BasicShapeAttributes(); //dpHighlightAttrs.setOutlineMaterial(Material.WHITE); //dpHighlightAttrs.setOutlineWidth(2d); // this is copied from gov.nasa.worldwindx.examples.util.LayerManagerLayer theInfoAnnotation = new ScreenAnnotation("", new Point(120, 520)); // Set annotation so that it will not force text to wrap (large width) and will adjust it's width to // that of the text. A height of zero will have the annotation height follow that of the text too. theInfoAnnotation.getAttributes().setSize(new Dimension(Integer.MAX_VALUE, 0)); theInfoAnnotation.getAttributes().setAdjustWidthToText(AVKey.SIZE_FIT_TEXT); // Set appearance attributes theInfoAnnotation.getAttributes().setCornerRadius(0); //theInfoAnnotation.getAttributes().setFont(this.font); theInfoAnnotation.getAttributes().setHighlightScale(1); theInfoAnnotation.getAttributes().setTextColor(Color.WHITE); theInfoAnnotation.getAttributes().setBackgroundColor(new Color(0f, 0f, 0f, .5f)); theInfoAnnotation.getAttributes().setInsets(new Insets(6, 6, 6, 6)); theInfoAnnotation.getAttributes().setBorderWidth(1); theInfoAnnotation.getAttributes().setVisible(false); }
/** * Constructs a new depiction annotation with a specified image source * and text at a specified position. * * @param imageSource the image source of this depiction annotation * @param text the text of this depiction annotation * @param position the position of this depiction annotation in globe * coordinates */ public DepictionAnnotation(Object imageSource, String text, Position position) { super(text, position); this.getAttributes().setImageSource(imageSource); this.getAttributes().setImageScale(1d); this.getAttributes().setImageOpacity(1d); this.getAttributes().setImageRepeat(Annotation.IMAGE_REPEAT_NONE); this.getAttributes().setTextColor(Color.LIGHT_GRAY); this.getAttributes().setBackgroundColor(new Color(0, 0, 0, 0)); this.getAttributes().setAdjustWidthToText(AVKey.SIZE_FIXED); this.getAttributes().setSize(new Dimension(64, 64)); this.getAttributes().setTextAlign(AVKey.CENTER); this.getAttributes().setLeaderGapWidth(3); }
/** * Constructs a new depiction annotation with a specified image source, * size and text at a specified position. * * @param imageSource the image source of this depiction annotation * @param dim the size of this depiction annotation * @param text the text of this depiction annotation * @param position the position of this depiction annotation in globe * coordinates */ public DepictionAnnotation(Object imageSource, Dimension dim, String text, Position position) { super(text, position); this.getAttributes().setImageSource(imageSource); this.getAttributes().setImageScale(1d); this.getAttributes().setImageOpacity(1d); this.getAttributes().setImageRepeat(Annotation.IMAGE_REPEAT_NONE); this.getAttributes().setTextColor(Color.LIGHT_GRAY); this.getAttributes().setBackgroundColor(new Color(0, 0, 0, 0)); this.getAttributes().setAdjustWidthToText(AVKey.SIZE_FIXED); this.getAttributes().setSize(dim); this.getAttributes().setTextAlign(AVKey.CENTER); this.getAttributes().setLeaderGapWidth(3); }