borland Packages  borland Class Hierarchy

Package borland.jbcl.model


About the model package

The model package contains data provider interfaces and classes for building model-view components.

The JBCL provides classes for four model types: singleton (single item), vector (list), matrix (table), and graph (tree). Its model-view architecture separates user-interface and background behavior from information about the data itself and screen rendering.

The JBCL has interfaces for each of these models. In every case, the interface named "Model", as in VectorModel, provides read-only access to the data. For each model, the JBCL also has a "WritableModel" interface that extends the read-only interface and adds write access to the data. For example, MatrixModel is an interface that provides read-only access to tabular data while WritableMatrixModel provides read-write access to that same type of data.

The model package also contains view manager interfaces and classes.

Visit the javabeans.writing newsgroup on the Borland Web page at news://forums.borland.com/borland.public.jbuilder.javabeans.writing. This newsgroup is dedicated to issues about writing JavaBeans in JBuilder and is actively monitored by our support engineers as well as the JBuilder Development team.

See also:


Interfaces

  • CustomPaintSite
  • GraphLocation
  • GraphModel
  • GraphModelListener
  • GraphSelection
  • GraphSelectionListener
  • GraphSubfocusListener
  • GraphViewManager
  • ItemEditMask
  • ItemEditMaskChar
  • ItemEditMaskRegionChar
  • ItemEditor
  • ItemEditSite
  • ItemPainter
  • ItemPaintSite
  • MatrixModel
  • MatrixModelListener
  • MatrixSelection
  • MatrixSelectionListener
  • MatrixSubfocusListener
  • MatrixViewManager
  • SingletonModel
  • SingletonModelListener
  • SingletonViewManager
  • ToggleItemEditor
  • VectorModel
  • VectorModelListener
  • VectorSelection
  • VectorSelectionListener
  • VectorSubfocusListener
  • VectorViewManager
  • WritableGraphModel
  • WritableGraphSelection
  • WritableMatrixModel
  • WritableMatrixSelection
  • WritableSingletonModel
  • WritableVectorModel
  • WritableVectorSelection
  • Classes and Components

  • BasicGraphSelection
  • BasicMatrixContainer
  • BasicMatrixSelection
  • BasicSelection
  • BasicSingletonContainer
  • BasicTreeContainer
  • BasicVectorContainer
  • BasicVectorSelection
  • BasicViewManager
  • BigDecimalFormatter
  • BinaryFormatter
  • BooleanFormatter
  • ByteFormatter
  • ColumnMatrixSelection
  • CrossMatrixSelection
  • DateFormatter
  • DoubleFormatter
  • GraphModelAdapter
  • GraphModelEvent
  • GraphModelMulticaster
  • GraphModelSearch
  • GraphSelectionAdapter
  • GraphSelectionEvent
  • GraphSelectionMulticaster
  • GraphSubfocusAdapter
  • GraphSubfocusEvent
  • IntegerFormatter
  • ItemEditMaskRegion
  • ItemEditMaskState
  • ItemEditMaskStr
  • ItemFormatStr
  • ItemFormatter
  • LinkedTreeContainer
  • LinkedTreeIterator
  • LinkedTreeNode
  • LongFormatter
  • MatrixLocation
  • MatrixModelAdapter
  • MatrixModelEvent
  • MatrixModelMulticaster
  • MatrixSelectionAdapter
  • MatrixSelectionEvent
  • MatrixSelectionMulticaster
  • MatrixSubfocusAdapter
  • MatrixSubfocusEvent
  • ModelEvent
  • MultiColumnMatrixSelection
  • MultiRowMatrixSelection
  • NullGraphSelection
  • NullMatrixSelection
  • NullVectorSelection
  • ObjectFormatter
  • ResTable
  • RowMatrixSelection
  • SelectionEvent
  • ShortFormatter
  • SimpleFormatter
  • SingleGraphSelection
  • SingleMatrixSelection
  • SingletonModelEvent
  • SingletonModelMulticaster
  • SingleVectorSelection
  • StringFormatter
  • SubfocusEvent
  • TimeFormatter
  • TimestampFormatter
  • TypedViewManager
  • VariantFormatStr
  • VariantFormatter
  • VectorModelAdapter
  • VectorModelEvent
  • VectorModelMulticaster
  • VectorSelectionAdapter
  • VectorSelectionEvent
  • VectorSelectionMulticaster
  • VectorSubfocusAdapter
  • VectorSubfocusEvent

  • Overview of classes in the model package

    Event classes

    BasicSelection - An abstract class that uses a jgl.Array to store the locations in the model object of the selected items. Use or extend a subclass of this class, depending upon the model required for your component. If you are creating a new model type, extend this class and add your own functionality.
    ModelEvent - The base clase for a model event.
    SelectionEvent - The base class for a selection event.
    SubfocusEvent - Tracks when the separate data items of a JBCL composite component have gained or lost focus. The subfocus event sets handle these events. A subfocusChanging event allows registered listeners to veto the subfocusChanged event. If, on receipt of a subfocusChanging event, a listener throws an EventVetoException, the focus does not move to the new item, and the subfocusChanged does not occur.

    GraphModel classes

    A graph model holds a tree of data items, and is used by model-view components such as a tree control.

    GraphModel - A read-only model that holds data items in a hierarchical relationship. It includes methods to return the children, parent, or root node of a specified node in the hierarchy.
    WritableGraphModel - Extends GraphModel and adds methods to add, change, and delete nodes in the hierarchy.
    BasicTreeContainer - An implementation of the WritableGraphModel interface.

    GraphModelEvent - The object created when the data in the graph model changes.
    GraphModelListener - The graph model event-listener methods. To receive notification of graph model events, implement this interface and register your component with the model object.
    GraphModelAdapter - A no-op implementation of the GraphModelListener class, for conveniently subclassing.
    GraphModelMulticaster - Dispatches graph model events to multiple listeners.

    GraphLocation - An abstract address in a graph data structure (parent, children).

    GraphSelection - Provides read-only access to a graph selection pool (all selected items) for a graph model component.
    WritableGraphSelection - Provides read-write access to a selection pool for a graph-model component.
    BasicGraphSelection - A selection class that permits the selection of one or more items. It provides for noncontiguous and range selections.

    SingleGraphSelection - A selection class that permits only one data item to be selected at a time. Selecting another data item deselects the first.
    NullGraphSelection - A selection class that permits no selection.

    GraphSelectionEvent - The event object created when an item is added or removed from the selection pool in the graph model.
    GraphSelectionListener - The interface implemented by components wanting to respond to selection events in a graph-model component.
    GraphSelectionAdapter - An event helper class that implements the GraphSelectionListener interface.
    GraphSelectionMulticaster - A multicaster for selection events which happen in a component that uses a graph model.

    GraphSubfocusEvent - The event object created when a data item in the graph model receives focus. There are two events in the graph subfocus event set: subfocusChanging and subfocusChanged.
    GraphSubfocusListener - The subfocus event-listener methods. To receive notification of graph subfocus events, implement this interface and register your component with the model object.
    GraphSubfocusAdapter - An event helper class that implements the GraphSubfocusListener interface.

    LinkedTreeContainer - A data provider component to handle a graph data model. Accepts data of type LinkedTreeNode.
    LinkedTreeIterator - Reads and writes one tree node at a time in a forward direction. Requires a linked tree.
    LinkedTreeNode - An object that can be a node in a linked graph data model such as that used by the TreeControl. Combines the properties and methods, such as parent and removeChild, needed for such nodes to function.
    GraphModelSearch - Facilitates searching through GraphModel data structures.

    GraphViewManager - Handles item painter and editor selection for components using a graph model.

    ItemEditor classes

    An item editor enables the end user to edit an item from within a model-view control, such as an item in a list control.
    ItemEditor - An interface that defines an item editor for editing data items.
    ItemEditSite - This interface is implemented where item editors can be provided with more information about their host containers and the details of a particular edit session.
    ItemEditMask - An open interface for character-by-character input validation. Not based on an ItemEditMask string, but the ItemEditMaskStr implementation uses a control string to validate characters.
    ItemEditMaskState - Carries state information for a control while the control is using an ItemEditMask interface. The control owns this information, though it is instantiated by the ItemEditMask. This allows multiple controls to share a common ItemEditMask.
    ItemEditMaskStr - Implements the ItemEditMask interface using pattern strings to control formatting, parsing, and edit interactions.
    ToggleItemEditor - A tagging interface that notifies all JBCL components that this editor is a toggle.

    ItemFormatter classes

    An item formatter is used to control text entry in a model-view control, such as editing a date from within a list control.
    VariantFormatter - Base class to format and parse data, time and date data, and strings. Implemented by ItemFormatStr, which uses JDK pattern strings. Supports numeric, currency, date-time, and text patterns.
    VariantFormatStr - Extends the VariantFormatter class. Uses string patterns to control formatting and parsing. Supports numeric, currency, date-time, and text patterns.
    ItemFormatStr - A simple wrapper class for VariantFormatStr. It was written primarily so there was a version of VariantFormatStr which implemented the basic ItemFormatter interface. This was done because the Model/View architecture does not know about Variants. This provides a way for the JBCL model/view classes to use VariantFormatStr for dataset activities without knowing about variants.
    SimpleFormatter - A simple wrapper class around VariantFormatter which hides the details of the formatting pattern and the desired Locale. You just tell it the type of data you want to format or parse, and it uses VariantFormatStr, which handles all the processing. Primarily intended as an example.

    ItemFormatter - An interface for translating a data object to and from a string. These are implementations of a particular data type.
    BigDecimalFormatter - Implements ItemFormatter for the BigDecimal data type.
    BinaryFormatter - Implements ItemFormatter for the Binary data type.
    BooleanFormatter - Implements ItemFormatter for the boolean data type.
    ByteFormatter - Used in JBCL for formatting and parsing of Byte columns in DataSets. The range is -128 to 127.
    DateFormatter - Implements ItemFormatter for the Date data type.
    DoubleFormatter - Implements ItemFormatter for the double data type.
    IntegerFormatter - Implements ItemFormatter for the int data type.
    LongFormatter - Implements ItemFormatter for the long data type.
    ObjectFormatter - Implements ItemFormatter for the Java Object data type.
    ShortFormatter - Like ByteFormatter, but for Short Columns (-32767 to 32768).
    StringFormatter - Implements ItemFormatter for the String data type.
    TimeFormatter - Implements ItemFormatter for the Time data type.
    TimestampFormatter - Implements ItemFormatter for the Timestamp data type.

    ItemPainter classes

    An item painter is used by a model-view component to paint a data item in a control, such as repainting an item in a list control when the list is scrolled.
    ItemPainter - An interface to define a single item painter for non-edit painting.
    CustomPaintSite - Provides custom item painters and painters with information about the host container in which the painting occurs.
    ItemPaintSite - An interface to be implemented where item painters can be provided with more information about their host container's fonts, margins, and colors.

    MatrixModel classes

    A matrix model holds a table of data items, and is used by model-view components such as a grid control.
    MatrixModel - A two-dimensional array of items that provides read-only access. This interface replaces the getCount() method of the vector model with getRowCount() and getColumnCount() methods.
    WritableMatrixModel - Extends MatrixModel and provides write access. This interface adds methods to add, change, and delete rows and columns. Its isVariableColumns and isVariableRows properties determine whether the number of rows or columns can be changed.
    BasicMatrixContainer - An implementation of the WritableMatrixModel interface.

    MatrixLocation - An address in a matrix data structure pointing to a specific row and column location.

    MatrixModelEvent - The object created when the data in the matrix model changes.
    MatrixModelListener - The matrix model event-listener methods. To receive notification of matrix model events, implement this interface and register your component with the model object.
    MatrixModelAdapter - An adapter class for the MatrixModelAdapter interface. A no-op implementation of the MatrixModelListener class, for conveniently subclassing.
    MatrixModelMulticaster - Dispatches matrix model events to multiple listeners.

    MatrixSelection - Provides read-only access to a matrix selection pool (all selected items) for a matrix model component.
    WritableMatrixSelection - Provides read-write access to a selection pool for a matrix model component.
    BasicMatrixSelection - A selection class that allows selection of one or more data items. It provides for noncontiguous and range selections.

    NullMatrixSelection - A selection class that permits no selection.
    SingleMatrixSelection - Implements WritableMatrixSelection allowing a single selection at a time.
    ColumnMatrixSelection - A selection class that allows the selection of an entire column only.
    RowMatrixSelection - A selection class that permits the selection of an entire row only.
    CrossMatrixSelection - A selection class that provides a kind of "crosshairs" selection. When the user clicks on a cell, that cell's entire row and entire column are selected.
    MultiColumnMatrixSelection - A selection class that allows the selection of multiple columns in the matrix.
    MultiRowMatrixSelection - A selection class that allows the selection of multiple rows in the matrix.

    MatrixSelectionEvent - The event object created when an item is added or removed from the selection pool in the matrix model.
    MatrixSelectionListener - The interface implemented by components wanting to respond to selection events in a matrix model component.
    MatrixSelectionAdapter - An event helper class that implements the MatrixSelectionListener interface.
    MatrixSelectionMulticaster - A multicaster for selection events which happen in components that use a matrix model.

    MatrixSubfocusEvent - The event object created when an item in the matrix model receives focus. There are two events in the matrix subfocus event set: subfocusChanging and subfocusChanged.
    MatrixSubfocusListener - The subfocus event-listener methods. To receive notification of matrix subfocus events, implement this interface and register your component with the model object.
    MatrixSubfocusAdapter - An event helper class that implements the MatrixSubfocusListener interface.

    MatrixViewManager - Handles item painter and editor selection for components using a matrix model.

    SingletonModel classes

    A singleton model holds a single data item, and is used by model-view components such as a checkbox.
    SingletonModel - Has a single data item and provides read-only access. This interface has get() and getCopy() methods and an enableEvents() method that switches the model events on and off.
    WritableSingletonModel - Defines the methods required for input and output operations of a singleton model. Extends SingletonModel and adds canSet() and set() methods.
    BasicSingletonContainer - A simple implementation of the WritableSingletonModel interface.

    SingletonModelEvent - The object created when the data in the singleton model changes.
    SingletonModelListener - The model event-listener methods. To receive notification of singleton model events, implement this interface and register your component with the model object.
    SingletonModelMulticaster - A multicaster for events related to a single-item model.

    SingletonViewManager - Handles item painter and item editor selection for components using a singleton model.

    VectorModel classes

    A vector model holds a list of data items, and is used by model-view components such as a list control.
    VectorModel - A one-dimensional array of data items that provides read-only access. This interface adds a getCount() method to those in the singleton model.
    WritableVectorModel - Extends VectorModel. Includes set() and canSet() methods, making the model writable. This interface also has insert(), append(), and remove() methods and an isVariableSize property.
    BasicVectorContainer - A simple implementation of the WritableVectorModel interface.

    VectorModelEvent - The object created when the data in the vector model changes.
    VectorModelListener - The vector model event-listener methods. To receive notification of vector data model events, implement this interface and register your component with the datamodel object.
    VectorModelAdapter - An adapter class for the VectorModelListener interface.
    VectorModelMulticaster - A multicaster for events related to a vector model. Dispatches vector model events to multiple listeners.

    VectorSelection - Provides read-only access to a vector selection pool (all selected items).
    WritableVectorSelection - Provides read-write access to a selection pool for a vector model component.
    BasicVectorSelection - A selection class that allows selection of one or more data items in the list. It provides for noncontiguous and range selections.

    NullVectorSelection - A selection class that permits no selection in the list.
    SingleVectorSelection - A selection class that permits only one data item to be selected at a time. Selecting another data item deselects the first.

    VectorSelectionEvent - The event object created when a data item is added or removed from the selection pool in the vector model.
    VectorSelectionListener - The interface implemented by components wanting to respond to selection events in a vector model component.
    VectorSelectionAdapter - An event helper class that implements the VectorSelectionListener interface.
    VectorSelectionMulticaster - Dispatches vector selection events to multiple listeners.

    VectorSubfocusEvent - The event object created when an item in the vector model receives focus. There are two events in the vector subfocus event set: subfocusChanging and subfocusChanged.
    VectorSubfocusListener - The subfocus event-listener methods. To receive notification of vector subfocus events, implement this interface and register your component with the model object.
    VectorSubfocusAdapter - An event helper class that implements the VectorSubfocusListener interface.

    VectorViewManager - Handles item painter and editor selection for components using a vector model.

    View managers

    A view manager delivers an appropriate item painter or item editor to a view component, to match the type of data item that needs to be manipulated in the control.
    BasicViewManager - A basic implementation of SingletonViewManager, VectorViewManager, MatrixViewManager, and GraphViewManager. Provides a single item painter and a single item editor for all items. Used for models that contain a single type of data.
    TypedViewManager - A basic implementation of each of SingletonViewManager, VectorViewManager, MatrixViewManager, and GraphViewManager. Examines the data item passed to it and hands back an appropriate item painter or item editor. Used for models that store more than one type of data.