|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.tanager.ui.CButtonPane
public class CButtonPane
This class encapsulates the buttons in the Tanager UI. Up, Down, Left, Right, Middle, Menu, Stop, and Power are the only buttons at this time.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
javax.swing.JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
javax.swing.JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
private javax.swing.JButton |
downButton_
Represents the Down button. |
private javax.swing.JButton |
leftButton_
Represents the Left button. |
private javax.swing.JButton |
menuButton_
Represents the Menu button. |
private javax.swing.JButton |
middleButton_
Represents the Middle button. |
private javax.swing.JButton |
powerButton_
Represents the Power (On/Off) button. |
private javax.swing.JButton |
rightButton_
Represents the Right button. |
private static long |
serialVersionUID
Represents the universal version ID of this class. |
private javax.swing.JButton |
stopButton_
Represents the Stop button. |
private javax.swing.Icon |
stopIcon_
Represents the default icon for the Stop button. |
private javax.swing.JButton |
upButton_
Represents the Up button. |
| 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 | |
|---|---|
CButtonPane(IUIControllerCallback uiController,
java.awt.Color backgroundColor)
This is the only contructor allowed for a CButtonPane object. |
|
| Method Summary | |
|---|---|
void |
addButtonListener(IButtonHandler buttonHandler)
This method is used to add a listener to the various buttons. |
protected javax.swing.JPanel |
createLowerNavigationButtonPanel(java.awt.Color backgroundColor)
This method arranges the Down button in a new pane. |
protected javax.swing.JPanel |
createMiddleNavigationButtonPanel(java.awt.Color backgroundColor)
This method arranges the Left, Right, and Middle buttons in a new pane. |
protected javax.swing.JPanel |
createUpperNavigationButtonPanel(java.awt.Color backgroundColor)
This method arranges the Up button in a new pane. |
void |
redraw(javax.swing.Icon middleButtonIcon)
This method redraws the pane using the settings from our current state. |
void |
removeButtonListener(IButtonHandler buttonHandler)
This method is used to remove a listener from the various buttons. |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
Represents the universal version ID of this
class. This ID is recommended for all
classes that implement the
Serializable interface.
private javax.swing.JButton upButton_
Represents the Up button.
private javax.swing.JButton downButton_
Represents the Down button.
private javax.swing.JButton leftButton_
Represents the Left button.
private javax.swing.JButton middleButton_
Represents the Middle button.
private javax.swing.JButton rightButton_
Represents the Right button.
private javax.swing.JButton stopButton_
Represents the Stop button.
private javax.swing.JButton menuButton_
Represents the Menu button.
private javax.swing.JButton powerButton_
Represents the Power (On/Off) button.
private javax.swing.Icon stopIcon_
Represents the default icon for the Stop button.
| Constructor Detail |
|---|
public CButtonPane(IUIControllerCallback uiController,
java.awt.Color backgroundColor)
This is the only contructor allowed for a
CButtonPane object. It
initializes the pane's buttons and layout.
uiController - a reference to the a
class implementing the
IUIControllerCallback interfacebackgroundColor - the background color
for the controls on this pane| Method Detail |
|---|
public void addButtonListener(IButtonHandler buttonHandler)
This method is used to add a listener to the various buttons.
Semantics:supportsUpButton() method
returns true
addActionListener() method,
passing the given button handler's up
button callback supportsDownButton() method
returns true
addActionListener() method,
passing the given button handler's down
button callback supportsLeftButton() method
returns true
addActionListener() method,
passing the given button handler's left
button callback supportsMiddleButton()
method returns true
addActionListener() method,
passing the given button handler's middle
button callback supportsStopButton()
method returns true
addActionListener() method,
passing the given button handler's stop
button callback supportsMenuButton()
method returns true
addActionListener() method,
passing the given button handler's menu
button callback supportsPowerButton()
method returns true
addActionListener() method,
passing the given button handler's power
button callback
buttonHandler - the listener to add to
the buttonspublic void removeButtonListener(IButtonHandler buttonHandler)
This method is used to remove a listener from the various buttons.
Semantics:supportsUpButton() method
returns true
removeActionListener()
method, passing the given button handler's
up button callback supportsDownButton() method
returns true
removeActionListener()
method, passing the given button handler's
down button callback supportsLeftButton() method
returns true
removeActionListener()
method, passing the given button handler's
left button callback supportsMiddleButton()
method returns true
removeActionListener()
method, passing the given button handler's
middle button callback supportsStopButton()
method returns true
removeActionListener() method,
passing the given button handler's stop
button callback supportsMenuButton()
method returns true
removeActionListener() method,
passing the given button handler's menu
button callback supportsPowerButton()
method returns true
removeActionListener() method,
passing the given button handler's power
button callback
buttonHandler - the listener to add to
the buttonspublic void redraw(javax.swing.Icon middleButtonIcon)
This method redraws the pane using the settings from our current state.
Semantics:
middleButtonIcon - the icon to be
displayed on the middle buttonprotected javax.swing.JPanel createUpperNavigationButtonPanel(java.awt.Color backgroundColor)
This method arranges the Up button in a new pane.
backgroundColor -
protected javax.swing.JPanel createMiddleNavigationButtonPanel(java.awt.Color backgroundColor)
This method arranges the Left, Right, and Middle buttons in a new pane.
backgroundColor -
protected javax.swing.JPanel createLowerNavigationButtonPanel(java.awt.Color backgroundColor)
This method arranges the Down button in a new pane.
backgroundColor -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||