home *** CD-ROM | disk | FTP | other *** search
- package com.sun.java.swing.plaf.basic;
-
- import com.sun.java.swing.AbstractAction;
- import java.awt.Dimension;
- import java.awt.Rectangle;
- import java.awt.event.ActionEvent;
- import java.io.Serializable;
-
- class BasicTreeUI$TreePageAction extends AbstractAction implements Serializable {
- // $FF: synthetic field
- private final BasicTreeUI this$0;
- private int direction;
-
- public BasicTreeUI$TreePageAction(BasicTreeUI var1, int var2, String var3) {
- super(var3);
- this.this$0 = var1;
- this.this$0 = var1;
- this.direction = var2;
- }
-
- public void actionPerformed(ActionEvent var1) {
- if (this.this$0.tree != null && this.this$0.getRowCount() > 0 && this.this$0.treeSelectionModel != null) {
- Dimension var3 = this.this$0.tree.getSize();
- Rectangle var7 = this.this$0.tree.getVisibleRect();
- int var8 = Math.max(0, var3.height - var7.height);
- int var5;
- if (this.direction == -1) {
- var5 = this.this$0.getMinSelectionRow();
- } else {
- var5 = this.this$0.getMaxSelectionRow();
- }
-
- if (var5 != -1) {
- Rectangle var6 = this.this$0.getRowBounds(var5);
- if (this.direction == -1) {
- var7.y = Math.max(0, var6.y + var6.height - var7.height);
- } else {
- var7.y = Math.min(var8, var6.y);
- }
- } else {
- var7.y = Math.min(var8, var7.y + var7.height * this.direction);
- }
-
- int var4;
- if (this.direction == 1) {
- var4 = this.this$0.getClosestRowForLocation(var7.x, var7.y + var7.height - 1);
- Rectangle var9 = this.this$0.getRowBounds(var4);
- var7.y = Math.min(var8, var9.y + var9.height - var7.height);
- } else {
- var4 = this.this$0.getClosestRowForLocation(var7.x, var7.y + 1);
- Rectangle var10 = this.this$0.getRowBounds(var4);
- var7.y = Math.min(var8, var10.y);
- }
-
- this.this$0.tree.scrollRectToVisible(var7);
- this.this$0.tree.setSelectionRow(var4);
- }
-
- }
-
- public boolean isEnabled() {
- return this.this$0.tree != null && this.this$0.tree.isEnabled();
- }
- }
-