/*
 * @(#)DropdownView.java    2.3.3   29 November 2004
 *
 * Copyright 2004
 * College of Computer and Information Science
 * Northeastern University
 * Boston, MA  02115
 *
 * The Java Power Tools software may be used for educational
 * purposes as long as this copyright notice is retained intact
 * at the top of all source files.
 *
 * To discuss possible commercial use of this software, 
 * contact Richard Rasala at Northeastern University, 
 * College of Computer and Information Science,
 * 617-373-2462 or rasala@ccs.neu.edu.
 *
 * The Java Power Tools software has been designed and built
 * in collaboration with Viera Proulx and Jeff Raab.
 *
 * Should this software be modified, the words "Modified from 
 * Original" must be included as a comment below this notice.
 *
 * All publication rights are retained.  This software or its 
 * documentation may not be published in any media either
 * in whole or in part without explicit permission.
 *
 * This software was created with support from Northeastern 
 * University and from NSF grant DUE-9950829.
 */

package edu.neu.ccs.gui;

import edu.neu.ccs.*;
import edu.neu.ccs.util.*;
import edu.neu.ccs.filter.*;

import java.awt.*;
import java.math.*;
import java.text.*;
import java.util.*;
import javax.swing.*;

/**
 * <p>A <code>{@link GeneralView GeneralView}</code> 
 * for the selection of one of various provided
 * <code>{@link String String}</code> items
 * or, if editable, a choice entered by the user.</p>
 *
 * @author  Richard Rasala
 * @author  Jeff Raab
 * @version 2.3.3
 * @since   1.0
 */
