lev.gui

## Class LUserSetting<T>

- java.lang.Object
- - java.awt.Component
  - - java.awt.Container
    - - lev.gui.LComponent
      - - lev.gui.LHelpComponent
        - - lev.gui.LUserSetting<T>

- Type Parameters:
    `T` -
  All Implemented Interfaces:
    java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
  Direct Known Subclasses:
    LCheckBox, LCheckBoxConfig, LColorSetting, LComboBox, LDoubleSetting, LDoubleSpinner, LNumericSetting, LSlider, LSpinner, LTextField

      public abstract class LUserSetting<T>
      extends LHelpComponent

  A GUI component that can be tied to a Setting in a SaveFile. This facilitates automatic updating of the savefile when the GUI updates.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `LUserSetting.UpdateCaretHandler` Handler that will update the savefile to the GUI's value
    `class` | `LUserSetting.UpdateChangeHandler` Handler that will update the savefile to the GUI's value
    `class` | `LUserSetting.UpdateHandler` Handler that will update the savefile to the GUI's value

    - ### Nested classes/interfaces inherited from class lev.gui.LHelpComponent

      `LHelpComponent.HelpActionHandler, LHelpComponent.HelpFocusHandler, LHelpComponent.HelpMouseHandler`

    - ### 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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected LLabel` | `titleLabel`

    - ### Fields inherited from class lev.gui.LHelpComponent

      `followPos, help, helpPrefix, helpYoffset, save, saveTie, title`

    - ### 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

    Constructors
    Constructor and Description
    `LUserSetting(java.lang.String text)` Creates a user setting component that doesn't use the label.
    `LUserSetting(java.lang.String text, java.awt.Font label, java.awt.Color shade)` Creates a user setting component that uses the label.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract void` | `addUpdateHandlers()` Abstract function that should add appropriate update handlers to the appropriate components.
    `abstract void` | `clearHighlight()` Abstract function that should clear any GUI components of their highlighted state.
    `java.lang.String` | `getName()`
    `abstract T` | `getValue()`
    `abstract void` | `highlightChanged()` Abstract function that should change some GUI component to symbolize it is highlighted.
    `java.lang.Boolean` | `isTied()`
    `abstract boolean` | `revertTo(java.util.Map<java.lang.Enum,Setting> m)` Reverts the GUI component to to SaveFile instance specified.
    `void` | `tie(java.lang.Enum setting, LSaveFile saveFile)` Ties this GUI component to a setting in a savefile.
    `void` | `tie(java.lang.Enum setting, LSaveFile saveFile, LHelpPanel help_, boolean hoverListener)` Ties this GUI component to a setting in a savefile.
    `void` | `update()` Updates the savefile to the GUI's value.

    - ### Methods inherited from class lev.gui.LHelpComponent

      `addHelpHandler, addHelpPrefix, getHelp, hasHelp, isFollowingPosition, linkTo, setFollowPosition, updateHelp`

    - ### Methods inherited from class lev.gui.LComponent

      `Add, centerIn, centerOn, centerOn, getBottom, getCenter, getRight, putUnder`

    - ### Methods inherited from class java.awt.Container

      `add, add, add, add, add, addContainerListener, addImpl, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, isValidateRoot, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, update, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### titleLabel

          protected LLabel titleLabel

  - ### Constructor Detail

    - #### LUserSetting

          public LUserSetting(java.lang.String text)

      Creates a user setting component that doesn't use the label.
      Parameters:
        `text` -

    - #### LUserSetting

          public LUserSetting(java.lang.String text,
                      java.awt.Font label,
                      java.awt.Color shade)

      Creates a user setting component that uses the label.
      Parameters:
        `text` -
        `label` -
        `shade` -

  - ### Method Detail

    - #### tie

          public void tie(java.lang.Enum setting,
                 LSaveFile saveFile,
                 LHelpPanel help_,
                 boolean hoverListener)

      Ties this GUI component to a setting in a savefile. Additionally, it links the GUI component to update a help panel when focused. Optionally it can update the help panel when hovered over too.
      Parameters:
        `setting` - Setting to tie to
        `saveFile` - SaveFile to tie to
        `help_` - HelpPanel to update
        `hoverListener` - Whether to update help panel on hover

    - #### tie

          public void tie(java.lang.Enum setting,
                 LSaveFile saveFile)

      Ties this GUI component to a setting in a savefile.
      Parameters:
        `setting` - Setting to tie to
        `saveFile` - SaveFile to tie to

    - #### addUpdateHandlers

          protected abstract void addUpdateHandlers()

      Abstract function that should add appropriate update handlers to the appropriate components.

    - #### revertTo

          public abstract boolean revertTo(java.util.Map<java.lang.Enum,Setting> m)

      Reverts the GUI component to to SaveFile instance specified.
      Parameters:
        `m` -
      Returns:

    - #### isTied

          public java.lang.Boolean isTied()

      Returns:

    - #### getValue

          public abstract T getValue()

      Returns:

    - #### update

          public void update()

      Updates the savefile to the GUI's value.

    - #### highlightChanged

          public abstract void highlightChanged()

      Abstract function that should change some GUI component to symbolize it is highlighted.

    - #### clearHighlight

          public abstract void clearHighlight()

      Abstract function that should clear any GUI components of their highlighted state.

    - #### getName

          public java.lang.String getName()

      Overrides:
        `getName` in class `java.awt.Component`