ewe.ui
Class TreeModelAdapter

java.lang.Object
  extended byewe.ui.TableModel
      extended byewe.ui.TreeTableModel
          extended byewe.ui.TreeModelAdapter
All Implemented Interfaces:
CellConstants, ControlConstants, EventListener, UIConstants
Direct Known Subclasses:
RegistryTreeModel

public abstract class TreeModelAdapter
extends TreeTableModel


Nested Class Summary
 
Nested classes inherited from class ewe.ui.TableModel
TableModel.CellControl, TableModel.ControlProxy
 
Field Summary
protected  Vector objects
           
 
Fields inherited from class ewe.ui.TreeTableModel
CanExpand, closedFolder, cutNodes, DepthMask, dynamicCanExpand, expandingIcon, expandingNodes, expansionLevel, FlagMask, HasChildren, hasControls, HasMoreSiblings, hideRoot, IsExpanded, IsNode, matrix, noLines, openFolder, page, PatternMask, ranges, rootObject, selectedColor, selectedLine, selectedLines, selectExpanded, showWaitCursor
 
Fields inherited from class ewe.ui.TableModel
activeCellControl, allColumnsSameSize, allRowsSameSize, canHScroll, canVScroll, cellInsets, charHeight, charWidth, clipData, controlProxy, cursorSize, fillToEqualHeights, fillToEqualWidths, gap, hasColumnHeaders, hasPreferredSize, hasRowHeaders, hasSpanningColumns, hasSpanningRows, horizontalScrollUnit, insets, numCols, numRows, preferredCols, preferredRows, rect, selectRowWhenEditing, shadeAlternateRows, table, tca, verticalScrollUnit
 
Fields inherited from interface ewe.ui.UIConstants
BDR_DOTTED, BDR_INNER, BDR_NOBORDER, BDR_OUTER, BDR_OUTLINE, BDR_RAISEDINNER, BDR_RAISEDOUTER, BDR_SUNKENINNER, BDR_SUNKENOUTER, BF_BOTTOM, BF_BOTTOMLEFT, BF_BOTTOMRIGHT, BF_BUTTON, BF_DIAGONAL, BF_DIAGONAL_ENDBOTTOMLEFT, BF_DIAGONAL_ENDBOTTOMRIGHT, BF_DIAGONAL_ENDTOPLEFT, BF_DIAGONAL_ENDTOPRIGHT, BF_EXACT, BF_FLAT, BF_LEFT, BF_MIDDLE, BF_MONO, BF_PALM, BF_RECT, BF_RIGHT, BF_SOFT, BF_SQUARE, BF_TOP, BF_TOPLEFT, BF_TOPRIGHT, EDGE_BUMP, EDGE_ETCHED, EDGE_RAISED, EDGE_SUNKEN
 
Fields inherited from interface ewe.ui.CellConstants
BORDER, BOTTOM, CELLFLAG, CELLMASK, CENTER, CONTROLMASK, DONTCHANGE, DONTFILL, DONTSTRETCH, EAST, FILL, FIXEDSIZE, GROW, HCENTER, HCONTRACT, HEXPAND, HFILL, HGROW, HSHRINK, HSTRETCH, INITIALLY_CLOSED, INITIALLY_MINIMIZED, INITIALLY_PREFERRED_SIZE, INSETS, LEFT, MAXIMUMSIZE, MINIMUMSIZE, NORTH, NORTHEAST, NORTHWEST, PREFERREDSIZE, RECT, RIGHT, SHRINK, SOUTH, SOUTHEAST, SOUTHWEST, SPAN, STRETCH, TEXTSIZE, TOP, VCENTER, VCONTRACT, VEXPAND, VFILL, VGROW, VSHRINK, VSTRETCH, WEST
 
Fields inherited from interface ewe.ui.ControlConstants
All, AlwaysEnabled, AlwaysRecalculateSizes, ByDeferredMouse, ByDeferredPen, ByFrameChange, ByKeyboard, ByMouse, ByPen, ByRequest, CalculatedSizes, Disabled, DisablePopupMenu, DisplayOnly, Down, DrawFlat, Flag, ForceResize, HasData, Invisible, KeepImage, KeepSIP, Left, MakeMenuAtLeastAsWide, Maximize, Minimize, MouseSensitive, NoFocus, NotAnEditor, NotEditable, PaintDataOnly, PaintOutsideOnly, PenTransparent, PreferredSizeOnly, Right, SendUpKeyEvents, SendUpPenEvents, ShowSIP, ShrinkToNothing, SmallControl, SpecialBackground, TakeControlEvents, TakesKeyFocus, Transparent, Up, WantDrag, WantHoldDown
 
Constructor Summary
TreeModelAdapter()
           
 
Method Summary
protected  void adjustFlags(Object parent, long[] indexes, byte[] flags)
          Use this to change the flags for the child indexes of the specified parent.
protected abstract  Object createObjectFor(Object parent, int childIndex)
          Use this to create a new node object for a node which is about to be expanded.
 int doExpand(int whichLine)
           
protected  int getChildCount(Object parent)
          If you do not override getChildIndexes() you must implement this.
