From f33bb86c78d0732c84c45f279fab666a0424fcbb Mon Sep 17 00:00:00 2001 From: Ken Mc Neill Date: Wed, 14 Nov 2007 16:40:03 +0000 Subject: Issue number: 483 Submitted by: lamer47 Reviewed by: kcr git-svn-id: https://svn.java.net/svn/j3d-core-utils~svn/trunk@175 9497e636-51bd-65ba-982d-a4982e1767a5 --- .../io/state/javax/media/j3d/Font3DState.java | 195 +++++++++++---------- .../io/state/javax/media/j3d/Text3DState.java | 92 +++++----- 2 files changed, 156 insertions(+), 131 deletions(-) diff --git a/src/classes/share/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/Font3DState.java b/src/classes/share/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/Font3DState.java index 47cf22e..e144fe0 100644 --- a/src/classes/share/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/Font3DState.java +++ b/src/classes/share/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/Font3DState.java @@ -41,7 +41,6 @@ * $Date$ * $State$ */ - package com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d; import javax.media.j3d.Font3D; @@ -61,103 +60,121 @@ import java.awt.geom.GeneralPath; public class Font3DState extends NodeComponentState { - private Font font=null; - private double tesselationTolerance=0.0D; - private FontExtrusion extrudePath=null; + private Font font = null; + private double tesselationTolerance = 0.0D; + private FontExtrusion extrudePath = null; - public Font3DState( SymbolTableData symbol, Controller control ) { - super( symbol, control ); + public Font3DState(SymbolTableData symbol, Controller control) { + super(symbol, control); } - public void writeConstructorParams( DataOutput out ) throws IOException { - super.writeConstructorParams( out ); - - out.writeUTF( font.getFontName() ); - out.writeInt( font.getStyle() ); - out.writeInt( font.getSize() ); - - out.writeDouble( tesselationTolerance ); - - if ( extrudePath!=null ) { - Shape shape = extrudePath.getExtrusionShape(); - if ( shape != null ) { - PathIterator shapePath = shape.getPathIterator( null ); - float[] coords = new float[ 6 ]; - int segType; - int points; - while ( !(shapePath.isDone()) ) { - // Get type of current path segment and associated coordinates - segType = shapePath.currentSegment( coords ); - out.writeInt( segType ); - - // Write out relevant coordinates - points = 0; - if ( segType==PathIterator.SEG_MOVETO) points = 1; - else if ( segType==PathIterator.SEG_LINETO ) points = 1; - else if (segType==PathIterator.SEG_QUADTO ) points = 2; - else if (segType==PathIterator.SEG_CUBICTO ) points = 3; - - for (int i=0;i