All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class edu.wpi.mqp.graphics.jviz.Brush

java.lang.Object
   |
   +----edu.wpi.mqp.graphics.jviz.Brush

public class Brush
extends Object
implements Cloneable, Serializable
The Brush class is the high-level container class for multiple brushes. JViz currently does not support multiple brushes, but adding a new brush would be fairly trivial once a way to implement changing brush priority was developed. That is bulk of what is missing from this class. It is hoped that this class can provide a transparent interface to the Vector of UserBrush objects. POSSIBLE IMPROVEMENTS: A function that would create a new user brush and add it could be helpful. there is little need to creat a userBrush object externally instead of internally. createNewUserBrush("Brush Name") where "Brush Name" would be a string to be associated with the user brush (not currently supported). This type of call would require that a reference to the data object we stored in this method or have it passed in. Both ways have their advantages.

Version:
1.0, created 15 NOV 1997
Author:
Matthew C. Jucius

Variable Index

 o numBrushes
 o userBrushes

Constructor Index

 o Brush(Data)
NOTE: The newData parameter may not need to be passed one this class NOTE: is completed.

Method Index

 o addUserBrush(UserBrush)
This method add a user brush to the userBrushes Vector.
 o clone()
This allows this class to be cloned
 o getBrushForPoint(int)
WARNING: Currently this method always returns the index 0 This method will return the index of the highest priority brush that a specified point is contained in.
 o getNumBrushes()
This method returns the number of brushes that have been placed into this class.
 o getPointsInBrush(int)
WARNING: Currently this method will always return an int array of length 0 WARNING: To get the desired array, you must currently call getUserBrush() WARNING: and then call the getPointsInBrush() method in that object.
 o getUserBrush(int)
This method will return the specified UserBrush object.

Variables

 o numBrushes
 protected int numBrushes
 o userBrushes
 protected Vector userBrushes

Constructors

 o Brush
 public Brush(Data newData)
NOTE: The newData parameter may not need to be passed one this class NOTE: is completed. It is currently only used to for a single UserBrush Constructor

Parameters:
newData - data object to make first UserBrush with

Methods

 o getNumBrushes
 public int getNumBrushes()
This method returns the number of brushes that have been placed into this class. Currently it only supports one brush.

Returns:
numBrushes as an int
 o getBrushForPoint
 public int getBrushForPoint(int pointIndex)
WARNING: Currently this method always returns the index 0 This method will return the index of the highest priority brush that a specified point is contained in. The point is specified by the index of the point in the data object.

Parameters:
pointIndex - index of the point in the data object
Returns:
index of the highest priority brush the point is contained in.
 o getPointsInBrush
 public int[] getPointsInBrush(int brushIndex)
WARNING: Currently this method will always return an int array of length 0 WARNING: To get the desired array, you must currently call getUserBrush() WARNING: and then call the getPointsInBrush() method in that object. This method will return an array int integer indices to points in the data object that are contained within the specified brush. It does so by getting the specified brush using getUserBrush() and then calling the getPointsInBrush() method in the UserBrush and returning that value. This method is meant as a convenience method.

Parameters:
brushIndex - is the index of the brush to get the points for.
Returns:
a full int array of indices to points in the data object
 o addUserBrush
 public int addUserBrush(UserBrush newUserBrush)
This method add a user brush to the userBrushes Vector. It returns the index that the class was added at.

Parameters:
newUserBrush - the new UserBrush object to add to the Vector
Returns:
index in the vector where the UserBrush was added
 o getUserBrush
 public UserBrush getUserBrush(int index)
This method will return the specified UserBrush object.

Parameters:
index - number of the UserBrush object to retrieve
Returns:
UserBrush object specified or null if not present.
 o clone
 public Object clone()
This allows this class to be cloned

Returns:
clone of this object; null if error occurred
Overrides:
clone in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index