示例#1
0
 @Override
 public void setSurfShapeColor(String id, Color col, double opacity) throws NoSuchShapeException {
   SurfaceShape shape = getSurfShape(id);
   BasicShapeAttributes newAttr = new BasicShapeAttributes(attr);
   newAttr.setOutlineMaterial(new Material(col));
   newAttr.setInteriorMaterial(new Material(col.brighter().brighter()));
   newAttr.setOutlineOpacity(opacity);
   newAttr.setInteriorOpacity(NORM_INSIDE_OPACITY * opacity);
   shape.setAttributes(newAttr);
 }
示例#2
0
 /**
  * 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);
 }
示例#3
0
 @Override
 public void setHighlightOpacity(double opacity) {
   attrHigh.setOutlineOpacity(opacity);
   attrHigh.setInteriorOpacity(HIGHL_INSIDE_OPACITY * opacity);
 }
示例#4
0
 @Override
 public double getHighlightOpacity() {
   return attrHigh.getOutlineOpacity();
 }
示例#5
0
 @Override
 public void setHighlightColor(Color col) {
   attrHigh.setOutlineMaterial(new Material(col));
   attrHigh.setInteriorMaterial(new Material(col.brighter().brighter()));
 }
示例#6
0
 @Override
 public Color getHighlightColor() {
   return attrHigh.getOutlineMaterial().getDiffuse();
 }
示例#7
0
 @Override
 public void setOpacity(double opacity) {
   attr.setOutlineOpacity(opacity);
   attr.setInteriorOpacity(NORM_INSIDE_OPACITY * opacity);
 }
示例#8
0
 @Override
 public double getOpacity() {
   return attr.getOutlineOpacity();
 }