UC Berkeley Group for User Interface Research
Updated November 17, 2000

edu.berkeley.guir.lib.gesture
Class GestureCategoryDisplay

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--edu.berkeley.guir.lib.gesture.util.FlowScrollPanel
                                |
                                +--edu.berkeley.guir.lib.gesture.GestureCategoryDisplay
All Implemented Interfaces:
Accessible, ImageObserver, ItemSelectable, MenuContainer, Observer, Scrollable, Serializable

public class GestureCategoryDisplay
extends FlowScrollPanel
implements Observer, ItemSelectable

Displays the elements (i.e. example Gestures) of a GestureCategory. Emits an ItemEvent when one is (de)selected.

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Inner classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
Component.AccessibleAWTComponent
 
Field Summary
protected  EventListenerList itemListenerList
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
GestureCategoryDisplay()
           
GestureCategoryDisplay(GestureCategory gc)
           
GestureCategoryDisplay(GestureCategory gc, boolean showAuthor)
           
 
Method Summary
 GestureDisplay addGesture(Gesture gesture)
          Causes the entire frame to be repacked to make sure that the new GestureDisplay is properly drawn.
 void addItemListener(ItemListener l)
           
protected  void fireItemChange(int type, Gesture item, int selectState)
           
 GestureCategory getGestureCategory()
           
 Object[] getSelectedObjects()
          Returns currently selected Gestures (or null if none).
 Gesture getSelection()
          Returns currently selected Gesture (or null if none).
 GestureDisplay getSelectionDisplay()
          Returns GestureDisplay associated with current selection (or null if none).
protected  void initUI()
          one-time setup when the widget is made
 boolean isOpaque()
           
 boolean isOptimizedDrawingEnabled()
          This component does tile its children
 void narrow(Vector gestures, String reason)
          Narrows to the specified gestures (which should be a Vector of Gesture).
 void rebuildUI()
          If the gesturecategory changes, need to change the gestures that are displayed.
 void removeItemListener(ItemListener l)
           
 void setAuthorVisible(boolean on)
           
 void setGestureCategory(GestureCategory gc)
           
 void update(Observable o, Object arg)
           
 
Methods inherited from class edu.berkeley.guir.lib.gesture.util.FlowScrollPanel
getPreferredScrollableViewportSize, getPreferredSize, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, main, setLayout, setScroller
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, paramString, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

itemListenerList

protected EventListenerList itemListenerList
Constructor Detail

GestureCategoryDisplay

public GestureCategoryDisplay()

GestureCategoryDisplay

public GestureCategoryDisplay(GestureCategory gc)

GestureCategoryDisplay

public GestureCategoryDisplay(GestureCategory gc,
                              boolean showAuthor)
Method Detail

setGestureCategory

public void setGestureCategory(GestureCategory gc)

getGestureCategory

public GestureCategory getGestureCategory()

update

public void update(Observable o,
                   Object arg)
Specified by:
update in interface Observer

addGesture

public GestureDisplay addGesture(Gesture gesture)
Causes the entire frame to be repacked to make sure that the new GestureDisplay is properly drawn. This seems wasteful, but nothing else worked.

initUI

protected void initUI()
one-time setup when the widget is made

rebuildUI

public void rebuildUI()
If the gesturecategory changes, need to change the gestures that are displayed.

isOpaque

public boolean isOpaque()
Overrides:
isOpaque in class JComponent

getSelectionDisplay

public GestureDisplay getSelectionDisplay()
Returns GestureDisplay associated with current selection (or null if none).

getSelection

public Gesture getSelection()
Returns currently selected Gesture (or null if none).

getSelectedObjects

public Object[] getSelectedObjects()
Returns currently selected Gestures (or null if none). For now this will always be an array of 1 Gesture.
Specified by:
getSelectedObjects in interface ItemSelectable

isOptimizedDrawingEnabled

public boolean isOptimizedDrawingEnabled()
This component does tile its children
Overrides:
isOptimizedDrawingEnabled in class JComponent

narrow

public void narrow(Vector gestures,
                   String reason)
Narrows to the specified gestures (which should be a Vector of Gesture). The reason is for inclusion in the frame title.

addItemListener

public void addItemListener(ItemListener l)
Specified by:
addItemListener in interface ItemSelectable

removeItemListener

public void removeItemListener(ItemListener l)
Specified by:
removeItemListener in interface ItemSelectable

fireItemChange

protected void fireItemChange(int type,
                              Gesture item,
                              int selectState)

setAuthorVisible

public void setAuthorVisible(boolean on)

Copyright Information