/** * 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() ); }