com.sas.visuals.adapters
Interface SpacePartitionerInterface

All Known Implementing Classes:
EqualSpacePartitioner, MinMaxSpacePartitioner, ProportionalSpacePartitioner

public interface SpacePartitionerInterface

SpacePartitionerInterface is designed to allow a given amount of space to be partitioned between a number of elements. An example of an element would be a column in an AutoSizingGridLayout.

See Also:
AutoSizingGridLayout, EqualSpacePartitioner, ProportionalSpacePartitioner, MinMaxSpacePartitioner

Method Summary
 int getPartitionedSpace(int[] sizes, int totalSize, int[] preferredSizes)
          Partition the space represented by totalSize into parts and store the resulting size in the sizes array.
 

Method Detail

getPartitionedSpace

int getPartitionedSpace(int[] sizes,
                        int totalSize,
                        int[] preferredSizes)
Partition the space represented by totalSize into parts and store the resulting size in the sizes array. preferredSizes may also be passed in to specify a preferred size for each of the parts.

Note that the length of the sizes array and the preferredSizes array should be equal if the preferredSizes array is specified.

Parameters:
sizes - The array to return the sizes of the parts in.
totalSize - The amount of space to split up between the parts.
preferredSizes - The preferred size of the parts. This may be null to indicate that no preferred size is available.
Returns:
The amount of totalSize left over after the space has been allocated. Note that for some implementations, this value may be negative.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.