JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.higrid
Class FormatTree

java.lang.Object
  |
  +--javax.swing.tree.DefaultTreeModel
        |
        +--com.klg.jclass.datasource.DataSourceTreeModel
              |
              +--com.klg.jclass.higrid.FormatTree
All Implemented Interfaces:
Serializable, TreeModel

public class FormatTree
extends DataSourceTreeModel

The FormatTree holds the design-time visual formatting information for all of the levels of HiGrid. It is composed of FormatNode objects that aggregate all of the information necessary to render a given table.

See Also:
Serialized Form

Field Summary
protected static int INDEX_AFTER_DETAILS
           
protected static int INDEX_BEFORE_DETAILS
           
protected static int INDEX_FOOTER
           
protected static int INDEX_RECORD
           
protected static int METADATA_ARRAY_SIZE
           
 
Fields inherited from class com.klg.jclass.datasource.DataSourceTreeModel
NullRoot
 
Fields inherited from class javax.swing.tree.DefaultTreeModel
asksAllowsChildren, listenerList, root
 
Constructor Summary
FormatTree(com.klg.jclass.higrid.HiGrid grid)
          Default constructor.
 
Method Summary
protected  void createFormats(com.klg.jclass.higrid.FormatNode node, com.klg.jclass.datasource.MetaDataModel[] arrayMetaData)
          Creates the specified RowFormat objects described by the passed FormatNode,
 void createFormatTreeFromDataModel(com.klg.jclass.datasource.DataModel dataModel)
          (Re-)creates a default FormatTree from the passed DataModel's MetaDataModel.
protected  void createFormatTreeFromNode(com.klg.jclass.higrid.FormatNode node, com.klg.jclass.datasource.MetaDataModel[] rootMetaData, int indent)
          Recursive helper routine for createFormatTreeFromDataModel() above
 com.klg.jclass.higrid.CellFormat findCellFormat(String name, com.klg.jclass.higrid.FormatNode startNode, int index)
          Searches for the CellFormat with the given name in the subtree of FormatNodes rooted at startNode.
protected  com.klg.jclass.higrid.CellFormat findCellFormat(String name, Vector cellFormats)
          Searches for the CellFormat with the given name in the passed Vector.
 void resetAllEditStatusRenderers(com.klg.jclass.higrid.HiGridEditStatusRenderer editStatusRenderer)
          Traverses the entire FormatTree and re-initializes the renderer for all cells of type EditStatusCellFormat with the passed editStatusRenderer.
 void resetAllHeaderRenderers(com.klg.jclass.higrid.HiGridHeaderRenderer headerRenderer)
          Traverses the entire FormatTree and re-initializes the renderer for all cells of a row with type HeaderFormat with the passed headerRenderer.
 void resetAllNodeRenderers(com.klg.jclass.higrid.HiGridNodeRenderer nodeRenderer)
          Traverses the entire FormatTree and re-initializes the renderer for all cells of type NodeCellFormat with the passed nodeRenderer.
protected  void resetAllRenderers(Class renderer, int rendererIndex)
          Helper method that traverses the entire FormatTree and re-initializes the renderer for all cells of the given indicatorFormats renderer type
 void resetPlaf()
          Traverses the entire FormatTree and re-initializes the PLAF for all cells.
protected  void resetRuntimeInfo()
          Reset the runtime info from the format tree
protected  void resetRuntimeInfo(com.klg.jclass.higrid.FormatNode node)
          Reset the runtime info for a given format node and its children
 com.klg.jclass.higrid.CellFormat searchRowFormat(String name, com.klg.jclass.higrid.FormatNode node, int index)
          Searches for the CellFormat with the given name in the passed node.
 void setSummaryFormat(com.klg.jclass.higrid.RowFormat rowFormat, com.klg.jclass.datasource.MetaDataModel metaData)
          Creates summary format information for the passed rowFormat based on the columns in the passed metaData.
 void setSummaryFormat(com.klg.jclass.higrid.RowFormat rowFormat, com.klg.jclass.datasource.MetaDataModel metaData, com.klg.jclass.higrid.CellStyleModel cellStyle)
          Creates summary format information for the passed rowFormat based on the columns in the passed metaData.
 
Methods inherited from class com.klg.jclass.datasource.DataSourceTreeModel
getRoot, getRootNode, setRoot
 
Methods inherited from class javax.swing.tree.DefaultTreeModel
addTreeModelListener, asksAllowsChildren, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getChild, getChildCount, getIndexOfChild, getListeners, getPathToRoot, getPathToRoot, getTreeModelListeners, insertNodeInto, isLeaf, nodeChanged, nodesChanged, nodeStructureChanged, nodesWereInserted, nodesWereRemoved, reload, reload, removeNodeFromParent, removeTreeModelListener, setAsksAllowsChildren, valueForPathChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INDEX_RECORD

protected static final int INDEX_RECORD
See Also:
Constant Field Values

INDEX_FOOTER

protected static final int INDEX_FOOTER
See Also:
Constant Field Values

INDEX_BEFORE_DETAILS

protected static final int INDEX_BEFORE_DETAILS
See Also:
Constant Field Values

INDEX_AFTER_DETAILS

protected static final int INDEX_AFTER_DETAILS
See Also:
Constant Field Values

METADATA_ARRAY_SIZE

protected static final int METADATA_ARRAY_SIZE
See Also:
Constant Field Values
Constructor Detail

