Package net.sourceforge.jeuclid.layout
Class LayoutInfoImpl
java.lang.Object
net.sourceforge.jeuclid.layout.LayoutInfoImpl
- All Implemented Interfaces:
LayoutInfo
- Version:
- $Revision: 88b901bf20fb $
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloatgetAscentHeight(LayoutStage stage) Returns the current height of the upper part of this component from the baseline.floatgetDescentHeight(LayoutStage stage) Returns the current height of the lower part of this component from the baseline.floatRetrieve the X-position of the horizontal center of the content.TheLayoutStagethis element represents.floatgetPosX(LayoutStage stage) Retrieve the X position of this element relative to its parent.floatgetPosY(LayoutStage stage) Retrieve the Y position of this element relative to its parent.floatRetrieve the stretch ascent if set, or STAGE1.ascent if unset.floatRetrieve the stretch descent if set, or STAGE1.descent if unset.floatRetrieve the stretch width if set, or STAGE1.width if unset.floatgetWidth(LayoutStage stage) Returns the current width of this element.voidmoveTo(float x, float y, LayoutStage stage) Move this element to the given position relative to its parent.voidsetAscentHeight(float ascentHeight, LayoutStage stage) voidsetDescentHeight(float descentHeight, LayoutStage stage) voidsetGraphicsObject(GraphicsObject graphicsObject) voidsetHorizontalCenterOffset(float newOffset, LayoutStage stage) voidsetLayoutStage(LayoutStage newStage) voidsetStretchAscent(float newStretchAscent) Set the stretch ascent for children.voidsetStretchDescent(float newStretchDescent) Set the stretch descent for children.voidsetStretchWidth(float newStretchWidth) Set the stretch width for children, or invalid input: '<' 0 if children should be horizontally unstretched.voidsetWidth(float width, LayoutStage stage) voidshiftVertically(float offsetY, LayoutStage stage) Shift vertically by given offset.
-
Constructor Details
-
LayoutInfoImpl
public LayoutInfoImpl()Default Constructor.
-
-
Method Details
-
getLayoutStage
TheLayoutStagethis element represents. The information will not be complete until the final LayoutStage (LayoutStage.STAGE2) has been reached.- Specified by:
getLayoutStagein interfaceLayoutInfo- Returns:
- current layout stage.
-
setLayoutStage
- Specified by:
setLayoutStagein interfaceLayoutInfo- Parameters:
newStage- new Layout Stage.
-
getAscentHeight
Returns the current height of the upper part of this component from the baseline.- Specified by:
getAscentHeightin interfaceLayoutInfo- Parameters:
stage-LayoutStageto get this information for (eitherLayoutStage.STAGE1orLayoutStage.STAGE2)- Returns:
- Height of the upper part
-
getDescentHeight
Returns the current height of the lower part of this component from the baseline.- Specified by:
getDescentHeightin interfaceLayoutInfo- Parameters:
stage-LayoutStageto get this information for (eitherLayoutStage.STAGE1orLayoutStage.STAGE2)- Returns:
- Height of the lower part.
-
getHorizontalCenterOffset
Retrieve the X-position of the horizontal center of the content. In most cases, this will be width / 2. This does not, however, take extra borders into account. An element may have different border width on left and right, in which case the center will be moved.- Specified by:
getHorizontalCenterOffsetin interfaceLayoutInfo- Parameters:
stage-LayoutStageto get this information for (eitherLayoutStage.STAGE1orLayoutStage.STAGE2)- Returns:
- X-position of the center of the content
-
getPosX
Retrieve the X position of this element relative to its parent.- Specified by:
getPosXin interfaceLayoutInfo- Parameters:
stage-LayoutStageto get this information for (eitherLayoutStage.STAGE1orLayoutStage.STAGE2)- Returns:
- X position
-
getPosY
Retrieve the Y position of this element relative to its parent.- Specified by:
getPosYin interfaceLayoutInfo- Parameters:
stage-LayoutStageto get this information for (eitherLayoutStage.STAGE1orLayoutStage.STAGE2)- Returns:
- Y position
-
getWidth
Returns the current width of this element.- Specified by:
getWidthin interfaceLayoutInfo- Parameters:
stage-LayoutStageto get this information for (eitherLayoutStage.STAGE1orLayoutStage.STAGE2)- Returns:
- Width of this element.
-
moveTo
Move this element to the given position relative to its parent.- Specified by:
moveToin interfaceLayoutInfo- Parameters:
x- new X positiony- new Y positionstage-LayoutStageto get this information for (eitherLayoutStage.STAGE1orLayoutStage.STAGE2)
-
setAscentHeight
- Specified by:
setAscentHeightin interfaceLayoutInfo- Parameters:
ascentHeight- new ascentHeight.stage-LayoutStageto get this information for (eitherLayoutStage.STAGE1orLayoutStage.STAGE2)
-
setDescentHeight
- Specified by:
setDescentHeightin interfaceLayoutInfo- Parameters:
descentHeight- new descentHeight.stage-LayoutStageto get this information for (eitherLayoutStage.STAGE1orLayoutStage.STAGE2)
-
setHorizontalCenterOffset
- Specified by:
setHorizontalCenterOffsetin interfaceLayoutInfo- Parameters:
newOffset- new horizontal offset.stage-LayoutStageto get this information for (eitherLayoutStage.STAGE1orLayoutStage.STAGE2)
-
setWidth
- Specified by:
setWidthin interfaceLayoutInfo- Parameters:
width- new width.stage-LayoutStageto get this information for (eitherLayoutStage.STAGE1orLayoutStage.STAGE2)
-
setGraphicsObject
- Specified by:
setGraphicsObjectin interfaceLayoutInfo- Parameters:
graphicsObject- the GraphicsObject to set.
-
getGraphicObjects
- Specified by:
getGraphicObjectsin interfaceLayoutInfo- Returns:
- Graphic objects associated with this node.
-
getStretchWidth
public float getStretchWidth()Retrieve the stretch width if set, or STAGE1.width if unset.- Specified by:
getStretchWidthin interfaceLayoutInfo- Returns:
- stretch width.
-
setStretchWidth
public void setStretchWidth(float newStretchWidth) Set the stretch width for children, or invalid input: '<' 0 if children should be horizontally unstretched.- Specified by:
setStretchWidthin interfaceLayoutInfo- Parameters:
newStretchWidth- new stretch width
-
getStretchAscent
public float getStretchAscent()Retrieve the stretch ascent if set, or STAGE1.ascent if unset.- Specified by:
getStretchAscentin interfaceLayoutInfo- Returns:
- stretch ascent.
-
getStretchDescent
public float getStretchDescent()Retrieve the stretch descent if set, or STAGE1.descent if unset.- Specified by:
getStretchDescentin interfaceLayoutInfo- Returns:
- stretch descent.
-
setStretchAscent
public void setStretchAscent(float newStretchAscent) Set the stretch ascent for children. Defaults to STAGE1.ascent- Specified by:
setStretchAscentin interfaceLayoutInfo- Parameters:
newStretchAscent- new stretch ascent
-
setStretchDescent
public void setStretchDescent(float newStretchDescent) Set the stretch descent for children. Defaults to STAGE1.descent- Specified by:
setStretchDescentin interfaceLayoutInfo- Parameters:
newStretchDescent- new stretch descent
-
shiftVertically
Shift vertically by given offset.- Specified by:
shiftVerticallyin interfaceLayoutInfo- Parameters:
offsetY- offset to shift.stage- Stage to manipulate.
-