/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.geoforge.worldwind.layer;
import gov.nasa.worldwind.avlist.AVKey;
import gov.nasa.worldwind.render.AnnotationAttributes;
import gov.nasa.worldwind.render.ScreenAnnotation;
import java.awt.*;
/**
*
* @author bill
*/
public class GfrRenderableLayerPickingCustomShape extends GfrRenderableLayerPickingCustomAbs
{
protected ScreenAnnotation annotation;
protected AnnotationAttributes annotationAttributes;
public GfrRenderableLayerPickingCustomShape()
{
super();
super.setPickEnabled(false);
// Annotation attributes
this.annotationAttributes = new AnnotationAttributes();
this.annotationAttributes.setFrameShape(AVKey.SHAPE_NONE);
this.annotationAttributes.setInsets(new Insets(0, 0, 0, 0));
this.annotationAttributes.setDrawOffset(new Point(0, 10));
this.annotationAttributes.setTextAlign(AVKey.CENTER);
this.annotationAttributes.setEffect(AVKey.TEXT_EFFECT_OUTLINE);
this.annotationAttributes.setFont(Font.decode("Arial-Bold-14")); // !!!!!!!!!!!!!!!!!!!!
this.annotationAttributes.setTextColor(Color.WHITE);
this.annotationAttributes.setBackgroundColor(Color.BLACK);
this.annotationAttributes.setSize(new Dimension(220, 0));
this.annotation = new ScreenAnnotation("", new Point(0, 0), this.annotationAttributes);
this.annotation.getAttributes().setVisible(false);
this.annotation.getAttributes().setDrawOffset(null); // use defaults
super.addRenderable(this.annotation);
}
@Override
public void dispose()
{
super.dispose();
}
public void setScreenPointAnnotation(Point pnt)
{
this.annotation.setScreenPoint(pnt);
}
public void setTextAnnotation(String str)
{
this.annotation.setText(str);
}
public void setVisibleAttributesAnnotation(boolean bln)
{
this.annotation.getAttributes().setVisible(bln);
}
}