|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectedu.washington.cs.supple.render.AbstractWidget
edu.washington.cs.supple.render.SimpleWidget
edu.washington.cs.supple.wlib.java2.SimpleSwingWidget
edu.washington.cs.supple.wlib.java2.ListWidget
| Field Summary | |
protected javax.swing.JButton |
dataEdit
|
protected SuppleType |
elementType
|
protected boolean |
exactLength
|
protected javax.swing.JList |
list
|
static java.lang.String |
LIST_SIZE_PROPERTY
|
static java.lang.String |
LIST_WIDTH_SCALE_PROPERTY
|
protected int |
listLength
|
protected javax.swing.JScrollPane |
listPane
|
protected double |
listWidthScale
|
protected javax.swing.event.ListSelectionListener |
selectionListener
|
protected int |
selectionMode
|
protected javax.swing.ListSelectionModel |
selectionModel
|
protected boolean |
updatingWidget
|
protected VectorType |
vtype
|
| Fields inherited from class edu.washington.cs.supple.wlib.java2.SimpleSwingWidget |
currentComponent, finalComponent |
| 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 | |
ListWidget(UiObject object,
int listSize,
double widthScale)
Does all of the common constructor work for lits |
|
ListWidget(UiObject object,
WidgetDescriptor wd,
WidgetFactory f)
|
|
| Method Summary | |
protected void |
addLegalValues(java.util.Vector diff,
java.util.Vector currentList)
Adds the specified values to the list model; it uses the position of the new elements in the currentList to determine where they should be inserted. |
void |
addSelection(int row)
|
protected javax.swing.JComponent |
buildList()
|
protected void |
deleteLegalValues(java.util.Vector diff)
Removes the specified values from the list model |
void |
disengage()
Used to break the connection between the widget and the underlying ui object |
protected void |
displayDetails()
Used when the underlying object is of UiObjectType or UiObjectValueVectorType it renders the detailed information about the selected values |
void |
engage()
Used to tie the widgets with the underlying ui objects |
protected WidgetDescriptor |
generateWidgetDescriptor()
Subclasses can override this method if their widget descriptor include extra information |
protected java.util.Vector |
getAddDiffs(java.util.Collection oldStuff,
java.util.Collection newStuff)
Creates a list of elements that are present in newStuff but not in oldStuff |
protected java.util.Vector |
getDeleteDiffs(java.util.Collection oldStuff,
java.util.Collection newStuff)
Creates a list of elements that are present in oldStuff but not in newStuff |
float |
getEffortEstimate(ActionDescription a)
This method is hear temporarily until we implement it for all simple widgets |
double |
getLengthScale(int maxLength)
|
int |
getListLength()
Returns the lenght of the list widget rendered; 0 means that the list will be as long as the number of elements in the domain of the object displayed |
protected javax.swing.ListModel |
getListModel()
|
protected javax.swing.ListSelectionModel |
getListSelectionModel()
|
protected java.awt.Dimension |
getPreferredSize()
Calculates the preferred size for this widget. |
protected javax.swing.event.ListSelectionListener |
getSelectionListener()
|
javax.swing.JComponent |
getSwingComponent(int hints)
|
WidgetProperties |
getWidgetProperties()
Returns the corresponding WidgetProperties |
double |
getWidthScale()
Returns the factor by which the width of this widget has been scaled down compared to the right width required to display all the elements without hiding or scrolling |
protected boolean |
isComponentReady()
|
boolean |
isExactLength()
Returns true if the list widget is precisely the same length as the domain of the underlying object |
protected boolean |
isSelectedIndex(int row)
|
protected boolean |
isUpdating()
This method lets you find out if the widget is in the process of updating itself (useful for breaking the cycle of change propagation between the widget and the underlying UiObject) |
protected void |
legalValuesChanged(java.beans.PropertyChangeEvent evt)
reacts to the change in the list of legal values in the underlying object |
void |
removeSelection(int row)
|
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 |
void |
setEnabled(boolean enabled)
This method is exposed only so that wrappers can access it; others should stay away |
protected void |
setUpdating(boolean b)
|
java.lang.String |
toString()
|
protected void |
updateDetailsState(java.util.Collection curValues)
Updates the active/inactive state of the Details button |
protected void |
updateSelection()
|
protected void |
updateSelection(int startIndex,
int endIndex)
Updates the selection based on the current value of the underlying object; uses the limiting indices to do the work only within small bounds if they are known; bounds are inclusive |
protected void |
updateValue(int startIndex,
int endIndex)
Called when the user manipulates the list and the selection changes |
protected void |
valueChanged(java.beans.PropertyChangeEvent evt)
Subclasses should override this method if they want to update display the value of the underlying type changes |
| Methods inherited from class edu.washington.cs.supple.wlib.java2.SimpleSwingWidget |
getConcreteWidget, getSize, refreshDisplay |
| Methods inherited from class edu.washington.cs.supple.render.SimpleWidget |
childIterator, hasChildren |
| 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, likelyValuesChanged, propertyChange, reportActionExecutionEvent, reportValueChangedEvent, setBag, setCost, setParent, setSizeCache, setValue, setWrapper, unwrapWidget |
| 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 |
protected int listLength
public static final java.lang.String LIST_SIZE_PROPERTY
public static final java.lang.String LIST_WIDTH_SCALE_PROPERTY
protected double listWidthScale
protected boolean exactLength
protected VectorType vtype
protected SuppleType elementType
protected javax.swing.JList list
protected javax.swing.JScrollPane listPane
protected javax.swing.JButton dataEdit
protected javax.swing.event.ListSelectionListener selectionListener
protected int selectionMode
protected boolean updatingWidget
protected javax.swing.ListSelectionModel selectionModel
| Constructor Detail |
public ListWidget(UiObject object,
int listSize,
double widthScale)
object - the corresponding UiObjectlistSize - the size of the displayed list element. If set to 0, the
displayed list size will be the same as the size of the domain
of the object. Finally, if the domain is not going to change
in size (and listSize is 0), then list will be rendered
without the scroll bars.
public ListWidget(UiObject object,
WidgetDescriptor wd,
WidgetFactory f)
| Method Detail |
public int getListLength()
public double getLengthScale(int maxLength)
public double getWidthScale()
public boolean isExactLength()
public WidgetProperties getWidgetProperties()
Widget
getWidgetProperties in interface WidgetgetWidgetProperties in class SimpleSwingWidgetprotected WidgetDescriptor generateWidgetDescriptor()
AbstractWidget
generateWidgetDescriptor in class AbstractWidgetpublic float getEffortEstimate(ActionDescription a)
SimpleWidget
getEffortEstimate in interface WidgetgetEffortEstimate in class SimpleWidgetpublic static boolean rendersObject(UiObject object)
public javax.swing.JComponent getSwingComponent(int hints)
hints - specifies the variant of the widget to be rendered
protected javax.swing.JComponent buildList()
protected void displayDetails()
protected java.awt.Dimension getPreferredSize()
protected javax.swing.event.ListSelectionListener getSelectionListener()
protected boolean isUpdating()
protected void setUpdating(boolean b)
protected void updateValue(int startIndex,
int endIndex)
startIndex - index of the first changed element in the listendIndex - index of the last changed element in the listprotected javax.swing.ListModel getListModel()
protected javax.swing.ListSelectionModel getListSelectionModel()
protected boolean isSelectedIndex(int row)
public void addSelection(int row)
public void removeSelection(int row)
protected void updateSelection()
protected void updateSelection(int startIndex,
int endIndex)
startIndex - endIndex - protected boolean isComponentReady()
protected void updateDetailsState(java.util.Collection curValues)
curValues - the current values held by the underlying variable
protected java.util.Vector getAddDiffs(java.util.Collection oldStuff,
java.util.Collection newStuff)
oldStuff - old listnewStuff - new list
protected java.util.Vector getDeleteDiffs(java.util.Collection oldStuff,
java.util.Collection newStuff)
oldStuff - old listnewStuff - new list
protected void addLegalValues(java.util.Vector diff,
java.util.Vector currentList)
diff - currentList - protected void deleteLegalValues(java.util.Vector diff)
diff - protected void legalValuesChanged(java.beans.PropertyChangeEvent evt)
legalValuesChanged in class AbstractWidgetevt - property change event with detailsprotected void valueChanged(java.beans.PropertyChangeEvent evt)
AbstractWidget
valueChanged in class AbstractWidgetevt - property change event with detailspublic java.lang.String toString()
toString in class AbstractWidgetpublic void disengage()
Widget
disengage in interface Widgetdisengage in class AbstractWidgetpublic void engage()
Widget
engage in interface Widgetengage in class SimpleSwingWidgetpublic void setEnabled(boolean enabled)
Widget
setEnabled in interface WidgetsetEnabled in class AbstractWidgetenabled - indicates if the underlying object is active
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||