edu.washington.cs.supple.wlib.java2
Class GridBagContainerWidget

java.lang.Object
  extended byedu.washington.cs.supple.render.AbstractWidget
      extended byedu.washington.cs.supple.render.AbstractContainerWidget
          extended byedu.washington.cs.supple.wlib.java2.ContainerSwingWidget
              extended byedu.washington.cs.supple.wlib.java2.GridBagContainerWidget
All Implemented Interfaces:
java.lang.Cloneable, ContainerWidget, java.util.EventListener, java.beans.PropertyChangeListener, SwingWidget, UnwrappedWidget, Widget

public class GridBagContainerWidget
extends ContainerSwingWidget

Author:
kgajos

Field Summary
static java.lang.String HEIGHT_CONSTRAINT_PROPERTY
           
protected  int heightConstraint
           
protected  int numChildren
           
static java.lang.String WIDTH_CONSTRAINT_PROPERTY
           
protected  int widthConstraint
           
 
Fields inherited from class edu.washington.cs.supple.wlib.java2.ContainerSwingWidget
actionButton, LEFT, LIST_PLACEMENT_PROPERTY, LISTING_WIDGET_PROPERTY, listingWidget, listPlacement, TOP
 
Fields inherited from class edu.washington.cs.supple.render.AbstractContainerWidget
children, containerType
 
Fields inherited from class edu.washington.cs.supple.render.AbstractWidget
bag, cost, engaged, object, parent, stateVar, textLabel, type, widgetDescriptor, wrapper
 
Fields inherited from interface edu.washington.cs.supple.render.Widget
MAX_HINT, NO_BORDER, NO_NAME, TOP_LEVEL_WIDGET
 
Constructor Summary
GridBagContainerWidget(UiObject object, int widthConstraint, int heightConstraint)
           
GridBagContainerWidget(UiObject object, int widthConstraint, int heightConstraint, SwingWidget lWidget, int placement)
           
GridBagContainerWidget(UiObject object, WidgetDescriptor wd, WidgetFactory f)
           
 
Method Summary
protected  WidgetDescriptor generateWidgetDescriptor()
          Subclasses can override this method if their widget descriptor include extra information
protected  java.awt.Dimension getContainerSize(int hints)
          Unless a child overrides getSize, it should override this method
 float getEffortEstimate(ActionDescription a)
           
 WidgetProperties getWidgetProperties()
          Returns the corresponding WidgetProperties
protected  javax.swing.JComponent makeSwingContainer(int hints)
          To be overriden by children (unless they override getSwingComponent)
static boolean rendersObject(UiObject object)
          A static method for testing the applicability of the widget given a type of the UI component to be rendered -- in this case it returns true for regular container objets with at least 4 children
 java.lang.String toString()
           
 
Methods inherited from class edu.washington.cs.supple.wlib.java2.ContainerSwingWidget
addActionButtonSize, addChildren, disengage, engage, getComponentForChild, getConcreteWidget, getListingWidget, getSize, getSwingComponent, hasListingWidget, makeActionButton, makeActionButtons, setEnabled, setListingWidget
 
Methods inherited from class edu.washington.cs.supple.render.AbstractContainerWidget
childIterator, getChild, getChildFor, getMaxChildSize, getMaxChildSize, getMinChildSize, getSumChildSize, getSumChildSize, hasChildren, makeVisible, setChildren
 
Methods inherited from class edu.washington.cs.supple.render.AbstractWidget
anotherPropertyChanged, clone, clone, dismissCurrentView, displayDynamic, equals, executeAction, getBag, getConcreteWidget, getCost, getParent, getPath, getSizeCache, getTextLabel, getType, getUiObject, getWidgetDescriptor, indexChanged, isEngaged, isEquivalent, legalValuesChanged, likelyValuesChanged, propertyChange, reportActionExecutionEvent, reportValueChangedEvent, setBag, setCost, setParent, setSizeCache, setValue, setWrapper, unwrapWidget, valueChanged
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.washington.cs.supple.render.Widget
childIterator, clone, clone, getBag, getConcreteWidget, getCost, getPath, getSizeCache, getTextLabel, getType, getUiObject, getWidgetDescriptor, hasChildren, isEngaged, isEquivalent, setBag, setCost, setParent, setSizeCache, setWrapper, unwrapWidget
 

Field Detail

HEIGHT_CONSTRAINT_PROPERTY

public static final java.lang.String HEIGHT_CONSTRAINT_PROPERTY
See Also:
Constant Field Values

WIDTH_CONSTRAINT_PROPERTY

public static final java.lang.String WIDTH_CONSTRAINT_PROPERTY
See Also:
Constant Field Values

widthConstraint

protected int widthConstraint

heightConstraint

protected int heightConstraint

numChildren

protected int numChildren
Constructor Detail

GridBagContainerWidget

public GridBagContainerWidget(UiObject object,
                              int widthConstraint,
                              int heightConstraint)

GridBagContainerWidget

public GridBagContainerWidget(UiObject object,
                              int widthConstraint,
                              int heightConstraint,
                              SwingWidget lWidget,
                              int placement)

GridBagContainerWidget

public GridBagContainerWidget(UiObject object,
                              WidgetDescriptor wd,
                              WidgetFactory f)
                       throws java.lang.Exception
Method Detail

rendersObject

public static boolean rendersObject(UiObject object)
A static method for testing the applicability of the widget given a type of the UI component to be rendered -- in this case it returns true for regular container objets with at least 4 children

Returns:
true for all coumpound objects with at least 4 children (including actions); false otherwise

getWidgetProperties

public WidgetProperties getWidgetProperties()
Description copied from interface: Widget
Returns the corresponding WidgetProperties

Specified by:
getWidgetProperties in interface Widget
Overrides:
getWidgetProperties in class ContainerSwingWidget
Returns:
properties associated with this widget

generateWidgetDescriptor

protected WidgetDescriptor generateWidgetDescriptor()
Description copied from class: AbstractWidget
Subclasses can override this method if their widget descriptor include extra information

Overrides:
generateWidgetDescriptor in class ContainerSwingWidget

getContainerSize

protected java.awt.Dimension getContainerSize(int hints)
Description copied from class: ContainerSwingWidget
Unless a child overrides getSize, it should override this method

Overrides:
getContainerSize in class ContainerSwingWidget
Parameters:
hints - rendering hints
Returns:
the size of the container object

makeSwingContainer

protected javax.swing.JComponent makeSwingContainer(int hints)
Description copied from class: ContainerSwingWidget
To be overriden by children (unless they override getSwingComponent)

Overrides:
makeSwingContainer in class ContainerSwingWidget
Parameters:
hints - rendering hints
Returns:
the container with all elements listed in the type

getEffortEstimate

public float getEffortEstimate(ActionDescription a)

toString

public java.lang.String toString()
Overrides:
toString in class ContainerSwingWidget