1 Clazz.declarePackage ("javax.swing.tree");
\r
2 Clazz.load (["javax.swing.tree.RowMapper"], "javax.swing.tree.AbstractLayoutCache", null, function () {
\r
3 c$ = Clazz.decorateAsClass (function () {
\r
4 this.nodeDimensions = null;
\r
5 this.treeModel = null;
\r
6 this.treeSelectionModel = null;
\r
7 this.rootVisible = false;
\r
9 Clazz.instantialize (this, arguments);
\r
10 }, javax.swing.tree, "AbstractLayoutCache", null, javax.swing.tree.RowMapper);
\r
11 Clazz.defineMethod (c$, "setNodeDimensions",
\r
13 this.nodeDimensions = nd;
\r
14 }, "javax.swing.tree.AbstractLayoutCache.NodeDimensions");
\r
15 Clazz.defineMethod (c$, "getNodeDimensions",
\r
17 return this.nodeDimensions;
\r
19 Clazz.defineMethod (c$, "setModel",
\r
20 function (newModel) {
\r
21 this.treeModel = newModel;
\r
22 }, "javax.swing.tree.TreeModel");
\r
23 Clazz.defineMethod (c$, "getModel",
\r
25 return this.treeModel;
\r
27 Clazz.defineMethod (c$, "setRootVisible",
\r
28 function (rootVisible) {
\r
29 this.rootVisible = rootVisible;
\r
31 Clazz.defineMethod (c$, "isRootVisible",
\r
33 return this.rootVisible;
\r
35 Clazz.defineMethod (c$, "setRowHeight",
\r
36 function (rowHeight) {
\r
37 this.rowHeight = rowHeight;
\r
39 Clazz.defineMethod (c$, "getRowHeight",
\r
41 return this.rowHeight;
\r
43 Clazz.defineMethod (c$, "setSelectionModel",
\r
45 if (this.treeSelectionModel != null) this.treeSelectionModel.setRowMapper (null);
\r
46 this.treeSelectionModel = newLSM;
\r
47 if (this.treeSelectionModel != null) this.treeSelectionModel.setRowMapper (this);
\r
48 }, "javax.swing.tree.TreeSelectionModel");
\r
49 Clazz.defineMethod (c$, "getSelectionModel",
\r
51 return this.treeSelectionModel;
\r
53 Clazz.defineMethod (c$, "getPreferredHeight",
\r
55 var rowCount = this.getRowCount ();
\r
57 var bounds = this.getBounds (this.getPathForRow (rowCount - 1), null);
\r
58 if (bounds != null) return bounds.y + bounds.height;
\r
61 Clazz.defineMethod (c$, "getPreferredWidth",
\r
63 var rowCount = this.getRowCount ();
\r
67 if (bounds == null) {
\r
68 firstPath = this.getPathForRow (0);
\r
71 firstPath = this.getPathClosestTo (bounds.x, bounds.y);
\r
72 endY = bounds.height + bounds.y;
\r
73 }var paths = this.getVisiblePathsFrom (firstPath);
\r
74 if (paths != null && paths.hasMoreElements ()) {
\r
75 var pBounds = this.getBounds (paths.nextElement (), null);
\r
77 if (pBounds != null) {
\r
78 width = pBounds.x + pBounds.width;
\r
79 if (pBounds.y >= endY) {
\r
82 while (pBounds != null && paths.hasMoreElements ()) {
\r
83 pBounds = this.getBounds (paths.nextElement (), pBounds);
\r
84 if (pBounds != null && pBounds.y < endY) {
\r
85 width = Math.max (width, pBounds.x + pBounds.width);
\r
91 }, "java.awt.Rectangle");
\r
92 Clazz.overrideMethod (c$, "getRowsForPaths",
\r
94 if (paths == null) return null;
\r
95 var numPaths = paths.length;
\r
96 var rows = Clazz.newIntArray (numPaths, 0);
\r
97 for (var counter = 0; counter < numPaths; counter++) rows[counter] = this.getRowForPath (paths[counter]);
\r
101 Clazz.defineMethod (c$, "getNodeDimensions",
\r
102 function (value, row, depth, expanded, placeIn) {
\r
103 var nd = this.getNodeDimensions ();
\r
105 return nd.getNodeDimensions (value, row, depth, expanded, placeIn);
\r
107 }, "~O,~N,~N,~B,java.awt.Rectangle");
\r
108 Clazz.defineMethod (c$, "isFixedRowHeight",
\r
110 return (this.rowHeight > 0);
\r
112 Clazz.pu$h(self.c$);
\r
113 c$ = Clazz.declareType (javax.swing.tree.AbstractLayoutCache, "NodeDimensions");
\r