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
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 |
itemListenerList
protected EventListenerList itemListenerList
GestureCategoryDisplay
public GestureCategoryDisplay()
GestureCategoryDisplay
public GestureCategoryDisplay(GestureCategory gc)
GestureCategoryDisplay
public GestureCategoryDisplay(GestureCategory gc,
boolean showAuthor)
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)