Package com.ccg.values

Value Transfer Classes.

See:
          Description

Interface Summary
ValuesConfig Definition of a values holder which can save/load its set of values.
ValuesEditor Implemented by Swing editors which are designed for a particular class of objects.
ValuesHolder Definition of objects which are capable of holding values (settings) for other objects.
 

Class Summary
ValuesConfigBean A 'generic' ValuesConfig implementation for beans (uses XML).
ValuesConfigEditor Complete configuration/value editor for a ValuesEditor and ValuesConfig implementation.
ValuesConfigList A configuration chooser (and optional editor) which lets the end user pick configurations from a named list.
ValuesConfigModel A standard ComboBoxModel which is associated with a set of configurations for a particular ValuesConfig class.
ValuesEditorAdapter Helper class to form a base for those wishing to implement a ValuesEditor.
ValuesEditorBean A 'generic' ValuesEditor implementation for bean style object.
ValuesFactoryTree A "factory" used to create and optionally edit objects which have an associated ValuesEditor and ValuesConfig.
ValuesPropertiesAdapter A base ValuesConfig implementation which stores the values held in standard Java property files.
View Utility to test a implementation of a ValuesEditor.
 

Package com.ccg.values Description

Value Transfer Classes.

This package provides a generic design for a method of transferring values (state information) to and from Objects. The design starts with the simple definition of a ValuesHolder and then evolves this into more defintions.

ValuesHolder

The ValuesHolder interface defines the core rules for a values holder. Basically, a values holder is designed to work in conjunction with a specific object class and is designed such that it can transfer values (or state information) to/from any instance of the object class it is designed to work with. The following is my attempt of a UML class diagram of this (bare with me as its 2002-Sep-7 and I'm just learning how to do this):

ValuesHolder UML

The following code fragment demonstrates how a values holder could be used to transfer information from one object to another:



static void transfer(Object dst, Object src, ValuesHolder xferAgent) {
  try {
    xferAgent.fromObject(src);
    xferAgent.toObject(dst);
  } catch (Exception e) {
        // Silently ignoring potential exceptions is probably
        // not wise in real life.
  }
}


ValuesConfig

The ValuesConfig definition adds the methods for value holders which have permanent configurations which can be saved, loaded, created and deleted. The following UML class diagram provides an overview:

ValuesConfig UML

ValuesEditor

The ValuesEditor adds the methods for value holders which have graphical user interfaces which allow the end user to modify the values of the associated object. The following UML class diagram provides an overview:

ValuesEditor UML

ValuesFactoryTree

The ValuesFactoryTree is a working demonstration of putting complementary ValuesConfig and ValuesEditor implementations to work to form a working editor which allows the user to create, view, change, delete and otherwise manage object configurations. The key thing being that the ValuesFactoryTree has no idea about what is actually being editted or how the information is actually being stored - it simply uses the rules put in place by the ValuesConfig and ValuesEditor definitions to form a generic editor that should work for any implementation. The following UML class diagram provides an overview:

ValuesFactoryTree UML

License/Use Information

The license text below the dashed line pertains to the "com/ccg" and
"com/include" libraries, documentation, executable binaries, and the
source code as distributed in this package by Paul Blankenbaker
(paul@mekwin.com).

------------------------------------------------------------------------------
This software is copyrighted by Paul Blankenbaker, Global
Atmospherics, Inc. and Unified Technologies, Inc., and other parties.
The following terms apply to all files associated with the software
unless explicitly disclaimed in individual files.

The authors hereby grant permission to use, copy, modify, distribute,
and license this software and its documentation for any purpose, provided
that existing copyright notices are retained in all copies and that this
notice is included verbatim in any distributions. No written agreement,
license, or royalty fee is required for any of the authorized uses.
Modifications to this software may be copyrighted by their authors
and need not follow the licensing terms described here, provided that
the new terms are clearly indicated on the first page of each file where
they apply.

IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.  THIS SOFTWARE
IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
MODIFICATIONS.

RESTRICTED RIGHTS: Use, duplication or disclosure by the government
is subject to the restrictions as set forth in subparagraph (c) (1) (ii)
of the Rights in Technical Data and Computer Software Clause as DFARS
252.227-7013 and FAR 52.227-19.



Copyright 1998-1998-2006 null. All Rights Reserved.