FormatTree

public FormatTree(com.klg.jclass.higrid.HiGrid grid)
Default constructor.

Method Detail

createFormatTreeFromDataModel

public void createFormatTreeFromDataModel(com.klg.jclass.datasource.DataModel dataModel)
(Re-)creates a default FormatTree from the passed DataModel's MetaDataModel.

Parameters:
dataModel - the DataModel from which the Format Tree is created.

createFormatTreeFromNode

protected void createFormatTreeFromNode(com.klg.jclass.higrid.FormatNode node,
                                        com.klg.jclass.datasource.MetaDataModel[] rootMetaData,
                                        int indent)
Recursive helper routine for createFormatTreeFromDataModel() above

Parameters:
node - The FormatNode which describes the visual format of the created rows.
rootMetaData - The array of root meta data for the format node.
indent - The nesting level of the passed node.

resetRuntimeInfo

protected void resetRuntimeInfo()
Reset the runtime info from the format tree


resetRuntimeInfo

protected void resetRuntimeInfo(com.klg.jclass.higrid.FormatNode node)
Reset the runtime info for a given format node and its children

Parameters:
node - The format node.

createFormats

protected void createFormats(com.klg.jclass.higrid.FormatNode node,
                             com.klg.jclass.datasource.MetaDataModel[] arrayMetaData)
Creates the specified RowFormat objects described by the passed FormatNode,

Parameters:
node - The FormatNode which describes the visual format of its created rows.
arrayMetaData - The array of meta data for the current format node.

setSummaryFormat

public void setSummaryFormat(com.klg.jclass.higrid.RowFormat rowFormat,
                             com.klg.jclass.datasource.MetaDataModel metaData)
Creates summary format information for the passed rowFormat based on the columns in the passed metaData.

Parameters:
rowFormat - the summary format for which to create the cell information.
metaData - the meta data that contains the column information.

setSummaryFormat

public void setSummaryFormat(com.klg.jclass.higrid.RowFormat rowFormat,
                             com.klg.jclass.datasource.MetaDataModel metaData,
                             com.klg.jclass.higrid.CellStyleModel cellStyle)
Creates summary format information for the passed rowFormat based on the columns in the passed metaData.

Parameters:
rowFormat - the summary format for which to create the cell information.
metaData - the meta data that contains the column information.
cellStyle - the cellStyle to use when creating the cellFormats.

findCellFormat

protected com.klg.jclass.higrid.CellFormat findCellFormat(String name,
                                                          Vector cellFormats)
Searches for the CellFormat with the given name in the passed Vector.

Parameters:
name - the name of the cell to search for.
cellFormats - a Vector of CellFormats to search.
Returns:
If found, CellFormat with given name, null otherwise.

searchRowFormat

public com.klg.jclass.higrid.CellFormat searchRowFormat(String name,
                                                        com.klg.jclass.higrid.FormatNode node,
                                                        int index)
Searches for the CellFormat with the given name in the passed node.

Parameters:
name - the name of the cell to search for.
node - the FormatNode to search within.
index - the type of RowFormat to search. Constants are defined in FormatNode.
Returns:
If found, CellFormat with given name, null otherwise.

findCellFormat

public com.klg.jclass.higrid.CellFormat findCellFormat(String name,
                                                       com.klg.jclass.higrid.FormatNode startNode,
                                                       int index)
Searches for the CellFormat with the given name in the subtree of FormatNodes rooted at startNode. If startNode is null, it starts at the root of the this FormatTree.

Parameters:
name - the name of the cell to search for.
startNode - the FormatNode to start searching at (null == start at tree root).
index - the type of RowFormat to search. Constants are defined in FormatNode.
Returns:
If found, CellFormat with given name, null otherwise.

resetAllNodeRenderers

public void resetAllNodeRenderers(com.klg.jclass.higrid.HiGridNodeRenderer nodeRenderer)
Traverses the entire FormatTree and re-initializes the renderer for all cells of type NodeCellFormat with the passed nodeRenderer.

Parameters:
nodeRenderer - the new HiGridNodeRenderer to use everywhere.

resetAllEditStatusRenderers

public void resetAllEditStatusRenderers(com.klg.jclass.higrid.HiGridEditStatusRenderer editStatusRenderer)
Traverses the entire FormatTree and re-initializes the renderer for all cells of type EditStatusCellFormat with the passed editStatusRenderer.

Parameters:
editStatusRenderer - the new HiGridEditStatusRenderer to use everywhere.

resetAllRenderers

protected void resetAllRenderers(Class renderer,
                                 int rendererIndex)
Helper method that traverses the entire FormatTree and re-initializes the renderer for all cells of the given indicatorFormats renderer type

Parameters:
renderer - the class of renderer to reset.
rendererIndex - the indicatorFormats index.

resetAllHeaderRenderers

public void resetAllHeaderRenderers(com.klg.jclass.higrid.HiGridHeaderRenderer headerRenderer)
Traverses the entire FormatTree and re-initializes the renderer for all cells of a row with type HeaderFormat with the passed headerRenderer.

Parameters:
headerRenderer - the new HiGridHeaderRenderer to use everywhere.

resetPlaf

public void resetPlaf()
Traverses the entire FormatTree and re-initializes the PLAF for all cells.


Copyright © 2004 Quest Software Inc..
All rights reserved.