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; }
protected void setupAnnotationAttributes(Annotation annotation) { java.awt.Color transparentBlack = new java.awt.Color(0, 0, 0, 0); AnnotationAttributes defaultAttribs = new AnnotationAttributes(); defaultAttribs.setAdjustWidthToText(AVKey.SIZE_FIXED); defaultAttribs.setBackgroundColor(transparentBlack); defaultAttribs.setBorderColor(transparentBlack); defaultAttribs.setBorderWidth(0); defaultAttribs.setCornerRadius(0); defaultAttribs.setDrawOffset(new java.awt.Point(0, 0)); defaultAttribs.setHighlightScale(1); defaultAttribs.setInsets(new java.awt.Insets(0, 0, 0, 0)); defaultAttribs.setImageScale(1); defaultAttribs.setImageOffset(new java.awt.Point(0, 0)); defaultAttribs.setImageOpacity(1); defaultAttribs.setImageRepeat(AVKey.REPEAT_NONE); defaultAttribs.setLeader(AVKey.SHAPE_NONE); defaultAttribs.setSize(new java.awt.Dimension(0, 0)); annotation.setPickEnabled(false); annotation.getAttributes().setDefaults(defaultAttribs); }