Package com.teamten.typeset
Interface Dimensions
- All Known Implementing Classes:
AbstractDimensions
,Bookmark
,Box
,Columns
,DiscardableElement
,Discretionary
,Element
,Font.Metrics
,Footnote
,Glue
,HBox
,Image
,IndexBookmark
,Kern
,LabelBookmark
,Leader
,NonDiscardableElement
,Page
,Penalty
,Rule
,SectionBookmark
,Text
,VBox
public interface Dimensions
Interface for anything that has width, height, and depth.
-
Method Summary
Modifier and TypeMethodDescriptionlong
getDepth()
The distance between the baseline and the bottom of the object in scaled points.long
The distance between the baseline and the top of the object in scaled points.long
getWidth()
The width of the object in scaled points.static Dimensions
horizontally
(List<? extends Dimensions> items) Computes the sum of the item widths and the max of the height and depth.static Dimensions
vertically
(List<? extends Dimensions> elements, VerticalAlignment verticalAlignment) Compute the dimensions of a vertical stack of elements, aligning them according to the specified parameter.static Dimensions
verticallyFirstBoxAligned
(List<? extends Dimensions> elements) Computes the size of a vertical box where the baseline alignment is on the first box.static Dimensions
verticallyLastBoxAligned
(List<? extends Dimensions> elements) Computes the size of a vertical box where the baseline alignment is on the last box.
-
Method Details
-
getWidth
long getWidth()The width of the object in scaled points. -
getHeight
long getHeight()The distance between the baseline and the top of the object in scaled points. -
getDepth
long getDepth()The distance between the baseline and the bottom of the object in scaled points. -
horizontally
Computes the sum of the item widths and the max of the height and depth. -
vertically
static Dimensions vertically(List<? extends Dimensions> elements, VerticalAlignment verticalAlignment) Compute the dimensions of a vertical stack of elements, aligning them according to the specified parameter. -
verticallyFirstBoxAligned
Computes the size of a vertical box where the baseline alignment is on the first box. The width is the max of the widths. The height is everything above the first box and the height of the first box. The depth is the rest.- Parameters:
elements
- the elements top to bottom.
-
verticallyLastBoxAligned
Computes the size of a vertical box where the baseline alignment is on the last box. The width is the max of the widths. The height is the sum of all the heights and depths except for the last box's depth. The depth is the last box's depth and all glues after that.- Parameters:
elements
- the elements top to bottom.
-