Package com.vaadin.client.ui.layout
Class VLayoutSlot
- java.lang.Object
-
- com.vaadin.client.ui.layout.VLayoutSlot
-
- Direct Known Subclasses:
ComponentConnectorLayoutSlot
public abstract class VLayoutSlot extends Object
An abstract slot class for ManagedLayout cells.- Author:
- Vaadin Ltd
-
-
Constructor Summary
Constructors Constructor Description VLayoutSlot(String baseClassName, com.google.gwt.user.client.ui.Widget widget)Constructs a slot instance for a ManagedLayout cell.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description AlignmentInfogetAlignment()Returns the alignment data for this slot.VCaptiongetCaption()Returns the caption element for this slot.protected abstract intgetCaptionHeight()Returns the height of the caption, or zero if there is no caption.protected abstract intgetCaptionWidth()Returns the width of the caption, or zero if there is no caption.doublegetExpandRatio()Deprecated.this value isn't used for anything by defaultintgetUsedHeight()Returns how much vertical space the widget and its caption use.intgetUsedSizeInDirection(boolean isVertical)Returns how much vertical or horizontal space the widget and its caption use depending on the indicated direction.intgetUsedWidth()Returns how much horizontal space the widget and its caption use.com.google.gwt.user.client.ui.WidgetgetWidget()Returns the widget that this slot contains.abstract intgetWidgetHeight()Returns the height of the widget, or zero if there is no caption.intgetWidgetSizeInDirection(boolean isVertical)Returns the widget's height if the indicated direction is vertical, and width if horizontal.abstract intgetWidgetWidth()Returns the width of the widget, or zero if there is no caption.com.google.gwt.user.client.ElementgetWrapperElement()Returns the wrapper element for the contents of this slot.abstract booleanisRelativeHeight()Returns whether the height of the widget has been set as relative.booleanisRelativeInDirection(boolean isVertical)Returns whether the height or the width of the widget has been set as relative depending on the indicated direction.abstract booleanisRelativeWidth()Returns whether the width of the widget has been set as relative.abstract booleanisUndefinedHeight()Returns whether the height of the widget has been set as undefined.booleanisUndefinedInDirection(boolean isVertical)Returns whether the height or the width of the widget has been set as undefined depending on the indicated direction.abstract booleanisUndefinedWidth()Returns whether the width of the widget has been set as undefined.voidpositionHorizontally(double currentLocation, double allocatedSpace, double marginRight)Position the slot horizontally and set the width and the right margin.voidpositionInDirection(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.voidpositionVertically(double currentLocation, double allocatedSpace, double marginBottom)Position the slot vertically and set the height and the bottom margin.protected voidreportActualRelativeHeight(int allocatedHeight)Override this method to report the expected outer height to the LayoutManager.protected voidreportActualRelativeWidth(int allocatedWidth)Override this method to report the expected outer width to the LayoutManager.voidsetAlignment(AlignmentInfo alignment)Sets the alignment data for this slot.voidsetCaption(VCaption caption)Sets the caption element for this slot.voidsetExpandRatio(double expandRatio)Deprecated.this value isn't used for anything by default
-
-
-
Constructor Detail
-
VLayoutSlot
public VLayoutSlot(String baseClassName, com.google.gwt.user.client.ui.Widget widget)
Constructs a slot instance for a ManagedLayout cell.- Parameters:
baseClassName- the base class name of the layoutwidget- the widget that should be set to this slot, should not benull
-
-
Method Detail
-
getCaption
public VCaption getCaption()
Returns the caption element for this slot.- Returns:
- the caption element, can be
null
-
setCaption
public void setCaption(VCaption caption)
Sets the caption element for this slot.- Parameters:
caption- the caption element, can benull
-
getAlignment
public AlignmentInfo getAlignment()
Returns the alignment data for this slot.- Returns:
- the alignment data, can be
null
-
getWidget
public com.google.gwt.user.client.ui.Widget getWidget()
Returns the widget that this slot contains.- Returns:
- the child widget, cannot be
null
-
setAlignment
public void setAlignment(AlignmentInfo alignment)
Sets the alignment data for this slot.- Parameters:
alignment- the alignment data, can benull
-
positionHorizontally
public void positionHorizontally(double currentLocation, double allocatedSpace, double marginRight)Position the slot horizontally and set the width and the right margin.- Parameters:
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)
-
positionVertically
public void positionVertically(double currentLocation, double allocatedSpace, double marginBottom)Position the slot vertically and set the height and the bottom margin.- Parameters:
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)
-
reportActualRelativeHeight
protected void reportActualRelativeHeight(int allocatedHeight)
Override this method to report the expected outer height to the LayoutManager. By default does nothing.- Parameters:
allocatedHeight- the height to set (including margins, borders and paddings) in pixels
-
reportActualRelativeWidth
protected void reportActualRelativeWidth(int allocatedWidth)
Override this method to report the expected outer width to the LayoutManager. By default does nothing.- Parameters:
allocatedWidth- the width to set (including margins, borders and paddings) in pixels
-
positionInDirection
public 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.- Parameters:
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-trueif the positioning should be done vertically,falseif horizontally
-
getWidgetSizeInDirection
public int getWidgetSizeInDirection(boolean isVertical)
Returns the widget's height if the indicated direction is vertical, and width if horizontal.- Parameters:
isVertical-trueif the requested dimension is height,falseif width- Returns:
- the widget height or width depending on the indicated direction
-
getUsedWidth
public int getUsedWidth()
Returns how much horizontal space the widget and its caption use.- Returns:
- the width of the contents in pixels
-
getUsedHeight
public int getUsedHeight()
Returns how much vertical space the widget and its caption use.- Returns:
- the height of the contents in pixels
-
getUsedSizeInDirection
public int getUsedSizeInDirection(boolean isVertical)
Returns how much vertical or horizontal space the widget and its caption use depending on the indicated direction.- Parameters:
isVertical-trueif the requested dimension is height,falseif width- Returns:
- the height or the width of the contents in pixels
-
getCaptionHeight
protected abstract int getCaptionHeight()
Returns the height of the caption, or zero if there is no caption.- Returns:
- the height of the caption, or zero if not found
-
getCaptionWidth
protected abstract int getCaptionWidth()
Returns the width of the caption, or zero if there is no caption.- Returns:
- the width of the caption, or zero if not found
-
getWidgetHeight
public abstract int getWidgetHeight()
Returns the height of the widget, or zero if there is no caption.- Returns:
- the height of the widget, or zero if not found
-
getWidgetWidth
public abstract int getWidgetWidth()
Returns the width of the widget, or zero if there is no caption.- Returns:
- the width of the widget, or zero if not found
-
isUndefinedHeight
public abstract boolean isUndefinedHeight()
Returns whether the height of the widget has been set as undefined.- Returns:
trueif the widget height is undefined,falseotherwise
-
isUndefinedWidth
public abstract boolean isUndefinedWidth()
Returns whether the width of the widget has been set as undefined.- Returns:
trueif the widget width is undefined,falseotherwise
-
isUndefinedInDirection
public boolean isUndefinedInDirection(boolean isVertical)
Returns whether the height or the width of the widget has been set as undefined depending on the indicated direction.- Parameters:
isVertical-trueif the requested dimension check is about height,falseif about width- Returns:
trueif the widget height or the widget width is undefined depending on the indicated direction,falseotherwise
-
isRelativeHeight
public abstract boolean isRelativeHeight()
Returns whether the height of the widget has been set as relative.- Returns:
trueif the widget height is relative,falseotherwise
-
isRelativeWidth
public abstract boolean isRelativeWidth()
Returns whether the width of the widget has been set as relative.- Returns:
trueif the widget width is relative,falseotherwise
-
isRelativeInDirection
public boolean isRelativeInDirection(boolean isVertical)
Returns whether the height or the width of the widget has been set as relative depending on the indicated direction.- Parameters:
isVertical-trueif the requested dimension check is about height,falseif about width- Returns:
trueif the widget height or the widget width is relative depending on the indicated direction,falseotherwise
-
getWrapperElement
public com.google.gwt.user.client.Element getWrapperElement()
Returns the wrapper element for the contents of this slot.- Returns:
- the wrapper element
-
setExpandRatio
@Deprecated public void setExpandRatio(double expandRatio)
Deprecated.this value isn't used for anything by defaultSet how the slot should be expanded relative to the other slots.- Parameters:
expandRatio- The ratio of the space the slot should occupy
-
getExpandRatio
@Deprecated public double getExpandRatio()
Deprecated.this value isn't used for anything by defaultGet the expand ratio for the slot. The expand ratio describes how the slot should be resized compared to other slots in the layout.- Returns:
- the expand ratio of the slot
- See Also:
setExpandRatio(double)
-
-