protected  long[] getChildIndexes(Object parent)
          This is used to get an array of indexes for each of the children of the parent Object.
 Object getDataObjectAt(int whichLine)
          This returns getTreeNodeAt(line).
 String getDisplayString(int forLine, TreeNode node)
           
protected  String getDisplayString(Object parentNode, int childIndex)
          Override this to get the display string for the child of the parent.
 byte getFlags(int forLine, TreeNode node)
           
protected  byte getFlags(Object parentNode, int childIndex, byte savedFlags)
          This is only called if "dynamicCanExpand" is set true.
 IImage getIcon(int forLine, TreeNode node)
           
protected  IImage getIcon(Object parentNode, int childIndex)
          Override this to get the icon for the child of the parent.
protected  int getIndexFor(int whichLine)
           
protected  Object getParentObject(int whichLine)
           
protected  int newNodeObject(Object node)
           
 
Methods inherited from class ewe.ui.TreeTableModel
addressOf, addressOf, calculateColWidth, calculateRowHeight, canDoCollapse, canDoExpand, canScreenScroll, clicked, collapse, collapseMatrix, collapsing, columnOf, countChildren, countSelectedLines, countTotalChildNodes, delete, deleted, doCollapse, doExpand, doubleClicked, drawNodeData, drawNodeLine, expand, expanding, expandMatrix, expandTo, expandTo, expandToLevel, findChild, findNextSibling, findParent, findParentOrPreviousSibling, findPreviousSibling, fireSelection, flagsAt, fullExpandCollapse, getDataToDragAndDrop, getDataToTransfer, getDataWidth, getDisplayStatus, getDrawOptions, getHeightOfObject, getMenuFor, getNodeToCollapse, getNodeToExpand, getRootObject, getSelectedLines, getSelectedRanges, getTextRect, getTreeNodeAt, indexOf, indexOf, init, insert, inserted, isCut, isSelected, made, modify, objectAt, paintLine, paintLine, paintTableCell, paintTableCell, pressed, reExpandNode, reExpandSelectedNode, released, removeEntries, scrollTo, select, select, selectAll, selectOnly, setRootObject, setSelectedLines, shrunk, toFlags, toReference, update, updateFlags
 
Methods inherited from class ewe.ui.TableModel
calculateTextCharsInColumn, calculateTextLinesInRow, canSelect, checkControlFor, clearCellAdjustments, closeActiveControl, deferPaintTableCell, doHotKey, findCellsInArea, fixBorder, getCellAttributes, getCellControlFor, getCellData, getCellInsets, getCellPreferredSize, getCellRect, getCellText, getColWidth, getControlFor, getLinesFor, getMaxColWidth, getMaxRowHeight, getMenuFor, getMenuOutsideCells, getMinColWidth, getMinRowHeight, getPreferredSize, getRowHeight, getToolTip, hasActiveControls, inset, isActiveCellControl, notifyDataChange, onEvent, onKeyEvent, paintTableCellData, paintTableCellText, penPressed, popupMenuEvent, remapColumns, resized, select, show, startedEditing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, toString
 

Field Detail

objects

protected Vector objects
Constructor Detail

TreeModelAdapter

public TreeModelAdapter()
Method Detail

newNodeObject

protected int newNodeObject(Object node)

getParentObject

protected Object getParentObject(int whichLine)

getIndexFor

protected int getIndexFor(int whichLine)

getDataObjectAt

public Object getDataObjectAt(int whichLine)
Description copied from class: TreeTableModel
This returns getTreeNodeAt(line).

Overrides:
getDataObjectAt in class TreeTableModel

doExpand

public int doExpand(int whichLine)
Overrides:
doExpand in class TreeTableModel

createObjectFor

protected abstract Object createObjectFor(Object parent,
                                          int childIndex)
Use this to create a new node object for a node which is about to be expanded.


getChildIndexes

protected long[] getChildIndexes(Object parent)
This is used to get an array of indexes for each of the children of the parent Object. By default this will call getChildCount() and then create an incremental list of indexes from 0 to the count-1.

These indexes are to be used by you to reference that child relative to the parent.


getChildCount

protected int getChildCount(Object parent)
If you do not override getChildIndexes() you must implement this.


adjustFlags

protected void adjustFlags(Object parent,
                           long[] indexes,
                           byte[] flags)
Use this to change the flags for the child indexes of the specified parent. The flags are created with each child being set as CanExpand and IsNode. By default this will leave the entries as they are.


getDisplayString

public String getDisplayString(int forLine,
                               TreeNode node)
Overrides:
getDisplayString in class TreeTableModel

getIcon

public IImage getIcon(int forLine,
                      TreeNode node)
Overrides:
getIcon in class TreeTableModel

getFlags

public byte getFlags(int forLine,
                     TreeNode node)
Overrides:
getFlags in class TreeTableModel

getDisplayString

protected String getDisplayString(Object parentNode,
                                  int childIndex)
Override this to get the display string for the child of the parent.


getIcon

protected IImage getIcon(Object parentNode,
                         int childIndex)
Override this to get the icon for the child of the parent.


getFlags

protected byte getFlags(Object parentNode,
                        int childIndex,
                        byte savedFlags)
This is only called if "dynamicCanExpand" is set true. This will then be called each time the node is to be displayed.

Override this to return the flags (IsNode and/or CanExpand) for the child of the parent.