/** * 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); }
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 text at a * specified position. * * @param text the text of this depiction annotation * @param position the position of this depiction annotation in globe * coordinates * * @see GlobeAnnotation#GlobeAnnotation(String, Position) */ public DepictionAnnotation(String text, Position position) { super(text, position); this.getAttributes().setTextColor(Color.LIGHT_GRAY); this.getAttributes().setBackgroundColor(new Color(0, 0, 0, 0)); this.getAttributes().setTextAlign(AVKey.CENTER); this.getAttributes().setLeaderGapWidth(3); }
/** * Sets whether or not this depiction is visible. * * @param visible the visibility state to be set */ public void setVisible(boolean visible) { if (this.depiction instanceof TacticalGraphic) { ((TacticalGraphic) this.depiction).setVisible(visible); } else if (this.depiction instanceof TacticalSymbol) { ((TacticalSymbol) this.depiction).setVisible(visible); } if (null != this.annotation) { this.annotation.getAttributes().setVisible(visible); } }
|| event.getEventAction().equals(SelectEvent.LEFT_CLICK)) { if (!annotation.getAttributes().isHighlighted()) { annotation.getAttributes().setHighlighted(true); update = true; } else if (event.getEventAction().equals(SelectEvent.ROLLOVER) && annotation.getAttributes().isHighlighted()) { annotation.getAttributes().setHighlighted(false); ((Component) this.wwd).setCursor(Cursor.getDefaultCursor()); this.update();
public void updateInfoAnnotation(final SelectEvent event) { //SystemUtils.LOG.info("updateInfoAnnotation " + event.getTopObject() + " " + theObjectInfoHash.get(event.getTopObject())); if (event.getEventAction().equals(SelectEvent.ROLLOVER) && theObjectInfoHash.get(event.getTopObject()) != null) { String info = theObjectInfoHash.get(event.getTopObject()); if (event.getTopObject() instanceof DirectedPath) { //SystemUtils.LOG.info("DirectedPath:::"); DirectedPath dp = (DirectedPath) event.getTopObject(); //dp.getAttributes().setOutlineMaterial(Material.WHITE); dp.setHighlighted(true); //dp.setAttributes(productLayer.dpHighlightAttrs); //theSelectedObjectLabel.setText("" + productLayer.theObjectInfoHash.get(dp)); theLastSelectedDP = dp; } theInfoAnnotation.setText(info); theInfoAnnotation.getAttributes().setVisible(true); //SystemUtils.LOG.info("selectedProduct " + getSelectedProduct()); //final ExecCommand command = datApp.getCommandManager().getExecCommand("showPolarWaveView"); //command.execute(2); } else if (event.getEventAction().equals(SelectEvent.LEFT_CLICK) && theSurfaceProductHash.get(event.getTopObject()) != null && theSurfaceSequenceHash.get(event.getTopObject()) != null) { //SystemUtils.LOG.info("click " + event.getTopObject()); OceanSwellTopComponent.setOSWRecord(theSurfaceProductHash.get(event.getTopObject()), theSurfaceSequenceHash.get(event.getTopObject())); } else { if (theLastSelectedDP != null) { theLastSelectedDP.setHighlighted(false); } theInfoAnnotation.getAttributes().setVisible(false); //theSelectedObjectLabel.setText(""); } }
/** * 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); }
theInfoAnnotation.getAttributes().setVisible(false);