base
Class MenuField

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by base.JFixedPanel
                      extended by base.MenuField
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class MenuField
extends JFixedPanel

This class implements a single user interface element that can be selected by the user with the cursor up/down keys. Such a MenuField can contain a single line of text for functions, it can consist of combinations out of text lines and images for CD/DVD entries and others. So a MenuField is always used when there are horizontal lines of data where the user can choose from.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Component
Component.BaselineResizeBehavior
 
Field Summary
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, 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
MenuField(RecordInfo rInfo, int id, Color customColor)
          Constructor for a MenuField that displays information about a scheduled recording of the internal VCR functionality
MenuField(String text, int id, Color customColor, boolean hasSubEntries)
          Constructor for a MenuField that displays general information; this constructor is used e.g.
MenuField(String text, int id, String albumdir, boolean albumLevel, Color customColor)
          Constructor for a MenuField that display information about a CD
MenuField(String text, int id, String trackdir, Color customColor, boolean hasSubEntries)
          Constructor for a MenuField that display information about the contents of a CD
 
Method Summary
 CDInfo getCDInfo()
          Retrieves the CDInfo associated to a menu
 String getDir()
          Retrieves the path in filesystem to data related to this menu item
 int getID()
          Returns the unique identifier assigned to this menu item
 int getItemNum()
           
 MediaInfo getMediaInfo()
          Retrieves the MediaInfo associated to a menu
 RecordInfo getRecordInfo()
          Retrieves the RecordInfo associated to a menu
 String getText()
          Retrieves the text associated with a menu item.
 String getTitle()
          Deprecated. duplicate of getText()
 TrackInfo getTrackInfo()
          Retrieves the TrackInfo associated to a menu
 void setCDInfo(CDInfo copy)
          Deprecated. TODO: modify the CD-related constructors so that the CDInfo object can be set there directly This method can be used only for menu item types that display CD (album or track) data, it can be used to set a full CDInfo structure to the menu
 void setDir(String dir)
          Sets the full path to the directory where data related to the menu item are stored into
 void setItemNum(int itemNum)
           
 void setMediaInfo(MediaInfo copy)
          Deprecated. TODO: modify the Media-related constructors so that the MediaInfo object can be set there directly This method can be used only for menu item types that display media data, it can be used to set a full MediaInfo structure to the menu
 void setSelected(boolean selected)
          Sets the selection and highlighting-state of this menu field.
 void setTrackInfo(TrackInfo copy)
          Deprecated. TODO: modify the CD-related constructors so that the TrackInfo object can be set there directly This method can be used only for menu item types that display CD (album or track) data, it can be used to set a full TrackInfo structure to the menu
 
Methods inherited from class base.JFixedPanel
getMaximumSize, getMinimumSize, getPreferredSize, getSize
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, 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, 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, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MenuField

public MenuField(RecordInfo rInfo,
                 int id,
                 Color customColor)
Constructor for a MenuField that displays information about a scheduled recording of the internal VCR functionality

Parameters:
rInfo - object that contains the scheduled recording information to be displayed to the user
id - a unique identifier that can be used later to identify a selected MenuField
customColor - color that has to be used for the labels when a MenuField is higlighted, when null is set the default color for highlighted texts is used

MenuField

public MenuField(String text,
                 int id,
                 String albumdir,
                 boolean albumLevel,
                 Color customColor)
Constructor for a MenuField that display information about a CD

Parameters:
text - the name of the album the user
id - a unique identifier that can be used later to identify a selected MenuField
albumdir - the storage position of that album
albumLevel - currently unused, has to be removed
customColor - color that has to be used for the labels when a MenuField is higlighted, when null is set the default color for highlighted texts is used

MenuField

public MenuField(String text,
                 int id,
                 String trackdir,
                 Color customColor,
                 boolean hasSubEntries)
Constructor for a MenuField that display information about the contents of a CD

