edu.umd.cs.piccolo.util
Class PUtil

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

public class PUtil
extends 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 Enumeration NULL_ENUMERATION
           
static Iterator NULL_ITERATOR
           
static 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 GeneralPath readPath(ObjectInputStream in)
          Reads a path from the provided inputStream in accordance with the serialization policy defined in writePath.
static Stroke readStroke(ObjectInputStream in)
          Reconstitutes a stroke from the provided Object Input Stream.
static void writePath(GeneralPath path, ObjectOutputStream out)
          Serializes the given path to the provided Object Output Stream.
static void writeStroke(Stroke stroke, 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 Iterator NULL_ITERATOR

NULL_ENUMERATION

public static Enumeration NULL_ENUMERATION

NULL_OUTPUT_STREAM

public static 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(Stroke stroke,
                               ObjectOutputStream out)
                        throws 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:
IOException

readStroke

public static Stroke readStroke(ObjectInputStream in)
                         throws IOException,
                                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:
IOException
ClassNotFoundException

readPath

public static GeneralPath readPath(ObjectInputStream in)
                            throws IOException,
                                   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:
IOException
ClassNotFoundException

writePath

public static void writePath(GeneralPath path,
                             ObjectOutputStream out)
                      throws 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:
IOException


Copyright © 1995-2011 Piccolo2D. All Rights Reserved.