Class ReferenceLayout
- java.lang.Object
-
- com.globalmentor.beans.BoundPropertyObject
-
- io.guise.framework.event.GuiseBoundPropertyObject
-
- io.guise.framework.component.layout.AbstractLayout<ReferenceConstraints>
-
- io.guise.framework.component.layout.ReferenceLayout
-
- All Implemented Interfaces:
com.globalmentor.beans.PropertyBindable
,com.globalmentor.beans.PropertyConstrainable
,Layout<ReferenceConstraints>
public class ReferenceLayout extends AbstractLayout<ReferenceConstraints>
A layout for components bound to component references such as IDs.- Author:
- Garret Wilson
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.guise.framework.component.layout.AbstractLayout
AbstractLayout.ConstraintsPropertyChangeListener
-
-
Constructor Summary
Constructors Constructor Description ReferenceLayout()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
componentConstraintsChanged(Component component, Constraints oldConstraints, Constraints newConstraints)
Indicates that the constraints for a component have changed.ReferenceConstraints
createDefaultConstraints()
Creates default constraints for the layout component.Component
getComponentByID(java.lang.String id)
Retrieves a component bound to a given ID.java.lang.Class<? extends ReferenceConstraints>
getConstraintsClass()
protected java.util.Map<java.lang.String,Component>
getReferenceIDComponentMap()
-
Methods inherited from class io.guise.framework.component.layout.AbstractLayout
addComponent, fireConstraintsPropertyChange, getComponentConstraintsChangeListener, getConstraints, getConstraintsPropertyChangeListener, getOwner, removeComponent, setOwner
-
Methods inherited from class io.guise.framework.event.GuiseBoundPropertyObject
getSession
-
Methods inherited from class com.globalmentor.beans.BoundPropertyObject
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, createPostponedPropertyChangeEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getForwardPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getRepeatPropertyChangeListener, getRepeatVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, getVetoableChangeSupport, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.guise.framework.component.layout.Layout
getSession
-
-
-
-
Method Detail
-
getReferenceIDComponentMap
protected java.util.Map<java.lang.String,Component> getReferenceIDComponentMap()
- Returns:
- The lazily-created map of components mapped to reference IDs.
-
getConstraintsClass
public java.lang.Class<? extends ReferenceConstraints> getConstraintsClass()
- Returns:
- The class representing the type of constraints appropriate for this layout.
-
componentConstraintsChanged
protected void componentConstraintsChanged(Component component, Constraints oldConstraints, Constraints newConstraints)
Indicates that the constraints for a component have changed. This method is also called when the component is first added to the layout. This version removes and installs property change listeners to and from the constraints objects as appropriate.This version adds or removes the component reference ID to the map.
- Overrides:
componentConstraintsChanged
in classAbstractLayout<ReferenceConstraints>
- Parameters:
component
- The component for which constraints have changed.oldConstraints
- The old component constraints, ornull
if there were no constraints previously.newConstraints
- The new component constraints, ornull
if the component now has no constraints.
-
createDefaultConstraints
public ReferenceConstraints createDefaultConstraints()
Description copied from interface:Layout
Creates default constraints for the layout component.- Returns:
- New default constraints for the layout component.
-
getComponentByID
public Component getComponentByID(java.lang.String id)
Retrieves a component bound to a given ID.- Parameters:
id
- The ID with which a component may be bound.- Returns:
- A component with constraints specifying the given ID, or
null
if there is no component bound to the given ID.
-
-