public static ShapeAttributes assembleInteriorAttributes(ShapeAttributes attrs, KMLPolyStyle style) { // Assign the attributes defined in the KML Feature element. if (style.getColor() != null) { Color color = WWUtil.decodeColorABGR(style.getColor()); attrs.setInteriorMaterial(new Material(color)); attrs.setInteriorOpacity((double)color.getAlpha() / 255); } if (style.getColorMode() != null && "random".Equals(style.getColorMode())) { attrs.setInteriorMaterial(new Material(WWUtil.makeRandomColor(attrs.getOutlineMaterial().getDiffuse()))); } return(attrs); }
/** {@inheritDoc} */ public void copy(ShapeAttributes attributes) { if (attributes != null) { this.drawInterior = attributes.isDrawInterior(); this.drawOutline = attributes.isDrawOutline(); this.enableAntialiasing = attributes.isEnableAntialiasing(); this.enableLighting = attributes.isEnableLighting(); this.interiorMaterial = attributes.getInteriorMaterial(); this.outlineMaterial = attributes.getOutlineMaterial(); this.interiorOpacity = attributes.getInteriorOpacity(); this.outlineOpacity = attributes.getOutlineOpacity(); this.outlineWidth = attributes.getOutlineWidth(); this.outlineStippleFactor = attributes.getOutlineStippleFactor(); this.outlineStipplePattern = attributes.getOutlineStipplePattern(); this.imageSource = attributes.getImageSource(); this.imageScale = attributes.getImageScale(); } }
public static ShapeAttributes assembleLineAttributes(ShapeAttributes attrs, KMLLineStyle style) { // Assign the attributes defined in the KML Feature element. if (style.getWidth() != null) { attrs.setOutlineWidth(style.getWidth()); } if (style.getColor() != null) { attrs.setOutlineMaterial(new Material(WWUtil.decodeColorABGR(style.getColor()))); } if (style.getColorMode() != null && "random".Equals(style.getColorMode())) { attrs.setOutlineMaterial(new Material(WWUtil.makeRandomColor(attrs.getOutlineMaterial().getDiffuse()))); } return(attrs); }
/** * Creates a new <code>BasicShapeAttributes</code> configured with the specified <code>attributes</code>. * * @param attributes the attributes to configure the new <code>BasicShapeAttributes</code> with. * * @throws ArgumentException if <code>attributes</code> is <code>null</code>. */ public BasicShapeAttributes(ShapeAttributes attributes) { if (attributes == null) { String message = Logging.getMessage("nullValue.AttributesIsNull"); Logging.logger().severe(message); throw new ArgumentException(message); } this.drawInterior = attributes.isDrawInterior(); this.drawOutline = attributes.isDrawOutline(); this.enableAntialiasing = attributes.isEnableAntialiasing(); this.enableLighting = attributes.isEnableLighting(); this.interiorMaterial = attributes.getInteriorMaterial(); this.outlineMaterial = attributes.getOutlineMaterial(); this.interiorOpacity = attributes.getInteriorOpacity(); this.outlineOpacity = attributes.getOutlineOpacity(); this.outlineWidth = attributes.getOutlineWidth(); this.outlineStippleFactor = attributes.getOutlineStippleFactor(); this.outlineStipplePattern = attributes.getOutlineStipplePattern(); this.imageSource = attributes.getImageSource(); this.imageScale = attributes.getImageScale(); }