Parameters:
text - the name of the track the user
id - a unique identifier that can be used later to identify a selected MenuField
trackdir - the storage position of that track
customColor - color that has to be used for the labels when a MenuField is higlighted, when null is set the default color for highlighted texts is used
hasSubEntries - when this value is set to true a small arrow is displayed at the right side of the MenuField that informs the user about sub-entries that will open when this entry is selected (opening of these sub-entries has to be implemented by the main application)

MenuField

public MenuField(String text,
                 int id,
                 Color customColor,
                 boolean hasSubEntries)
Constructor for a MenuField that displays general information; this constructor is used e.g. for the top-level entries where the user can choose which part of the media center has to be used

Parameters:
text - the text for the menu the user
id - a unique identifier that can be used later to identify a selected MenuField
customColor - color that has to be used for the labels when a MenuField is higlighted, when null is set the default color for highlighted texts is used
hasSubEntries - when this value is set to true a small arrow is displayed at the right side of the MenuField that informs the user about sub-entries that will open when this entry is selected (opening of these sub-entries has to be implemented by the main application)
Method Detail

getRecordInfo

public RecordInfo getRecordInfo()
Retrieves the RecordInfo associated to a menu

Returns:
the RecordInfo object associated to this menu item or null in case it is not a menu that displays RecordInfo data

setItemNum

public void setItemNum(int itemNum)

getItemNum

public int getItemNum()

getTrackInfo

public TrackInfo getTrackInfo()
Retrieves the TrackInfo associated to a menu

Returns:
the TrackInfo object associated to this menu item or null in case it is not a menu that displays a CDs TrackInfo data

setCDInfo

public void setCDInfo(CDInfo copy)
Deprecated. TODO: modify the CD-related constructors so that the CDInfo object can be set there directly This method can be used only for menu item types that display CD (album or track) data, it can be used to set a full CDInfo structure to the menu

Parameters:
copy - the CDInfo object that has to be associated with this menu item

getCDInfo

public CDInfo getCDInfo()
Retrieves the CDInfo associated to a menu

Returns:
the CDInfo object associated to this menu item or null in case it is not a menu that displays CDInfo data

setTrackInfo

public void setTrackInfo(TrackInfo copy)
Deprecated. TODO: modify the CD-related constructors so that the TrackInfo object can be set there directly This method can be used only for menu item types that display CD (album or track) data, it can be used to set a full TrackInfo structure to the menu

Parameters:
copy - the TrackInfo object that has to be associated with this menu item

getMediaInfo

public MediaInfo getMediaInfo()
Retrieves the MediaInfo associated to a menu

Returns:
the MediaInfo object associated to this menu item or null in case it is not a menu that displays MediaInfo-related data

setMediaInfo

public void setMediaInfo(MediaInfo copy)
Deprecated. TODO: modify the Media-related constructors so that the MediaInfo object can be set there directly This method can be used only for menu item types that display media data, it can be used to set a full MediaInfo structure to the menu

Parameters:
copy - the MediaInfo object that has to be associated with this menu item

setDir

public void setDir(String dir)
Sets the full path to the directory where data related to the menu item are stored into

Parameters:
dir - the filesystem path to the storage location

getDir

public String getDir()
Retrieves the path in filesystem to data related to this menu item

Returns:
the path to the storage directory of the data or null in case this is not applicable for this menu item type

getID

public int getID()
Returns the unique identifier assigned to this menu item

Returns:
the id set during consturction of the object

getText

public String getText()
Retrieves the text associated with a menu item. This method is called by the main application whenever an entry is selected and higlighted. In this case the value returned here is sent to an optionally connected LCD so that the application could be used also without a TV connected.

Returns:
the text of this menu item

setSelected

public void setSelected(boolean selected)
Sets the selection and highlighting-state of this menu field.

Overrides:
setSelected in class JFixedPanel
Parameters:
selected - true when this item is selected and has to be highlighted, false otherwise

getTitle

public String getTitle()
Deprecated. duplicate of getText()