/** * Initializing constructor. * * @param name the name of this layer */ public SurfShapesLayer(String name) { // properties of layer setName(name); setEnabled(true); // painting attributes for shapes attr.setOutlineMaterial(Material.ORANGE); attr.setOutlineWidth(1.5); Material intMat = new Material(Color.ORANGE.brighter().brighter()); attr.setInteriorMaterial(intMat); attr.setInteriorOpacity(NORM_INSIDE_OPACITY); // painting attributes for hihglighted shapes attrHigh.setOutlineMaterial(Material.BLACK); attrHigh.setOutlineWidth(2); attrHigh.setInteriorMaterial(Material.WHITE); attrHigh.setInteriorOpacity(HIGHL_INSIDE_OPACITY); // popup annotation attributes AnnotationAttributes attrAnno = new AnnotationAttributes(); attrAnno.setAdjustWidthToText(AVKey.SIZE_FIT_TEXT); attrAnno.setFrameShape(AVKey.SHAPE_RECTANGLE); attrAnno.setCornerRadius(3); attrAnno.setDrawOffset(new Point(0, 8)); attrAnno.setLeaderGapWidth(8); attrAnno.setTextColor(Color.BLACK); attrAnno.setBackgroundColor(new Color(1f, 1f, 1f, .85f)); attrAnno.setBorderColor(new Color(0xababab)); attrAnno.setInsets(new Insets(3, 3, 3, 3)); attrAnno.setVisible(false); popupAnnotation.setAttributes(attrAnno); popupAnnotation.setAlwaysOnTop(true); addRenderable(popupAnnotation); }
protected AnnotationAttributes getAnnotationPanelAttributes(String annoText) { AnnotationAttributes attrs = new AnnotationAttributes(); attrs.setAdjustWidthToText(AVKey.SIZE_FIXED); attrs.setSize(this.computePanelSize(annoText)); attrs.setFrameShape(AVKey.SHAPE_RECTANGLE); attrs.setTextColor(Color.WHITE); attrs.setBackgroundColor(new Color(0f, 0f, 0f, 0.6f)); attrs.setCornerRadius(10); attrs.setInsets(new Insets(10, 10, 0, 0)); attrs.setBorderColor(new Color(0xababab)); attrs.setFont(Font.decode("Arial-PLAIN-12")); attrs.setTextAlign(AVKey.LEFT); return attrs; }