com.vaadin.terminal.
Interface Sizeable
All Superinterfaces:
All Known Subinterfaces:
Component, Component.Focusable, ComponentContainer, DragSource, DropTarget, Field, Layout
All Known Implementing Classes:
AbsoluteLayout, AbstractComponent, AbstractComponentContainer, AbstractField, AbstractLayout, AbstractMedia, AbstractOrderedLayout, AbstractSelect, AbstractSplitPanel, AbstractTextField, Accordion, Audio, Button, CheckBox, ComboBox, CssLayout, CustomComponent, CustomLayout, DateField, DragAndDropWrapper, Embedded, ExpandLayout, Form, FormLayout, GridLayout, HorizontalLayout, HorizontalSplitPanel, InlineDateField, Label, Link, ListSelect, LoginForm, MenuBar, NativeButton, NativeSelect, OptionGroup, OrderedLayout, Panel, PasswordField, PopupDateField, PopupView, ProgressIndicator, RichTextArea, Select, Slider, SplitPanel, Table, TabSheet, TextArea, TextField, Tree, TreeTable, TwinColSelect, Upload, UriFragmentUtility, VerticalLayout, VerticalSplitPanel, Video, Window
- extends Serializable
public interface Sizeable
Interface to be implemented by components wishing to display some object that may be dynamically resized during runtime.
Since:
3.0
Version:
6.8.18
Author:
Vaadin Ltd.
Field Summary | |
---|---|
static float |
SIZE_UNDEFINED
|
static String[] |
UNIT_SYMBOLS
Textual representations of units symbols. |
static int |
UNITS_CM
Unit code representing centimeters. |
static int |
UNITS_EM
Unit code representing the font-size of the relevant font. |
static int |
UNITS_EX
Unit code representing the x-height of the relevant font. |
static int |
UNITS_INCH
Unit code representing inches. |
static int |
UNITS_MM
Unit code representing millimeters. |
static int |
UNITS_PERCENTAGE
Unit code representing in percentage of the containing element defined by terminal. |
static int |
UNITS_PICAS
Unit code representing picas (12 points). |
static int |
UNITS_PIXELS
Unit code representing pixels. |
static int |
UNITS_POINTS
Unit code representing points (1/72nd of an inch). |
Method Summary | |
---|---|
float |
getHeight()
Gets the height of the object. |
int |
getHeightUnits()
Gets the height property units. |
float |
getWidth()
Gets the width of the object. |
int |
getWidthUnits()
Gets the width property units. |
void |
setHeight(float height)
Deprecated. Consider using setHeight(String) or
setHeight(float, int) instead. This method works,
but is error-prone since the unit must be set separately (and
components might have different default unit). |
void |
setHeight(float height,
int unit)
Sets the height of the object. |
void |
setHeight(String height)
Sets the height of the component using String presentation. |
void |
setHeightUnits(int units)
Deprecated. Consider setting height and unit simultaneously using setHeight(String) or setHeight(float, int) ,
which is less error-prone. |
void |
setSizeFull()
Sets the size to 100% x 100%. |
void |
setSizeUndefined()
Clears any size settings. |
void |
setWidth(float width)
Deprecated. Consider using setWidth(String) instead. This method
works, but is error-prone since the unit must be set
separately (and components might have different default
unit). |
void |
setWidth(float width,
int unit)
Sets the width of the object. |
void |
setWidth(String width)
Sets the width of the component using String presentation. |
void |
setWidthUnits(int units)
Deprecated. Consider setting width and unit simultaneously using setWidth(String) or setWidth(float, int) ,
which is less error-prone. |
Field Detail |
---|
UNITS_PIXELS
static final int UNITS_PIXELS
- See Also:
- Constant Field Values
Unit code representing pixels.
UNITS_POINTS
static final int UNITS_POINTS
- See Also:
- Constant Field Values
Unit code representing points (1/72nd of an inch).
UNITS_PICAS
static final int UNITS_PICAS
- See Also:
- Constant Field Values
Unit code representing picas (12 points).
UNITS_EM
static final int UNITS_EM
- See Also:
- Constant Field Values
Unit code representing the font-size of the relevant font.
UNITS_EX
static final int UNITS_EX
- See Also:
- Constant Field Values
Unit code representing the x-height of the relevant font.
UNITS_MM
static final int UNITS_MM
- See Also:
- Constant Field Values
Unit code representing millimeters.
UNITS_CM
static final int UNITS_CM
- See Also:
- Constant Field Values
Unit code representing centimeters.
UNITS_INCH
static final int UNITS_INCH
- See Also:
- Constant Field Values
Unit code representing inches.
UNITS_PERCENTAGE
static final int UNITS_PERCENTAGE
- See Also:
- Constant Field Values
Unit code representing in percentage of the containing element defined by terminal.
SIZE_UNDEFINED
static final float SIZE_UNDEFINED
See Also:
UNIT_SYMBOLS
static final String[] UNIT_SYMBOLS
UNITS_PIXELS
: "px"UNITS_POINTS
: "pt"UNITS_PICAS
: "pc"UNITS_EM
: "em"UNITS_EX
: "ex"UNITS_MM
: "mm"UNITS_CM
. "cm"UNITS_INCH
: "in"UNITS_PERCENTAGE
: "%"
Textual representations of units symbols. Supported units and their symbols are:
Sizeable.UNIT_SYMBOLS[UNITS_PIXELS]
.
Method Detail |
---|
getWidth
float getWidth()
- Returns:
- width of the object in units specified by widthUnits property.
Gets the width of the object. Negative number implies unspecified size (terminal is free to set the size).
setWidth
@Deprecated
void setWidth(float width)
- Parameters:
width
- the width of the object in units specified by widthUnits property.
Deprecated. Consider using setWidth(String)
instead. This method
works, but is error-prone since the unit must be set
separately (and components might have different default
unit).
Sets the width of the object. Negative number implies unspecified size (terminal is free to set the size).
getHeight
float getHeight()
- Returns:
- height of the object in units specified by heightUnits property.
Gets the height of the object. Negative number implies unspecified size (terminal is free to set the size).
setHeight
@Deprecated
void setHeight(float height)
- Parameters:
height
- the height of the object in units specified by heightUnits property.
Deprecated. Consider using setHeight(String)
or
setHeight(float, int)
instead. This method works,
but is error-prone since the unit must be set separately (and
components might have different default unit).
Sets the height of the object. Negative number implies unspecified size (terminal is free to set the size).
getWidthUnits
int getWidthUnits()
- Returns:
- units used in width property.
Gets the width property units.
setWidthUnits
@Deprecated
void setWidthUnits(int units)
- Parameters:
units
- the units used in width property.
Deprecated. Consider setting width and unit simultaneously using
setWidth(String)
or setWidth(float, int)
,
which is less error-prone.
Sets the width property units.
getHeightUnits
int getHeightUnits()
- Returns:
- units used in height property.
Gets the height property units.
setHeightUnits
@Deprecated
void setHeightUnits(int units)
- Parameters:
units
- the units used in height property.
Deprecated. Consider setting height and unit simultaneously using
setHeight(String)
or setHeight(float, int)
,
which is less error-prone.
Sets the height property units.
setHeight
void setHeight(String height)
- Parameters:
height
- in CSS style string representation
Sets the height of the component using String presentation. String presentation is similar to what is used in Cascading Style Sheets. Size can be length or percentage of available size. The empty string ("") or null will unset the height and set the units to pixels. See CSS specification for more details.
setWidth
void setWidth(float width,
int unit)
- Parameters:
width
- the width of the object.unit
- the unit used for the width. Possible values includeUNITS_PIXELS
,UNITS_POINTS
,UNITS_PICAS
,UNITS_EM
,UNITS_EX
,UNITS_MM
,UNITS_CM
,UNITS_INCH
,UNITS_PERCENTAGE
.
Sets the width of the object. Negative number implies unspecified size (terminal is free to set the size).
setHeight
void setHeight(float height,
int unit)
- Parameters:
height
- the height of the object.unit
- the unit used for the width. Possible values includeUNITS_PIXELS
,UNITS_POINTS
,UNITS_PICAS
,UNITS_EM
,UNITS_EX
,UNITS_MM
,UNITS_CM
,UNITS_INCH
,UNITS_PERCENTAGE
.
Sets the height of the object. Negative number implies unspecified size (terminal is free to set the size).
setWidth
void setWidth(String width)
- Parameters:
width
- in CSS style string representation, null or empty string to reset
Sets the width of the component using String presentation. String presentation is similar to what is used in Cascading Style Sheets. Size can be length or percentage of available size. The empty string ("") or null will unset the width and set the units to pixels. See CSS specification for more details.
setSizeFull
void setSizeFull()
Sets the size to 100% x 100%.
setSizeUndefined
void setSizeUndefined()
Clears any size settings.