com.vaadin.client.ui.layout.
Class LayoutDependencyTree
- java.lang.Object
-
- com.vaadin.client.ui.layout.LayoutDependencyTree
-
public class LayoutDependencyTree extends Object
Internal class used to keep track of layout dependencies during one layout run. This class is not intended to be used directly by applications.
Since:
7.0.0
Author:
Vaadin Ltd
-
-
Constructor Summary
Constructors Constructor Description LayoutDependencyTree(ApplicationConnection connection)
Constructs a layout dependency helper class.
-
Method Summary
All Methods Modifier and Type Method Description ManagedLayout[]
getHorizontalLayoutTargets()
Deprecated.
As of 7.0.1, usegetHorizontalLayoutTargetsJsArray()
for improved performance.com.google.gwt.core.client.JsArrayString
getHorizontalLayoutTargetsJsArray()
Returns a JsArrayString array of connectorIds for managed layouts that are waiting for horizontal layouting.
Collection<ComponentConnector>
getMeasureTargets()
Deprecated.
As of 7.0.1, usegetMeasureTargetsJsArray()
for improved performance.com.google.gwt.core.client.JsArrayString
getMeasureTargetsJsArray()
Returns a JsArrayString array of connectorIds for components that are waiting for either horizontal or vertical measuring.
ComponentConnector
getScrollingBoundary(ComponentConnector connector)
Returns the scrolling boundary for this component.
ManagedLayout[]
getVerticalLayoutTargets()
Deprecated.
As of 7.0.1, usegetVerticalLayoutTargetsJsArray()
for improved performance.com.google.gwt.core.client.JsArrayString
getVerticalLayoutTargetsJsArray()
Returns a JsArrayString array of connectorIds for managed layouts that are waiting for vertical layouting.
boolean
hasConnectorsToMeasure()
Returns whether there are any components waiting for either horizontal or vertical measuring.
boolean
hasHorizontalConnectorToLayout()
Returns whether there are any managed layouts waiting for horizontal layouting.
boolean
hasVerticaConnectorToLayout()
Returns whether there are any managed layouts waiting for vertical layouting.
void
logDependencyStatus(ComponentConnector connector)
Logs horizontal and vertical
LayoutDependencyTree.LayoutDependency
state for the given connector.void
markAsHorizontallyLayouted(ManagedLayout layout)
Marks the managed layout as layouted horizontally and propagates the need of horizontal measuring for any components that might have got their size changed as a result.
void
markAsVerticallyLayouted(ManagedLayout layout)
Marks the managed layout as layouted vertically and propagates the need of vertical measuring for any components that might have got their size changed as a result.
void
markHeightAsChanged(ComponentConnector connector)
Marks the component's height as changed.
void
markWidthAsChanged(ComponentConnector connector)
Marks the component's width as changed.
boolean
noMoreChangesExpected(ComponentConnector connector)
Returns whether all required layouting and measuring has been done for this component to both directions and there are no more blockers waiting for handling.
void
setNeedsHorizontalLayout(ManagedLayout layout, boolean needsLayout)
Deprecated.
As of 7.0.1, usesetNeedsHorizontalLayout(String, boolean)
for improved performance.void
setNeedsHorizontalLayout(String connectorId, boolean needsLayout)
Informs this LayoutDependencyTree that the horizontal size of a managed layout might have changed and it needs layouting, or that the layouting is no longer necessary.
void
setNeedsHorizontalMeasure(ComponentConnector connector, boolean needsMeasure)
Informs this LayoutDependencyTree that the horizontal size of a component might have changed and it needs measuring, or that the measuring is no longer necessary.
void
setNeedsHorizontalMeasure(String connectorId, boolean needsMeasure)
Deprecated.
UsesetNeedsHorizontalMeasure(ComponentConnector, boolean)
for improved performance.void
setNeedsMeasure(ComponentConnector connector, boolean needsMeasure)
Informs this LayoutDependencyTree that the size of a component might have changed and it needs measuring in both directions, or that the measuring is no longer necessary.
void
setNeedsMeasure(String connectorId, boolean needsMeasure)
Deprecated.
As of 7.4.2, usesetNeedsMeasure(ComponentConnector, boolean)
for improved performance.void
setNeedsVerticalLayout(ManagedLayout layout, boolean needsLayout)
Deprecated.
As of 7.0.1, usesetNeedsVerticalLayout(String, boolean)
for improved performance.void
setNeedsVerticalLayout(String connectorId, boolean needsLayout)
Informs this LayoutDependencyTree that the vertical size of a managed layout might have changed and it needs layouting, or that the layouting is no longer necessary.
void
setNeedsVerticalMeasure(ComponentConnector connector, boolean needsMeasure)
Informs this LayoutDependencyTree that the vertical size of a component might have changed and it needs measuring, or that the measuring is no longer necessary.
void
setNeedsVerticalMeasure(String connectorId, boolean needsMeasure)
Deprecated.
UsesetNeedsVerticalMeasure(ComponentConnector, boolean)
for improved performance.
-
-
-
Constructor Detail
-
LayoutDependencyTree
public LayoutDependencyTree(ApplicationConnection connection)
Constructs a layout dependency helper class.
Parameters:
connection
- the current application connection instance, should not benull
See Also:
-
-
Method Detail
-
setNeedsMeasure
public void setNeedsMeasure(ComponentConnector connector, boolean needsMeasure)
Informs this LayoutDependencyTree that the size of a component might have changed and it needs measuring in both directions, or that the measuring is no longer necessary. If there are blockers, measuring will be delayed and cannot be disabled before the blockers have been removed.
Parameters:
connector
- the connector of the component whose size might have changed, should not benull
needsMeasure
-true
if measuring should be enabled,false
if measuring should be disabled (disabling is only effective if there are no blockers)
-
setNeedsMeasure
@Deprecated public void setNeedsMeasure(String connectorId, boolean needsMeasure)
Deprecated.As of 7.4.2, usesetNeedsMeasure(ComponentConnector, boolean)
for improved performance.Parameters:
connectorId
- the connector id of the component whose size might have changedneedsMeasure
-true
if measuring should be enabled,false
if measuring should be disabled (disabling is only effective if there are no blockers)
-
setNeedsHorizontalMeasure
public void setNeedsHorizontalMeasure(ComponentConnector connector, boolean needsMeasure)
Informs this LayoutDependencyTree that the horizontal size of a component might have changed and it needs measuring, or that the measuring is no longer necessary. If there are blockers, measuring will be delayed and cannot be disabled before the blockers have been removed.
Parameters:
connector
- the connector of the component whose horizontal size might have changed, should not benull
needsMeasure
-true
if measuring should be enabled,false
if measuring should be disabled (disabling is only effective if there are no blockers)
-
setNeedsHorizontalMeasure
@Deprecated public void setNeedsHorizontalMeasure(String connectorId, boolean needsMeasure)
Deprecated.UsesetNeedsHorizontalMeasure(ComponentConnector, boolean)
for improved performance.Parameters:
connectorId
- the connector id of the component whose horizontal size might have changedneedsMeasure
-true
if measuring should be enabled,false
if measuring should be disabled (disabling is only effective if there are no blockers)
-
setNeedsVerticalMeasure
public void setNeedsVerticalMeasure(ComponentConnector connector, boolean needsMeasure)
Informs this LayoutDependencyTree that the vertical size of a component might have changed and it needs measuring, or that the measuring is no longer necessary. If there are blockers, measuring will be delayed and cannot be disabled before the blockers have been removed.
Parameters:
connector
- the connector of the component whose vertical size might have changed, should not benull
needsMeasure
-true
if measuring should be enabled,false
if measuring should be disabled (disabling is only effective if there are no blockers)
-
setNeedsVerticalMeasure
@Deprecated public void setNeedsVerticalMeasure(String connectorId, boolean needsMeasure)
Deprecated.UsesetNeedsVerticalMeasure(ComponentConnector, boolean)
for improved performance.Parameters:
connectorId
- the connector id of the component whose vertical size might have changedneedsMeasure
-true
if measuring should be enabled,false
if measuring should be disabled (disabling is only effective if there are no blockers)
-
setNeedsHorizontalLayout
@Deprecated public void setNeedsHorizontalLayout(ManagedLayout layout, boolean needsLayout)
Deprecated.As of 7.0.1, usesetNeedsHorizontalLayout(String, boolean)
for improved performance.Parameters:
layout
- the managed layout whose horizontal size might have changed, should not benull
needsLayout
-true
if layouting should be enabled,false
if layouting should be disabled (disabling is only effective if there are no blockers)
-
setNeedsHorizontalLayout
public void setNeedsHorizontalLayout(String connectorId, boolean needsLayout)
Informs this LayoutDependencyTree that the horizontal size of a managed layout might have changed and it needs layouting, or that the layouting is no longer necessary. If there are blockers, layouting will be delayed and cannot be disabled before the blockers have been removed. Logs a warning if no dependency is found.
Parameters:
connectorId
- the connector id of the managed layout whose horizontal size might have changedneedsLayout
-true
if layouting should be enabled,false
if layouting should be disabled (disabling is only effective if there are no blockers)
-
setNeedsVerticalLayout
@Deprecated public void setNeedsVerticalLayout(ManagedLayout layout, boolean needsLayout)
Deprecated.As of 7.0.1, usesetNeedsVerticalLayout(String, boolean)
for improved performance.Parameters:
layout
- the managed layout whose vertical size might have changed, should not benull
needsLayout
-true
if layouting should be enabled,false
if layouting should be disabled (disabling is only effective if there are no blockers)
-
setNeedsVerticalLayout
public void setNeedsVerticalLayout(String connectorId, boolean needsLayout)
Informs this LayoutDependencyTree that the vertical size of a managed layout might have changed and it needs layouting, or that the layouting is no longer necessary. If there are blockers, layouting will be delayed and cannot be disabled before the blockers have been removed. Logs a warning if no dependency is found.
Parameters:
connectorId
- the connector id of the managed layout whose vertical size might have changedneedsLayout
-true
if layouting should be enabled,false
if layouting should be disabled (disabling is only effective if there are no blockers)
-
markAsHorizontallyLayouted
public void markAsHorizontallyLayouted(ManagedLayout layout)
Marks the managed layout as layouted horizontally and propagates the need of horizontal measuring for any components that might have got their size changed as a result. If there are blockers, nothing is done.
Parameters:
layout
- the managed layout whose horizontal layouting has been done, should not benull
-
markAsVerticallyLayouted
public void markAsVerticallyLayouted(ManagedLayout layout)
Marks the managed layout as layouted vertically and propagates the need of vertical measuring for any components that might have got their size changed as a result. If there are blockers, nothing is done.
Parameters:
layout
- the managed layout whose vertical layouting has been done, should not benull
-
markHeightAsChanged
public void markHeightAsChanged(ComponentConnector connector)
Marks the component's height as changed. Iterates through all components whose vertical size depends on this component's size. If the dependent is a managed layout triggers need for vertical layouting, otherwise triggers need for vertical measuring for any dependent components of that component in turn. Finally triggers horizontal measuring for the scrolling boundary, in case vertical scrollbar has appeared or disappeared due the height change.
Parameters:
connector
- the connector of the component whose height has changed, should not benull
-
markWidthAsChanged
public void markWidthAsChanged(ComponentConnector connector)
Marks the component's width as changed. Iterates through all components whose horizontal size depends on this component's size. If the dependent is a managed layout triggers need for horizontal layouting, otherwise triggers need for horizontal measuring for any dependent components of that component in turn. Finally triggers vertical measuring for the scrolling boundary, in case horizontal scrollbar has appeared or disappeared due the width change.
Parameters:
connector
- the connector of the component whose width has changed, should not benull
-
hasConnectorsToMeasure
public boolean hasConnectorsToMeasure()
Returns whether there are any components waiting for either horizontal or vertical measuring.
Returns:
true
if either measure queue contains anything,false
otherwise
-
hasHorizontalConnectorToLayout
public boolean hasHorizontalConnectorToLayout()
Returns whether there are any managed layouts waiting for horizontal layouting.
Returns:
true
if horizontal layouting queue is not empty,false
otherwise
-
hasVerticaConnectorToLayout
public boolean hasVerticaConnectorToLayout()
Returns whether there are any managed layouts waiting for vertical layouting.
Returns:
true
if vertical layouting queue is not empty,false
otherwise
-
getHorizontalLayoutTargets
@Deprecated public ManagedLayout[] getHorizontalLayoutTargets()
Deprecated.As of 7.0.1, usegetHorizontalLayoutTargetsJsArray()
for improved performance.Returns:
array of managed layouts waiting for horizontal layouting
-
getVerticalLayoutTargets
@Deprecated public ManagedLayout[] getVerticalLayoutTargets()
Deprecated.As of 7.0.1, usegetVerticalLayoutTargetsJsArray()
for improved performance.Returns:
array of managed layouts waiting for vertical layouting
-
getHorizontalLayoutTargetsJsArray
public com.google.gwt.core.client.JsArrayString getHorizontalLayoutTargetsJsArray()
Returns a JsArrayString array of connectorIds for managed layouts that are waiting for horizontal layouting.
Returns:
JsArrayString of connectorIds
-
getVerticalLayoutTargetsJsArray
public com.google.gwt.core.client.JsArrayString getVerticalLayoutTargetsJsArray()
Returns a JsArrayString array of connectorIds for managed layouts that are waiting for vertical layouting.
Returns:
JsArrayString of connectorIds
-
getMeasureTargets
@Deprecated public Collection<ComponentConnector> getMeasureTargets()
Deprecated.As of 7.0.1, usegetMeasureTargetsJsArray()
for improved performance.Returns:
connectors that are waiting for measuring
-
getMeasureTargetsJsArray
public com.google.gwt.core.client.JsArrayString getMeasureTargetsJsArray()
Returns a JsArrayString array of connectorIds for components that are waiting for either horizontal or vertical measuring.
Returns:
JsArrayString of connectorIds
-
logDependencyStatus
public void logDependencyStatus(ComponentConnector connector)
Logs horizontal and vertical
LayoutDependencyTree.LayoutDependency
state for the given connector.Parameters:
connector
- the connector whose state to log, should not benull
-
noMoreChangesExpected
public boolean noMoreChangesExpected(ComponentConnector connector)
Returns whether all required layouting and measuring has been done for this component to both directions and there are no more blockers waiting for handling.
Parameters:
connector
- the connector to check, should not benull
Returns:
true
if nothing is pending,false
otherwise
-
getScrollingBoundary
public ComponentConnector getScrollingBoundary(ComponentConnector connector)
Returns the scrolling boundary for this component. If a cached value is available, the check isn't performed again. If no cached value exists, iterates through the component hierarchy until the closest parent that implements
MayScrollChildren
has been found.Parameters:
connector
- the connector to check, should not benull
Returns:
the closest scrolling parent or
null
if not found
-
-