blob: 1981b93600a172ab5de7a15e1320fcf4fdb51e83 [file] [log] [blame]
package org.eclipse.nebula.widgets.nattable.core.layer.axis
import java.io.Serializable
/**
* Represents a linear dimension (e.g. horizontal, vertical) that is composed of segments (e.g. columns, rows).
*/
interface Axis {
/**
* @return The number of segments on this axis.
*/
def int getSegmentCount()
/**
* Gets the start pixel location of the segment at the given position. This function must be defined for all valid segment position
* values and <em>also</em> for segment position = segment count. Technically the segment count is not a valid segment position because
* segment positions are 0-indexed and range from 0 to segment count - 1. However, the 'start' pixel location of the segment position after
* the last segment is used to calculate the pixel size of the last segment, and also the overall pixel size of the axis.
*
* @param segmentPosition
* @return The start pixel location of the given segment position.
*/
def int getStartPixelOfSegmentPosition(int segmentPosition)
/**
* @param pixelLocation
* @return The position of the segment that contains the given pixel location.
*/
def int getSegmentPositionOfPixelLocation(int pixelLocation)
/**
* @param segmentPosition
* @return The identifier associated with the given segment position.
*/
def Serializable getIdOfSegmentPosition(int segmentPosition)
/**
* @param segmentId
* @return The position of the segment associated with the given segment identifier.
*/
def int getSegmentPositionOfId(Serializable segmentId)
}