com.guiseframework.component.layout
Class ReferenceLayout

java.lang.Object
  extended by com.globalmentor.beans.BoundPropertyObject
      extended by com.guiseframework.event.GuiseBoundPropertyObject
          extended by com.guiseframework.component.layout.AbstractLayout<ReferenceConstraints>
              extended by com.guiseframework.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 com.guiseframework.component.layout.AbstractLayout
AbstractLayout.ConstraintsPropertyChangeListener
 
Field Summary
 
Fields inherited from class com.globalmentor.beans.BoundPropertyObject
NO_PROPERTY_CHANGE_LISTENERS, NO_VETOABLE_CHANGE_LISTENERS
 
Constructor Summary
ReferenceLayout()
           
 
Method Summary
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 container.
 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 com.guiseframework.component.layout.AbstractLayout
addComponent, fireConstraintsPropertyChange, getComponentConstraintsChangeListener, getConstraints, getConstraintsPropertyChangeListener, getOwner, removeComponent, setOwner
 
Methods inherited from class com.guiseframework.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 com.guiseframework.component.layout.Layout
getSession
 
Methods inherited from interface com.globalmentor.beans.PropertyBindable
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, hasPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
 

Constructor Detail

ReferenceLayout

public ReferenceLayout()
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 adds or removes the component reference ID to the map.

Overrides:
componentConstraintsChanged in class AbstractLayout<ReferenceConstraints>
Parameters:
component - The component for which constraints have changed.
oldConstraints - The old component constraints, or null if there were no constraints previously.
newConstraints - The new component constraints, or null if the component now has no constraints.

createDefaultConstraints

public ReferenceConstraints createDefaultConstraints()
Creates default constraints for the container.

Returns:
New default constraints for the container.
Throws:
java.lang.IllegalStateException - if this layout does not support default constraints.

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.


Copyright © 2005-2010 GlobalMentor, Inc. All Rights Reserved.