edu.umd.cs.piccolo.util
Class PUtil

java.lang.Object
  extended by edu.umd.cs.piccolo.util.PUtil

public class PUtil
extends java.lang.Object

PUtil util methods for the Piccolo framework.

Version:
1.0
Author:
Jesse Grosjean

Field Summary
static int ACTIVITY_SCHEDULER_FRAME_DELAY
           
static long DEFAULT_ACTIVITY_STEP_RATE
          PActivities are broken into steps, this is how many milliseconds should pass between steps.
static java.util.Enumeration NULL_ENUMERATION
           
static java.util.Iterator NULL_ITERATOR
           
static java.io.OutputStream NULL_OUTPUT_STREAM
          Deprecated. This has been moved into a private static class of PObjectOutputStream
 
Constructor Summary
PUtil()
           
 
Method Summary
static PCamera createBasicScenegraph()
          Creates the simplest possible scene graph.
static java.awt.geom.GeneralPath readPath(java.io.ObjectInputStream in)
          Reads a path from the provided inputStream in accordance with the serialization policy defined in writePath.
static java.awt.Stroke readStroke(java.io.ObjectInputStream in)
          Reconstitutes a stroke from the provided Object Input Stream.
static void writePath(java.awt.geom.GeneralPath path, java.io.ObjectOutputStream out)
          Serializes the given path to the provided Object Output Stream.
static void writeStroke(java.awt.Stroke stroke, java.io.ObjectOutputStream out)
          Serializes the given stroke object to the object output stream provided.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_ACTIVITY_STEP_RATE

public static long DEFAULT_ACTIVITY_STEP_RATE
PActivities are broken into steps, this is how many milliseconds should pass between steps.


ACTIVITY_SCHEDULER_FRAME_DELAY

public static int ACTIVITY_SCHEDULER_FRAME_DELAY

NULL_ITERATOR

public static java.util.Iterator NULL_ITERATOR

NULL_ENUMERATION

public static java.util.Enumeration NULL_ENUMERATION

NULL_OUTPUT_STREAM

public static java.io.OutputStream NULL_OUTPUT_STREAM
Deprecated. This has been moved into a private static class of PObjectOutputStream
Constructor Detail

PUtil

public PUtil()
Method Detail

createBasicScenegraph

public static PCamera createBasicScenegraph()
Creates the simplest possible scene graph. 1 Camera, 1 Layer, 1 Root

Returns:
a basic scene with 1 camera, layer and root

writeStroke

public static void writeStroke(java.awt.Stroke stroke,
                               java.io.ObjectOutputStream out)
                        throws java.io.IOException
Serializes the given stroke object to the object output stream provided. By default strokes are not serializable. This method solves that problem.

Parameters:
stroke - stroke to be serialized
out - stream to which the stroke is to be serialized.
Throws:
java.io.IOException

readStroke

public static java.awt.Stroke readStroke(java.io.ObjectInputStream in)
                                  throws java.io.IOException,
                                         java.lang.ClassNotFoundException
Reconstitutes a stroke from the provided Object Input Stream. According to the scheme found in writeStroke. By default strokes are not serializable.

Parameters:
in - stream from which Stroke is to be read
Returns:
a stroke object
Throws:
java.io.IOException
java.lang.ClassNotFoundException

readPath

public static java.awt.geom.GeneralPath readPath(java.io.ObjectInputStream in)
                                          throws java.io.IOException,
                                                 java.lang.ClassNotFoundException
Reads a path from the provided inputStream in accordance with the serialization policy defined in writePath.

Parameters:
in - stream from which to read the path.
Returns:
reconstituted path
Throws:
java.io.IOException
java.lang.ClassNotFoundException

writePath

public static void writePath(java.awt.geom.GeneralPath path,
                             java.io.ObjectOutputStream out)
                      throws java.io.IOException
Serializes the given path to the provided Object Output Stream.

Parameters:
path - path to be serialized
out - stream to which the path should be serialized
Throws:
java.io.IOException


Copyright © 1995-2009 Piccolo2D. All Rights Reserved.