public class DropdownView extends Dropdown 
    implements GeneralView 
{
    /** The GeneralViewSupport object. */
    protected GeneralViewSupport delegate = null;
    
    
    //////////////////
    // Constructors //
    //////////////////
    
    /**
     * <p>Constructs a view with no initial items.</p>
     *
     * <p>Other constructors:</p>
     *
     * <ul><code>
     *   <li>DropdownView(int)</li>
     *   <li>DropdownView(Font)</li>
     *   <li>DropdownView(Font, int)</li>
     *   <li>DropdownView(String[])</li>
     *   <li>DropdownView(String[], int)</li>
     *   <li>DropdownView(String[], Font)</li>
     *   <li>DropdownView(String[], Font, int)</li>
     *   <li>DropdownView(String[], String)</li>
     *   <li>DropdownView(String[], String, int)</li>
     *   <li>DropdownView(String[], String, Font)</li>
     *   <li>DropdownView(String[], String, Font, int)</li>
     *   <li>DropdownView(String[], String, boolean)</li>
     *   <li>DropdownView(String[], String, int, boolean)</li>
     *   <li>DropdownView(String[], String, Font, boolean)</li>
     *   <li>DropdownView(String[], String, Font, int, boolean)</li>
     *   <li>DropdownView(String[], String, boolean, Class)</li>
     *   <li>DropdownView(String[], String, int, boolean, Class)</li>
     *   <li>DropdownView(String[], String, Font, boolean, Class)</li>
     *   <li>DropdownView(String[], String, Font, int, boolean, Class)</li>
     *   <li>DropdownView(String[], String, boolean, Class, StringableFilter)</li>
     *   <li>DropdownView(String[], String, int, boolean, Class, StringableFilter)</li>
     *   <li>DropdownView(String[], String, Font, boolean, Class, StringableFilter)</li>
     *   <li>DropdownView(String[], String, Font, int, boolean, Class, StringableFilter)</li>
     * </code></ul>
     */
    public DropdownView() {
        initializeDropdownView(null, DEFAULT_SELECTION, null, 0, false, null, null);
    }
    
    
    /**
     * Constructs a view with no initial items and the given minimum width.
     *
     * @param minWidth the preferred minimum width
     * @see   #DropdownView()
     */
    public DropdownView(int minWidth) {
        initializeDropdownView(null, DEFAULT_SELECTION, null, minWidth, false, null, null);
    }
    
    
    /**
     * Constructs a view with no initial items and the given font.
     *
     * @param font the font for the view
     * @see   #DropdownView()
     */
    public DropdownView(Font font) {
        initializeDropdownView(null, DEFAULT_SELECTION, font, 0, false, null, null);
    }
    
    
    /**
     * Constructs a view with no initial items, the given font, and the
     * given minimum width.
     *
     * @param font the font for the view
     * @param minWidth the preferred minimum width
     * @see   #DropdownView()
     */
    public DropdownView(Font font, int minWidth) {
        initializeDropdownView(null, DEFAULT_SELECTION, font, minWidth, false, null, null);
    }
    
    
    /**
     * <p>Constructs a view with the given array of items,
     * for which the first item is selected by default.</p>
     *
     * <p>If the given array of items is <code>null</code>,
     * no items are initially added to the view.</p>
     *
     * @param items the array of dropdown items
     * @see   #DropdownView()
     */
    public DropdownView(String[] items) {
        initializeDropdownView(items, DEFAULT_SELECTION, null, 0, false, null, null);
    }
    
    
    /**
     * <p>Constructs a view with the given array of items,
     * for which the first item is selected by default
     * and with the given minimum width.</p>
     *
     * <p>If the given array of items is <code>null</code>,
     * no items are initially added to the view.</p>
     *
     * @param items    the array of dropdown items
     * @param minWidth the preferred minimum width
     * @see   #DropdownView()
     */
    public DropdownView(String[] items, int minWidth) {
        initializeDropdownView(items, DEFAULT_SELECTION, null, minWidth, false, null, null);
    }
    
    
    /**
     * <p>Constructs a view with the given array of items,
     * for which the first item is selected by default
     * and with the given font.</p>
     *
     * <p>If the given array of items is <code>null</code>,
     * no items are initially added to the view.</p>
     *
     * @param items the array of dropdown items
     * @param font  the font for the view
     * @see   #DropdownView()
     */
    public DropdownView(String[] items, Font font) {
        initializeDropdownView(items, DEFAULT_SELECTION, font, 0, false, null, null);
    }
    
    
    /**
     * <p>Constructs a view with the given array of items,
     * for which the first item is selected by default
     * and with the given font and minimum width.</p>
     *
     * <p>If the given array of items is <code>null</code>,
     * no items are initially added to the view.</p>
     *
     * @param items    the array of dropdown items
     * @param font     the font for the view
     * @param minWidth the preferred minimum width
     * @see   #DropdownView()
     */
    public DropdownView(String[] items, Font font, int minWidth) {
        initializeDropdownView(items, DEFAULT_SELECTION, font, minWidth, false, null, null);
    }
    
    
    /**
     * <p>Constructs a view with the given array of items, 
     * for which the given selection is selected by default.</p>
     *
     * <p>If the given array of items is <code>null</code>,
     * no items are initially added to the view.</p>
     *
     * <p>If the view is not editable and the selection is
     * not in the array of items then the selection will
     * set the default state but will not be displayed.</p>
     *
     * @param items     the array of dropdown items
     * @param selection the default initial choice
     * @see   #DropdownView()
     */
    public DropdownView(String[] items, String selection) {
        initializeDropdownView(items, selection, null, 0, false, null, null);
    }
    
    
    
    /**
     * <p>Constructs a view with the given array of items, 
     * for which the given selection is selected by default,
     * and with the given minimum width.</p>
     *
     * <p>If the given array of items is <code>null</code>,
     * no items are initially added to the view.</p>
     *
     * <p>If the view is not editable and the selection is
     * not in the array of items then the selection will
     * set the default state but will not be displayed.</p>
     *
     * @param items     the array of dropdown items
     * @param selection the default initial choice
     * @param minWidth  the preferred minimum width
     * @see   #DropdownView()
     */
    public DropdownView(String[] items, String selection, int minWidth) {
        initializeDropdownView(items, selection, null, minWidth, false, null, null);
    }
    
    
    /**
     * <p>Constructs a view with the given array of items, 
     * for which the given selection is selected by default
     * and with the given font.</p>
     *
     * <p>If the given array of items is <code>null</code>,
     * no items are initially added to the view.</p>
     *
     * <p>If the view is not editable and the selection is
     * not in the array of items then the selection will
     * set the default state but will not be displayed.</p>
     *
     * @param items     the array of dropdown items
     * @param selection the default initial choice
     * @param font      the font for the view
     * @see   #DropdownView()
     */
    public DropdownView(String[] items, String selection, Font font) {
        initializeDropdownView(items, selection, font, 0, false, null, null);
    }
    
    
    
    /**
     * <p>Constructs a view with the given array of items, 
     * for which the given selection is selected by default,
     * and with the given font and minimum width.</p>
     *
     * <p>If the given array of items is <code>null</code>,
     * no items are initially added to the view.</p>
     *
     * <p>If the view is not editable and the selection is
     * not in the array of items then the selection will
     * set the default state but will not be displayed.</p>
     *
     * @param items     the array of dropdown items
     * @param selection the default initial choice
     * @param font      the font for the view
     * @param minWidth  the preferred minimum width
     * @see   #DropdownView()
     */
    public DropdownView(String[] items, String selection, Font font, int minWidth) {
        initializeDropdownView(items, selection, font, minWidth, false, null, null);
    }
    
    
    /**
     * <p>Constructs a view with the given array of items, 
     * for which the given selection is selected by default,
     * and with the given editable state.</p>
     *
     * <p>If the given array of items is <code>null</code>,
     * no items are initially added to the view.</p>
     *
     * <p>If the view is not editable and the selection is
     * not in the array of items then the selection will
     * set the default state but will not be displayed.</p>
     *
     * @param items     the array of dropdown items
     * @param selection the label for the initial default choice
     * @param editable  whether or not the view is user editable
     * @see   #DropdownView()
     */
    public DropdownView(
        String[] items,
        String   selection,
        boolean  editable )
    {
        initializeDropdownView(items, selection, null, 0, editable, null, null);
    }
    
    
    /**
     * <p>Constructs a view with the given array of items, 
     * for which the given selection is selected by default,
     * and with the given width and editable state.</p>
     *
     * <p>If the given array of items is <code>null</code>,
     * no items are initially added to the view.</p>
     *
     * <p>If the view is not editable and the selection is
     * not in the array of items then the selection will
     * set the default state but will not be displayed.</p>
     *
     * @param items     the array of dropdown items
     * @param selection the label for the initial default choice
     * @param minWidth  the preferred minimum width
     * @param editable  whether or not the view is user editable
     * @see   #DropdownView()
     */
    public DropdownView(
        String[] items,
        String   selection,
        int      minWidth,
        boolean  editable )
    {
        initializeDropdownView(items, selection, null, minWidth, editable, null, null);
    }
    
    
    /**
     * <p>Constructs a view with the given array of items, 
     * for which the given selection is selected by default,
     * and with the given font and editable state.</p>
     *
     * <p>If the given array of items is <code>null</code>,
     * no items are initially added to the view.</p>
     *
     * <p>If the view is not editable and the selection is
     * not in the array of items then the selection will
     * set the default state but will not be displayed.</p>
     *
     * @param items     the array of dropdown items
     * @param selection the label for the initial default choice
     * @param font      the font for the view
     * @param editable  whether or not the view is user editable
     * @see   #DropdownView()
     */
    public DropdownView(
        String[] items,
        String   selection,
        Font     font,
        boolean  editable )
    {
        initializeDropdownView(items, selection, font, 0, editable, null, null);
    }
    
    
    /**
     * <p>Constructs a view with the given array of items, 
     * for which the given selection is selected by default,
     * and with the given font, width, and editable state.</p>
     *
     * <p>If the given array of items is <code>null</code>,
     * no items are initially added to the view.</p>
     *
     * <p>If the view is not editable and the selection is
     * not in the array of items then the selection will
     * set the default state but will not be displayed.</p>
     *
     * @param items     the array of dropdown items
     * @param selection the label for the initial default choice
     * @param font      the font for the view
     * @param minWidth  the preferred minimum width
     * @param editable  whether or not the view is user editable
     * @see   #DropdownView()
     */
    public DropdownView(
        String[] items,
        String   selection,
        Font     font,
        int      minWidth,
        boolean  editable )
    {
        initializeDropdownView(items, selection, font, minWidth, editable, null, null);
    }
    
    
    /**
     * <p>Constructs a view with the given array of items, 
     * for which the given selection is selected by default,
     * with the given editable state,
     * and the <code>Stringable</code> data type for the
     * <code>TypedView</code> data type.</p>
     *
     * <p>If the given array of items is <code>null</code>,
     * no items are initially added to the view.</p>
     *
     * <p>If the view is not editable and the selection is
     * not in the array of items then the selection will
     * set the default state but will not be displayed.</p>
     *
     * <p>The data type must be <code>Stringable</code> or
     * <code>null</code>.  If <code>null</code> then the
     * data type is set to <code>XString.class</code>.
     *
     * @param items     the array of dropdown items
     * @param selection the label for the initial default choice
     * @param editable  whether or not the view is user editable
     * @param dataType  the <code>Stringable</code> model type for this view
     * @throws Error if the given data type is not assignable from
     *         the Stringable reference type or null
     * @see   #DropdownView()
     */
    public DropdownView(
        String[] items,
        String   selection,
        boolean  editable,
        Class    dataType )
    {
        initializeDropdownView(items, selection, null, 0, editable, dataType, null);
    }
    
    
    /**
     * <p>Constructs a view with the given array of items, 
     * for which the given selection is selected by default,
     * with the given minimum width and editable state,
     * and the <code>Stringable</code> data type for the
     * <code>TypedView</code> data type.</p>
     *
     * <p>If the given array of items is <code>null</code>,
     * no items are initially added to the view.</p>
     *
     * <p>If the view is not editable and the selection is
     * not in the array of items then the selection will
     * set the default state but will not be displayed.</p>
     *
     * <p>The data type must be <code>Stringable</code> or
     * <code>null</code>.  If <code>null</code> then the
     * data type is set to <code>XString.class</code>.
     *
     * @param items     the array of dropdown items
     * @param selection the label for the initial default choice
     * @param minWidth  the preferred minimum width
     * @param editable  whether or not the view is user editable
     * @param dataType  the <code>Stringable</code> model type for this view
     * @throws Error if the given data type is not assignable from
     *         the Stringable reference type or null
     * @see   #DropdownView()
     */
    public DropdownView(
        String[] items,
        String   selection,
        int      minWidth,
        boolean  editable,
        Class    dataType )
    {
        initializeDropdownView(items, selection, null, minWidth, editable, dataType, null);
    }
    
    
    /**
     * <p>Constructs a view with the given array of items, 
     * for which the given selection is selected by default,
     * with the given font and editable state,
     * and the <code>Stringable</code> data type for the
     * <code>TypedView</code> data type.</p>
     *
     * <p>If the given array of items is <code>null</code>,
     * no items are initially added to the view.</p>
     *
     * <p>If the view is not editable and the selection is
     * not in the array of items then the selection will
     * set the default state but will not be displayed.</p>
     *
     * <p>The data type must be <code>Stringable</code> or
     * <code>null</code>.  If <code>null</code> then the
     * data type is set to <code>XString.class</code>.
     *
     * @param items     the array of dropdown items
     * @param selection the label for the initial default choice
     * @param font      the font for the view
     * @param editable  whether or not the view is user editable
     * @param dataType  the <code>Stringable</code> model type for this view
     * @throws Error if the given data type is not assignable from
     *         the Stringable reference type or null
     * @see   #DropdownView()
     */
    public DropdownView(
        String[] items,
        String   selection,
        Font     font,
        boolean  editable,
        Class    dataType )
    {
        initializeDropdownView(items, selection, font, 0, editable, dataType, null);
    }
    
    
    /**
     * <p>Constructs a view with the given array of items, 
     * for which the given selection is selected by default,
     * with the given font, minimum width, and editable state,
     * and the <code>Stringable</code> data type for the
     * <code>TypedView</code> data type.</p>
     *
     * <p>If the given array of items is <code>null</code>,
     * no items are initially added to the view.</p>
     *
     * <p>If the view is not editable and the selection is
     * not in the array of items then the selection will
     * set the default state but will not be displayed.</p>
     *
     * <p>The data type must be <code>Stringable</code> or
     * <code>null</code>.  If <code>null</code> then the
     * data type is set to <code>XString.class</code>.
     *
     * @param items     the array of dropdown items
     * @param selection the label for the initial default choice
     * @param font      the font for the view
     * @param minWidth  the preferred minimum width
     * @param editable  whether or not the view is user editable
     * @param dataType  the <code>Stringable</code> model type for this view
     * @throws Error if the given data type is not assignable from
     *         the Stringable reference type or null
     * @see   #DropdownView()
     */
    public DropdownView(
        String[] items,
        String   selection,
        Font     font,
        int      minWidth,
        boolean  editable,
        Class    dataType )
    {
        initializeDropdownView(items, selection, font, minWidth, editable, dataType, null);
    }
    
    
    /**
     * <p>Constructs a view with the given array of items, 
     * for which the given selection is selected by default,
     * with the given editable state,
     * and the <code>Stringable</code> data type for the
     * <code>TypedView</code> data type, and
     * the given <code>StringableFilter</code> that sets
     * the desired input filter.</p>
     *
     * <p>If the given array of items is <code>null</code>,
     * no items are initially added to the view.</p>
     *
     * <p>If the view is not editable and the selection is
     * not in the array of items then the selection will
     * set the default state but will not be displayed.</p>
     *
     * <p>The data type must be <code>Stringable</code> or
     * <code>null</code>.  If <code>null</code> then the
     * data type is set to <code>XString.class</code>.
     *
     * @param items     the array of dropdown items
     * @param selection the label for the initial default choice
     * @param editable  whether or not the view is user editable
     * @param dataType  the <code>Stringable</code> model type for this view
     * @param filter    the optional <code>StringableFilter</code> filter
     * @throws Error if the given data type is not assignable from
     *         the Stringable reference type or null
     * @see   #DropdownView()
     */
    public DropdownView(
        String[]         items,
        String           selection,
        boolean          editable,
        Class            dataType,
        StringableFilter filter  )
    {
        initializeDropdownView(items, selection, null, 0, editable, dataType, filter);
    }
    
    
    /**
     * <p>Constructs a view with the given array of items, 
     * for which the given selection is selected by default,
     * with the given minimum width and editable state,
     * and the <code>Stringable</code> data type for the
     * <code>TypedView</code> data type, and
     * the given <code>StringableFilter</code> that sets
     * the desired input filter.</p>
     *
     * <p>If the given array of items is <code>null</code>,
     * no items are initially added to the view.</p>
     *
     * <p>If the view is not editable and the selection is
     * not in the array of items then the selection will
     * set the default state but will not be displayed.</p>
     *
     * <p>The data type must be <code>Stringable</code> or
     * <code>null</code>.  If <code>null</code> then the
     * data type is set to <code>XString.class</code>.
     *
     * @param items     the array of dropdown items
     * @param selection the label for the initial default choice
     * @param minWidth  the preferred minimum width
     * @param editable  whether or not the view is user editable
     * @param dataType  the <code>Stringable</code> model type for this view
     * @param filter    the optional <code>StringableFilter</code> filter
     * @throws Error if the given data type is not assignable from
     *         the Stringable reference type or null
     * @see   #DropdownView()
     */
    public DropdownView(
        String[]         items,
        String           selection,
        int              minWidth,
        boolean          editable,
        Class            dataType,
        StringableFilter filter  )
    {
        initializeDropdownView(items, selection, null, minWidth, editable, dataType, filter);
    }
    
    
    /**
     * <p>Constructs a view with the given array of items, 
     * for which the given selection is selected by default,
     * with the given font and editable state,
     * and the <code>Stringable</code> data type for the
     * <code>TypedView</code> data type, and
     * the given <code>StringableFilter</code> that sets
     * the desired input filter.</p>
     *
     * <p>If the given array of items is <code>null</code>,
     * no items are initially added to the view.</p>
     *
     * <p>If the view is not editable and the selection is
     * not in the array of items then the selection will
     * set the default state but will not be displayed.</p>
     *
     * <p>The data type must be <code>Stringable</code> or
     * <code>null</code>.  If <code>null</code> then the
     * data type is set to <code>XString.class</code>.
     *
     * @param items     the array of dropdown items
     * @param selection the label for the initial default choice
     * @param font      the font for the view
     * @param editable  whether or not the view is user editable
     * @param dataType  the <code>Stringable</code> model type for this view
     * @param filter    the optional <code>StringableFilter</code> filter
     * @throws Error if the given data type is not assignable from
     *         the Stringable reference type or null
     * @see   #DropdownView()
     */
    public DropdownView(
        String[]         items,
        String           selection,
        Font             font,
        boolean          editable,
        Class            dataType,
        StringableFilter filter  )
    {
        initializeDropdownView(items, selection, font, 0, editable, dataType, filter);
    }
    
    
    /**
     * <p>Constructs a view with the given array of items, 
     * for which the given selection is selected by default,
     * with the given font, minimum width, and editable state,
     * and the <code>Stringable</code> data type for the
     * <code>TypedView</code> data type, and
     * the given <code>StringableFilter</code> that sets
     * the desired input filter.</p>
     *
     * <p>If the given array of items is <code>null</code>,
     * no items are initially added to the view.</p>
     *
     * <p>If the view is not editable and the selection is
     * not in the array of items then the selection will
     * set the default state but will not be displayed.</p>
     *
     * <p>The data type must be <code>Stringable</code> or
     * <code>null</code>.  If <code>null</code> then the
     * data type is set to <code>XString.class</code>.
     *
     * @param items     the array of dropdown items
     * @param selection the label for the initial default choice
     * @param font      the font for the view
     * @param minWidth  the preferred minimum width
     * @param editable  whether or not the view is user editable
     * @param dataType  the <code>Stringable</code> model type for this view
     * @param filter    the optional <code>StringableFilter</code> filter
     * @throws Error if the given data type is not assignable from
     *         the Stringable reference type or null
     * @see   #DropdownView()
     */
    public DropdownView(
        String[]         items,
        String           selection,
        Font             font,
        int              minWidth,
        boolean          editable,
        Class            dataType,
        StringableFilter filter  )
    {
        initializeDropdownView(items, selection, font, minWidth, editable, dataType, filter);
    }
    
    
    /**
     * The initializer.
     *
     * @param items     the array of dropdown items
     * @param selection the label for the initial default choice
     * @param font      the font for the view
     * @param minWidth  the preferred minimum width
     * @param editable  whether or not the view is user editable
     * @param dataType  the <code>Stringable</code> model type for this view
     * @param filter    the optional <code>StringableFilter</code> filter
     */
    protected void initializeDropdownView(
        String[]         items,
        String           selection,
        Font             font,
        int              minWidth,
        boolean          editable,
        Class            dataType,
        StringableFilter filter  )
    {
        delegate = new GeneralViewSupport(
            this,
            this.listenerList,
            null,
            null,
            null,
            null             );
        
        initializeDropdown(items, selection, font, minWidth, editable);
        
        setDataType(dataType);
        setFilter(filter);
    }
    
    
    ///////////////////////////////
    // GeneralView and TypedView //
    ///////////////////////////////
    
    /**
     * Returns a new dropdown view with the same item list, font, preferred
     * width, minimum width, data type, view state, default view state,
     * initial input properties, stringable filter, and editable state
     * as this dropdown view.
     *
     * @return a copy of this dropdown view
     */
    public GeneralView makeCopy() {
        DropdownView copy = new DropdownView();
        
        // copy font and geometry
        copy.setFont            (getFont());
        copy.setMinimumWidth    (getMinimumWidth());
        copy.setPreferredWidth  (getPreferredWidth());
        
        // copy data
        copy.addItems(getItems());
        
        // copy settings
        copy.setEditable        (isEditable());
        copy.setDataType        (getDataType());
        copy.setViewState       (getViewState());
        copy.setDefaultViewState(getDefaultViewState());
        copy.setInputProperties (new InputProperties(getInputProperties()));
        copy.setFilter          (getFilter());
        
        return copy;
    }
    
    
    public void setDataType(Class dataType) {
        delegate.setDataType(dataType);
    }
    
    
    public Class getDataType() {
        return delegate.getDataType();
    }
    
    
    public void setFilter(StringableFilter filter) {
        delegate.setFilter(filter);
    }
    
    
    public StringableFilter getFilter() {
        return delegate.getFilter();
    }
    
    
    public Stringable demandObject() {
        return delegate.demandObject();
    }
    
    
    public Stringable requestObject()
        throws CancelledException
    {
        return delegate.requestObject();
    }
    
    
    public Stringable demandObject(StringableFilter filter) {
        return delegate.demandObject(filter);
    }
    
    
    public Stringable requestObject(StringableFilter filter)
        throws CancelledException
    {
        return delegate.requestObject(filter);
    }
    
    
    public Stringable demandObject(Class dataType, StringableFilter filter) {
        return delegate.demandObject(dataType, filter);
    }
    
    
    public Stringable requestObject(Class dataType, StringableFilter filter)
        throws CancelledException
    {
        return delegate.requestObject(dataType, filter);
    }
    
    
    public void setInputProperties(InputProperties properties) {
        delegate.setInputProperties(properties);
    }
    
    
    public InputProperties getInputProperties() {
        return delegate.getInputProperties();
    }
    
    
    public void setErrorPromptTitleSuggestion(
        String errorPrompt,
        String dialogTitle,
        String suggestion )
    {
         delegate.setErrorPromptTitleSuggestion(errorPrompt, dialogTitle, suggestion );
    }
    
    
    /////////////
    // Fragile //
    /////////////
    
    public void addMalformedDataListener(MalformedDataListener l) {
        delegate.addMalformedDataListener(l);
    }
    
    
    public void removeMalformedDataListener(MalformedDataListener l) {
        delegate.removeMalformedDataListener(l);
    }
    
    
    /////////////////////////////////
    // Demand and request for byte //
    /////////////////////////////////
    
    /**
     * Returns a <CODE>byte</CODE> extracted from the field
     * using the mandatory model.
     *
     * @see #demandByte(StringableFilter)
     * @see #demandByteAsHex()
     * @see #demandByteAsHex(StringableFilter)
     * @see #requestByte()
     * @see #requestByte(StringableFilter)
     * @see #requestByteAsHex()
     * @see #requestByteAsHex(StringableFilter)
     */
    public byte demandByte() {
        return demandByte(null);
    }
    
    
    /**
     * Returns a <CODE>byte</CODE> extracted from the field
     * using the mandatory model with the given filter.
     *
     * @param f the filter to use for the input operation
     * @see #demandByte()
     * @see #demandByteAsHex()
     * @see #demandByteAsHex(StringableFilter)
     * @see #requestByte()
     * @see #requestByte(StringableFilter)
     * @see #requestByteAsHex()
     * @see #requestByteAsHex(StringableFilter)
     */
    public byte demandByte(StringableFilter f) {
        XByte object = (XByte) demandObject(XByte.class, f);
        
        return object.getValue();
    }
    
    
    /**
     * Returns a <CODE>byte</CODE> extracted from the field
     * as hexidecimal data
     * using the mandatory model.
     *
     * @see #demandByte()
     * @see #demandByte(StringableFilter)
     * @see #demandByteAsHex(StringableFilter)
     * @see #requestByte()
     * @see #requestByte(StringableFilter)
     * @see #requestByteAsHex()
     * @see #requestByteAsHex(StringableFilter)
     */
    public byte demandByteAsHex() {
        return demandByteAsHex(null);
    }
    
    
    /**
     * Returns a <CODE>byte</CODE> extracted from the field
     * as hexidecimal data
     * using the mandatory model with the given filter.
     *
     * @param f the filter to use for the input operation
     * @see #demandByte()
     * @see #demandByte(StringableFilter)
     * @see #demandByteAsHex()
     * @see #requestByte()
     * @see #requestByte(StringableFilter)
     * @see #requestByteAsHex()
     * @see #requestByteAsHex(StringableFilter)
     */
    public byte demandByteAsHex(StringableFilter f) {
        HexXByte object = (HexXByte) demandObject(HexXByte.class, f);
        
        return object.getValue();
    }
    
    
    /**
     * Returns a <CODE>byte</CODE> extracted from the field
     * using the optional model.
     *
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #demandByte()
     * @see #demandByte(StringableFilter)
     * @see #demandByteAsHex()
     * @see #demandByteAsHex(StringableFilter)
     * @see #requestByte(StringableFilter)
     * @see #requestByteAsHex()
     * @see #requestByteAsHex(StringableFilter)
     */
    public byte requestByte() throws CancelledException {
        return requestByte(null);
    }
    
    
    /**
     * Returns a <CODE>byte</CODE> extracted from the field
     * using the optional model with the given filter.
     *
     * @param f the filter to use for the input operation
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #demandByte()
     * @see #demandByte(StringableFilter)
     * @see #demandByteAsHex()
     * @see #demandByteAsHex(StringableFilter)
     * @see #requestByte()
     * @see #requestByteAsHex()
     * @see #requestByteAsHex(StringableFilter)
     */
    public byte requestByte(StringableFilter f) throws CancelledException {
        XByte object = (XByte) requestObject(XByte.class, f);
        
        return object.getValue();
    }
    
    
    /**
     * Returns a <CODE>byte</CODE> extracted from the field
     * as hexidecimal data
     * using the optional model.
     *
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #demandByte()
     * @see #demandByte(StringableFilter)
     * @see #demandByteAsHex()
     * @see #demandByteAsHex(StringableFilter)
     * @see #requestByte()
     * @see #requestByte(StringableFilter)
     * @see #requestByteAsHex(StringableFilter)
     */
    public byte requestByteAsHex() throws CancelledException {
        return requestByteAsHex(null);
    }
    
    
    /**
     * Returns a <CODE>byte</CODE> extracted from the field
     * as hexidecimal data
     * using the optional model with the given filter.
     *
     * @param f the filter to use for the input operation
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #demandByte()
     * @see #demandByte(StringableFilter)
     * @see #demandByteAsHex()
     * @see #demandByteAsHex(StringableFilter)
     * @see #requestByte()
     * @see #requestByte(StringableFilter)
     * @see #requestByteAsHex()
     */
    public byte requestByteAsHex(StringableFilter f) throws CancelledException {
        HexXByte object = (HexXByte) requestObject(HexXByte.class, f);
        
        return object.getValue();
    }
    
    
    //////////////////////////////////
    // Demand and request for short //
    //////////////////////////////////
    
    /**
     * Returns a <CODE>short</CODE> extracted from the field
     * using the mandatory model.
     *
     * @see #demandShort(StringableFilter)
     * @see #demandShortAsHex()
     * @see #demandShortAsHex(StringableFilter)
     * @see #requestShort()
     * @see #requestShort(StringableFilter)
     * @see #requestShortAsHex()
     * @see #requestShortAsHex(StringableFilter)
     */
    public short demandShort() {
        return demandShort(null);
    }
    
    
    /**
     * Returns a <CODE>short</CODE> extracted from the field
     * using the mandatory model with the given filter.
     *
     * @param f the filter to use for the input operation
     * @see #demandShort()
     * @see #demandShortAsHex()
     * @see #demandShortAsHex(StringableFilter)
     * @see #requestShort()
     * @see #requestShort(StringableFilter)
     * @see #requestShortAsHex()
     * @see #requestShortAsHex(StringableFilter)
     */
    public short demandShort(StringableFilter f) {
        XShort object = (XShort) demandObject(XShort.class, f);
        
        return object.getValue();
    }
    
    
    /**
     * Returns a <CODE>short</CODE> extracted from the field
     * as hexidecimal data
     * using the mandatory model.
     *
     * @see #demandShort()
     * @see #demandShort(StringableFilter)
     * @see #demandShortAsHex(StringableFilter)
     * @see #requestShort()
     * @see #requestShort(StringableFilter)
     * @see #requestShortAsHex()
     * @see #requestShortAsHex(StringableFilter)
     */
    public short demandShortAsHex() {
        return demandShortAsHex(null);
    }
    
    
    /**
     * Returns a <CODE>short</CODE> extracted from the field
     * as hexidecimal data
     * using the mandatory model with the given filter.
     *
     * @param f the filter to use for the input operation
     * @see #demandShort()
     * @see #demandShort(StringableFilter)
     * @see #demandShortAsHex()
     * @see #requestShort()
     * @see #requestShort(StringableFilter)
     * @see #requestShortAsHex()
     * @see #requestShortAsHex(StringableFilter)
     */
    public short demandShortAsHex(StringableFilter f) {
        HexXShort object = (HexXShort) demandObject(HexXShort.class, f);
        
        return object.getValue();
    }
    
    
    /**
     * Returns a <CODE>short</CODE> extracted from the field
     * using the optional model.
     *
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #demandShort()
     * @see #demandShort(StringableFilter)
     * @see #demandShortAsHex()
     * @see #demandShortAsHex(StringableFilter)
     * @see #requestShort(StringableFilter)
     * @see #requestShortAsHex()
     * @see #requestShortAsHex(StringableFilter)
     */
    public short requestShort() throws CancelledException {
        return requestShort(null);
    }
    
    
    /**
     * Returns a <CODE>short</CODE> extracted from the field
     * using the optional model with the given filter.
     *
     * @param f the filter to use for the input operation
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #demandShort()
     * @see #demandShort(StringableFilter)
     * @see #demandShortAsHex()
     * @see #demandShortAsHex(StringableFilter)
     * @see #requestShort()
     * @see #requestShortAsHex()
     * @see #requestShortAsHex(StringableFilter)
     */
    public short requestShort(StringableFilter f) throws CancelledException {
        XShort object = (XShort) requestObject(XShort.class, f);
        
        return object.getValue();
    }
    
    
    /**
     * Returns a <CODE>short</CODE> extracted from the field
     * as hexidecimal data
     * using the optional model.
     *
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #demandShort()
     * @see #demandShort(StringableFilter)
     * @see #demandShortAsHex()
     * @see #demandShortAsHex(StringableFilter)
     * @see #requestShort()
     * @see #requestShort(StringableFilter)
     * @see #requestShortAsHex(StringableFilter)
     */
    public short requestShortAsHex() throws CancelledException {
        return requestShortAsHex(null);
    }
    
    
    /**
     * Returns a <CODE>short</CODE> extracted from the field
     * as hexidecimal data
     * using the optional model with the given filter.
     *
     * @param f the filter to use for the input operation
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #demandShort()
     * @see #demandShort(StringableFilter)
     * @see #demandShortAsHex()
     * @see #demandShortAsHex(StringableFilter)
     * @see #requestShort()
     * @see #requestShort(StringableFilter)
     * @see #requestShortAsHex()
     */
    public short requestShortAsHex(StringableFilter f) throws CancelledException {
        HexXShort object = (HexXShort) requestObject(HexXShort.class, f);
        
        return object.getValue();
    }
    
    
    ////////////////////////////////
    // Demand and request for int //
    ////////////////////////////////
    
    /**
     * Returns an <CODE>int</CODE> extracted from the field
     * using the mandatory model.
     *
     * @see #demandInt(StringableFilter)
     * @see #demandIntAsHex()
     * @see #demandIntAsHex(StringableFilter)
     * @see #requestInt()
     * @see #requestInt(StringableFilter)
     * @see #requestIntAsHex()
     * @see #requestIntAsHex(StringableFilter)
     */
    public int demandInt() {
        return demandInt(null);
    }
    
    
    /**
     * Returns an <CODE>int</CODE> extracted from the field
     * using the mandatory model with the given filter.
     *
     * @param f the filter to use for the input operation
     * @see #demandInt()
     * @see #demandIntAsHex()
     * @see #demandIntAsHex(StringableFilter)
     * @see #requestInt()
     * @see #requestInt(StringableFilter)
     * @see #requestIntAsHex()
     * @see #requestIntAsHex(StringableFilter)
     */
    public int demandInt(StringableFilter f) {
        XInt object = (XInt) demandObject(XInt.class, f);
        
        return object.getValue();
    }
    
    
    /**
     * Returns an <CODE>int</CODE> extracted from the field
     * as hexidecimal data
     * using the mandatory model.
     *
     * @see #demandInt()
     * @see #demandInt(StringableFilter)
     * @see #demandIntAsHex(StringableFilter)
     * @see #requestInt()
     * @see #requestInt(StringableFilter)
     * @see #requestIntAsHex()
     * @see #requestIntAsHex(StringableFilter)
     */
    public int demandIntAsHex() {
        return demandIntAsHex(null);
    }
    
    
    /**
     * Returns an <CODE>int</CODE> extracted from the field
     * as hexidecimal data
     * using the mandatory model with the given filter.
     *
     * @param f the filter to use for the input operation
     * @see #demandInt()
     * @see #demandInt(StringableFilter)
     * @see #demandIntAsHex()
     * @see #requestInt()
     * @see #requestInt(StringableFilter)
     * @see #requestIntAsHex()
     * @see #requestIntAsHex(StringableFilter)
     */
    public int demandIntAsHex(StringableFilter f) {
        HexXInt object = (HexXInt) demandObject(HexXInt.class, f);
        
        return object.getValue();
    }
    
    
    /**
     * Returns an <CODE>int</CODE> extracted from the field
     * using the optional model.
     *
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #demandInt()
     * @see #demandInt(StringableFilter)
     * @see #demandIntAsHex()
     * @see #demandIntAsHex(StringableFilter)
     * @see #requestInt(StringableFilter)
     * @see #requestIntAsHex()
     * @see #requestIntAsHex(StringableFilter)
     */
    public int requestInt() throws CancelledException {
        return requestInt(null);
    }
    
    
    /**
     * Returns an <CODE>int</CODE> extracted from the field
     * using the optional model with the given filter.
     *
     * @param f the filter to use for the input operation
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #demandInt()
     * @see #demandInt(StringableFilter)
     * @see #demandIntAsHex()
     * @see #demandIntAsHex(StringableFilter)
     * @see #requestInt()
     * @see #requestIntAsHex()
     * @see #requestIntAsHex(StringableFilter)
     */
    public int requestInt(StringableFilter f) throws CancelledException {
        XInt object = (XInt) requestObject(XInt.class, f);
        
        return object.getValue();
    }
    
    
    /**
     * Returns an <CODE>int</CODE> extracted from the field
     * as hexidecimal data
     * using the optional model.
     *
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #demandInt()
     * @see #demandInt(StringableFilter)
     * @see #demandIntAsHex()
     * @see #demandIntAsHex(StringableFilter)
     * @see #requestInt()
     * @see #requestInt(StringableFilter)
     * @see #requestIntAsHex(StringableFilter)
     */
    public int requestIntAsHex() throws CancelledException {
        return requestIntAsHex(null);
    }
    
    
    /**
     * Returns an <CODE>int</CODE> extracted from the field
     * as hexidecimal data
     * using the optional model with the given filter.
     *
     * @param f the filter to use for the input operation
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #demandInt()
     * @see #demandInt(StringableFilter)
     * @see #demandIntAsHex()
     * @see #demandIntAsHex(StringableFilter)
     * @see #requestInt()
     * @see #requestInt(StringableFilter)
     * @see #requestIntAsHex()
     */
    public int requestIntAsHex(StringableFilter f) throws CancelledException {
        HexXInt object = (HexXInt) requestObject(HexXInt.class, f);
        
        return object.getValue();
    }
    
    
    /////////////////////////////////
    // Demand and request for long //
    /////////////////////////////////
    
    /**
     * Returns a <CODE>long</CODE> extracted from the field
     * using the mandatory model.
     *
     * @see #demandLong(StringableFilter)
     * @see #demandLongAsHex()
     * @see #demandLongAsHex(StringableFilter)
     * @see #requestLong()
     * @see #requestLong(StringableFilter)
     * @see #requestLongAsHex()
     * @see #requestLongAsHex(StringableFilter)
     */
    public long demandLong() {
        return demandLong(null);
    }
    
    
    /**
     * Returns a <CODE>long</CODE> extracted from the field
     * using the mandatory model with the given filter.
     *
     * @param f the filter to use for the input operation
     * @see #demandLong()
     * @see #demandLongAsHex()
     * @see #demandLongAsHex(StringableFilter)
     * @see #requestLong()
     * @see #requestLong(StringableFilter)
     * @see #requestLongAsHex()
     * @see #requestLongAsHex(StringableFilter)
     */
    public long demandLong(StringableFilter f) {
        XLong object = (XLong) demandObject(XLong.class, f);
        
        return object.getValue();
    }
    
    
    /**
     * Returns a <CODE>long</CODE> extracted from the field
     * as hexidecimal data
     * using the mandatory model.
     *
     * @see #demandLong()
     * @see #demandLong(StringableFilter)
     * @see #demandLongAsHex(StringableFilter)
     * @see #requestLong()
     * @see #requestLong(StringableFilter)
     * @see #requestLongAsHex()
     * @see #requestLongAsHex(StringableFilter)
     */
    public long demandLongAsHex() {
        return demandLongAsHex(null);
    }
    
    
    /**
     * Returns a <CODE>long</CODE> extracted from the field
     * as hexidecimal data
     * using the mandatory model with the given filter.
     *
     * @param f the filter to use for the input operation
     * @see #demandLong()
     * @see #demandLong(StringableFilter)
     * @see #demandLongAsHex()
     * @see #requestLong()
     * @see #requestLong(StringableFilter)
     * @see #requestLongAsHex()
     * @see #requestLongAsHex(StringableFilter)
     */
    public long demandLongAsHex(StringableFilter f) {
        HexXLong object = (HexXLong) demandObject(HexXLong.class, f);
        
        return object.getValue();
    }
    
    
    /**
     * Returns a <CODE>long</CODE> extracted from the field
     * using the optional model.
     *
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #demandLong()
     * @see #demandLong(StringableFilter)
     * @see #demandLongAsHex()
     * @see #demandLongAsHex(StringableFilter)
     * @see #requestLong(StringableFilter)
     * @see #requestLongAsHex()
     * @see #requestLongAsHex(StringableFilter)
     */
    public long requestLong() throws CancelledException {
        return requestLong(null);
    }
    
    
    /**
     * Returns a <CODE>long</CODE> extracted from the field
     * using the optional model with the given filter.
     *
     * @param f the filter to use for the input operation
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #demandLong()
     * @see #demandLong(StringableFilter)
     * @see #demandLongAsHex()
     * @see #demandLongAsHex(StringableFilter)
     * @see #requestLong()
     * @see #requestLongAsHex()
     * @see #requestLongAsHex(StringableFilter)
     */
    public long requestLong(StringableFilter f) throws CancelledException {
        XLong object = (XLong) requestObject(XLong.class, f);
        
        return object.getValue();
    }
    
    
    /**
     * Returns a <CODE>long</CODE> extracted from the field
     * as hexidecimal data
     * using the optional model.
     *
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #demandLong()
     * @see #demandLong(StringableFilter)
     * @see #demandLongAsHex()
     * @see #demandLongAsHex(StringableFilter)
     * @see #requestLong()
     * @see #requestLong(StringableFilter)
     * @see #requestLongAsHex(StringableFilter)
     */
    public long requestLongAsHex() throws CancelledException {
        return requestLongAsHex(null);
    }
    
    
    /**
     * Returns a <CODE>long</CODE> extracted from the field
     * as hexidecimal data
     * using the optional model with the given filter.
     *
     * @param f the filter to use for the input operation
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #demandLong()
     * @see #demandLong(StringableFilter)
     * @see #demandLongAsHex()
     * @see #demandLongAsHex(StringableFilter)
     * @see #requestLong()
     * @see #requestLong(StringableFilter)
     * @see #requestLongAsHex()
     */
    public long requestLongAsHex(StringableFilter f) throws CancelledException {
        HexXLong object = (HexXLong) requestObject(HexXLong.class, f);
        
        return object.getValue();
    }
    
    
    /////////////////////////////////
    // Demand and request for float //
    /////////////////////////////////
    
    /**
     * Returns a <CODE>float</CODE> extracted from the field
     * using the mandatory model.
     *
     * @see #demandFloat(StringableFilter)
     * @see #demandFloatAsHex()
     * @see #demandFloatAsHex(StringableFilter)
     * @see #requestFloat()
     * @see #requestFloat(StringableFilter)
     * @see #requestFloatAsHex()
     * @see #requestFloatAsHex(StringableFilter)
     */
    public float demandFloat() {
        return demandFloat(null);
    }
    
    
    /**
     * Returns a <CODE>float</CODE> extracted from the field
     * using the mandatory model with the given filter.
     *
     * @param f the filter to use for the input operation
     * @see #demandFloat()
     * @see #demandFloatAsHex()
     * @see #demandFloatAsHex(StringableFilter)
     * @see #requestFloat()
     * @see #requestFloat(StringableFilter)
     * @see #requestFloatAsHex()
     * @see #requestFloatAsHex(StringableFilter)
     */
    public float demandFloat(StringableFilter f) {
        XFloat object = (XFloat) demandObject(XFloat.class, f);
        
        return object.getValue();
    }
    
    
    /**
     * Returns a <CODE>float</CODE> extracted from the field
     * as hexidecimal data
     * using the mandatory model.
     *
     * @see #demandFloat()
     * @see #demandFloat(StringableFilter)
     * @see #demandFloatAsHex(StringableFilter)
     * @see #requestFloat()
     * @see #requestFloat(StringableFilter)
     * @see #requestFloatAsHex()
     * @see #requestFloatAsHex(StringableFilter)
     */
    public float demandFloatAsHex() {
        return demandFloatAsHex(null);
    }
    
    
    /**
     * Returns a <CODE>float</CODE> extracted from the field
     * as hexidecimal data
     * using the mandatory model with the given filter.
     *
     * @param f the filter to use for the input operation
     * @see #demandFloat()
     * @see #demandFloat(StringableFilter)
     * @see #demandFloatAsHex()
     * @see #requestFloat()
     * @see #requestFloat(StringableFilter)
     * @see #requestFloatAsHex()
     * @see #requestFloatAsHex(StringableFilter)
     */
    public float demandFloatAsHex(StringableFilter f) {
        HexXFloat object = (HexXFloat) demandObject(HexXFloat.class, f);
        
        return object.getValue();
    }
    
    
    /**
     * Returns a <CODE>float</CODE> extracted from the field
     * using the optional model.
     *
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #demandFloat()
     * @see #demandFloat(StringableFilter)
     * @see #demandFloatAsHex()
     * @see #demandFloatAsHex(StringableFilter)
     * @see #requestFloat(StringableFilter)
     * @see #requestFloatAsHex()
     * @see #requestFloatAsHex(StringableFilter)
     */
    public float requestFloat() throws CancelledException {
        return requestFloat(null);
    }
    
    
    /**
     * Returns a <CODE>float</CODE> extracted from the field
     * using the optional model with the given filter.
     *
     * @param f the filter to use for the input operation
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #demandFloat()
     * @see #demandFloat(StringableFilter)
     * @see #demandFloatAsHex()
     * @see #demandFloatAsHex(StringableFilter)
     * @see #requestFloat()
     * @see #requestFloatAsHex()
     * @see #requestFloatAsHex(StringableFilter)
     */
    public float requestFloat(StringableFilter f) throws CancelledException {
        XFloat object = (XFloat) requestObject(XFloat.class, f);
        
        return object.getValue();
    }
    
    
    /**
     * Returns a <CODE>float</CODE> extracted from the field
     * as hexidecimal data
     * using the optional model.
     *
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #demandFloat()
     * @see #demandFloat(StringableFilter)
     * @see #demandFloatAsHex()
     * @see #demandFloatAsHex(StringableFilter)
     * @see #requestFloat()
     * @see #requestFloat(StringableFilter)
     * @see #requestFloatAsHex(StringableFilter)
     */
    public float requestFloatAsHex() throws CancelledException {
        return requestFloatAsHex(null);
    }
    
    
    /**
     * Returns a <CODE>float</CODE> extracted from the field
     * as hexidecimal data
     * using the optional model with the given filter.
     *
     * @param f the filter to use for the input operation
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #demandFloat()
     * @see #demandFloat(StringableFilter)
     * @see #demandFloatAsHex()
     * @see #demandFloatAsHex(StringableFilter)
     * @see #requestFloat()
     * @see #requestFloat(StringableFilter)
     * @see #requestFloatAsHex()
     */
    public float requestFloatAsHex(StringableFilter f) throws CancelledException {
        HexXFloat object = (HexXFloat) requestObject(HexXFloat.class, f);
        
        return object.getValue();
    }
    
    
    /////////////////////////////////
    // Demand and request for double //
    /////////////////////////////////
    
    /**
     * Returns a <CODE>double</CODE> extracted from the field
     * using the mandatory model.
     *
     * @see #demandDouble(StringableFilter)
     * @see #demandDoubleAsHex()
     * @see #demandDoubleAsHex(StringableFilter)
     * @see #requestDouble()
     * @see #requestDouble(StringableFilter)
     * @see #requestDoubleAsHex()
     * @see #requestDoubleAsHex(StringableFilter)
     */
    public double demandDouble() {
        return demandDouble(null);
    }
    
    
    /**
     * Returns a <CODE>double</CODE> extracted from the field
     * using the mandatory model with the given filter.
     *
     * @param f the filter to use for the input operation
     * @see #demandDouble()
     * @see #demandDoubleAsHex()
     * @see #demandDoubleAsHex(StringableFilter)
     * @see #requestDouble()
     * @see #requestDouble(StringableFilter)
     * @see #requestDoubleAsHex()
     * @see #requestDoubleAsHex(StringableFilter)
     */
    public double demandDouble(StringableFilter f) {
        XDouble object = (XDouble) demandObject(XDouble.class, f);
        
        return object.getValue();
    }
    
    
    /**
     * Returns a <CODE>double</CODE> extracted from the field
     * as hexidecimal data
     * using the mandatory model.
     *
     * @see #demandDouble()
     * @see #demandDouble(StringableFilter)
     * @see #demandDoubleAsHex(StringableFilter)
     * @see #requestDouble()
     * @see #requestDouble(StringableFilter)
     * @see #requestDoubleAsHex()
     * @see #requestDoubleAsHex(StringableFilter)
     */
    public double demandDoubleAsHex() {
        return demandDoubleAsHex(null);
    }
    
    
    /**
     * Returns a <CODE>double</CODE> extracted from the field
     * as hexidecimal data
     * using the mandatory model with the given filter.
     *
     * @param f the filter to use for the input operation
     * @see #demandDouble()
     * @see #demandDouble(StringableFilter)
     * @see #demandDoubleAsHex()
     * @see #requestDouble()
     * @see #requestDouble(StringableFilter)
     * @see #requestDoubleAsHex()
     * @see #requestDoubleAsHex(StringableFilter)
     */
    public double demandDoubleAsHex(StringableFilter f) {
        HexXDouble object = (HexXDouble) demandObject(HexXDouble.class, f);
        
        return object.getValue();
    }
    
    
    /**
     * Returns a <CODE>double</CODE> extracted from the field
     * using the optional model.
     *
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #demandDouble()
     * @see #demandDouble(StringableFilter)
     * @see #demandDoubleAsHex()
     * @see #demandDoubleAsHex(StringableFilter)
     * @see #requestDouble(StringableFilter)
     * @see #requestDoubleAsHex()
     * @see #requestDoubleAsHex(StringableFilter)
     */
    public double requestDouble() throws CancelledException {
        return requestDouble(null);
    }
    
    
    /**
     * Returns a <CODE>double</CODE> extracted from the field
     * using the optional model with the given filter.
     *
     * @param f the filter to use for the input operation
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #demandDouble()
     * @see #demandDouble(StringableFilter)
     * @see #demandDoubleAsHex()
     * @see #demandDoubleAsHex(StringableFilter)
     * @see #requestDouble()
     * @see #requestDoubleAsHex()
     * @see #requestDoubleAsHex(StringableFilter)
     */
    public double requestDouble(StringableFilter f) throws CancelledException {
        XDouble object = (XDouble) requestObject(XDouble.class, f);
        
        return object.getValue();
    }
    
    
    /**
     * Returns a <CODE>double</CODE> extracted from the field
     * as hexidecimal data
     * using the optional model.
     *
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #demandDouble()
     * @see #demandDouble(StringableFilter)
     * @see #demandDoubleAsHex()
     * @see #demandDoubleAsHex(StringableFilter)
     * @see #requestDouble()
     * @see #requestDouble(StringableFilter)
     * @see #requestDoubleAsHex(StringableFilter)
     */
    public double requestDoubleAsHex() throws CancelledException {
        return requestDoubleAsHex(null);
    }
    
    
    /**
     * Returns a <CODE>double</CODE> extracted from the field
     * as hexidecimal data
     * using the optional model with the given filter.
     *
     * @param f the filter to use for the input operation
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #demandDouble()
     * @see #demandDouble(StringableFilter)
     * @see #demandDoubleAsHex()
     * @see #demandDoubleAsHex(StringableFilter)
     * @see #requestDouble()
     * @see #requestDouble(StringableFilter)
     * @see #requestDoubleAsHex()
     */
    public double requestDoubleAsHex(StringableFilter f) throws CancelledException {
        HexXDouble object = (HexXDouble) requestObject(HexXDouble.class, f);
        
        return object.getValue();
    }
    
    
    /////////////////////////////////
    // Demand and request for char //
    /////////////////////////////////
    
    /**
     * Returns a <code>char</code> extracted from the field
     * using the mandatory model.
     *
     * @see #demandChar(StringableFilter)
     * @see #requestChar()
     * @see #requestChar(StringableFilter)
     */
    public char demandChar() {
        return demandChar(null);
    }
    
    
    /**
     * Returns a <code>char</code> extracted from the field
     * using the mandatory model, with the given filter.
     *
     * @param f the filter to use for the input operation
     * @see #demandChar()
     * @see #requestChar(StringableFilter)
     * @see #requestChar()
     */
    public char demandChar(StringableFilter f) {
        XChar object = (XChar) demandObject(XChar.class, f);
        
        return object.getValue();
    }
    
    
    /**
     * Returns a <code>char</code> extracted from the field
     * using the optional model.
     *
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #requestChar(StringableFilter)
     * @see #demandChar()
     * @see #demandChar(StringableFilter)
     */
    public char requestChar() throws CancelledException {
        return requestChar(null);
    }
    
    
    /**
     * Returns a <code>char</code> extracted from the field
     * using the optional model, with the given filter.
     *
     * @param f the filter to use for the input operation
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #requestChar()
     * @see #demandChar(StringableFilter)
     * @see #demandChar()
     */
    public char requestChar(StringableFilter f) 
        throws CancelledException 
    {
        XChar object = (XChar) requestObject(XChar.class, f);
        
        return object.getValue();
    }
    
    
    ////////////////////////////////////
    // Demand and request for boolean //
    ////////////////////////////////////
    
    /**
     * Returns a <code>boolean</code> extracted from the field
     * using the mandatory model.
     *
     * @see #demandBoolean(StringableFilter)
     * @see #requestBoolean()
     * @see #requestBoolean(StringableFilter)
     */
    public boolean demandBoolean() {
        return demandBoolean(null);
    }
    
    
    /**
     * Returns a <code>boolean</code> extracted from the field
     * using the mandatory model, with the given filter.
     *
     * @param f the filter to use for the input operation
     * @see #demandBoolean()
     * @see #requestBoolean(StringableFilter)
     * @see #requestBoolean()
     */
    public boolean demandBoolean(StringableFilter f) {
        XBoolean object = (XBoolean) demandObject(XBoolean.class, f);
        
        return object.getValue();
    }
    
    
    /**
     * Returns a <code>boolean</code> extracted from the field
     * using the optional model.
     *
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #requestBoolean(StringableFilter)
     * @see #demandBoolean()
     * @see #demandBoolean(StringableFilter)
     */
    public boolean requestBoolean() throws CancelledException {
        return requestBoolean(null);
    }
    
    
    /**
     * Returns a <code>boolean</code> extracted from the field
     * using the optional model, with the given filter.
     *
     * @param f the filter to use for the input operation
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #requestBoolean()
     * @see #demandBoolean(StringableFilter)
     * @see #demandBoolean()
     */
    public boolean requestBoolean(StringableFilter f) 
        throws CancelledException 
    {
        XBoolean object = (XBoolean) requestObject(XBoolean.class, f);
        
        return object.getValue();
    }
    
    
    ///////////////////////////////////
    // Demand and request for String //
    ///////////////////////////////////
    
    /**
     * Returns a <code>String</code> extracted from the field
     * using the mandatory model.
     *
     * @see #demandString(StringableFilter)
     * @see #requestString()
     * @see #requestString(StringableFilter)
     */
    public String demandString() {
        return demandString(null);
    }
    
    
    /**
     * Returns a <code>String</code> extracted from the field
     * using the mandatory model, with the given filter.
     *
     * @param f the filter to use for the input operation
     * @see #demandString()
     * @see #requestString(StringableFilter)
     * @see #requestString()
     */
    public String demandString(StringableFilter f) {
        XString object = (XString) demandObject(XString.class, f);
        
        return object.getValue();
    }
    
    
    /**
     * Returns a <code>String</code> extracted from the field
     * using the optional model.
     *
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #requestString(StringableFilter)
     * @see #demandString()
     * @see #demandString(StringableFilter)
     */
    public String requestString() throws CancelledException {
        return requestString(null);
    }
    
    
    /**
     * Returns a <code>String</code> extracted from the field
     * using the optional model, with the given filter.
     *
     * @param f the filter to use for the input operation
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #requestString()
     * @see #demandString(StringableFilter)
     * @see #demandString()
     */
    public String requestString(StringableFilter f) 
        throws CancelledException 
    {
        XString object = (XString) requestObject(XString.class, f);
        
        return object.getValue();
    }
    
    
    //////////////////////////////////
    // Demand and request for Color //
    //////////////////////////////////
    
    /**
     * <p>Returns a <code>Color</code> extracted from the field
     * using the mandatory model.</p>
     *
     * <p>Although the <code>Color</code> input methods are
     * available in this view, it is recommended that the
     * class <code>ColorView</code> be used for color input.</p>
     *
     * @see #demandColor(StringableFilter)
     * @see #requestColor()
     * @see #requestColor(StringableFilter)
     */
    public Color demandColor() {
        return demandColor(null);
    }
    
    
    /**
     * <p>Returns a <code>Color</code> extracted from the field
     * using the mandatory model, with the given filter.</p>
     *
     * <p>Although the <code>Color</code> input methods are
     * available in this view, it is recommended that the
     * class <code>ColorView</code> be used for color input.</p>
     *
     * @param f the filter to use for the input operation
     * @see #demandColor()
     * @see #requestColor(StringableFilter)
     * @see #requestColor()
     */
    public Color demandColor(StringableFilter f) {
        XColor object = (XColor) demandObject(XColor.class, f);
        
        return object.getValue();
    }
    
    
    /**
     * <p>Returns a <code>Color</code> extracted from the field
     * using the optional model.</p>
     *
     * <p>Although the <code>Color</code> input methods are
     * available in this view, it is recommended that the
     * class <code>ColorView</code> be used for color input.</p>
     *
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #requestColor(StringableFilter)
     * @see #demandColor()
     * @see #demandColor(StringableFilter)
     */
    public Color requestColor() throws CancelledException {
        return requestColor(null);
    }
    
    
    /**
     * <p>Returns a <code>Color</code> extracted from the field
     * using the optional model, with the given filter.</p>
     *
     * <p>Although the <code>Color</code> input methods are
     * available in this view, it is recommended that the
     * class <code>ColorView</code> be used for color input.</p>
     *
     * @param f the filter to use for the input operation
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #requestColor()
     * @see #demandColor(StringableFilter)
     * @see #demandColor()
     */
    public Color requestColor(StringableFilter f) 
        throws CancelledException 
    {
        XColor object = (XColor) requestObject(XColor.class, f);
        
        return object.getValue();
    }
    
    
    ///////////////////////////////////////
    // Demand and request for BigInteger //
    ///////////////////////////////////////
    
    /**
     * Returns a <code>BigInteger</code> extracted from the field
     * using the mandatory model.
     *
     * @see #demandBigInteger(StringableFilter)
     * @see #requestBigInteger()
     * @see #requestBigInteger(StringableFilter)
     */
    public BigInteger demandBigInteger() {
        return demandBigInteger(null);
    }
    
    
    /**
     * Returns a <code>BigInteger</code> extracted from the field
     * using the mandatory model, with the given filter.
     *
     * @param f the filter to use for the input operation
     * @see #demandBigInteger()
     * @see #requestBigInteger(StringableFilter)
     * @see #requestBigInteger()
     */
    public BigInteger demandBigInteger(StringableFilter f) {
        XBigInteger object = (XBigInteger) demandObject(XBigInteger.class, f);
        
        return object.getValue();
    }
    
    
    /**
     * Returns a <code>BigInteger</code> extracted from the field
     * using the optional model.
     *
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #requestBigInteger(StringableFilter)
     * @see #demandBigInteger()
     * @see #demandBigInteger(StringableFilter)
     */
    public BigInteger requestBigInteger() 
        throws CancelledException 
    {
        return requestBigInteger(null);
    }
    
    
    /**
     * Returns a <code>BigInteger</code> extracted from the field
     * using the optional model, with the given filter.
     *
     * @param f the filter to use for the input operation
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #requestBigInteger()
     * @see #demandBigInteger(StringableFilter)
     * @see #demandBigInteger()
     */
    public BigInteger requestBigInteger(StringableFilter f) 
        throws CancelledException 
    {
        XBigInteger object = (XBigInteger) requestObject(XBigInteger.class, f);
        
        return object.getValue();
    }
    
    
    ///////////////////////////////////////
    // Demand and request for BigDecimal //
    ///////////////////////////////////////
    
    /**
     * Returns a <code>BigDecimal</code> extracted from the field
     * using the mandatory model.
     *
     * @see #demandBigDecimal(StringableFilter)
     * @see #requestBigDecimal()
     * @see #requestBigDecimal(StringableFilter)
     */
    public BigDecimal demandBigDecimal() {
        return demandBigDecimal(null);
    }
    
    
    /**
     * Returns a <code>BigDecimal</code> extracted from the field
     * using the mandatory model, with the given filter.
     *
     * @param f the filter to use for the input operation
     * @see #demandBigDecimal()
     * @see #requestBigDecimal(StringableFilter)
     * @see #requestBigDecimal()
     */
    public BigDecimal demandBigDecimal(StringableFilter f) {
        XBigDecimal object = (XBigDecimal) demandObject(XBigDecimal.class, f);
        
        return object.getValue();
    }
    
    
    /**
     * Returns a <code>BigDecimal</code> extracted from the field
     * using the optional model.
     *
     * @throws CancelledException
     *      if the user cancelled the input operation
     * @see #requestBigDecimal(StringableFilter)
     * @see #demandBigDecimal()
     * @see #demandBigDecimal(StringableFilter)
     */
    public BigDecimal requestBigDecimal() 
        throws CancelledException 
    {
        return requestBigDecimal(null);
    }
    
    
    /**
     * Returns a <code>BigDecimal</code> extracted from the field
     * using the optional model, with the given filter.
     *
     * @param f the filter to use for the input operation
     * @see #requestBigDecimal()
     * @see #demandBigDecimal(StringableFilter)
     * @see #demandBigDecimal()
     */
    public BigDecimal requestBigDecimal(StringableFilter f) 
        throws CancelledException 
    {
        XBigDecimal object = (XBigDecimal) requestObject(XBigDecimal.class, f);
        
        return object.getValue();
    }
    
}
