public abstract class VLayoutSlot extends Object
Constructor and Description |
---|
VLayoutSlot(String baseClassName,
com.google.gwt.user.client.ui.Widget widget)
Constructs a slot instance for a ManagedLayout cell.
|
Modifier and Type | Method and Description |
---|---|
AlignmentInfo |
getAlignment()
Returns the alignment data for this slot.
|
VCaption |
getCaption()
Returns the caption element for this slot.
|
protected abstract int |
getCaptionHeight()
Returns the height of the caption, or zero if there is no caption.
|
protected abstract int |
getCaptionWidth()
Returns the width of the caption, or zero if there is no caption.
|
double |
getExpandRatio()
Deprecated.
this value isn't used for anything by default
|
int |
getUsedHeight()
Returns how much vertical space the widget and its caption use.
|
int |
getUsedSizeInDirection(boolean isVertical)
Returns how much vertical or horizontal space the widget and its caption
use depending on the indicated direction.
|
int |
getUsedWidth()
Returns how much horizontal space the widget and its caption use.
|
com.google.gwt.user.client.ui.Widget |
getWidget()
Returns the widget that this slot contains.
|
abstract int |
getWidgetHeight()
Returns the height of the widget, or zero if there is no caption.
|
int |
getWidgetSizeInDirection(boolean isVertical)
Returns the widget's height if the indicated direction is vertical, and
width if horizontal.
|
abstract int |
getWidgetWidth()
Returns the width of the widget, or zero if there is no caption.
|
com.google.gwt.user.client.Element |
getWrapperElement()
Returns the wrapper element for the contents of this slot.
|
abstract boolean |
isRelativeHeight()
Returns whether the height of the widget has been set as relative.
|
boolean |
isRelativeInDirection(boolean isVertical)
Returns whether the height or the width of the widget has been set as
relative depending on the indicated direction.
|
abstract boolean |
isRelativeWidth()
Returns whether the width of the widget has been set as relative.
|
abstract boolean |
isUndefinedHeight()
Returns whether the height of the widget has been set as undefined.
|
boolean |
isUndefinedInDirection(boolean isVertical)
Returns whether the height or the width of the widget has been set as
undefined depending on the indicated direction.
|
abstract boolean |
isUndefinedWidth()
Returns whether the width of the widget has been set as undefined.
|
void |
positionHorizontally(double currentLocation,
double allocatedSpace,
double marginRight)
Position the slot horizontally and set the width and the right margin.
|
void |
positionInDirection(double currentLocation,
double allocatedSpace,
double endingMargin,
boolean isVertical)
Position the slot vertically and set the height and the bottom margin, or
horizontally and set the width and the right margin, depending on the
indicated direction.
|
void |
positionVertically(double currentLocation,
double allocatedSpace,
double marginBottom)
Position the slot vertically and set the height and the bottom margin.
|
protected void |
reportActualRelativeHeight(int allocatedHeight)
Override this method to report the expected outer height to the
LayoutManager.
|
protected void |
reportActualRelativeWidth(int allocatedWidth)
Override this method to report the expected outer width to the
LayoutManager.
|
void |
setAlignment(AlignmentInfo alignment)
Sets the alignment data for this slot.
|
void |
setCaption(VCaption caption)
Sets the caption element for this slot.
|
void |
setExpandRatio(double expandRatio)
Deprecated.
this value isn't used for anything by default
|
public VLayoutSlot(String baseClassName, com.google.gwt.user.client.ui.Widget widget)
baseClassName
- the base class name of the layoutwidget
- the widget that should be set to this slot, should not be
null
public VCaption getCaption()
null
public void setCaption(VCaption caption)
caption
- the caption element, can be null
public AlignmentInfo getAlignment()
null
public com.google.gwt.user.client.ui.Widget getWidget()
null
public void setAlignment(AlignmentInfo alignment)
alignment
- the alignment data, can be null
public void positionHorizontally(double currentLocation, double allocatedSpace, double marginRight)
currentLocation
- the left position for this slotallocatedSpace
- how much horizontal space is available for this slotmarginRight
- the right margin this slot should have (removed if negative)public void positionVertically(double currentLocation, double allocatedSpace, double marginBottom)
currentLocation
- the top position for this slotallocatedSpace
- how much vertical space is available for this slotmarginBottom
- the bottom margin this slot should have (removed if negative)protected void reportActualRelativeHeight(int allocatedHeight)
allocatedHeight
- the height to set (including margins, borders and paddings) in
pixelsprotected void reportActualRelativeWidth(int allocatedWidth)
allocatedWidth
- the width to set (including margins, borders and paddings) in
pixelspublic void positionInDirection(double currentLocation, double allocatedSpace, double endingMargin, boolean isVertical)
currentLocation
- the top position or the left position for this slot depending
on the indicated directionallocatedSpace
- how much space is available for this slot in the indicated
directionendingMargin
- the bottom margin or the right margin this slot should have
depending on the indicated direction (removed if negative)isVertical
- true
if the positioning should be done vertically,
false
if horizontallypublic int getWidgetSizeInDirection(boolean isVertical)
isVertical
- true
if the requested dimension is height,
false
if widthpublic int getUsedWidth()
public int getUsedHeight()
public int getUsedSizeInDirection(boolean isVertical)
isVertical
- true
if the requested dimension is height,
false
if widthprotected abstract int getCaptionHeight()
protected abstract int getCaptionWidth()
public abstract int getWidgetHeight()
public abstract int getWidgetWidth()
public abstract boolean isUndefinedHeight()
true
if the widget height is undefined, false
otherwisepublic abstract boolean isUndefinedWidth()
true
if the widget width is undefined, false
otherwisepublic boolean isUndefinedInDirection(boolean isVertical)
isVertical
- true
if the requested dimension check is about height,
false
if about widthtrue
if the widget height or the widget width is
undefined depending on the indicated direction, false
otherwisepublic abstract boolean isRelativeHeight()
true
if the widget height is relative, false
otherwisepublic abstract boolean isRelativeWidth()
true
if the widget width is relative, false
otherwisepublic boolean isRelativeInDirection(boolean isVertical)
isVertical
- true
if the requested dimension check is about height,
false
if about widthtrue
if the widget height or the widget width is relative
depending on the indicated direction, false
otherwisepublic com.google.gwt.user.client.Element getWrapperElement()
@Deprecated public void setExpandRatio(double expandRatio)
expandRatio
- The ratio of the space the slot should occupy@Deprecated public double getExpandRatio()
setExpandRatio(double)
Copyright © 2022 Vaadin Ltd. All rights reserved.