home *** CD-ROM | disk | FTP | other *** search
- package javax.swing;
-
- import java.awt.Component;
- import java.awt.Dimension;
- import java.awt.GraphicsEnvironment;
- import java.awt.HeadlessException;
- import java.awt.LayoutManager;
- import java.awt.Point;
- import java.awt.Rectangle;
- import java.awt.event.MouseEvent;
- import java.io.IOException;
- import java.io.ObjectInputStream;
- import java.io.ObjectOutputStream;
- import java.io.Serializable;
- import java.util.Collections;
- import java.util.Enumeration;
- import java.util.Hashtable;
- import java.util.Set;
- import java.util.Stack;
- import java.util.Vector;
- import javax.accessibility.Accessible;
- import javax.accessibility.AccessibleContext;
- import javax.accessibility.AccessibleState;
- import javax.swing.JTree.1;
- import javax.swing.event.TreeExpansionEvent;
- import javax.swing.event.TreeExpansionListener;
- import javax.swing.event.TreeModelEvent;
- import javax.swing.event.TreeModelListener;
- import javax.swing.event.TreeSelectionEvent;
- import javax.swing.event.TreeSelectionListener;
- import javax.swing.event.TreeWillExpandListener;
- import javax.swing.plaf.TreeUI;
- import javax.swing.plaf.UIResource;
- import javax.swing.text.Position;
- import javax.swing.text.Position.Bias;
- import javax.swing.tree.DefaultMutableTreeNode;
- import javax.swing.tree.DefaultTreeModel;
- import javax.swing.tree.DefaultTreeSelectionModel;
- import javax.swing.tree.ExpandVetoException;
- import javax.swing.tree.TreeCellEditor;
- import javax.swing.tree.TreeCellRenderer;
- import javax.swing.tree.TreeModel;
- import javax.swing.tree.TreeNode;
- import javax.swing.tree.TreePath;
- import javax.swing.tree.TreeSelectionModel;
- import sun.swing.SwingUtilities2;
- import sun.swing.SwingUtilities2.Section;
-
- public class JTree extends JComponent implements Scrollable, Accessible {
- private static final String uiClassID = "TreeUI";
- protected transient TreeModel treeModel;
- protected transient TreeSelectionModel selectionModel;
- protected boolean rootVisible;
- protected transient TreeCellRenderer cellRenderer;
- protected int rowHeight;
- private boolean rowHeightSet;
- private transient Hashtable expandedState;
- protected boolean showsRootHandles;
- private boolean showsRootHandlesSet;
- protected transient TreeSelectionRedirector selectionRedirector;
- protected transient TreeCellEditor cellEditor;
- protected boolean editable;
- protected boolean largeModel;
- protected int visibleRowCount;
- protected boolean invokesStopCellEditing;
- protected boolean scrollsOnExpand;
- private boolean scrollsOnExpandSet;
- protected int toggleClickCount;
- protected transient TreeModelListener treeModelListener;
- private transient Stack expandedStack;
- private TreePath leadPath;
- private TreePath anchorPath;
- private boolean expandsSelectedPaths;
- private boolean settingUI;
- private boolean dragEnabled;
- private DropMode dropMode;
- private transient DropLocation dropLocation;
- private int expandRow;
- private TreeTimer dropTimer;
- private transient TreeExpansionListener uiTreeExpansionListener;
- private static int TEMP_STACK_SIZE = 11;
- public static final String CELL_RENDERER_PROPERTY = "cellRenderer";
- public static final String TREE_MODEL_PROPERTY = "model";
- public static final String ROOT_VISIBLE_PROPERTY = "rootVisible";
- public static final String SHOWS_ROOT_HANDLES_PROPERTY = "showsRootHandles";
- public static final String ROW_HEIGHT_PROPERTY = "rowHeight";
- public static final String CELL_EDITOR_PROPERTY = "cellEditor";
- public static final String EDITABLE_PROPERTY = "editable";
- public static final String LARGE_MODEL_PROPERTY = "largeModel";
- public static final String SELECTION_MODEL_PROPERTY = "selectionModel";
- public static final String VISIBLE_ROW_COUNT_PROPERTY = "visibleRowCount";
- public static final String INVOKES_STOP_CELL_EDITING_PROPERTY = "invokesStopCellEditing";
- public static final String SCROLLS_ON_EXPAND_PROPERTY = "scrollsOnExpand";
- public static final String TOGGLE_CLICK_COUNT_PROPERTY = "toggleClickCount";
- public static final String LEAD_SELECTION_PATH_PROPERTY = "leadSelectionPath";
- public static final String ANCHOR_SELECTION_PATH_PROPERTY = "anchorSelectionPath";
- public static final String EXPANDS_SELECTED_PATHS_PROPERTY = "expandsSelectedPaths";
-
- protected static TreeModel getDefaultTreeModel() {
- DefaultMutableTreeNode var0 = new DefaultMutableTreeNode("JTree");
- DefaultMutableTreeNode var1 = new DefaultMutableTreeNode("colors");
- var0.add(var1);
- var1.add(new DefaultMutableTreeNode("blue"));
- var1.add(new DefaultMutableTreeNode("violet"));
- var1.add(new DefaultMutableTreeNode("red"));
- var1.add(new DefaultMutableTreeNode("yellow"));
- var1 = new DefaultMutableTreeNode("sports");
- var0.add(var1);
- var1.add(new DefaultMutableTreeNode("basketball"));
- var1.add(new DefaultMutableTreeNode("soccer"));
- var1.add(new DefaultMutableTreeNode("football"));
- var1.add(new DefaultMutableTreeNode("hockey"));
- var1 = new DefaultMutableTreeNode("food");
- var0.add(var1);
- var1.add(new DefaultMutableTreeNode("hot dogs"));
- var1.add(new DefaultMutableTreeNode("pizza"));
- var1.add(new DefaultMutableTreeNode("ravioli"));
- var1.add(new DefaultMutableTreeNode("bananas"));
- return new DefaultTreeModel(var0);
- }
-
- protected static TreeModel createTreeModel(Object var0) {
- Object var1;
- if (!(var0 instanceof Object[]) && !(var0 instanceof Hashtable) && !(var0 instanceof Vector)) {
- var1 = new DynamicUtilTreeNode("root", var0);
- } else {
- var1 = new DefaultMutableTreeNode("root");
- javax.swing.JTree.DynamicUtilTreeNode.createChildren((DefaultMutableTreeNode)var1, var0);
- }
-
- return new DefaultTreeModel((TreeNode)var1, false);
- }
-
- public JTree() {
- this(getDefaultTreeModel());
- }
-
- public JTree(Object[] var1) {
- this(createTreeModel(var1));
- this.setRootVisible(false);
- this.setShowsRootHandles(true);
- this.expandRoot();
- }
-
- public JTree(Vector<?> var1) {
- this(createTreeModel(var1));
- this.setRootVisible(false);
- this.setShowsRootHandles(true);
- this.expandRoot();
- }
-
- public JTree(Hashtable<?, ?> var1) {
- this(createTreeModel(var1));
- this.setRootVisible(false);
- this.setShowsRootHandles(true);
- this.expandRoot();
- }
-
- public JTree(TreeNode var1) {
- this(var1, false);
- }
-
- public JTree(TreeNode var1, boolean var2) {
- this((TreeModel)(new DefaultTreeModel(var1, var2)));
- }
-
- public JTree(TreeModel var1) {
- this.rowHeightSet = false;
- this.showsRootHandlesSet = false;
- this.scrollsOnExpandSet = false;
- this.dropMode = DropMode.USE_SELECTION;
- this.expandRow = -1;
- this.expandedStack = new Stack();
- this.toggleClickCount = 2;
- this.expandedState = new Hashtable();
- this.setLayout((LayoutManager)null);
- this.rowHeight = 16;
- this.visibleRowCount = 20;
- this.rootVisible = true;
- this.selectionModel = new DefaultTreeSelectionModel();
- this.cellRenderer = null;
- this.scrollsOnExpand = true;
- this.setOpaque(true);
- this.expandsSelectedPaths = true;
- this.updateUI();
- this.setModel(var1);
- }
-
- public TreeUI getUI() {
- return (TreeUI)this.ui;
- }
-
- public void setUI(TreeUI var1) {
- if ((TreeUI)this.ui != var1) {
- this.settingUI = true;
- this.uiTreeExpansionListener = null;
-
- try {
- super.setUI(var1);
- } finally {
- this.settingUI = false;
- }
- }
-
- }
-
- public void updateUI() {
- this.setUI((TreeUI)UIManager.getUI(this));
- TreeCellRenderer var1 = this.getCellRenderer();
- if (!(var1 instanceof UIResource) && var1 instanceof Component) {
- SwingUtilities.updateComponentTreeUI((Component)var1);
- }
-
- TreeCellEditor var2 = this.getCellEditor();
- if (!(var2 instanceof UIResource)) {
- if (var2 instanceof Component) {
- SwingUtilities.updateComponentTreeUI((Component)var2);
- } else if (var2 instanceof DefaultCellEditor) {
- Component var3 = ((DefaultCellEditor)var2).getComponent();
- if (var3 != null) {
- SwingUtilities.updateComponentTreeUI(var3);
- }
- }
- }
-
- }
-
- public String getUIClassID() {
- return "TreeUI";
- }
-
- public TreeCellRenderer getCellRenderer() {
- return this.cellRenderer;
- }
-
- public void setCellRenderer(TreeCellRenderer var1) {
- TreeCellRenderer var2 = this.cellRenderer;
- this.cellRenderer = var1;
- this.firePropertyChange("cellRenderer", var2, this.cellRenderer);
- this.invalidate();
- }
-
- public void setEditable(boolean var1) {
- boolean var2 = this.editable;
- this.editable = var1;
- this.firePropertyChange("editable", var2, var1);
- if (this.accessibleContext != null) {
- this.accessibleContext.firePropertyChange("AccessibleState", var2 ? AccessibleState.EDITABLE : null, var1 ? AccessibleState.EDITABLE : null);
- }
-
- }
-
- public boolean isEditable() {
- return this.editable;
- }
-
- public void setCellEditor(TreeCellEditor var1) {
- TreeCellEditor var2 = this.cellEditor;
- this.cellEditor = var1;
- this.firePropertyChange("cellEditor", var2, var1);
- this.invalidate();
- }
-
- public TreeCellEditor getCellEditor() {
- return this.cellEditor;
- }
-
- public TreeModel getModel() {
- return this.treeModel;
- }
-
- public void setModel(TreeModel var1) {
- this.clearSelection();
- TreeModel var2 = this.treeModel;
- if (this.treeModel != null && this.treeModelListener != null) {
- this.treeModel.removeTreeModelListener(this.treeModelListener);
- }
-
- if (this.accessibleContext != null) {
- if (this.treeModel != null) {
- this.treeModel.removeTreeModelListener((TreeModelListener)this.accessibleContext);
- }
-
- if (var1 != null) {
- var1.addTreeModelListener((TreeModelListener)this.accessibleContext);
- }
- }
-
- this.treeModel = var1;
- this.clearToggledPaths();
- if (this.treeModel != null) {
- if (this.treeModelListener == null) {
- this.treeModelListener = this.createTreeModelListener();
- }
-
- if (this.treeModelListener != null) {
- this.treeModel.addTreeModelListener(this.treeModelListener);
- }
-
- if (this.treeModel.getRoot() != null && !this.treeModel.isLeaf(this.treeModel.getRoot())) {
- this.expandedState.put(new TreePath(this.treeModel.getRoot()), Boolean.TRUE);
- }
- }
-
- this.firePropertyChange("model", var2, this.treeModel);
- this.invalidate();
- }
-
- public boolean isRootVisible() {
- return this.rootVisible;
- }
-
- public void setRootVisible(boolean var1) {
- boolean var2 = this.rootVisible;
- this.rootVisible = var1;
- this.firePropertyChange("rootVisible", var2, this.rootVisible);
- if (this.accessibleContext != null) {
- ((AccessibleJTree)this.accessibleContext).fireVisibleDataPropertyChange();
- }
-
- }
-
- public void setShowsRootHandles(boolean var1) {
- boolean var2 = this.showsRootHandles;
- TreeModel var3 = this.getModel();
- this.showsRootHandles = var1;
- this.showsRootHandlesSet = true;
- this.firePropertyChange("showsRootHandles", var2, this.showsRootHandles);
- if (this.accessibleContext != null) {
- ((AccessibleJTree)this.accessibleContext).fireVisibleDataPropertyChange();
- }
-
- this.invalidate();
- }
-
- public boolean getShowsRootHandles() {
- return this.showsRootHandles;
- }
-
- public void setRowHeight(int var1) {
- int var2 = this.rowHeight;
- this.rowHeight = var1;
- this.rowHeightSet = true;
- this.firePropertyChange("rowHeight", var2, this.rowHeight);
- this.invalidate();
- }
-
- public int getRowHeight() {
- return this.rowHeight;
- }
-
- public boolean isFixedRowHeight() {
- return this.rowHeight > 0;
- }
-
- public void setLargeModel(boolean var1) {
- boolean var2 = this.largeModel;
- this.largeModel = var1;
- this.firePropertyChange("largeModel", var2, var1);
- }
-
- public boolean isLargeModel() {
- return this.largeModel;
- }
-
- public void setInvokesStopCellEditing(boolean var1) {
- boolean var2 = this.invokesStopCellEditing;
- this.invokesStopCellEditing = var1;
- this.firePropertyChange("invokesStopCellEditing", var2, var1);
- }
-
- public boolean getInvokesStopCellEditing() {
- return this.invokesStopCellEditing;
- }
-
- public void setScrollsOnExpand(boolean var1) {
- boolean var2 = this.scrollsOnExpand;
- this.scrollsOnExpand = var1;
- this.scrollsOnExpandSet = true;
- this.firePropertyChange("scrollsOnExpand", var2, var1);
- }
-
- public boolean getScrollsOnExpand() {
- return this.scrollsOnExpand;
- }
-
- public void setToggleClickCount(int var1) {
- int var2 = this.toggleClickCount;
- this.toggleClickCount = var1;
- this.firePropertyChange("toggleClickCount", var2, var1);
- }
-
- public int getToggleClickCount() {
- return this.toggleClickCount;
- }
-
- public void setExpandsSelectedPaths(boolean var1) {
- boolean var2 = this.expandsSelectedPaths;
- this.expandsSelectedPaths = var1;
- this.firePropertyChange("expandsSelectedPaths", var2, var1);
- }
-
- public boolean getExpandsSelectedPaths() {
- return this.expandsSelectedPaths;
- }
-
- public void setDragEnabled(boolean var1) {
- if (var1 && GraphicsEnvironment.isHeadless()) {
- throw new HeadlessException();
- } else {
- this.dragEnabled = var1;
- }
- }
-
- public boolean getDragEnabled() {
- return this.dragEnabled;
- }
-
- public final void setDropMode(DropMode var1) {
- if (var1 != null) {
- switch (1.$SwitchMap$javax$swing$DropMode[var1.ordinal()]) {
- case 1:
- case 2:
- case 3:
- case 4:
- this.dropMode = var1;
- return;
- }
- }
-
- throw new IllegalArgumentException(var1 + ": Unsupported drop mode for tree");
- }
-
- public final DropMode getDropMode() {
- return this.dropMode;
- }
-
- DropLocation dropLocationForPoint(Point var1) {
- DropLocation var2 = null;
- int var3 = this.getClosestRowForLocation(var1.x, var1.y);
- Rectangle var4 = this.getRowBounds(var3);
- TreeModel var5 = this.getModel();
- Object var6 = var5 == null ? null : var5.getRoot();
- TreePath var7 = var6 == null ? null : new TreePath(var6);
- Object var8 = null;
- Object var9 = null;
- boolean var10 = var3 == -1 || var1.y < var4.y || var1.y >= var4.y + var4.height;
- switch (1.$SwitchMap$javax$swing$DropMode[this.dropMode.ordinal()]) {
- case 1:
- case 2:
- if (var10) {
- var2 = new DropLocation(var1, (TreePath)null, -1, (1)null);
- } else {
- var2 = new DropLocation(var1, this.getPathForRow(var3), -1, (1)null);
- }
- break;
- case 3:
- case 4:
- if (var3 == -1) {
- if (var6 != null && !var5.isLeaf(var6) && this.isExpanded(var7)) {
- var2 = new DropLocation(var1, var7, 0, (1)null);
- } else {
- var2 = new DropLocation(var1, (TreePath)null, -1, (1)null);
- }
- } else {
- boolean var11 = this.dropMode == DropMode.ON_OR_INSERT || !var5.isLeaf(this.getPathForRow(var3).getLastPathComponent());
- SwingUtilities2.Section var12 = SwingUtilities2.liesInVertical(var4, var1, var11);
- TreePath var14;
- TreePath var15;
- if (var12 == Section.LEADING) {
- var14 = this.getPathForRow(var3);
- var15 = var14.getParentPath();
- } else {
- if (var12 != Section.TRAILING) {
- assert var11;
-
- var2 = new DropLocation(var1, this.getPathForRow(var3), -1, (1)null);
- break;
- }
-
- int var13 = var3 + 1;
- if (var13 >= this.getRowCount()) {
- if (!var5.isLeaf(var6) && this.isExpanded(var7)) {
- var13 = var5.getChildCount(var6);
- var2 = new DropLocation(var1, var7, var13, (1)null);
- } else {
- var2 = new DropLocation(var1, (TreePath)null, -1, (1)null);
- }
- break;
- }
-
- var14 = this.getPathForRow(var13);
- var15 = var14.getParentPath();
- }
-
- if (var15 != null) {
- var2 = new DropLocation(var1, var15, var5.getIndexOfChild(var15.getLastPathComponent(), var14.getLastPathComponent()), (1)null);
- } else if (!var11 && var5.isLeaf(var6)) {
- var2 = new DropLocation(var1, (TreePath)null, -1, (1)null);
- } else {
- var2 = new DropLocation(var1, var7, -1, (1)null);
- }
- }
- break;
- default:
- assert false : "Unexpected drop mode";
- }
-
- if (var10 || var3 != this.expandRow) {
- this.cancelDropTimer();
- }
-
- if (!var10 && var3 != this.expandRow && this.isCollapsed(var3)) {
- this.expandRow = var3;
- this.startDropTimer();
- }
-
- return var2;
- }
-
- Object setDropLocation(TransferHandler.DropLocation var1, Object var2, boolean var3) {
- Object var4 = null;
- DropLocation var5 = (DropLocation)var1;
- if (this.dropMode == DropMode.USE_SELECTION) {
- if (var5 == null) {
- if (!var3 && var2 != null) {
- this.setSelectionPaths(((TreePath[][])((TreePath[][])var2))[0]);
- this.setAnchorSelectionPath(((TreePath[][])((TreePath[][])var2))[1][0]);
- this.setLeadSelectionPath(((TreePath[][])((TreePath[][])var2))[1][1]);
- }
- } else {
- if (this.dropLocation == null) {
- TreePath[] var6 = this.getSelectionPaths();
- if (var6 == null) {
- var6 = new TreePath[0];
- }
-
- var4 = new TreePath[][]{var6, {this.getAnchorSelectionPath(), this.getLeadSelectionPath()}};
- } else {
- var4 = var2;
- }
-
- this.setSelectionPath(var5.getPath());
- }
- }
-
- DropLocation var7 = this.dropLocation;
- this.dropLocation = var5;
- this.firePropertyChange("dropLocation", var7, this.dropLocation);
- return var4;
- }
-
- void dndDone() {
- this.cancelDropTimer();
- this.dropTimer = null;
- }
-
- public final DropLocation getDropLocation() {
- return this.dropLocation;
- }
-
- private void startDropTimer() {
- if (this.dropTimer == null) {
- this.dropTimer = new TreeTimer(this);
- }
-
- this.dropTimer.start();
- }
-
- private void cancelDropTimer() {
- if (this.dropTimer != null && this.dropTimer.isRunning()) {
- this.expandRow = -1;
- this.dropTimer.stop();
- }
-
- }
-
- public boolean isPathEditable(TreePath var1) {
- return this.isEditable();
- }
-
- public String getToolTipText(MouseEvent var1) {
- String var2 = null;
- if (var1 != null) {
- Point var3 = var1.getPoint();
- int var4 = this.getRowForLocation(var3.x, var3.y);
- TreeCellRenderer var5 = this.getCellRenderer();
- if (var4 != -1 && var5 != null) {
- TreePath var6 = this.getPathForRow(var4);
- Object var7 = var6.getLastPathComponent();
- Component var8 = var5.getTreeCellRendererComponent(this, var7, this.isRowSelected(var4), this.isExpanded(var4), this.getModel().isLeaf(var7), var4, true);
- if (var8 instanceof JComponent) {
- Rectangle var10 = this.getPathBounds(var6);
- var3.translate(-var10.x, -var10.y);
- MouseEvent var9 = new MouseEvent(var8, var1.getID(), var1.getWhen(), var1.getModifiers(), var3.x, var3.y, var1.getXOnScreen(), var1.getYOnScreen(), var1.getClickCount(), var1.isPopupTrigger(), 0);
- var2 = ((JComponent)var8).getToolTipText(var9);
- }
- }
- }
-
- if (var2 == null) {
- var2 = this.getToolTipText();
- }
-
- return var2;
- }
-
- public String convertValueToText(Object var1, boolean var2, boolean var3, boolean var4, int var5, boolean var6) {
- if (var1 != null) {
- String var7 = var1.toString();
- if (var7 != null) {
- return var7;
- }
- }
-
- return "";
- }
-
- public int getRowCount() {
- TreeUI var1 = this.getUI();
- return var1 != null ? var1.getRowCount(this) : 0;
- }
-
- public void setSelectionPath(TreePath var1) {
- this.getSelectionModel().setSelectionPath(var1);
- }
-
- public void setSelectionPaths(TreePath[] var1) {
- this.getSelectionModel().setSelectionPaths(var1);
- }
-
- public void setLeadSelectionPath(TreePath var1) {
- TreePath var2 = this.leadPath;
- this.leadPath = var1;
- this.firePropertyChange("leadSelectionPath", var2, var1);
- }
-
- public void setAnchorSelectionPath(TreePath var1) {
- TreePath var2 = this.anchorPath;
- this.anchorPath = var1;
- this.firePropertyChange("anchorSelectionPath", var2, var1);
- }
-
- public void setSelectionRow(int var1) {
- int[] var2 = new int[]{var1};
- this.setSelectionRows(var2);
- }
-
- public void setSelectionRows(int[] var1) {
- TreeUI var2 = this.getUI();
- if (var2 != null && var1 != null) {
- int var3 = var1.length;
- TreePath[] var4 = new TreePath[var3];
-
- for(int var5 = 0; var5 < var3; ++var5) {
- var4[var5] = var2.getPathForRow(this, var1[var5]);
- }
-
- this.setSelectionPaths(var4);
- }
-
- }
-
- public void addSelectionPath(TreePath var1) {
- this.getSelectionModel().addSelectionPath(var1);
- }
-
- public void addSelectionPaths(TreePath[] var1) {
- this.getSelectionModel().addSelectionPaths(var1);
- }
-
- public void addSelectionRow(int var1) {
- int[] var2 = new int[]{var1};
- this.addSelectionRows(var2);
- }
-
- public void addSelectionRows(int[] var1) {
- TreeUI var2 = this.getUI();
- if (var2 != null && var1 != null) {
- int var3 = var1.length;
- TreePath[] var4 = new TreePath[var3];
-
- for(int var5 = 0; var5 < var3; ++var5) {
- var4[var5] = var2.getPathForRow(this, var1[var5]);
- }
-
- this.addSelectionPaths(var4);
- }
-
- }
-
- public Object getLastSelectedPathComponent() {
- TreePath var1 = this.getSelectionModel().getSelectionPath();
- return var1 != null ? var1.getLastPathComponent() : null;
- }
-
- public TreePath getLeadSelectionPath() {
- return this.leadPath;
- }
-
- public TreePath getAnchorSelectionPath() {
- return this.anchorPath;
- }
-
- public TreePath getSelectionPath() {
- return this.getSelectionModel().getSelectionPath();
- }
-
- public TreePath[] getSelectionPaths() {
- return this.getSelectionModel().getSelectionPaths();
- }
-
- public int[] getSelectionRows() {
- return this.getSelectionModel().getSelectionRows();
- }
-
- public int getSelectionCount() {
- return this.selectionModel.getSelectionCount();
- }
-
- public int getMinSelectionRow() {
- return this.getSelectionModel().getMinSelectionRow();
- }
-
- public int getMaxSelectionRow() {
- return this.getSelectionModel().getMaxSelectionRow();
- }
-
- public int getLeadSelectionRow() {
- TreePath var1 = this.getLeadSelectionPath();
- return var1 != null ? this.getRowForPath(var1) : -1;
- }
-
- public boolean isPathSelected(TreePath var1) {
- return this.getSelectionModel().isPathSelected(var1);
- }
-
- public boolean isRowSelected(int var1) {
- return this.getSelectionModel().isRowSelected(var1);
- }
-
- public Enumeration<TreePath> getExpandedDescendants(TreePath var1) {
- if (!this.isExpanded(var1)) {
- return null;
- } else {
- Enumeration var2 = this.expandedState.keys();
- Vector var3 = null;
- if (var2 != null) {
- while(var2.hasMoreElements()) {
- TreePath var4 = (TreePath)var2.nextElement();
- Object var5 = this.expandedState.get(var4);
- if (var4 != var1 && var5 != null && (Boolean)var5 && var1.isDescendant(var4) && this.isVisible(var4)) {
- if (var3 == null) {
- var3 = new Vector();
- }
-
- var3.addElement(var4);
- }
- }
- }
-
- if (var3 == null) {
- Set var6 = Collections.emptySet();
- return Collections.enumeration(var6);
- } else {
- return var3.elements();
- }
- }
- }
-
- public boolean hasBeenExpanded(TreePath var1) {
- return var1 != null && this.expandedState.get(var1) != null;
- }
-
- public boolean isExpanded(TreePath var1) {
- if (var1 == null) {
- return false;
- } else {
- Object var2 = this.expandedState.get(var1);
- if (var2 != null && (Boolean)var2) {
- TreePath var3 = var1.getParentPath();
- return var3 != null ? this.isExpanded(var3) : true;
- } else {
- return false;
- }
- }
- }
-
- public boolean isExpanded(int var1) {
- TreeUI var2 = this.getUI();
- if (var2 != null) {
- TreePath var3 = var2.getPathForRow(this, var1);
- if (var3 != null) {
- Boolean var4 = (Boolean)this.expandedState.get(var3);
- return var4 != null && var4;
- }
- }
-
- return false;
- }
-
- public boolean isCollapsed(TreePath var1) {
- return !this.isExpanded(var1);
- }
-
- public boolean isCollapsed(int var1) {
- return !this.isExpanded(var1);
- }
-
- public void makeVisible(TreePath var1) {
- if (var1 != null) {
- TreePath var2 = var1.getParentPath();
- if (var2 != null) {
- this.expandPath(var2);
- }
- }
-
- }
-
- public boolean isVisible(TreePath var1) {
- if (var1 != null) {
- TreePath var2 = var1.getParentPath();
- return var2 != null ? this.isExpanded(var2) : true;
- } else {
- return false;
- }
- }
-
- public Rectangle getPathBounds(TreePath var1) {
- TreeUI var2 = this.getUI();
- return var2 != null ? var2.getPathBounds(this, var1) : null;
- }
-
- public Rectangle getRowBounds(int var1) {
- return this.getPathBounds(this.getPathForRow(var1));
- }
-
- public void scrollPathToVisible(TreePath var1) {
- if (var1 != null) {
- this.makeVisible(var1);
- Rectangle var2 = this.getPathBounds(var1);
- if (var2 != null) {
- this.scrollRectToVisible(var2);
- if (this.accessibleContext != null) {
- ((AccessibleJTree)this.accessibleContext).fireVisibleDataPropertyChange();
- }
- }
- }
-
- }
-
- public void scrollRowToVisible(int var1) {
- this.scrollPathToVisible(this.getPathForRow(var1));
- }
-
- public TreePath getPathForRow(int var1) {
- TreeUI var2 = this.getUI();
- return var2 != null ? var2.getPathForRow(this, var1) : null;
- }
-
- public int getRowForPath(TreePath var1) {
- TreeUI var2 = this.getUI();
- return var2 != null ? var2.getRowForPath(this, var1) : -1;
- }
-
- public void expandPath(TreePath var1) {
- TreeModel var2 = this.getModel();
- if (var1 != null && var2 != null && !var2.isLeaf(var1.getLastPathComponent())) {
- this.setExpandedState(var1, true);
- }
-
- }
-
- public void expandRow(int var1) {
- this.expandPath(this.getPathForRow(var1));
- }
-
- public void collapsePath(TreePath var1) {
- this.setExpandedState(var1, false);
- }
-
- public void collapseRow(int var1) {
- this.collapsePath(this.getPathForRow(var1));
- }
-
- public TreePath getPathForLocation(int var1, int var2) {
- TreePath var3 = this.getClosestPathForLocation(var1, var2);
- if (var3 != null) {
- Rectangle var4 = this.getPathBounds(var3);
- if (var4 != null && var1 >= var4.x && var1 < var4.x + var4.width && var2 >= var4.y && var2 < var4.y + var4.height) {
- return var3;
- }
- }
-
- return null;
- }
-
- public int getRowForLocation(int var1, int var2) {
- return this.getRowForPath(this.getPathForLocation(var1, var2));
- }
-
- public TreePath getClosestPathForLocation(int var1, int var2) {
- TreeUI var3 = this.getUI();
- return var3 != null ? var3.getClosestPathForLocation(this, var1, var2) : null;
- }
-
- public int getClosestRowForLocation(int var1, int var2) {
- return this.getRowForPath(this.getClosestPathForLocation(var1, var2));
- }
-
- public boolean isEditing() {
- TreeUI var1 = this.getUI();
- return var1 != null ? var1.isEditing(this) : false;
- }
-
- public boolean stopEditing() {
- TreeUI var1 = this.getUI();
- return var1 != null ? var1.stopEditing(this) : false;
- }
-
- public void cancelEditing() {
- TreeUI var1 = this.getUI();
- if (var1 != null) {
- var1.cancelEditing(this);
- }
-
- }
-
- public void startEditingAtPath(TreePath var1) {
- TreeUI var2 = this.getUI();
- if (var2 != null) {
- var2.startEditingAtPath(this, var1);
- }
-
- }
-
- public TreePath getEditingPath() {
- TreeUI var1 = this.getUI();
- return var1 != null ? var1.getEditingPath(this) : null;
- }
-
- public void setSelectionModel(TreeSelectionModel var1) {
- if (var1 == null) {
- var1 = javax.swing.JTree.EmptySelectionModel.sharedInstance();
- }
-
- TreeSelectionModel var2 = this.selectionModel;
- if (this.selectionModel != null && this.selectionRedirector != null) {
- this.selectionModel.removeTreeSelectionListener(this.selectionRedirector);
- }
-
- if (this.accessibleContext != null) {
- this.selectionModel.removeTreeSelectionListener((TreeSelectionListener)this.accessibleContext);
- ((TreeSelectionModel)var1).addTreeSelectionListener((TreeSelectionListener)this.accessibleContext);
- }
-
- this.selectionModel = (TreeSelectionModel)var1;
- if (this.selectionRedirector != null) {
- this.selectionModel.addTreeSelectionListener(this.selectionRedirector);
- }
-
- this.firePropertyChange("selectionModel", var2, this.selectionModel);
- if (this.accessibleContext != null) {
- this.accessibleContext.firePropertyChange("AccessibleSelection", false, true);
- }
-
- }
-
- public TreeSelectionModel getSelectionModel() {
- return this.selectionModel;
- }
-
- protected TreePath[] getPathBetweenRows(int var1, int var2) {
- TreeUI var5 = this.getUI();
- int var3 = Math.min(var1, var2);
- int var4 = Math.max(var1, var2);
- if (var5 == null) {
- return null;
- } else {
- TreePath[] var6 = new TreePath[var4 - var3 + 1];
-
- for(int var7 = var3; var7 <= var4; ++var7) {
- var6[var7 - var3] = var5.getPathForRow(this, var7);
- }
-
- return var6;
- }
- }
-
- public void setSelectionInterval(int var1, int var2) {
- TreePath[] var3 = this.getPathBetweenRows(var1, var2);
- this.getSelectionModel().setSelectionPaths(var3);
- }
-
- public void addSelectionInterval(int var1, int var2) {
- TreePath[] var3 = this.getPathBetweenRows(var1, var2);
- this.getSelectionModel().addSelectionPaths(var3);
- }
-
- public void removeSelectionInterval(int var1, int var2) {
- TreePath[] var3 = this.getPathBetweenRows(var1, var2);
- this.getSelectionModel().removeSelectionPaths(var3);
- }
-
- public void removeSelectionPath(TreePath var1) {
- this.getSelectionModel().removeSelectionPath(var1);
- }
-
- public void removeSelectionPaths(TreePath[] var1) {
- this.getSelectionModel().removeSelectionPaths(var1);
- }
-
- public void removeSelectionRow(int var1) {
- int[] var2 = new int[]{var1};
- this.removeSelectionRows(var2);
- }
-
- public void removeSelectionRows(int[] var1) {
- TreeUI var2 = this.getUI();
- if (var2 != null && var1 != null) {
- int var3 = var1.length;
- TreePath[] var4 = new TreePath[var3];
-
- for(int var5 = 0; var5 < var3; ++var5) {
- var4[var5] = var2.getPathForRow(this, var1[var5]);
- }
-
- this.removeSelectionPaths(var4);
- }
-
- }
-
- public void clearSelection() {
- this.getSelectionModel().clearSelection();
- }
-
- public boolean isSelectionEmpty() {
- return this.getSelectionModel().isSelectionEmpty();
- }
-
- public void addTreeExpansionListener(TreeExpansionListener var1) {
- if (this.settingUI) {
- this.uiTreeExpansionListener = var1;
- }
-
- this.listenerList.add(TreeExpansionListener.class, var1);
- }
-
- public void removeTreeExpansionListener(TreeExpansionListener var1) {
- this.listenerList.remove(TreeExpansionListener.class, var1);
- if (this.uiTreeExpansionListener == var1) {
- this.uiTreeExpansionListener = null;
- }
-
- }
-
- public TreeExpansionListener[] getTreeExpansionListeners() {
- return (TreeExpansionListener[])this.listenerList.getListeners(TreeExpansionListener.class);
- }
-
- public void addTreeWillExpandListener(TreeWillExpandListener var1) {
- this.listenerList.add(TreeWillExpandListener.class, var1);
- }
-
- public void removeTreeWillExpandListener(TreeWillExpandListener var1) {
- this.listenerList.remove(TreeWillExpandListener.class, var1);
- }
-
- public TreeWillExpandListener[] getTreeWillExpandListeners() {
- return (TreeWillExpandListener[])this.listenerList.getListeners(TreeWillExpandListener.class);
- }
-
- public void fireTreeExpanded(TreePath var1) {
- Object[] var2 = this.listenerList.getListenerList();
- TreeExpansionEvent var3 = null;
- if (this.uiTreeExpansionListener != null) {
- var3 = new TreeExpansionEvent(this, var1);
- this.uiTreeExpansionListener.treeExpanded(var3);
- }
-
- for(int var4 = var2.length - 2; var4 >= 0; var4 -= 2) {
- if (var2[var4] == TreeExpansionListener.class && var2[var4 + 1] != this.uiTreeExpansionListener) {
- if (var3 == null) {
- var3 = new TreeExpansionEvent(this, var1);
- }
-
- ((TreeExpansionListener)var2[var4 + 1]).treeExpanded(var3);
- }
- }
-
- }
-
- public void fireTreeCollapsed(TreePath var1) {
- Object[] var2 = this.listenerList.getListenerList();
- TreeExpansionEvent var3 = null;
- if (this.uiTreeExpansionListener != null) {
- var3 = new TreeExpansionEvent(this, var1);
- this.uiTreeExpansionListener.treeCollapsed(var3);
- }
-
- for(int var4 = var2.length - 2; var4 >= 0; var4 -= 2) {
- if (var2[var4] == TreeExpansionListener.class && var2[var4 + 1] != this.uiTreeExpansionListener) {
- if (var3 == null) {
- var3 = new TreeExpansionEvent(this, var1);
- }
-
- ((TreeExpansionListener)var2[var4 + 1]).treeCollapsed(var3);
- }
- }
-
- }
-
- public void fireTreeWillExpand(TreePath var1) throws ExpandVetoException {
- Object[] var2 = this.listenerList.getListenerList();
- TreeExpansionEvent var3 = null;
-
- for(int var4 = var2.length - 2; var4 >= 0; var4 -= 2) {
- if (var2[var4] == TreeWillExpandListener.class) {
- if (var3 == null) {
- var3 = new TreeExpansionEvent(this, var1);
- }
-
- ((TreeWillExpandListener)var2[var4 + 1]).treeWillExpand(var3);
- }
- }
-
- }
-
- public void fireTreeWillCollapse(TreePath var1) throws ExpandVetoException {
- Object[] var2 = this.listenerList.getListenerList();
- TreeExpansionEvent var3 = null;
-
- for(int var4 = var2.length - 2; var4 >= 0; var4 -= 2) {
- if (var2[var4] == TreeWillExpandListener.class) {
- if (var3 == null) {
- var3 = new TreeExpansionEvent(this, var1);
- }
-
- ((TreeWillExpandListener)var2[var4 + 1]).treeWillCollapse(var3);
- }
- }
-
- }
-
- public void addTreeSelectionListener(TreeSelectionListener var1) {
- this.listenerList.add(TreeSelectionListener.class, var1);
- if (this.listenerList.getListenerCount(TreeSelectionListener.class) != 0 && this.selectionRedirector == null) {
- this.selectionRedirector = new TreeSelectionRedirector(this);
- this.selectionModel.addTreeSelectionListener(this.selectionRedirector);
- }
-
- }
-
- public void removeTreeSelectionListener(TreeSelectionListener var1) {
- this.listenerList.remove(TreeSelectionListener.class, var1);
- if (this.listenerList.getListenerCount(TreeSelectionListener.class) == 0 && this.selectionRedirector != null) {
- this.selectionModel.removeTreeSelectionListener(this.selectionRedirector);
- this.selectionRedirector = null;
- }
-
- }
-
- public TreeSelectionListener[] getTreeSelectionListeners() {
- return (TreeSelectionListener[])this.listenerList.getListeners(TreeSelectionListener.class);
- }
-
- protected void fireValueChanged(TreeSelectionEvent var1) {
- Object[] var2 = this.listenerList.getListenerList();
-
- for(int var3 = var2.length - 2; var3 >= 0; var3 -= 2) {
- if (var2[var3] == TreeSelectionListener.class) {
- ((TreeSelectionListener)var2[var3 + 1]).valueChanged(var1);
- }
- }
-
- }
-
- public void treeDidChange() {
- this.revalidate();
- this.repaint();
- }
-
- public void setVisibleRowCount(int var1) {
- int var2 = this.visibleRowCount;
- this.visibleRowCount = var1;
- this.firePropertyChange("visibleRowCount", var2, this.visibleRowCount);
- this.invalidate();
- if (this.accessibleContext != null) {
- ((AccessibleJTree)this.accessibleContext).fireVisibleDataPropertyChange();
- }
-
- }
-
- public int getVisibleRowCount() {
- return this.visibleRowCount;
- }
-
- private void expandRoot() {
- TreeModel var1 = this.getModel();
- if (var1 != null && var1.getRoot() != null) {
- this.expandPath(new TreePath(var1.getRoot()));
- }
-
- }
-
- public TreePath getNextMatch(String var1, int var2, Position.Bias var3) {
- int var4 = this.getRowCount();
- if (var1 == null) {
- throw new IllegalArgumentException();
- } else if (var2 >= 0 && var2 < var4) {
- var1 = var1.toUpperCase();
- int var5 = var3 == Bias.Forward ? 1 : -1;
- int var6 = var2;
-
- do {
- TreePath var7 = this.getPathForRow(var6);
- String var8 = this.convertValueToText(var7.getLastPathComponent(), this.isRowSelected(var6), this.isExpanded(var6), true, var6, false);
- if (var8.toUpperCase().startsWith(var1)) {
- return var7;
- }
-
- var6 = (var6 + var5 + var4) % var4;
- } while(var6 != var2);
-
- return null;
- } else {
- throw new IllegalArgumentException();
- }
- }
-
- private void writeObject(ObjectOutputStream var1) throws IOException {
- Vector var2 = new Vector();
- var1.defaultWriteObject();
- if (this.cellRenderer != null && this.cellRenderer instanceof Serializable) {
- var2.addElement("cellRenderer");
- var2.addElement(this.cellRenderer);
- }
-
- if (this.cellEditor != null && this.cellEditor instanceof Serializable) {
- var2.addElement("cellEditor");
- var2.addElement(this.cellEditor);
- }
-
- if (this.treeModel != null && this.treeModel instanceof Serializable) {
- var2.addElement("treeModel");
- var2.addElement(this.treeModel);
- }
-
- if (this.selectionModel != null && this.selectionModel instanceof Serializable) {
- var2.addElement("selectionModel");
- var2.addElement(this.selectionModel);
- }
-
- Object var3 = this.getArchivableExpandedState();
- if (var3 != null) {
- var2.addElement("expandedState");
- var2.addElement(var3);
- }
-
- var1.writeObject(var2);
- if (this.getUIClassID().equals("TreeUI")) {
- byte var4 = JComponent.getWriteObjCounter(this);
- --var4;
- JComponent.setWriteObjCounter(this, var4);
- if (var4 == 0 && this.ui != null) {
- this.ui.installUI(this);
- }
- }
-
- }
-
- private void readObject(ObjectInputStream var1) throws IOException, ClassNotFoundException {
- var1.defaultReadObject();
- this.expandedState = new Hashtable();
- this.expandedStack = new Stack();
- Vector var2 = (Vector)var1.readObject();
- int var3 = 0;
- int var4 = var2.size();
- if (var3 < var4 && var2.elementAt(var3).equals("cellRenderer")) {
- ++var3;
- this.cellRenderer = (TreeCellRenderer)var2.elementAt(var3);
- ++var3;
- }
-
- if (var3 < var4 && var2.elementAt(var3).equals("cellEditor")) {
- ++var3;
- this.cellEditor = (TreeCellEditor)var2.elementAt(var3);
- ++var3;
- }
-
- if (var3 < var4 && var2.elementAt(var3).equals("treeModel")) {
- ++var3;
- this.treeModel = (TreeModel)var2.elementAt(var3);
- ++var3;
- }
-
- if (var3 < var4 && var2.elementAt(var3).equals("selectionModel")) {
- ++var3;
- this.selectionModel = (TreeSelectionModel)var2.elementAt(var3);
- ++var3;
- }
-
- if (var3 < var4 && var2.elementAt(var3).equals("expandedState")) {
- ++var3;
- this.unarchiveExpandedState(var2.elementAt(var3));
- ++var3;
- }
-
- if (this.listenerList.getListenerCount(TreeSelectionListener.class) != 0) {
- this.selectionRedirector = new TreeSelectionRedirector(this);
- this.selectionModel.addTreeSelectionListener(this.selectionRedirector);
- }
-
- if (this.treeModel != null) {
- this.treeModelListener = this.createTreeModelListener();
- if (this.treeModelListener != null) {
- this.treeModel.addTreeModelListener(this.treeModelListener);
- }
- }
-
- }
-
- private Object getArchivableExpandedState() {
- TreeModel var1 = this.getModel();
- if (var1 != null) {
- Enumeration var2 = this.expandedState.keys();
- if (var2 != null) {
- Vector var3 = new Vector();
-
- while(var2.hasMoreElements()) {
- TreePath var4 = (TreePath)var2.nextElement();
-
- int[] var5;
- try {
- var5 = this.getModelIndexsForPath(var4);
- } catch (Error var7) {
- var5 = null;
- }
-
- if (var5 != null) {
- var3.addElement(var5);
- var3.addElement(this.expandedState.get(var4));
- }
- }
-
- return var3;
- }
- }
-
- return null;
- }
-
- private void unarchiveExpandedState(Object var1) {
- if (var1 instanceof Vector) {
- Vector var2 = (Vector)var1;
-
- for(int var3 = var2.size() - 1; var3 >= 0; --var3) {
- Boolean var4 = (Boolean)var2.elementAt(var3--);
-
- try {
- TreePath var5 = this.getPathForIndexs((int[])var2.elementAt(var3));
- if (var5 != null) {
- this.expandedState.put(var5, var4);
- }
- } catch (Error var7) {
- }
- }
- }
-
- }
-
- private int[] getModelIndexsForPath(TreePath var1) {
- if (var1 != null) {
- TreeModel var2 = this.getModel();
- int var3 = var1.getPathCount();
- int[] var4 = new int[var3 - 1];
- Object var5 = var2.getRoot();
-
- for(int var6 = 1; var6 < var3; ++var6) {
- var4[var6 - 1] = var2.getIndexOfChild(var5, var1.getPathComponent(var6));
- var5 = var1.getPathComponent(var6);
- if (var4[var6 - 1] < 0) {
- return null;
- }
- }
-
- return var4;
- } else {
- return null;
- }
- }
-
- private TreePath getPathForIndexs(int[] var1) {
- if (var1 == null) {
- return null;
- } else {
- TreeModel var2 = this.getModel();
- if (var2 == null) {
- return null;
- } else {
- int var3 = var1.length;
- Object var4 = var2.getRoot();
- TreePath var5 = new TreePath(var4);
-
- for(int var6 = 0; var6 < var3; ++var6) {
- var4 = var2.getChild(var4, var1[var6]);
- if (var4 == null) {
- return null;
- }
-
- var5 = var5.pathByAddingChild(var4);
- }
-
- return var5;
- }
- }
- }
-
- public Dimension getPreferredScrollableViewportSize() {
- int var1 = this.getPreferredSize().width;
- int var2 = this.getVisibleRowCount();
- int var3 = -1;
- if (this.isFixedRowHeight()) {
- var3 = var2 * this.getRowHeight();
- } else {
- TreeUI var4 = this.getUI();
- if (var4 != null && var2 > 0) {
- int var5 = var4.getRowCount(this);
- if (var5 >= var2) {
- Rectangle var6 = this.getRowBounds(var2 - 1);
- if (var6 != null) {
- var3 = var6.y + var6.height;
- }
- } else if (var5 > 0) {
- Rectangle var7 = this.getRowBounds(0);
- if (var7 != null) {
- var3 = var7.height * var2;
- }
- }
- }
-
- if (var3 == -1) {
- var3 = 16 * var2;
- }
- }
-
- return new Dimension(var1, var3);
- }
-
- public int getScrollableUnitIncrement(Rectangle var1, int var2, int var3) {
- if (var2 == 1) {
- int var5 = this.getClosestRowForLocation(0, var1.y);
- if (var5 != -1) {
- Rectangle var4 = this.getRowBounds(var5);
- if (var4.y != var1.y) {
- if (var3 < 0) {
- return Math.max(0, var1.y - var4.y);
- }
-
- return var4.y + var4.height - var1.y;
- }
-
- if (var3 >= 0) {
- return var4.height;
- }
-
- if (var5 != 0) {
- var4 = this.getRowBounds(var5 - 1);
- return var4.height;
- }
- }
-
- return 0;
- } else {
- return 4;
- }
- }
-
- public int getScrollableBlockIncrement(Rectangle var1, int var2, int var3) {
- return var2 == 1 ? var1.height : var1.width;
- }
-
- public boolean getScrollableTracksViewportWidth() {
- if (this.getParent() instanceof JViewport) {
- return ((JViewport)this.getParent()).getWidth() > this.getPreferredSize().width;
- } else {
- return false;
- }
- }
-
- public boolean getScrollableTracksViewportHeight() {
- if (this.getParent() instanceof JViewport) {
- return ((JViewport)this.getParent()).getHeight() > this.getPreferredSize().height;
- } else {
- return false;
- }
- }
-
- protected void setExpandedState(TreePath var1, boolean var2) {
- if (var1 != null) {
- TreePath var4 = var1.getParentPath();
- Stack var3;
- if (this.expandedStack.size() == 0) {
- var3 = new Stack();
- } else {
- var3 = (Stack)this.expandedStack.pop();
- }
-
- try {
- label190:
- while(true) {
- if (var4 == null) {
- int var5 = var3.size() - 1;
-
- while(true) {
- if (var5 < 0) {
- break label190;
- }
-
- var4 = (TreePath)var3.pop();
- if (!this.isExpanded(var4)) {
- try {
- this.fireTreeWillExpand(var4);
- } catch (ExpandVetoException var14) {
- return;
- }
-
- this.expandedState.put(var4, Boolean.TRUE);
- this.fireTreeExpanded(var4);
- if (this.accessibleContext != null) {
- ((AccessibleJTree)this.accessibleContext).fireVisibleDataPropertyChange();
- }
- }
-
- --var5;
- }
- }
-
- if (this.isExpanded(var4)) {
- var4 = null;
- } else {
- var3.push(var4);
- var4 = var4.getParentPath();
- }
- }
- } finally {
- if (this.expandedStack.size() < TEMP_STACK_SIZE) {
- var3.removeAllElements();
- this.expandedStack.push(var3);
- }
-
- }
-
- if (!var2) {
- Object var17 = this.expandedState.get(var1);
- if (var17 != null && (Boolean)var17) {
- try {
- this.fireTreeWillCollapse(var1);
- } catch (ExpandVetoException var13) {
- return;
- }
-
- this.expandedState.put(var1, Boolean.FALSE);
- this.fireTreeCollapsed(var1);
- if (this.removeDescendantSelectedPaths(var1, false) && !this.isPathSelected(var1)) {
- this.addSelectionPath(var1);
- }
-
- if (this.accessibleContext != null) {
- ((AccessibleJTree)this.accessibleContext).fireVisibleDataPropertyChange();
- }
- }
- } else {
- Object var18 = this.expandedState.get(var1);
- if (var18 == null || !(Boolean)var18) {
- try {
- this.fireTreeWillExpand(var1);
- } catch (ExpandVetoException var12) {
- return;
- }
-
- this.expandedState.put(var1, Boolean.TRUE);
- this.fireTreeExpanded(var1);
- if (this.accessibleContext != null) {
- ((AccessibleJTree)this.accessibleContext).fireVisibleDataPropertyChange();
- }
- }
- }
- }
-
- }
-
- protected Enumeration<TreePath> getDescendantToggledPaths(TreePath var1) {
- if (var1 == null) {
- return null;
- } else {
- Vector var2 = new Vector();
- Enumeration var3 = this.expandedState.keys();
-
- while(var3.hasMoreElements()) {
- TreePath var4 = (TreePath)var3.nextElement();
- if (var1.isDescendant(var4)) {
- var2.addElement(var4);
- }
- }
-
- return var2.elements();
- }
- }
-
- protected void removeDescendantToggledPaths(Enumeration<TreePath> var1) {
- if (var1 != null) {
- while(var1.hasMoreElements()) {
- Enumeration var2 = this.getDescendantToggledPaths((TreePath)var1.nextElement());
- if (var2 != null) {
- while(var2.hasMoreElements()) {
- this.expandedState.remove(var2.nextElement());
- }
- }
- }
- }
-
- }
-
- protected void clearToggledPaths() {
- this.expandedState.clear();
- }
-
- protected TreeModelListener createTreeModelListener() {
- return new TreeModelHandler(this);
- }
-
- protected boolean removeDescendantSelectedPaths(TreePath var1, boolean var2) {
- TreePath[] var3 = this.getDescendantSelectedPaths(var1, var2);
- if (var3 != null) {
- this.getSelectionModel().removeSelectionPaths(var3);
- return true;
- } else {
- return false;
- }
- }
-
- private TreePath[] getDescendantSelectedPaths(TreePath var1, boolean var2) {
- TreeSelectionModel var3 = this.getSelectionModel();
- TreePath[] var4 = var3 != null ? var3.getSelectionPaths() : null;
- if (var4 == null) {
- return null;
- } else {
- boolean var5 = false;
-
- for(int var6 = var4.length - 1; var6 >= 0; --var6) {
- if (var4[var6] == null || !var1.isDescendant(var4[var6]) || var1.equals(var4[var6]) && !var2) {
- var4[var6] = null;
- } else {
- var5 = true;
- }
- }
-
- if (!var5) {
- var4 = null;
- }
-
- return var4;
- }
- }
-
- void removeDescendantSelectedPaths(TreeModelEvent var1) {
- TreePath var2 = var1.getTreePath();
- Object[] var3 = var1.getChildren();
- TreeSelectionModel var4 = this.getSelectionModel();
- if (var4 != null && var2 != null && var3 != null && var3.length > 0) {
- for(int var5 = var3.length - 1; var5 >= 0; --var5) {
- this.removeDescendantSelectedPaths(var2.pathByAddingChild(var3[var5]), true);
- }
- }
-
- }
-
- void setUIProperty(String var1, Object var2) {
- if (var1 == "rowHeight") {
- if (!this.rowHeightSet) {
- this.setRowHeight(((Number)var2).intValue());
- this.rowHeightSet = false;
- }
- } else if (var1 == "scrollsOnExpand") {
- if (!this.scrollsOnExpandSet) {
- this.setScrollsOnExpand((Boolean)var2);
- this.scrollsOnExpandSet = false;
- }
- } else if (var1 == "showsRootHandles") {
- if (!this.showsRootHandlesSet) {
- this.setShowsRootHandles((Boolean)var2);
- this.showsRootHandlesSet = false;
- }
- } else {
- super.setUIProperty(var1, var2);
- }
-
- }
-
- protected String paramString() {
- String var1 = this.rootVisible ? "true" : "false";
- String var2 = this.showsRootHandles ? "true" : "false";
- String var3 = this.editable ? "true" : "false";
- String var4 = this.largeModel ? "true" : "false";
- String var5 = this.invokesStopCellEditing ? "true" : "false";
- String var6 = this.scrollsOnExpand ? "true" : "false";
- return super.paramString() + ",editable=" + var3 + ",invokesStopCellEditing=" + var5 + ",largeModel=" + var4 + ",rootVisible=" + var1 + ",rowHeight=" + this.rowHeight + ",scrollsOnExpand=" + var6 + ",showsRootHandles=" + var2 + ",toggleClickCount=" + this.toggleClickCount + ",visibleRowCount=" + this.visibleRowCount;
- }
-
- public AccessibleContext getAccessibleContext() {
- if (this.accessibleContext == null) {
- this.accessibleContext = new AccessibleJTree(this);
- }
-
- return this.accessibleContext;
- }
-
- // $FF: synthetic method
- static int access$000(JTree var0) {
- return var0.expandRow;
- }
-
- // $FF: synthetic method
- static Hashtable access$200(JTree var0) {
- return var0.expandedState;
- }
- }
-