com.vaadin.terminal
Interface Sizeable

All Superinterfaces:
Serializable
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

public interface Sizeable
extends Serializable

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
Unit code representing pixels.

See Also:
Constant Field Values

UNITS_POINTS

static final int UNITS_POINTS
Unit code representing points (1/72nd of an inch).

See Also:
Constant Field Values

UNITS_PICAS

static final int UNITS_PICAS
Unit code representing picas (12 points).

See Also:
Constant Field Values

UNITS_EM

static final int UNITS_EM
Unit code representing the font-size of the relevant font.

See Also:
Constant Field Values

UNITS_EX

static final int UNITS_EX
Unit code representing the x-height of the relevant font.

See Also:
Constant Field Values

UNITS_MM

static final int UNITS_MM
Unit code representing millimeters.

See Also:
Constant Field Values

UNITS_CM

static final int UNITS_CM
Unit code representing centimeters.

See Also:
Constant Field Values

UNITS_INCH

static final int UNITS_INCH
Unit code representing inches.

See Also:
Constant Field Values

UNITS_PERCENTAGE

static final int UNITS_PERCENTAGE
Unit code representing in percentage of the containing element defined by terminal.

See Also:
Constant Field Values

SIZE_UNDEFINED

static final float SIZE_UNDEFINED
See Also:
Constant Field Values

UNIT_SYMBOLS

static final String[] UNIT_SYMBOLS
Textual representations of units symbols. Supported units and their symbols are: These can be used like Sizeable.UNIT_SYMBOLS[UNITS_PIXELS].

Method Detail

getWidth

float getWidth()
Gets the width of the object. Negative number implies unspecified size (terminal is free to set the size).

Returns:
width of the object in units specified by widthUnits property.

setWidth

@Deprecated
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).

Sets the width of the object. Negative number implies unspecified size (terminal is free to set the size).

Parameters:
width - the width of the object in units specified by widthUnits property.

getHeight

float getHeight()
Gets the height of the object. Negative number implies unspecified size (terminal is free to set the size).

Returns:
height of the object in units specified by heightUnits property.

setHeight

@Deprecated
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).

Sets the height of the object. Negative number implies unspecified size (terminal is free to set the size).

Parameters:
height - the height of the object in units specified by heightUnits property.

getWidthUnits

int getWidthUnits()
Gets the width property units.

Returns:
units used in width property.

setWidthUnits

@Deprecated
void setWidthUnits(int units)
Deprecated. Consider setting width and unit simultaneously using setWidth(String) or setWidth(float, int), which is less error-prone.

Sets the width property units.

Parameters:
units - the units used in width property.

getHeightUnits

int getHeightUnits()
Gets the height property units.

Returns:
units used in height property.

setHeightUnits

@Deprecated
void setHeightUnits(int units)
Deprecated. Consider setting height and unit simultaneously using setHeight(String) or setHeight(float, int), which is less error-prone.

Sets the height property units.

Parameters:
units - the units used in height property.

setHeight

void setHeight(String height)
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.

Parameters:
height - in CSS style string representation

setWidth

void setWidth(float width,
              int unit)
Sets the width of the object. Negative number implies unspecified size (terminal is free to set the size).

Parameters:
width - the width of the object.
unit - the unit used for the width. Possible values include UNITS_PIXELS, UNITS_POINTS, UNITS_PICAS, UNITS_EM, UNITS_EX, UNITS_MM, UNITS_CM, UNITS_INCH, UNITS_PERCENTAGE.

setHeight

void setHeight(float height,
               int unit)
Sets the height of the object. Negative number implies unspecified size (terminal is free to set the size).

Parameters:
height - the height of the object.
unit - the unit used for the width. Possible values include UNITS_PIXELS, UNITS_POINTS, UNITS_PICAS, UNITS_EM, UNITS_EX, UNITS_MM, UNITS_CM, UNITS_INCH, UNITS_PERCENTAGE.

setWidth

void setWidth(String width)
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.

Parameters:
width - in CSS style string representation, null or empty string to reset

setSizeFull

void setSizeFull()
Sets the size to 100% x 100%.


setSizeUndefined

void setSizeUndefined()
Clears any size settings.



Copyright © 2000-2011 Vaadin Ltd. All Rights Reserved.