com.vaadin.ui.
Class AbsoluteLayout
java.lang.Object
com.vaadin.ui.AbstractComponent
com.vaadin.ui.AbstractComponentContainer
com.vaadin.ui.AbstractLayout
com.vaadin.ui.AbsoluteLayout
All Implemented Interfaces:
LayoutEvents.LayoutClickNotifier, MethodEventSource, Paintable, Sizeable, VariableOwner, Component, ComponentContainer, Layout, Layout.MarginHandler, Serializable, EventListener
- extends AbstractLayout
- implements LayoutEvents.LayoutClickNotifier
public class AbsoluteLayout
AbsoluteLayout is a layout implementation that mimics html absolute positioning.
See Also:
Nested Class Summary | |
---|---|
class |
AbsoluteLayout.ComponentPosition
The CompontPosition class represents a components position within the absolute layout. |
Nested classes/interfaces inherited from class com.vaadin.ui.AbstractComponent |
---|
AbstractComponent.ComponentErrorEvent, AbstractComponent.ComponentErrorHandler |
Nested classes/interfaces inherited from interface com.vaadin.ui.Layout |
---|
Layout.AlignmentHandler, Layout.MarginHandler, Layout.MarginInfo, Layout.SpacingHandler |
Nested classes/interfaces inherited from interface com.vaadin.ui.ComponentContainer |
---|
ComponentContainer.ComponentAttachEvent, ComponentContainer.ComponentAttachListener, ComponentContainer.ComponentDetachEvent, ComponentContainer.ComponentDetachListener |
Nested classes/interfaces inherited from interface com.vaadin.ui.Component |
---|
Component.ErrorEvent, Component.ErrorListener, Component.Event, Component.Focusable, Component.Listener |
Nested classes/interfaces inherited from interface com.vaadin.terminal.Paintable |
---|
Paintable.RepaintRequestEvent, Paintable.RepaintRequestListener |
Field Summary |
---|
Fields inherited from class com.vaadin.ui.AbstractLayout |
---|
margins |
Fields inherited from interface com.vaadin.terminal.Sizeable |
---|
SIZE_UNDEFINED, UNIT_SYMBOLS, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS |
Constructor Summary | |
---|---|
AbsoluteLayout()
Creates an AbsoluteLayout with full size. |
Method Summary | |
---|---|
void |
addComponent(Component c)
This only implements the events and component parent calls. |
void |
addComponent(Component c,
String cssPosition)
Adds a component to the layout. |
void |
addListener(LayoutEvents.LayoutClickListener listener)
Add a click listener to the layout. |
int |
getComponentCount()
Gets the number of contained components. |
Iterator<Component> |
getComponentIterator()
Gets an iterator for going through all components enclosed in the absolute layout. |
AbsoluteLayout.ComponentPosition |
getPosition(Component component)
Gets the position of a component in the layout. |
void |
paintContent(PaintTarget target)
Paints any needed component-specific things to the given UIDL stream. |
void |
removeComponent(Component c)
This only implements the events and component parent calls. |
void |
removeListener(LayoutEvents.LayoutClickListener listener)
Removes an LayoutClickListener. |
void |
replaceComponent(Component oldComponent,
Component newComponent)
Replaces one component with another one. |
Methods inherited from class com.vaadin.ui.AbstractLayout |
---|
changeVariables, fireClick, getMargin, setMargin, setMargin, setMargin |
Methods inherited from class com.vaadin.ui.AbstractComponentContainer |
---|
addListener, addListener, attach, detach, fireComponentAttachEvent, fireComponentDetachEvent, moveComponentsFrom, removeAllComponents, removeListener, removeListener, requestRepaintAll, setEnabled, setHeight, setWidth |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.vaadin.ui.ComponentContainer |
---|
addListener, addListener, moveComponentsFrom, removeAllComponents, removeListener, removeListener, requestRepaintAll |
Methods inherited from interface com.vaadin.ui.Component |
---|
addListener, addStyleName, attach, childRequestedRepaint, detach, getApplication, getCaption, getIcon, getLocale, getParent, getStyleName, getWindow, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setCaption, setEnabled, setIcon, setParent, setReadOnly, setStyleName, setVisible |
Methods inherited from interface com.vaadin.terminal.Paintable |
---|
addListener, getDebugId, paint, removeListener, requestRepaint, requestRepaintRequests, setDebugId |
Methods inherited from interface com.vaadin.terminal.VariableOwner |
---|
isImmediate |
Methods inherited from interface com.vaadin.terminal.Sizeable |
---|
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeight, setHeightUnits, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidth, setWidthUnits |
Constructor Detail |
---|
AbsoluteLayout
public AbsoluteLayout()
Creates an AbsoluteLayout with full size.
Method Detail |
---|
getComponentIterator
public Iterator<Component> getComponentIterator()
- Specified by:
getComponentIterator
in interfaceComponentContainer
- Returns:
- the component iterator.
Gets an iterator for going through all components enclosed in the absolute layout.
getComponentCount
public int getComponentCount()
- Returns:
- the number of contained components
Gets the number of contained components. Consistent with the iterator
returned by getComponentIterator()
.
replaceComponent
public void replaceComponent(Component oldComponent,
Component newComponent)
- Specified by:
replaceComponent
in interfaceComponentContainer
- Parameters:
oldComponent
- the old component that will be replaced.newComponent
- the new component to be replaced.
Replaces one component with another one. The new component inherits the old components position.
addComponent
public void addComponent(Component c)
- Specified by:
addComponent
in interfaceComponentContainer
- Overrides:
addComponent
in classAbstractComponentContainer
- Parameters:
c
- the component to be added.- See Also:
ComponentContainer.addComponent(Component)
Description copied from class: AbstractComponentContainer
This only implements the events and component parent calls. The extending classes must implement component list maintenance and call this method after component list maintenance.
removeComponent
public void removeComponent(Component c)
- Specified by:
removeComponent
in interfaceComponentContainer
- Overrides:
removeComponent
in classAbstractComponentContainer
- Parameters:
c
- the component to be removed.- See Also:
ComponentContainer.removeComponent(Component)
Description copied from class: AbstractComponentContainer
This only implements the events and component parent calls. The extending classes must implement component list maintenance and call this method before component list maintenance.
addComponent
public void addComponent(Component c,
String cssPosition)
- Parameters:
c
- The component to add to the layoutcssPosition
- The css position string
Adds a component to the layout. The component can be positioned by providing a string formatted in CSS-format.
For example the string "top:10px;left:10px" will position the component 10 pixels from the left and 10 pixels from the top. The identifiers: "top","left","right" and "bottom" can be used to specify the position.
getPosition
public AbsoluteLayout.ComponentPosition getPosition(Component component)
- Parameters:
component
- The component which position is needed- Returns:
- An instance of ComponentPosition containing the position of the component, or null if the component is not enclosed in the layout.
Gets the position of a component in the layout. Returns null if component is not attached to the layout.
paintContent
public void paintContent(PaintTarget target)
throws PaintException
- Overrides:
paintContent
in classAbstractLayout
- Parameters:
target
- the target UIDL stream where the component should paint itself to- Throws:
PaintException
- if the paint operation failed.
Description copied from class: AbstractComponent
Paints any needed component-specific things to the given UIDL stream. The
more general AbstractComponent.paint(PaintTarget)
method handles all general
attributes common to all components, and it calls this method to paint
any component-specific attributes to the UIDL stream.
addListener
public void addListener(LayoutEvents.LayoutClickListener listener)
- Specified by:
addListener
in interfaceLayoutEvents.LayoutClickNotifier
- Parameters:
listener
- The listener to add
Description copied from interface: LayoutEvents.LayoutClickNotifier
Add a click listener to the layout. The listener is called whenever
the user clicks inside the layout. An event is also triggered when
the click targets a component inside a nested layout or Panel,
provided the targeted component does not prevent the click event from
propagating. A caption is not considered part of a component.
The child component that was clicked is included in the
LayoutEvents.LayoutClickEvent
.
Use #removeListener(LayoutClickListener)
to remove the
listener.
removeListener
public void removeListener(LayoutEvents.LayoutClickListener listener)
- Specified by:
removeListener
in interfaceLayoutEvents.LayoutClickNotifier
- Parameters:
listener
- LayoutClickListener to be removed
Description copied from interface: LayoutEvents.LayoutClickNotifier
Removes an LayoutClickListener.