home *** CD-ROM | disk | FTP | other *** search
- package com.sun.java.swing.plaf.basic;
-
- import com.sun.java.swing.AbstractAction;
- import java.awt.event.ActionEvent;
- import java.io.Serializable;
-
- class BasicTreeUI$TreeTraverseAction extends AbstractAction implements Serializable {
- // $FF: synthetic field
- private final BasicTreeUI this$0;
- private int direction;
-
- public BasicTreeUI$TreeTraverseAction(BasicTreeUI var1, int var2, String var3) {
- super(var3);
- this.this$0 = var1;
- this.this$0 = var1;
- this.direction = var2;
- }
-
- public void actionPerformed(ActionEvent var1) {
- int var2;
- if (this.this$0.tree != null && (var2 = this.this$0.getRowCount()) > 0) {
- int var3 = this.this$0.tree.getMinSelectionRow();
- int var4;
- if (var3 == -1) {
- var4 = 0;
- } else if (this.direction == 1) {
- if (!this.this$0.isLeaf(var3) && !this.this$0.isExpanded(var3)) {
- this.this$0.expandRow(var3);
- var4 = -1;
- } else {
- var4 = Math.min(var3 + 1, var2 - 1);
- }
- } else if (!this.this$0.isLeaf(var3) && this.this$0.isExpanded(var3)) {
- this.this$0.collapseRow(var3);
- var4 = -1;
- } else {
- try {
- if (!this.this$0.largeModel) {
- var4 = ((VisibleTreeNode)this.this$0.getNode(var3).getParent()).getRow();
- } else {
- int[] var5 = new int[1];
- LargeTreeModelNode var6 = this.this$0.getLargeParentAndChildIndexOfRow(var3, var5);
- var4 = var6.getRow();
- }
- } catch (Exception var7) {
- var4 = -1;
- }
- }
-
- if (var4 != -1) {
- this.this$0.tree.setSelectionInterval(var4, var4);
- this.this$0.ensureRowsAreVisible(var4, var4);
- }
- }
-
- }
-
- public boolean isEnabled() {
- return this.this$0.tree != null && this.this$0.tree.isEnabled();
- }
- }
-