edu.neu.ccs.gui
Interface Path.Strategy

Enclosing interface:
Path

public static interface Path.Strategy

The Strategy interface requires one method that returns a GeneralPath given its input parameters.


Method Summary
 GeneralPath makePath(float[][] vertex, float[][] tangent, ClosureMode closuremode, WindingRule windingrule)
          The method makePath must return a non-null GeneralPath given a vertex array, a tangent array, a choice of ClosureMode, and a choice of WindingRule.
 

Method Detail

makePath

public GeneralPath makePath(float[][] vertex,
                            float[][] tangent,
                            ClosureMode closuremode,
                            WindingRule windingrule)

The method makePath must return a non-null GeneralPath given a vertex array, a tangent array, a choice of ClosureMode, and a choice of WindingRule.

The GeneralPath returned may be empty, that is, it may have no segments.

The vertex array parameter must have the form float[N][2] or else an empty GeneralPath must be returned.

If the method uses the tangent array then the tangent array must have the form float[N][2] for the same N as the vertex array or be null. The specification for the strategy must state what will happen in the null case. In the case of a null tangent array, it is acceptable to simply return an empty path but the designer may specify other behavior if there is a better default action.

If the method does not use the tangent array, this fact must be documented. In this case, it must be acceptable to pass any tangent parameter including null with no change in the path returned.

If the closure mode is null, the default ClosureMode.CLOSED should be used.

If the winding rule is null, the default WindingRule.WIND_NON_ZERO should be used.

This method should not throw an exception. It should always return an empty path as a last resort.

Parameters:
vertex - the array of vertex data
tangent - the array of corresponding tangent data
closuremode - the closure mode
windingrule - the winding rule