/** * Returns a String representation of this ColoringAttributes object. * If the scene graph is live only those values with their * Capability read bit set will be displayed. */ @Override public String toString() { StringBuffer str = new StringBuffer(getNamePrefix()); str.append("org.scijava.java3d.ColoringAttributes: "); String shadingModes[] = { "FASTEST", "NICEST", "SHADE_FLAT", "SHADE_GOURAUD" }; try { Color3f color=new Color3f(); getColor( color ); str.append( "Color="+color ); } catch (CapabilityNotSetException e) {str.append("Color=N/A");} try { str.append( " ShadeModel="+shadingModes[getShadeModel()] ); } catch (CapabilityNotSetException ex) {str.append("ShadeModel=N/A");} return new String(str); }
@Override public void writeObject( DataOutput out ) throws IOException { super.writeObject( out ); ColoringAttributes attr = (ColoringAttributes)node; Color3f clr = new Color3f(); attr.getColor( clr ); control.writeColor3f( out, clr ); out.writeInt( attr.getShadeModel() ); }
/** * Use the currently selected color to paint an edge. * * @param shape a Java3D shape - must be a LineArray * */ void highlightEdge(Shape3D shape) { Color3f highlightColor = volumes.getSelectedColor(); if (shape.getGeometry() instanceof LineArray) { Appearance appearance = shape.getAppearance(); ColoringAttributes ca = appearance.getColoringAttributes(); Color3f before = new Color3f(); appearance.setColoringAttributes(ca); ca.getColor(before); ca.setColor(highlightColor); } }
Appearance appearance = shape.getAppearance(); ColoringAttributes ca = appearance.getColoringAttributes(); ca.getColor(currentColor); if (!currentColor.equals(edgeColor)) { continue;