home *** CD-ROM | disk | FTP | other *** search
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Container;
- import java.awt.Dimension;
- import java.awt.Event;
- import java.awt.Font;
- import java.awt.FontMetrics;
- import java.awt.Graphics;
- import java.awt.Image;
- import java.awt.Panel;
- import java.awt.Rectangle;
- import java.awt.Scrollbar;
- import java.awt.image.ImageObserver;
- import java.beans.BeanInfo;
- import java.beans.Introspector;
- import java.util.Date;
- import java.util.StringTokenizer;
- import java.util.Vector;
-
- public class JDPTreePicker extends Panel {
- JDPUser user;
- Panel targetPanel;
- JDPDragItem dragPanel;
- Scrollbar scrollEast;
- Scrollbar scrollSouth;
- static final String[] iconNames = new String[]{"Folder", "Table", "Multiple Table", "Database", "Computer", "Person", "Databases", "Search", "Document", "Drive", "Printer", "blank", "Arrow", "Picture", "Label", "TextField", "ChiselFrame", "Button", "Checkbox", "RadioButton", "Choice", "List", "ScrollSouth", "ScrollEast", "Panel", "TabPanel", "Tree", "Grid", "HotKey", "Slider", "Progress", "Spinner", "Custom", "Chart", "Report", "Email", "Pager", "Calendar", "Dialog", "RMI"};
- public static final int FOLDER = 0;
- public static final int TABLE = 1;
- public static final int MULTIPLE_TABLE = 2;
- public static final int DATABASE = 3;
- public static final int COMPUTER = 4;
- public static final int PERSON = 5;
- public static final int MULTIPLE_DATABASE = 6;
- public static final int SEARCH = 7;
- public static final int DOCUMENT = 8;
- public static final int DRIVE = 9;
- public static final int PRINTER = 10;
- public static final int BLANK1 = 11;
- public static final int BLANK2 = 11;
- public static final int BLANK3 = 11;
- public static final int ARROW = 12;
- public static final int PICTURE = 13;
- public static final int LABEL = 14;
- public static final int TEXTFIELD = 15;
- public static final int CHISELFRAME = 16;
- public static final int BUTTON = 17;
- public static final int CHECKBOX = 18;
- public static final int RADIO = 19;
- public static final int CHOICE = 20;
- public static final int LIST = 21;
- public static final int SCROLLSOUTH = 22;
- public static final int SCROLLEAST = 23;
- public static final int PANEL = 24;
- public static final int TAB = 25;
- public static final int TREE = 26;
- public static final int GRID = 27;
- public static final int HOTKEY = 28;
- public static final int SLIDER = 29;
- public static final int PROGRESS = 30;
- public static final int SPINNER = 31;
- public static final int CUSTOM = 32;
- public static final int CHART = 33;
- public static final int REPORT = 34;
- public static final int EMAIL = 35;
- public static final int PAGER = 36;
- public static final int CALENDAR = 37;
- public static final int DIALOG = 38;
- public static final int RMI = 39;
- public static final int TREE_WIDTH_RESIZED = 10010;
- Image offscreen;
- Image offscreen1;
- Rectangle offscreensize;
- // $FF: renamed from: gr java.awt.Graphics
- Graphics field_0;
- static Image defaultIconImage;
- Image iconImage;
- Image iconImages;
- Graphics grI;
- JDPImageLoader imageLoader;
- static JDesignerPro thisJDP;
- JDPTreeBranch treeRoot;
- JDPTreeBranch parentBranch;
- JDPTreeBranch lastCheckedParentBranch;
- int[] icons;
- boolean[] expanded;
- boolean[] dragAndDrops;
- Object[] dropKeys;
- String[] dropMessages;
- Object thisObject;
- String compType;
- String compPosition;
- String[] text;
- String[][] properties;
- Vector treeVector;
- int xOffset;
- int yOffset;
- int currheight;
- int currxpoint = 10;
- int currypoint = 10;
- int lastxpoint = 10;
- int lastypoint = 10;
- Rectangle Bounds;
- Rectangle widthRect;
- boolean resizingAllowed = true;
- int[] widths;
- Font lastFont;
- // $FF: renamed from: fm java.awt.FontMetrics
- FontMetrics field_1;
- Font prevFont;
- Color prevForeground;
- Color prevBackground;
- int cursorPos;
- int initcursorPos;
- int lastevtx;
- int lastevty;
- boolean lastnoleaves;
- int maxWidth;
- int maxHeight;
- int minimumWidth = 140;
- int minimumHeight = 40;
- int currentWidth;
- boolean draggingWidth;
- int currentIndex = -1;
- int nextIndex;
- JDPTreeBranch currentBranchSelected;
- JDPTreeBranch lastAddedBranch;
- String[] currentBranch;
- int[] currentBranchIcons;
- int currentBranchLvl = -1;
- Event thisEvent;
- boolean nothingChanged;
- boolean stillDragging;
- int dragXoffset;
- int dragYoffset;
- int xpOffset;
- int ypOffset;
- public boolean autoScrollOn = true;
- boolean startMouseDrag;
- int startMouseX;
- int startMouseY;
- boolean dropEvent;
- boolean onPage;
- boolean drawnSelected = true;
- int scrollDown;
- boolean listOnly;
- long lastEventTime;
- int makeVisibleRequest = -1;
- boolean showCompPosition;
- boolean allowMultiple;
- boolean threeDBorder = true;
- boolean selectionsAreCheckboxes;
- boolean allowChangeOrder;
- boolean scrollEastDisabled;
- boolean scrollSouthDisabled;
- String searchString = "";
- Event dragPanelEvent;
- String[] columnHeader;
- int[] columnWidth;
- int colHeaderHeight = 16;
- Rectangle[] columnHeaderRects;
- Rectangle[] columnResizeRects;
- boolean[] rightJustify;
- StringTokenizer stok;
- int saveColumnWidth;
- int dragCol;
- int initColXpoint;
- boolean draggingColMouse;
- int currentXpos;
- boolean performRedraw;
- Color textHighlightText;
- Color textHighlight;
- Color controlColor;
- Color backColor;
- boolean hasFocus;
- boolean alwaysHasFocus;
- public static final int ITEM_MOVED = 10001;
- public static final int COLUMN_RESIZED = 10002;
- public static final int COLUMN_SELECTED = 10003;
-
- public int getSelectedLvl() {
- return this.currentBranchLvl;
- }
-
- public void sortTree() {
- this.sortTree(this.treeRoot, false, (boolean[])null, 0);
- }
-
- public void sortTree(JDPTreeBranch var1) {
- this.sortTree(var1, false, (boolean[])null, 0);
- }
-
- public void sortTree(JDPTreeBranch var1, boolean var2) {
- this.sortTree(var1, var2, (boolean[])null, 0);
- }
-
- public void sortTree(JDPTreeBranch var1, boolean[] var2) {
- this.sortTree(var1, false, var2, 0);
- }
-
- public void sortTree(JDPTreeBranch var1, boolean var2, boolean[] var3) {
- this.sortTree(var1, var2, var3, 0);
- }
-
- void sortTree(JDPTreeBranch var1, boolean var2, boolean[] var3, int var4) {
- String var7 = null;
- int var8 = 0;
- if (var1.leaves != null) {
- if (var3 == null || var3.length <= var4 || !var3[var4]) {
- for(int var9 = 0; var9 < var1.leaves.size(); ++var9) {
- for(int var10 = var9; var10 < var1.leaves.size(); ++var10) {
- JDPTreeBranch var6 = (JDPTreeBranch)var1.leaves.elementAt(var10);
- if (var2) {
- if (var7 == null || var6.name.toLowerCase().compareTo(var7) < 0) {
- var7 = var6.name.toLowerCase();
- var8 = var10;
- }
- } else if (var7 == null || var6.name.compareTo(var7) < 0) {
- var7 = var6.name;
- var8 = var10;
- }
- }
-
- if (var9 < var8 || var8 != 0) {
- JDPTreeBranch var5 = (JDPTreeBranch)var1.leaves.elementAt(var9);
- var1.leaves.setElementAt(var1.leaves.elementAt(var8), var9);
- var1.leaves.setElementAt(var5, var8);
- if (this.listOnly) {
- ((JDPTreeBranch)var1.leaves.elementAt(var9)).branchIndex = var9;
- ((JDPTreeBranch)var1.leaves.elementAt(var8)).branchIndex = var8;
- }
- }
-
- var7 = null;
- var8 = 0;
- }
- }
-
- for(int var12 = 0; var12 < var1.leaves.size(); ++var12) {
- JDPTreeBranch var11 = (JDPTreeBranch)var1.leaves.elementAt(var12);
- this.sortTree(var11, var2, var3, var4 + 1);
- }
- }
-
- }
-
- void repaintColHead(int var1, int var2) {
- if (this.draggingColMouse) {
- if (this.saveColumnWidth + var2 - this.initColXpoint > 10) {
- this.columnWidth[var1] = this.saveColumnWidth + var2 - this.initColXpoint;
- this.nothingChanged = false;
- ((Component)this).repaint(this.initColXpoint - this.saveColumnWidth, 1, this.Bounds.width + 1000, this.colHeaderHeight + 2);
- return;
- }
- } else {
- this.currentXpos = var2;
- this.nothingChanged = false;
- ((Component)this).repaint(0, 1, this.Bounds.width + 1000, this.colHeaderHeight + 2);
- }
-
- }
-
- public void makeVisible(int var1) {
- if (var1 >= 0) {
- this.makeVisibleRequest = var1;
- this.reDraw();
- }
- }
-
- void resetRectangles(JDPTreeBranch var1) {
- if (var1 != null) {
- var1.expandRect = null;
- var1.textRect = null;
- if (var1.leaves != null) {
- for(int var2 = 0; var2 < var1.leaves.size(); ++var2) {
- this.resetRectangles((JDPTreeBranch)var1.leaves.elementAt(var2));
- }
- }
-
- }
- }
-
- public void layout() {
- ((Component)this).repaint();
- }
-
- public JDPTreeBranch addNewBranch(JDPTreeBranch var1, String var2, int var3, boolean var4, Object var5, String var6, boolean var7) {
- this.addItem(var1, var2, var3, var4, var5, var6, var7);
- ++this.nextIndex;
- return this.lastAddedBranch;
- }
-
- public JDPTreeBranch addNewBranch(JDPTreeBranch var1, String var2, int var3) {
- Object var4 = null;
- int var5 = this.getTreeBranch(var1).length;
- if (this.dropKeys != null && this.dropKeys.length > var5 + 1) {
- var4 = this.dropKeys[var5 + 1];
- }
-
- String var6 = null;
- if (this.dropMessages != null && this.dropMessages.length > var5 + 1) {
- var6 = this.dropMessages[var5 + 1];
- }
-
- return this.addNewBranch(var1, var2, var3, var4, var6, (String)null);
- }
-
- public JDPTreeBranch addNewBranch(JDPTreeBranch var1, String var2, int var3, Object var4, String var5, String var6) {
- int var7 = this.getTreeBranch(var1).length;
- boolean var8 = false;
- if (this.dragAndDrops != null && this.dragAndDrops.length > var7 + 1) {
- var8 = this.dragAndDrops[var7 + 1];
- }
-
- this.addItem(var1, var2, var3, var8, var4, var5, this.expanded[var7 + 1]);
- ++this.nextIndex;
- this.lastAddedBranch.compType = var6;
- return this.lastAddedBranch;
- }
-
- public boolean removeTreeBranch(JDPTreeBranch var1) {
- JDPTreeBranch[] var2 = this.getTreeBranch(var1);
- var1.leaves = null;
- var1.leaves = new Vector();
- if (var2.length > 1) {
- JDPTreeBranch var3 = var2[var2.length - 2];
- int var4 = var3.leaves.indexOf(var1);
- if (var4 >= 0) {
- var3.leaves.removeElementAt(var4);
- }
-
- Object var5 = null;
- }
-
- this.nothingChanged = false;
- ((Component)this).repaint();
- return true;
- }
-
- public JDPTreeBranch getCurrentBranch() {
- return this.currentBranchSelected;
- }
-
- public void setIconImagePath(String var1) {
- this.imageLoader = new JDPImageLoader(this.user, this, var1);
- (new Thread(this.imageLoader)).start();
- }
-
- public JDPTreeBranch setRoot(String var1, boolean var2) {
- return this.setRoot(var1, var2, 0);
- }
-
- public JDPTreeBranch setRoot(String var1, boolean var2, int var3) {
- this.nothingChanged = false;
- this.treeRoot = null;
- if (this.user.JDesignerPro != null) {
- this.user.JDesignerPro.gc();
- }
-
- this.treeRoot = new JDPTreeBranch();
- this.treeRoot.name = var1;
- this.treeRoot.expanded = var2;
- this.treeRoot.selected = false;
- this.treeRoot.leaves = new Vector();
- if (this.icons != null) {
- this.treeRoot.icon = this.icons[0];
- } else {
- this.treeRoot.icon = var3;
- }
-
- if (this.dragAndDrops != null) {
- this.treeRoot.dragAndDrop = this.dragAndDrops[0];
- } else {
- this.treeRoot.dragAndDrop = false;
- }
-
- if (this.dropKeys != null) {
- this.treeRoot.dropKey = this.dropKeys[0];
- } else {
- this.treeRoot.dropKey = null;
- }
-
- if (this.dropMessages != null) {
- this.treeRoot.dropMessage = this.dropMessages[0];
- } else {
- this.treeRoot.dropMessage = null;
- }
-
- this.xOffset = 0;
- this.yOffset = 0;
- this.currentIndex = -1;
- this.nextIndex = 0;
- this.currentBranchSelected = null;
- this.lastAddedBranch = null;
- this.currentBranch = null;
- this.currentBranchIcons = null;
- this.currentBranchLvl = -1;
- this.nothingChanged = false;
- ((Component)this).repaint();
- return this.treeRoot;
- }
-
- int drawIcon(JDPTreeBranch var1, int var2, int var3, boolean var4) {
- int var5 = var1.icon;
- byte var6 = 0;
- if (this.selectionsAreCheckboxes) {
- Color var7 = this.field_0.getColor();
- byte var8 = 0;
- if (var5 < 0) {
- var8 = 20;
- }
-
- var2 += var8;
- this.field_0.setColor(JDPUtils.darker(this.controlColor));
- this.field_0.drawRect(var2 - 15, var3 - 1, 10, 10);
- if (var4) {
- this.field_0.setColor(Color.black);
- this.field_0.drawLine(var2 - 13, var3 + 3, var2 - 11, var3 + 5);
- this.field_0.drawLine(var2 - 13, var3 + 4, var2 - 11, var3 + 6);
- this.field_0.drawLine(var2 - 13, var3 + 5, var2 - 11, var3 + 7);
- this.field_0.drawLine(var2 - 11, var3 + 5, var2 - 7, var3 + 1);
- this.field_0.drawLine(var2 - 11, var3 + 6, var2 - 7, var3 + 2);
- this.field_0.drawLine(var2 - 11, var3 + 7, var2 - 7, var3 + 3);
- }
-
- this.field_0.setColor(var7);
- }
-
- if (var5 < 0 && this.listOnly) {
- return var6;
- } else {
- if (var5 == -1 && var1.iconImage == null) {
- this.loadBeanInfo(var1);
- var5 = var1.icon;
- var6 = 21;
- }
-
- byte var9 = 0;
- if (var4) {
- var9 = 1;
- }
-
- if (this.iconImages == null) {
- this.iconImages = ((Component)this).createImage(20, 18);
- }
-
- this.grI = this.iconImages.getGraphics();
- this.grI.setColor(this.backColor);
- this.grI.fillRect(0, 0, this.Bounds.width, this.Bounds.height);
- if (var1.iconImage != null) {
- boolean var10 = this.field_0.drawImage(var1.iconImage, var2 - 1 + var6, var3 - 3, (ImageObserver)null);
- if (!var10) {
- this.performRedraw = true;
- }
- } else {
- this.grI.drawImage(this.iconImage, -var5 * 20, -var9 * 19, (ImageObserver)null);
- this.field_0.drawImage(this.iconImages, var2 - 3 + var6, var3 - 3, (ImageObserver)null);
- }
-
- if (var2 > 10 && !this.listOnly) {
- this.field_0.setColor(this.controlColor);
- this.field_0.drawLine(var2 - 3, var3 + 4, var2 - 3, var3 + 4);
- this.field_0.setColor(Color.black);
- }
-
- return var6;
- }
- }
-
- public void selectRoot() {
- this.currentBranch = new String[1];
- this.currentBranchIcons = new int[1];
- this.currentBranch[0] = this.treeRoot.name;
- this.currentBranchIcons[0] = this.treeRoot.icon;
- this.currentBranchLvl = 0;
- this.resetSelections(this.treeRoot);
- this.treeRoot.selected = true;
- this.xOffset = 0;
- this.yOffset = 0;
- this.scrollDown = 0;
- this.drawnSelected = false;
- this.nothingChanged = false;
- ((Component)this).repaint();
- }
-
- public void setProperties(String[][] var1) {
- this.properties = var1;
- }
-
- public int getMinHeight() {
- return this.minimumHeight;
- }
-
- public void setMinHeight(int var1) {
- this.minimumHeight = var1;
- Container var2 = ((Component)this).getParent();
- this.layout();
-
- while(var2 != null) {
- ((Component)var2).layout();
- ((Component)var2).repaint();
- ((Component)var2).paintAll(((Component)var2).getGraphics());
- var2 = ((Component)var2).getParent();
- }
-
- this.nothingChanged = false;
- ((Component)this).repaint();
- if (this.user.jdpMenuPanel != null) {
- this.user.jdpMenuPanel.reloadTab();
- }
-
- }
-
- int StringHeight() {
- if (this.field_0 == null) {
- return 0;
- } else {
- if (this.field_0.getFont() != this.lastFont) {
- this.getFontWidths();
- this.lastFont = this.field_0.getFont();
- }
-
- return this.field_1.getHeight();
- }
- }
-
- void createTree(JDPUser var1, Panel var2, JDPDragItem var3) {
- this.user = var1;
- this.targetPanel = var2;
- this.dragPanel = var3;
- this.textHighlightText = JDPUtils.getTextHighlightText();
- this.textHighlight = JDPUtils.getTextHighlight();
- this.iconImage = defaultIconImage;
- this.checkIconsLoaded();
- ((Component)this).setBackground(Color.white);
- this.iconImages = ((Component)this).createImage(20, 18);
- this.expanded = new boolean[50];
- if (!JDPUser.classactivated) {
- System.out.println("Software Violation - this class may only be used in conjunction with JDesignerPro.");
- } else {
- ((Component)this).show();
- if (var1 != null && var1.JDesignerPro != null) {
- var1.JDesignerPro.gc();
- }
-
- }
- }
-
- public JDPTreeBranch addEntry(String[] var1, int[] var2, Object var3, String var4, String var5, String[] var6, String[][] var7, Vector var8) {
- int[] var9 = this.icons;
- this.setIcons(var2);
- this.setObject(var3);
- this.setCompType(var4);
- this.setPosition(var5);
- this.setText(var6);
- this.setProperties(var7);
- this.setTreeVector(var8);
- this.lastAddedBranch = null;
- this.addEntry(var1);
- this.icons = var9;
- this.setObject((Object)null);
- this.setCompType((String)null);
- this.setPosition((String)null);
- return this.lastAddedBranch;
- }
-
- public void setTargetPanel(Panel var1) {
- this.targetPanel = var1;
- }
-
- public boolean addEntry(String[] var1, int[] var2, String var3) {
- return this.addEntry(var1, var2, var3, false);
- }
-
- public boolean addEntry(String[] var1, int[] var2, String var3, boolean var4) {
- int[] var5 = this.icons;
- this.setIcons(var2);
- this.setObject((Object)null);
- this.setCompType(var3);
- this.setPosition((String)null);
- boolean var6 = this.addEntry(var1, var4);
- this.icons = var5;
- this.setCompType((String)null);
- return var6;
- }
-
- public boolean addEntry(String[] var1) {
- return this.addEntry(var1, false);
- }
-
- public boolean addEntry(String[] var1, boolean var2) {
- return this.addEntry(var1, false, false);
- }
-
- public boolean addEntry(String[] var1, boolean var2, boolean var3) {
- this.nothingChanged = false;
- Vector var4 = this.getBranch(this.treeRoot, var1, 0, var2);
- int var5 = Integer.parseInt((String)var4.elementAt(1));
- JDPTreeBranch var6 = (JDPTreeBranch)var4.elementAt(0);
- if (var5 < 0 && !var3) {
- return true;
- } else {
- int var7;
- for(var7 = var1.length - 1; var7 >= 0 && var1[var7] == null; --var7) {
- }
-
- ++var7;
- if (var5 < 0) {
- var5 = var7 - 1;
- }
-
- for(int var8 = var5; var8 < var7; ++var8) {
- int var9 = 0;
- if (this.icons != null && this.icons.length > var8 + 1) {
- var9 = this.icons[var8 + 1];
- }
-
- boolean var10 = false;
- if (this.dragAndDrops != null && this.dragAndDrops.length > var8 + 1) {
- var10 = this.dragAndDrops[var8 + 1];
- }
-
- Object var11 = null;
- if (this.dropKeys != null && this.dropKeys.length > var8 + 1) {
- var11 = this.dropKeys[var8 + 1];
- }
-
- String var12 = null;
- if (this.dropMessages != null && this.dropMessages.length > var8 + 1) {
- var12 = this.dropMessages[var8 + 1];
- }
-
- if (var1[var8] != null) {
- var6 = this.addItem(var6, var1[var8], var9, var10, var11, var12, this.expanded[var8 + 1]);
- }
- }
-
- ++this.nextIndex;
- return false;
- }
- }
-
- public void setSelectionsCheckboxes(boolean var1) {
- this.selectionsAreCheckboxes = var1;
- if (var1) {
- this.allowMultiple = var1;
- }
-
- }
-
- public boolean getSelectionsCheckboxes() {
- return this.selectionsAreCheckboxes;
- }
-
- public void setIcons(int[] var1) {
- this.icons = var1;
- }
-
- public int[] getSelectedBranchIcons() {
- return this.currentBranchIcons;
- }
-
- public boolean removeBranch(String[] var1) {
- return this.remBranch(this.treeRoot, var1, 0);
- }
-
- boolean remBranch(JDPTreeBranch var1, String[] var2, int var3) {
- if (var1 == null) {
- return false;
- } else {
- this.nothingChanged = false;
- if (var1 == this.treeRoot && var3 == 0) {
- if (var1.name != null && var1.name.equals(var2[var3])) {
- if (var3 + 1 != var2.length && var2[var3 + 1] != null) {
- return this.remBranch(var1, var2, var3 + 1);
- }
-
- this.setRoot("", false);
- return true;
- }
- } else if (var1.leaves != null) {
- for(int var4 = 0; var4 < var1.leaves.size(); ++var4) {
- JDPTreeBranch var5 = (JDPTreeBranch)var1.leaves.elementAt(var4);
- if (var5 != null && var5.name.equals(var2[var3])) {
- if (var5.branchIndex == this.currentIndex) {
- this.currentIndex = -1;
- this.currentBranchSelected = null;
- }
-
- if (var3 + 1 != var2.length && var2[var3 + 1] != null) {
- return this.remBranch(var5, var2, var3 + 1);
- }
-
- var1.leaves.removeElementAt(var4);
- if (var1 != this.treeRoot && var1.leaves.size() == 0) {
- var1.expanded = false;
- var1.expandRect = null;
- }
-
- if (this.listOnly) {
- while(var4 < var1.leaves.size()) {
- var5 = (JDPTreeBranch)var1.leaves.elementAt(var4);
- var5.branchIndex += -1;
- ++var4;
- }
-
- this.nextIndex += -1;
- }
-
- Object var7 = null;
- ((Component)this).repaint();
- this.user.JDesignerPro.gc();
- return true;
- }
- }
- }
-
- return false;
- }
- }
-
- public boolean removeBranch(JDPTreeBranch var1) {
- var1.leaves = null;
- var1.leaves = new Vector();
- this.nothingChanged = false;
- ((Component)this).repaint();
- return true;
- }
-
- public void setScrollEastDisabled(boolean var1) {
- this.scrollEastDisabled = var1;
- this.reDraw();
- }
-
- public boolean getScrollEastDisabled() {
- return this.scrollEastDisabled;
- }
-
- public String[] getSelectedBranch() {
- if (this.currentBranch != null) {
- for(int var1 = this.currentBranchLvl + 1; var1 < this.currentBranch.length; ++var1) {
- this.currentBranch[var1] = null;
- }
- }
-
- return this.currentBranch;
- }
-
- public JDPTreeBranch getParentBranch() {
- if (this.currentBranchSelected == null) {
- this.parentBranch = this.treeRoot;
- } else {
- if (this.lastCheckedParentBranch != null && this.currentBranchSelected.equals(this.lastCheckedParentBranch)) {
- return this.parentBranch;
- }
-
- this.lastCheckedParentBranch = this.currentBranchSelected;
- JDPTreeBranch[] var1 = this.getTreeBranch(this.currentBranchSelected);
- if (var1.length - 2 >= 0) {
- this.parentBranch = var1[var1.length - 2];
- } else {
- this.parentBranch = this.treeRoot;
- }
- }
-
- return this.parentBranch;
- }
-
- public void setTreeVector(Vector var1) {
- this.treeVector = var1;
- }
-
- String getLeafName(int var1) {
- if (this.currentBranchSelected.leaves.size() == 0) {
- return null;
- } else if (this.currentBranchSelected.leaves.size() <= var1) {
- return null;
- } else {
- if (((JDPTreeBranch)this.currentBranchSelected.leaves.elementAt(var1)).name.equals("")) {
- ++var1;
- }
-
- return this.currentBranchSelected.leaves.size() <= var1 ? null : ((JDPTreeBranch)this.currentBranchSelected.leaves.elementAt(var1)).name;
- }
- }
-
- public static String[] getTreeIconList() {
- return iconNames;
- }
-
- int[] getFontWidths() {
- this.field_1 = this.field_0.getFontMetrics();
- this.widths = this.field_1.getWidths();
- return this.widths;
- }
-
- public void reDraw() {
- this.nothingChanged = false;
- ((Component)this).repaint();
- }
-
- public void paint(Graphics var1) {
- this.update(var1);
- }
-
- public JDPTreeBranch addItem(JDPTreeBranch var1, String var2, int var3, boolean var4, Object var5, String var6, boolean var7) {
- this.nothingChanged = false;
- JDPTreeBranch var8 = new JDPTreeBranch();
- if (var1.leaves == null) {
- var1.leaves = new Vector();
- }
-
- var1.leaves.addElement(var8);
- var8.name = var2;
- var8.branchIndex = this.nextIndex;
- var8.icon = var3;
- var8.dragAndDrop = var4;
- var8.dropKey = var5;
- var8.dropMessage = var6;
- var8.expanded = var7;
- var8.selected = false;
- var8.leaves = new Vector();
- var8.thisObject = this.thisObject;
- var8.compType = this.compType;
- var8.compPosition = this.compPosition;
- var8.text = this.text;
- var8.properties = this.properties;
- var8.treeVector = this.treeVector;
- this.lastAddedBranch = var8;
- return var8;
- }
-
- public int getSelectedIndex() {
- return this.currentBranchSelected != null && this.currentBranchSelected.selected ? this.currentIndex : -1;
- }
-
- void resetSelections(JDPTreeBranch var1, int var2) {
- if (var1.selected && var1.textRect != null) {
- this.nothingChanged = false;
- }
-
- var1.selected = false;
- if (var1.leaves != null) {
- for(int var3 = 0; var3 < var1.leaves.size(); ++var3) {
- this.resetSelections((JDPTreeBranch)var1.leaves.elementAt(var3), var2 + 1);
- }
- }
-
- if (var2 == 0) {
- ((Component)this).repaint();
- }
-
- }
-
- public void resetSelections() {
- if (this.currentBranchSelected != null) {
- this.resetSelections(this.treeRoot);
- this.currentBranchSelected = null;
- this.currentIndex = -1;
- }
-
- }
-
- boolean checkMouseClick(JDPTreeBranch var1, Event var2) {
- if (this.checkButtonPress(var2)) {
- return false;
- } else if (var1 == null) {
- return false;
- } else {
- if (var1.leaves != null && var1.leaves.size() == 0) {
- }
-
- Date var3 = new Date();
- this.drawnSelected = true;
- if (var1.expandRect != null && var1.expandRect.inside(var2.x, var2.y)) {
- if (var1.expanded) {
- var1.expanded = false;
- ((Component)this).repaint();
- return false;
- } else {
- var1.expanded = true;
- this.currentBranchSelected = var1;
- this.currentIndex = var1.branchIndex;
- this.currentBranch[this.currentBranchLvl] = var1.name;
- this.currentBranchIcons[this.currentBranchLvl] = var1.icon;
- this.resetSelections(this.treeRoot);
- var1.selected = true;
- ((Component)this).repaint();
- this.thisEvent = new Event(this, var3.getTime(), 701, var2.x, var2.y, var2.key, var2.modifiers, "BranchOpen");
- ((Component)this).postEvent(this.thisEvent);
- this.thisEvent = null;
- return true;
- }
- } else {
- Rectangle var4 = null;
- if (var1.textRect != null) {
- var4 = new Rectangle(var1.textRect.x, var1.textRect.y, var1.textRect.width, var1.textRect.height);
- if (this.listOnly) {
- var4.width = 1000;
- }
- }
-
- if (var4 != null && var4.inside(var2.x, var2.y)) {
- this.currentBranchSelected = var1;
- this.currentIndex = var1.branchIndex;
- this.currentBranch[this.currentBranchLvl] = var1.name;
- this.currentBranchIcons[this.currentBranchLvl] = var1.icon;
- if (var1.leaves != null && var1.leaves.size() != 0) {
- this.thisEvent = new Event(this, var3.getTime(), 701, var2.x, var2.y, var2.key, var2.modifiers, "BranchSelect");
- } else if (var1.selected && !this.selectionsAreCheckboxes) {
- if (this.listOnly) {
- if (var2.when - this.lastEventTime < 500L) {
- this.thisEvent = new Event(this, var3.getTime(), 1001, var2.x, var2.y, var2.key, var2.modifiers, new Integer(var1.branchIndex));
- } else {
- this.lastEventTime = var2.when;
- if (this.allowMultiple) {
- this.thisEvent = new Event(this, var3.getTime(), 702, var2.x, var2.y, var2.key, var2.modifiers, new Integer(var1.branchIndex));
- } else {
- this.thisEvent = new Event(this, var3.getTime(), 701, var2.x, var2.y, var2.key, var2.modifiers, new Integer(var1.branchIndex));
- }
- }
- } else {
- this.thisEvent = new Event(this, var3.getTime(), 701, var2.x, var2.y, var2.key, var2.modifiers, "LeafSelect");
- }
- } else if (!this.listOnly) {
- this.thisEvent = new Event(this, var3.getTime(), 1001, var2.x, var2.y, var2.key, var2.modifiers, "JDPTreePicker");
- } else {
- this.thisEvent = new Event(this, var3.getTime(), 701, var2.x, var2.y, var2.key, var2.modifiers, new Integer(var1.branchIndex));
- this.lastEventTime = var2.when;
- }
-
- if (!this.allowMultiple) {
- this.resetSelections(this.treeRoot);
- }
-
- if (this.listOnly && var1.selected && this.allowMultiple) {
- if (this.selectionsAreCheckboxes) {
- if (var2.x < var4.x + 20) {
- var1.selected = false;
- }
- } else {
- var1.selected = false;
- }
- } else if (this.selectionsAreCheckboxes) {
- if (var2.x < var4.x + 20) {
- var1.selected = true;
- }
- } else {
- var1.selected = true;
- }
-
- ((Component)this).repaint();
- return true;
- } else {
- if (var1.leaves != null) {
- for(int var5 = 0; var5 < var1.leaves.size(); ++var5) {
- this.currentBranchSelected = var1;
- this.currentIndex = var1.branchIndex;
- this.currentBranchIcons[this.currentBranchLvl] = var1.icon;
- this.currentBranch[this.currentBranchLvl++] = var1.name;
- JDPTreeBranch var6 = (JDPTreeBranch)var1.leaves.elementAt(var5);
- if (this.checkMouseClick(var6, var2)) {
- return true;
- }
- }
- }
-
- this.currentBranchLvl += -1;
- return false;
- }
- }
- }
- }
-
- public void resetSelections(JDPTreeBranch var1) {
- this.resetSelections(var1, 0);
- }
-
- public JDPTreePicker() {
- this.textHighlightText = JDPUtils.getTextHighlightText();
- this.textHighlight = JDPUtils.getTextHighlight();
- }
-
- public JDPTreePicker(JDPUser var1) {
- this.createTree(var1, (Panel)null, (JDPDragItem)null);
- }
-
- public JDPTreePicker(JDPUser var1, Panel var2) {
- this.createTree(var1, var2, (JDPDragItem)null);
- }
-
- public JDPTreePicker(JDPUser var1, Panel var2, JDPDragItem var3) {
- this.createTree(var1, var2, var3);
- }
-
- public void clear() {
- this.setRoot("", false);
- this.reDraw();
- }
-
- public void setText(String[] var1) {
- this.text = var1;
- }
-
- public void setCompType(String var1) {
- this.compType = var1;
- }
-
- public void setResizingAllowed(boolean var1) {
- this.resizingAllowed = var1;
- this.widthRect = null;
- this.reDraw();
- }
-
- public boolean setResizingAllowed() {
- return this.resizingAllowed;
- }
-
- void drawEntry(JDPTreeBranch var1) {
- if (var1 != null) {
- int var2 = this.lastxpoint;
- int var3 = this.lastypoint;
- int var4 = this.lastypoint;
- this.lastxpoint = this.currxpoint;
- this.lastypoint = this.currypoint;
- byte var5 = 8;
- byte var6 = 8;
- int var7 = 0;
- if (this.currypoint > -100) {
- this.onPage = true;
- }
-
- if (this.currypoint > this.Bounds.height) {
- this.onPage = false;
- }
-
- if (var1.selected && this.drawnSelected && !this.listOnly || this.makeVisibleRequest >= 0 && var1.branchIndex == this.makeVisibleRequest) {
- if (this.currypoint < 20) {
- this.scrollDown = this.currypoint - 30;
- } else if (this.listOnly) {
- if (this.currypoint > this.Bounds.height) {
- this.scrollDown = this.currypoint - 60;
- } else {
- this.makeVisibleRequest = -1;
- }
- } else if (this.currypoint > this.Bounds.height - 20) {
- this.scrollDown = this.currypoint - 30;
- } else {
- this.makeVisibleRequest = -1;
- }
- }
-
- int var8 = 0;
- if (var1.icon < 0 && var1.iconImage == null) {
- var8 = 21;
- }
-
- if (this.listOnly) {
- var8 += 21;
- }
-
- if (this.selectionsAreCheckboxes) {
- var8 -= 15;
- if (var1.icon < 0) {
- --var8;
- }
- }
-
- if (var1 != this.treeRoot && (var1.leaves == null || var1.leaves.size() == 0)) {
- var1.expanded = false;
- }
-
- var2 = this.currxpoint;
- int var9 = var2 + 100;
- var3 = this.currypoint;
- if (var1 != null) {
- if (this.listOnly && !this.onPage) {
- String var24 = var1.name.trim();
- int var26 = this.user.u.StringWidth(this.field_0, var24);
- int var29 = var2 + 13 + var26;
- if (var29 + this.xOffset > this.maxWidth) {
- this.maxWidth = var29 + this.xOffset;
- }
-
- this.currypoint += this.currheight + 2;
- } else {
- if (!this.listOnly && var1 != this.treeRoot) {
- if (var1.leaves != null && var1.leaves.size() > 0 && ((JDPTreeBranch)var1.leaves.elementAt(0)).name != null) {
- var2 = this.currxpoint;
- var9 = var2 + 100;
- var3 = this.currypoint;
- this.field_0.setColor(this.controlColor);
- if (var4 < var3) {
- if (this.lastnoleaves) {
- this.field_0.drawLine(var9 + 4, var4 + 4, var9 + 4, var3 - 1);
- } else {
- this.field_0.drawLine(var9 + 4, var4 + 11, var9 + 4, var3 - 1);
- }
- }
-
- this.field_0.drawLine(var9 + 9, var3 + 4, var9 + 14, var3 + 4);
- if (this.onPage) {
- this.field_0.setColor(JDPUtils.darker(this.controlColor));
- this.field_0.drawRect(var9, var3, var5, var6);
- var1.expandRect = new Rectangle(var2, var3, var5, var6);
- this.field_0.setColor(Color.black);
- this.field_0.drawLine(var9 + 2, var3 + 4, var9 + 6, var3 + 4);
- if (!var1.expanded && var1.leaves.size() > 0) {
- this.field_0.drawLine(var9 + 4, var3 + 2, var9 + 4, var3 + 6);
- }
- }
-
- var7 = this.lastypoint - 2;
- this.lastnoleaves = false;
- } else if (var1.name != null && (!var1.name.equals("") || this.listOnly)) {
- var1.expandRect = null;
- this.field_0.setColor(this.controlColor);
- this.field_0.drawLine(var9 + 4, var4 + 11, var9 + 4, this.currypoint + 4);
- this.field_0.drawLine(var9 + 4, this.currypoint + 4, var9 + 14, this.currypoint + 4);
- var2 = this.currxpoint;
- var9 = var2 + 100;
- var3 = this.currypoint;
- var7 = this.lastypoint - 2;
- if (this.lastnoleaves) {
- this.field_0.setColor(this.controlColor);
- this.field_0.drawLine(var9 + 4, var4 + 4, var9 + 4, var4 + 10);
- }
-
- this.lastnoleaves = true;
- } else {
- var7 = var4;
- }
- }
-
- this.field_0.setColor(Color.black);
- if ((var1 == this.treeRoot || var1.name != null && (!var1.name.equals("") || this.listOnly)) && (!this.listOnly || var1 != this.treeRoot)) {
- String var10 = var1.name.trim();
- boolean var11 = false;
- if (this.showCompPosition && !var1.equals(this.treeRoot)) {
- if (var1.compPosition != null && !var1.compPosition.equals("")) {
- if (!var11) {
- var10 = var10 + " (";
- }
-
- var10 = var10 + var1.compPosition;
- var11 = true;
- }
-
- if (var1.relatedComps != null && var1.relatedComps.length > 0 && var1.name.indexOf("SP1") < 0 && var1.name.indexOf("RL1") < 0) {
- if (!var11) {
- var10 = var10 + " (";
- } else {
- var10 = var10 + ",";
- }
-
- var10 = var10 + "W";
- var11 = true;
- }
-
- if (var1.text != null && var1.text.length > 0 && var1.text[0] != null && !var1.text[0].equals("")) {
- if (!var11) {
- var10 = var10 + " (";
- } else {
- var10 = var10 + ",";
- }
-
- var10 = var10 + "S";
- var11 = true;
- }
-
- if (var1.treeVector != null && var1.treeVector.size() > 0) {
- JDPTreeBranch var12 = (JDPTreeBranch)var1.treeVector.elementAt(0);
- if (var12.leaves != null && var12.leaves.size() > 0) {
- boolean var14 = false;
- int var15 = -1;
-
- while(!var14 && var15++ < var12.leaves.size() - 1) {
- JDPTreeBranch var13 = (JDPTreeBranch)var12.leaves.elementAt(var15);
- if (var13.leaves != null && var13.leaves.size() > 0) {
- if (!var11) {
- var10 = var10 + " (";
- } else {
- var10 = var10 + ",";
- }
-
- var10 = var10 + "I";
- var11 = true;
- var14 = true;
- }
- }
- }
- }
-
- if (var11) {
- var10 = var10 + ")";
- }
- }
-
- int var27 = this.user.u.StringWidth(this.field_0, var10);
- if (this.onPage) {
- String var30 = var10;
- if (this.columnWidth != null && this.columnWidth.length > 0) {
- this.stok = new StringTokenizer(var10, "|");
- var30 = this.stok.nextToken();
- var27 = this.user.u.StringWidth(this.field_0, var30);
- }
-
- if (var1.name == null) {
- var8 -= this.drawIcon(var1, var9 + 16 - var8, var3, var1.selected);
- } else {
- this.field_0.setColor(((Component)this).getForeground());
- if (var1.selected || this.selectionsAreCheckboxes && this.currentBranchSelected != null && this.currentBranchSelected.equals(var1)) {
- var8 -= this.drawIcon(var1, var9 + 16 - var8, var3, var1.selected);
- if ((!this.selectionsAreCheckboxes || this.currentBranchSelected != null && this.currentBranchSelected.equals(var1)) && (var1.name.length() > 0 || this.listOnly)) {
- if (!this.listOnly || this.columnWidth != null && this.columnWidth.length > 0) {
- if (!this.hasFocus && !this.alwaysHasFocus) {
- this.field_0.setColor(JDPUtils.darker(this.textHighlight));
- this.field_0.drawRect(var9 + 34 - var8, var3 - 3, var27 + 2, this.currheight + 1);
- this.field_0.setColor(((Component)this).getForeground());
- } else {
- this.field_0.setColor(this.textHighlight);
- this.field_0.fillRect(var9 + 35 - var8, var3 - 2, var27 + 1, this.currheight);
- this.field_0.setColor(JDPUtils.darker(this.textHighlight));
- this.field_0.drawRect(var9 + 34 - var8, var3 - 3, var27 + 2, this.currheight + 1);
- this.field_0.setColor(this.textHighlightText);
- }
- } else if (!this.hasFocus && !this.alwaysHasFocus) {
- this.field_0.setColor(JDPUtils.darker(this.textHighlight));
- this.field_0.drawRect(var9 + 33 - var8, var3 - 4, this.Bounds.width - 1 + this.xOffset, this.currheight + 3);
- this.field_0.setColor(((Component)this).getForeground());
- } else {
- this.field_0.setColor(this.textHighlight);
- this.field_0.fillRect(var9 + 34 - var8, var3 - 3, this.Bounds.width - 2 + this.xOffset, this.currheight + 2);
- this.field_0.setColor(JDPUtils.darker(this.textHighlight));
- this.field_0.drawRect(var9 + 33 - var8, var3 - 4, this.Bounds.width - 1 + this.xOffset, this.currheight + 3);
- this.field_0.setColor(this.textHighlightText);
- }
- }
- } else {
- var8 -= this.drawIcon(var1, var9 + 16 - var8, var3, var1.selected);
- }
-
- if (this.columnWidth != null && this.columnWidth.length > 0) {
- int var32 = -var8;
- int var33 = 0;
- int var16 = var27;
-
- for(int var17 = 0; var17 < this.columnWidth.length; ++var17) {
- if (var17 > 0) {
- if (this.stok.hasMoreTokens()) {
- var30 = this.stok.nextToken();
- } else {
- var30 = null;
- }
- }
-
- if (var30 != null) {
- var27 = this.user.u.StringWidth(this.field_0, var30);
- if (var17 == 0) {
- var16 = var27;
- }
-
- var33 = 0;
- if (this.rightJustify[var17]) {
- var33 = this.columnWidth[var17] - var27 - 5;
- }
-
- if (var27 > this.columnWidth[var17] - 5) {
- var33 = 0;
- }
-
- if (var17 > 0) {
- this.field_0.setColor(this.backColor);
- this.field_0.fillRect(var9 + 32 + var32, var3 - 3, this.Bounds.width, this.currheight + 2);
- this.field_0.setColor(Color.black);
- }
-
- this.field_0.drawString(var30, var9 + 36 + var32 + var33, var3 + this.currheight - 5);
- if (var17 == 0) {
- var32 -= var8 - 2;
- }
-
- var32 += this.columnWidth[var17];
- }
- }
-
- var27 = var16;
- } else {
- this.field_0.drawString(var10, var9 + 36 - var8, var3 + this.currheight - 5);
- }
-
- this.field_0.setColor(this.backColor);
- }
-
- var1.textRect = new Rectangle(var2 + 14 - var8, var3 - 3, 28 + var27, this.currheight + 1);
- if (var1.textRect.width > this.Bounds.width - 6) {
- var1.textRect.width = this.Bounds.width - 6;
- }
-
- if (var1.icon >= 0 && this.listOnly && this.selectionsAreCheckboxes) {
- Rectangle var35 = var1.textRect;
- var35.x -= 20;
- var35 = var1.textRect;
- var35.width += 20;
- }
-
- if (this.dragPanel != null) {
- if (var1.dropKey != null && (var1.dropMessage == null || var1.dragAndDrop)) {
- this.dragPanel.addDragRectangle(var1.textRect, this.offscreen, this, var1.dropKey, var1);
- }
-
- if (var3 > 0 && var3 < this.Bounds.height && var1.dropKey != null && var1.dropMessage != null) {
- this.dragPanel.addDropRectangle(var1.textRect, this, var1.dropKey, var1.dropMessage, var1);
- }
- }
- }
-
- int var31 = var2 + 13 + var27;
- if (var31 + this.xOffset > this.maxWidth) {
- this.maxWidth = var31 + this.xOffset;
- }
-
- this.currypoint += this.currheight + 2;
- }
- }
-
- if (this.listOnly || var1.expanded) {
- this.currxpoint += 19;
- if (var1.leaves != null && var1.leaves.size() > 0) {
- for(int var25 = 0; var25 < var1.leaves.size(); ++var25) {
- this.drawEntry((JDPTreeBranch)var1.leaves.elementAt(var25));
- }
- }
-
- this.lastnoleaves = false;
- this.currxpoint -= 19;
- }
- }
-
- this.lastxpoint = this.currxpoint;
- this.lastypoint = var7;
- this.maxHeight = this.currypoint + this.yOffset;
- }
- }
-
- void drawBorder(Graphics var1) {
- boolean var2 = false;
- if (this.threeDBorder) {
- var1.setColor(JDPUtils.darker(this.controlColor));
- var1.drawLine(0, 0, this.Bounds.width, 0);
- var1.drawLine(0, 0, 0, this.Bounds.height);
- var1.setColor(Color.black);
- var1.drawLine(1, 1, this.Bounds.width - 1, 1);
- var1.drawLine(1, 1, 1, this.Bounds.height - 1);
- var1.setColor(this.controlColor);
- var1.drawLine(this.Bounds.width - 2, 2, this.Bounds.width - 2, this.Bounds.height - 2);
- var1.drawLine(2, this.Bounds.height - 2, this.Bounds.width - 2, this.Bounds.height - 2);
- var1.setColor(JDPUtils.brighter(this.controlColor));
- var1.drawLine(this.Bounds.width - 1, 1, this.Bounds.width - 1, this.Bounds.height - 1);
- var1.drawLine(1, this.Bounds.height - 1, this.Bounds.width - 1, this.Bounds.height - 1);
- } else {
- var2 = true;
- var1.setColor(Color.white);
- var1.drawRect(1, 1, this.Bounds.width - 2, this.Bounds.height - 2);
- var1.setColor(Color.black);
- var1.drawRect(0, 0, this.Bounds.width - 1, this.Bounds.height - 1);
- }
- }
-
- public void setAlwaysHasFocus(boolean var1) {
- this.alwaysHasFocus = var1;
- }
-
- public boolean getAlwaysHasFocus() {
- return this.alwaysHasFocus;
- }
-
- public void select(JDPTreeBranch var1) {
- if (var1 != null) {
- if (var1.equals(this.treeRoot)) {
- String[] var4 = new String[]{var1.name};
- this.select(var4, 0);
- } else {
- if (!this.allowMultiple) {
- this.resetSelections(this.treeRoot);
- }
-
- if (var1 != null) {
- JDPTreeBranch[] var2 = this.getTreeBranch(var1);
- if (var2 != null) {
- this.currentBranch = new String[var2.length];
- this.currentBranchIcons = new int[var2.length];
- this.currentBranchLvl = var2.length - 1;
- var1.selected = true;
- this.getTreeBranch(var1);
-
- for(int var3 = 0; var3 < var2.length; ++var3) {
- this.currentBranch[var3] = var2[var3].name;
- this.currentBranchIcons[var3] = var2[var3].icon;
- if (var3 < var2.length - 1 || var2[var3].leaves != null) {
- var2[var3].expanded = true;
- }
-
- var2[var3].expanded = true;
- }
-
- if (!this.selectionsAreCheckboxes) {
- this.currentBranchSelected = var2[var2.length - 1];
- this.currentIndex = this.currentBranchSelected.branchIndex;
- }
- } else {
- this.treeRoot.selected = true;
- this.currentBranchSelected = this.treeRoot;
- this.currentIndex = this.treeRoot.branchIndex;
- this.currentBranchLvl = 0;
- }
- } else {
- this.treeRoot.selected = true;
- this.currentBranchSelected = this.treeRoot;
- this.currentIndex = this.treeRoot.branchIndex;
- this.currentBranchLvl = 0;
- }
-
- this.nothingChanged = false;
- this.drawnSelected = true;
- ((Component)this).repaint();
- }
- }
- }
-
- public void select(String[] var1) {
- if (var1 != null && var1[0] != null) {
- int var2;
- for(var2 = 0; var1.length > var2 && var1[var2] != null; ++var2) {
- }
-
- if (this.treeRoot.name != null && var1[0].equals(this.treeRoot.name)) {
- this.select(var1, var2);
- } else {
- String[] var3 = new String[var2 + 1];
- var3[0] = this.treeRoot.name;
-
- for(int var4 = 0; var4 < var2; ++var4) {
- var3[var4 + 1] = var1[var4];
- }
-
- this.select(var3, var2);
- }
- }
- }
-
- void select(String[] var1, int var2) {
- for(int var3 = var2 + 1; var3 < var1.length; ++var3) {
- var1[var3] = null;
- }
-
- if (this.currentBranch == null || this.currentBranch.length < var1.length) {
- this.currentBranch = new String[var1.length];
- this.currentBranchIcons = new int[var1.length];
- }
-
- System.arraycopy(var1, 0, this.currentBranch, 0, var1.length);
- this.currentBranchLvl = var2;
- JDPTreeBranch var6 = this.getTreeBranch(this.treeRoot, var1, 0);
- if (!this.allowMultiple) {
- this.resetSelections(this.treeRoot);
- }
-
- if (var6 != null) {
- var6.selected = true;
- JDPTreeBranch[] var4 = this.getTreeBranch(var6);
-
- for(int var5 = 0; var5 < var4.length; ++var5) {
- this.currentBranchIcons[var5] = var4[var5].icon;
- if (var5 < var4.length - 1 || var4[var5].leaves != null) {
- var4[var5].expanded = true;
- }
-
- var4[var5].expanded = true;
- }
-
- if (!this.selectionsAreCheckboxes) {
- this.currentBranchSelected = var4[var4.length - 1];
- this.currentIndex = this.currentBranchSelected.branchIndex;
- }
- } else {
- this.treeRoot.selected = true;
- this.currentBranchSelected = this.treeRoot;
- this.currentIndex = this.treeRoot.branchIndex;
- }
-
- this.nothingChanged = false;
- this.drawnSelected = true;
- ((Component)this).repaint();
- }
-
- public void select(int var1) {
- if (var1 >= 0) {
- JDPTreeBranch[] var2 = this.getTreeBranch(new Integer(var1));
- if (var2 != null) {
- JDPTreeBranch var3 = var2[var2.length - 1];
- if (this.currentBranch == null || this.currentBranch.length < var2.length) {
- this.currentBranch = new String[var2.length];
- this.currentBranchIcons = new int[var2.length];
- }
-
- if (!this.allowMultiple) {
- this.resetSelections(this.treeRoot);
- }
-
- if (var3 != null) {
- var3.selected = true;
- JDPTreeBranch[] var4 = this.getTreeBranch(var3);
-
- for(int var5 = 0; var5 < var4.length; ++var5) {
- this.currentBranchIcons[var5] = var4[var5].icon;
- if (var5 < var4.length - 1 || var4[var5].leaves != null) {
- var4[var5].expanded = true;
- }
-
- var4[var5].expanded = true;
- }
-
- if (!this.selectionsAreCheckboxes) {
- this.currentBranchSelected = var4[var4.length - 1];
- this.currentIndex = this.currentBranchSelected.branchIndex;
- }
- } else {
- this.currentBranchSelected = this.treeRoot;
- this.currentIndex = this.treeRoot.branchIndex;
- }
-
- this.nothingChanged = false;
- this.drawnSelected = true;
- ((Component)this).repaint();
- }
- }
- }
-
- public int[] getSelectedIndexes() {
- if (this.listOnly) {
- int var1 = 0;
- int[] var2 = new int[this.treeRoot.leaves.size()];
-
- for(int var3 = 0; var3 < this.treeRoot.leaves.size(); ++var3) {
- if (((JDPTreeBranch)this.treeRoot.leaves.elementAt(var3)).selected) {
- var2[var1++] = var3;
- }
- }
-
- int[] var4 = new int[var1];
- System.arraycopy(var2, 0, var4, 0, var1);
- return var4;
- } else {
- return null;
- }
- }
-
- public Dimension preferredSize() {
- Dimension var1 = new Dimension(this.minimumWidth, this.minimumHeight);
- return var1;
- }
-
- public void setMultipleSelections(boolean var1) {
- this.allowMultiple = var1;
- }
-
- public boolean getMultipleSelections() {
- return this.allowMultiple;
- }
-
- public void setColumns(int var1) {
- this.columnHeader = new String[var1];
- this.columnWidth = new int[var1];
- this.rightJustify = new boolean[var1];
-
- for(int var2 = 0; var2 < var1; ++var2) {
- this.columnHeader[var2] = Integer.toString(var2);
- this.columnWidth[var2] = 100;
- }
-
- }
-
- public int getColumns() {
- return this.columnHeader == null ? 0 : this.columnHeader.length;
- }
-
- public String[] getTreeBranchNames(Object var1) {
- JDPTreeBranch[] var2 = this.getTreeBranch(var1);
- if (var2 == null) {
- return null;
- } else {
- String[] var3 = new String[var2.length];
-
- for(int var4 = 0; var4 < var2.length; ++var4) {
- var3[var4] = var2[var4].name;
- }
-
- return var3;
- }
- }
-
- public void setRightJustify(int var1, boolean var2) {
- this.rightJustify[var1] = var2;
- this.reDraw();
- }
-
- public boolean getRightJustify(int var1) {
- return this.rightJustify[var1];
- }
-
- boolean checkButtonPress(Event var1) {
- if (this.columnHeaderRects == null) {
- return false;
- } else {
- for(int var2 = 0; var2 < this.columnHeaderRects.length; ++var2) {
- if (this.columnHeaderRects[var2].inside(var1.x, var1.y)) {
- Event var3 = new Event(this, (new Date()).getTime(), 10003, var1.x, var1.y, var1.key, var1.modifiers, new Integer(var2));
- ((Component)this).postEvent(var3);
- return true;
- }
- }
-
- return false;
- }
- }
-
- public static int getIconValue(String var0) {
- for(int var1 = 0; var1 < iconNames.length; ++var1) {
- if (var0.equals(iconNames[var1])) {
- return var1;
- }
- }
-
- return -1;
- }
-
- public void setDragAndDrop(boolean[] var1) {
- this.dragAndDrops = var1;
- }
-
- Vector getBranch(JDPTreeBranch var1, String[] var2, int var3, boolean var4) {
- if (var1.leaves != null) {
- for(int var5 = 0; var5 < var1.leaves.size(); ++var5) {
- JDPTreeBranch var6 = (JDPTreeBranch)var1.leaves.elementAt(var5);
- if (var6 != null) {
- if (var4 && var6.name != null && var2[var3] != null && var6.name.toUpperCase().equals(var2[var3].toUpperCase())) {
- if (var3 + 1 != var2.length && var2[var3 + 1] != null) {
- return this.getBranch(var6, var2, var3 + 1, var4);
- }
-
- var3 = -1;
- break;
- }
-
- if (!var4 && var6.name.equals(var2[var3])) {
- if (var3 + 1 != var2.length && var2[var3 + 1] != null) {
- return this.getBranch(var6, var2, var3 + 1, var4);
- }
-
- var3 = -1;
- break;
- }
- }
- }
- }
-
- Vector var7 = new Vector();
- var7.addElement(var1);
- var7.addElement(Integer.toString(var3));
- return var7;
- }
-
- String[] getBranch(JDPTreeBranch var1, Rectangle var2, int var3, String[] var4) {
- var4[var3] = var1.name;
- if (var1.textRect != null && var1.textRect.equals(var2)) {
- return var4;
- } else {
- if (var1.leaves != null) {
- for(int var5 = 0; var5 < var1.leaves.size(); ++var5) {
- JDPTreeBranch var6 = (JDPTreeBranch)var1.leaves.elementAt(var5);
- String[] var7 = this.getBranch(var6, var2, var3 + 1, var4);
- if (var7 != null) {
- return var7;
- }
- }
- }
-
- return null;
- }
- }
-
- JDPTreeBranch[] getBranch(JDPTreeBranch var1, Object var2, int var3, JDPTreeBranch[] var4) {
- var4[var3] = var1;
- if (var2 instanceof String) {
- if (var1.name != null && var1.name.equals((String)var2)) {
- var4[var3 + 1] = null;
- return var4;
- }
- } else if (var2 instanceof Rectangle) {
- if (var1.textRect != null && var1.textRect.equals((Rectangle)var2)) {
- var4[var3 + 1] = null;
- return var4;
- }
- } else if (var2 instanceof JDPTreeBranch) {
- if (var1 != null && var1.equals((JDPTreeBranch)var2)) {
- var4[var3 + 1] = null;
- return var4;
- }
- } else if (var2 instanceof Integer) {
- if (var1 != null && (var1.leaves == null || var1.leaves.size() == 0) && var1.branchIndex == (Integer)var2) {
- var4[var3 + 1] = null;
- return var4;
- }
- } else if (var1.thisObject != null && var1.thisObject.equals(var2)) {
- var4[var3 + 1] = null;
- return var4;
- }
-
- if (var1.leaves != null) {
- for(int var5 = 0; var5 < var1.leaves.size(); ++var5) {
- JDPTreeBranch var6 = (JDPTreeBranch)var1.leaves.elementAt(var5);
- JDPTreeBranch[] var7 = this.getBranch(var6, var2, var3 + 1, var4);
- if (var7 != null) {
- return var7;
- }
- }
- }
-
- return null;
- }
-
- String[] getBranch(Rectangle var1) {
- String[] var2 = new String[100];
- String[] var3 = this.getBranch(this.treeRoot, (Rectangle)var1, 0, (String[])var2);
- if (var3 == null) {
- return null;
- } else {
- int var4 = 0;
- var4 = 0;
-
- while(var3[var4] != null) {
- ++var4;
- if (var4 >= 100) {
- break;
- }
- }
-
- var2 = new String[var4];
- System.arraycopy(var3, 0, var2, 0, var4);
- return var2;
- }
- }
-
- public JDPTreeBranch getBranch(Object var1) {
- JDPTreeBranch[] var2 = this.getTreeBranch(var1);
- return var2 != null && var2.length != 0 ? var2[var2.length - 1] : null;
- }
-
- public void setDragPanel(JDPDragItem var1) {
- this.dragPanel = var1;
- if (this.targetPanel == null) {
- this.targetPanel = this.dragPanel.targetPanel;
- }
-
- }
-
- public JDPDragItem getDragPanel() {
- return this.dragPanel;
- }
-
- public void setColumnWidth(int var1, int var2) {
- this.columnWidth[var1] = var2;
- this.reDraw();
- }
-
- public int getColumnWidth(int var1) {
- return this.columnWidth[var1];
- }
-
- public void setColumnHeader(int var1, String var2) {
- this.columnHeader[var1] = var2;
- this.reDraw();
- }
-
- public String getColumnHeader(int var1) {
- return this.columnHeader[var1];
- }
-
- void drawColumnHeader() {
- if (this.columnHeader != null && this.columnHeader.length != 0) {
- this.columnHeaderRects = new Rectangle[3];
- this.columnResizeRects = new Rectangle[3];
- int var1 = 3 - this.xOffset;
-
- for(int var2 = 0; var2 < this.columnHeader.length; ++var2) {
- this.drawButton(this.columnHeader[var2], this.rightJustify[var2], Color.black, var1 + 100, 2, this.columnWidth[var2], this.colHeaderHeight);
- this.columnHeaderRects[var2] = new Rectangle(var1 + 2, 2, this.columnWidth[var2], this.colHeaderHeight);
- this.columnResizeRects[var2] = new Rectangle(var1 + this.columnWidth[var2] - 2, 2, 4, this.colHeaderHeight);
- var1 += this.columnWidth[var2];
- }
-
- } else {
- this.columnHeaderRects = null;
- this.columnResizeRects = null;
- }
- }
-
- public void setPosition(String var1) {
- this.compPosition = var1;
- }
-
- void drawButton(String var1, Color var2, int var3, int var4, int var5, int var6) {
- this.drawButton(var1, (String)null, var2, var3, var4, var5, var6);
- }
-
- void drawButton(String var1, boolean var2, Color var3, int var4, int var5, int var6, int var7) {
- String var8 = "Left";
- if (var2) {
- var8 = "Right";
- }
-
- this.drawButton(var1, var8, var3, var4, var5, var6, var7);
- }
-
- void drawButton(String var1, String var2, Color var3, int var4, int var5, int var6, int var7) {
- if (this.columnHeader != null && this.columnHeader.length > 1 && this.columnHeader[0] != null && this.columnHeader[0].equals("0") && this.columnHeader[1].equals("1")) {
- var2 = null;
- }
-
- this.field_0.setColor(this.controlColor);
- this.field_0.fillRect(var4 + 1, var5 + 1, var6 - 1, var7 - 1);
- this.field_0.setColor(JDPUtils.brighter(this.controlColor));
- this.field_0.drawLine(var4, var5, var4 + var6, var5);
- this.field_0.drawLine(var4, var5, var4, var5 + var7);
- this.field_0.setColor(JDPUtils.darker(JDPUtils.darker(this.controlColor)));
- this.field_0.setColor(Color.black);
- this.field_0.drawLine(var4 - 1, var5, var4 - 1, var5 + var7);
- this.field_0.drawLine(var4, var5 + var7, var4 + var6 - 2, var5 + var7);
- this.field_0.drawLine(var4 + var6 - 1, var5, var4 + var6 - 1, var5 + var7);
- this.field_0.setColor(var3);
- if (var1 != null) {
- int var8 = 0;
- if (var2 == null) {
- var8 = var4 + var6 / 2 - this.user.u.StringWidth(this.field_0, var1) / 2;
- } else if (var2.equals("Right")) {
- var8 = var4 + var6 - this.user.u.StringWidth(this.field_0, var1) - 3;
- } else {
- var8 = var4 + 2;
- }
-
- if (var8 <= var4) {
- var8 = var4 + 1;
- }
-
- int var9 = this.StringHeight() - 5;
- int var10 = var9 + (var7 - var9) / 2;
- if (var1.indexOf("|") >= 0) {
- var10 = var9 + 2;
-
- for(StringTokenizer var11 = new StringTokenizer(var1, "|"); var11.hasMoreTokens(); var10 += var9 + 2) {
- this.field_0.drawString(var11.nextToken(), var8, var5 + var10);
- }
- } else {
- if (var10 <= var9) {
- var10 = var9;
- }
-
- this.field_0.drawString(var1, var8, var5 + var10);
- }
- }
-
- this.field_0.setColor(Color.black);
- }
-
- public boolean handleEvent(Event var1) {
- this.Bounds = ((Component)this).bounds();
- this.drawnSelected = false;
- if (this.scrollEast != null && var1.target.equals(this.scrollEast)) {
- byte var8 = 20;
- if (this.scrollSouth != null && this.scrollSouth.isVisible()) {
- var8 = 30;
- }
-
- this.makeVisibleRequest = -1;
- this.nothingChanged = false;
- switch (var1.id) {
- case 601:
- this.dropEvent = true;
- this.yOffset -= var8;
- ((Component)this).repaint(2, 2, this.Bounds.width, this.Bounds.height);
- return true;
- case 602:
- this.dropEvent = true;
- this.yOffset += var8;
- ((Component)this).repaint(2, 2, this.Bounds.width, this.Bounds.height);
- return true;
- case 603:
- this.dropEvent = true;
- this.yOffset = this.yOffset - this.Bounds.height + var8;
- ((Component)this).repaint(2, 2, this.Bounds.width, this.Bounds.height);
- return true;
- case 604:
- this.dropEvent = true;
- this.yOffset = this.yOffset + this.Bounds.height - var8;
- ((Component)this).repaint(2, 2, this.Bounds.width, this.Bounds.height);
- return true;
- case 605:
- if (this.dropEvent) {
- this.dropEvent = false;
- return true;
- }
-
- this.yOffset = this.scrollEast.getValue();
- ((Component)this).repaint(2, 2, this.Bounds.width, this.Bounds.height);
- return true;
- default:
- this.dropEvent = false;
- return false;
- }
- } else if (this.scrollSouth != null && var1.target.equals(this.scrollSouth)) {
- this.nothingChanged = false;
- switch (var1.id) {
- case 601:
- this.dropEvent = true;
- this.xOffset -= 10;
- ((Component)this).repaint(2, 2, this.Bounds.width, this.Bounds.height);
- return true;
- case 602:
- this.dropEvent = true;
- this.xOffset += 10;
- ((Component)this).repaint(2, 2, this.Bounds.width, this.Bounds.height);
- return true;
- case 603:
- this.dropEvent = true;
- this.xOffset = this.xOffset - this.Bounds.width + 10;
- ((Component)this).repaint(2, 2, this.Bounds.width, this.Bounds.height);
- return true;
- case 604:
- this.dropEvent = true;
- this.xOffset = this.xOffset + this.Bounds.width - 10;
- ((Component)this).repaint(2, 2, this.Bounds.width, this.Bounds.height);
- return true;
- case 605:
- if (this.dropEvent) {
- this.dropEvent = false;
- return true;
- }
-
- this.xOffset = this.scrollSouth.getValue();
- ((Component)this).repaint(2, 2, this.Bounds.width, this.Bounds.height);
- return true;
- default:
- this.dropEvent = false;
- return false;
- }
- } else {
- this.dropEvent = false;
- if (!((Component)this).isEnabled()) {
- return true;
- } else {
- switch (var1.id) {
- case 202:
- case 204:
- case 205:
- this.reDraw();
- return false;
- case 401:
- if (var1.key > 31 && var1.key < 127) {
- byte[] var7 = new byte[]{(byte)var1.key};
- String var10001 = this.searchString;
- this.searchString = var10001 + new String(var7);
- this.getParentBranch();
- if (!this.searchString.endsWith("\n")) {
- for(int var14 = 0; var14 < this.parentBranch.leaves.size(); ++var14) {
- JDPTreeBranch var13 = (JDPTreeBranch)this.parentBranch.leaves.elementAt(var14);
- if (var13.name.startsWith(this.searchString)) {
- this.select(var13);
- this.makeVisible(this.currentIndex);
- this.reDraw();
- return true;
- }
- }
- } else {
- this.searchString = "";
- }
- }
-
- return false;
- case 402:
- if (var1.key == 10) {
- this.searchString = "";
- this.thisEvent = new Event(this, var1.when, 701, var1.x, var1.y, var1.key, var1.modifiers, "LeafSelect");
- this.nothingChanged = false;
- ((Component)this).repaint();
- return true;
- }
-
- return false;
- case 403:
- this.nothingChanged = false;
- byte var2 = 20;
- if (this.scrollSouth != null && this.scrollSouth.isVisible()) {
- var2 = 30;
- }
-
- switch (var1.key) {
- case 1002:
- this.yOffset = this.yOffset - this.Bounds.height + var2;
- ((Component)this).repaint(2, 2, this.Bounds.width, this.Bounds.height);
- return true;
- case 1003:
- this.yOffset = this.yOffset + this.Bounds.height - var2;
- ((Component)this).repaint(2, 2, this.Bounds.width, this.Bounds.height);
- return true;
- case 1004:
- if (this.listOnly) {
- this.select(this.getSelectedIndex() - 1);
- this.makeVisible(this.getSelectedIndex() - 1);
- return true;
- }
-
- return false;
- case 1005:
- if (this.listOnly) {
- this.select(this.getSelectedIndex() + 1);
- this.makeVisible(this.getSelectedIndex() + 1);
- return true;
- }
-
- return false;
- case 1006:
- return true;
- case 1007:
- return true;
- default:
- return false;
- }
- case 501:
- ((Component)this).requestFocus();
- if (this.columnResizeRects != null) {
- for(int var12 = 0; var12 < this.columnResizeRects.length; ++var12) {
- if (this.columnResizeRects[var12] != null && this.columnResizeRects[var12].inside(var1.x, var1.y)) {
- this.saveColumnWidth = this.columnWidth[var12];
- this.dragCol = var12;
- this.initColXpoint = var1.x;
- this.draggingColMouse = true;
- this.repaintColHead(this.dragCol, var1.x);
- return true;
- }
- }
- }
-
- this.dragXoffset = this.xOffset;
- this.dragYoffset = this.yOffset;
- this.nothingChanged = false;
- if (this.widthRect != null && this.widthRect.inside(var1.x, var1.y)) {
- this.draggingWidth = true;
- this.currentWidth = var1.x;
- }
-
- this.startMouseDrag = true;
- this.startMouseX = var1.x + this.xpOffset;
- this.startMouseY = var1.y + this.ypOffset;
- return false;
- case 502:
- this.nothingChanged = false;
- if (this.draggingColMouse) {
- this.thisEvent = new Event(this, (new Date()).getTime(), 10002, var1.x, var1.y, var1.key, var1.modifiers, new Integer(this.dragCol));
- ((Component)this).repaint();
- this.draggingColMouse = false;
- return true;
- } else if (this.draggingWidth) {
- this.draggingWidth = false;
- int var11 = var1.x - this.currentWidth;
- this.thisEvent = new Event(this, (new Date()).getTime(), 10010, var1.x, var1.y, var1.key, var1.modifiers, new Integer(this.minimumWidth + var11));
- this.setMinWidth(this.minimumWidth + var11);
- return true;
- } else if (!((Component)this).isEnabled()) {
- return true;
- } else if (this.dragPanel != null && this.dragPanel.isVisible()) {
- this.nothingChanged = true;
- var1.x += this.xpOffset;
- var1.y += this.ypOffset;
- var1.target = this.targetPanel;
- this.dragPanel.postEvent(var1);
- return true;
- } else {
- int var10 = this.currentIndex;
- this.currentIndex = -1;
- this.currentBranch = new String[50];
- this.currentBranchIcons = new int[50];
- this.currentBranchLvl = 0;
- if (!this.checkMouseClick(this.treeRoot, var1)) {
- this.currentIndex = var10;
- return false;
- }
-
- return false;
- }
- case 503:
- if (this.user.jdpMainWindow != null && this.widthRect != null) {
- if (this.user.jdpMainWindow.getCursorType() == 3) {
- return false;
- }
-
- if (this.widthRect != null && this.widthRect.inside(var1.x, var1.y)) {
- this.user.jdpMainWindow.setCursor(10);
- return false;
- }
-
- if (this.columnResizeRects != null) {
- for(int var9 = 0; var9 < this.columnResizeRects.length; ++var9) {
- if (this.columnResizeRects[var9] != null && this.columnResizeRects[var9].inside(var1.x, var1.y)) {
- this.user.jdpMainWindow.setCursor(10);
- return false;
- }
- }
- }
-
- this.user.jdpMainWindow.setCursor(0);
- }
-
- return false;
- case 505:
- if (this.user.jdpMainWindow != null && this.widthRect != null) {
- if (this.user.jdpMainWindow.getCursorType() == 3) {
- return false;
- }
-
- this.user.jdpMainWindow.setCursor(0);
- }
-
- return false;
- case 506:
- if (this.draggingWidth) {
- return true;
- } else if (this.draggingColMouse) {
- if (var1.x != this.lastevtx) {
- this.repaintColHead(this.dragCol, var1.x);
- }
-
- this.lastevtx = var1.x;
- return true;
- } else {
- if (this.autoScrollOn) {
- if (var1.y > 10 && var1.y < this.Bounds.height - 10) {
- if (var1.x < 10 && this.xOffset > 0) {
- this.xOffset -= 20;
- this.stillDragging = true;
- this.nothingChanged = false;
- this.dragPanelEvent = var1;
- ((Component)this).repaint();
- }
-
- if (var1.x > this.Bounds.width - 10 && this.xOffset < this.maxWidth + 20 - this.Bounds.width) {
- this.xOffset += 20;
- this.stillDragging = true;
- this.nothingChanged = false;
- this.dragPanelEvent = var1;
- ((Component)this).repaint();
- }
- }
-
- if (var1.x > 10 && var1.x < this.Bounds.width - 10 && this.scrollEast != null && this.scrollEast.isVisible()) {
- if (var1.y < 10 && var1.y > -10 && this.yOffset > 0) {
- this.yOffset -= 20;
- this.stillDragging = true;
- this.nothingChanged = false;
- this.dragPanelEvent = var1;
- ((Component)this).repaint();
- }
-
- if (var1.y > this.Bounds.height - 10 && var1.y < this.Bounds.height + 10 && this.yOffset < this.maxHeight + 20 - this.Bounds.height) {
- this.yOffset += 20;
- this.stillDragging = true;
- this.nothingChanged = false;
- this.dragPanelEvent = var1;
- ((Component)this).repaint();
- }
- }
- }
-
- if (this.dragPanel != null) {
- if (this.startMouseDrag) {
- var1.x = this.startMouseX;
- var1.y = this.startMouseY;
- this.startMouseDrag = false;
- } else {
- var1.x += this.xpOffset;
- var1.y += this.ypOffset;
- }
-
- if (this.allowChangeOrder) {
- var1.x = 10;
- }
-
- this.dragPanel.postEvent(var1);
- return true;
- }
-
- return false;
- }
- case 1001:
- this.nothingChanged = false;
- if (var1.target instanceof JDPDragItem) {
- if (this.allowChangeOrder && var1.arg.equals("JDPDragItem")) {
- JDPTreeBranch[] var3 = this.dragPanel.getDraggedBranch(this);
- JDPTreeBranch[] var4 = this.dragPanel.getDroppedBranch(this);
- if (var3 != null && var4 != null) {
- int var5 = var3[var3.length - 1].branchIndex;
- int var6 = var4[var4.length - 1].branchIndex;
- if (this.moveListItem(var5, var6)) {
- this.thisEvent = new Event(this, (new Date()).getTime(), 10001, var1.x, var1.y, var1.key, var1.modifiers, new Integer(var5));
- this.reDraw();
- }
- }
- }
-
- return true;
- }
-
- return false;
- case 1004:
- this.hasFocus = true;
- this.reDraw();
- return false;
- case 1005:
- this.hasFocus = false;
- this.reDraw();
- return false;
- case 10003:
- return true;
- default:
- if (this.user.jdpMainWindow != null && this.widthRect != null) {
- if (this.user.jdpMainWindow.getCursorType() == 3) {
- return false;
- }
-
- this.user.jdpMainWindow.setCursor(0);
- }
-
- return false;
- }
- }
- }
- }
-
- public String[] getSelectedItems() {
- if (this.listOnly) {
- int var1 = 0;
- String[] var2 = new String[this.treeRoot.leaves.size()];
-
- for(int var3 = 0; var3 < this.treeRoot.leaves.size(); ++var3) {
- JDPTreeBranch var4 = (JDPTreeBranch)this.treeRoot.leaves.elementAt(var3);
- if (var4.selected) {
- var2[var1++] = var4.name;
- }
- }
-
- String[] var5 = new String[var1];
- System.arraycopy(var2, 0, var5, 0, var1);
- return var5;
- } else {
- return null;
- }
- }
-
- public void setObject(Object var1) {
- this.thisObject = var1;
- }
-
- public void setExpanded(boolean[] var1) {
- this.expanded = var1;
- }
-
- boolean moveListItem(int var1, int var2) {
- if (var1 == var2) {
- return false;
- } else {
- int var3 = 0;
- int var4 = 0;
- byte var5 = 0;
- if (var1 < var2) {
- var3 = var1;
- var4 = var2;
- var5 = 1;
- } else {
- var3 = var1;
- var4 = var2;
- var5 = -1;
- }
-
- JDPTreeBranch var6 = this.getBranch((Object)(new Integer(var1)));
- String var7 = var6.name;
- int var8 = var6.icon;
- boolean var9 = var6.selected;
- boolean var10 = var6.dragAndDrop;
- Object var11 = var6.dropKey;
- String var12 = var6.dropMessage;
-
- for(int var15 = var3; var15 != var4; var15 += var5) {
- JDPTreeBranch var13 = this.getBranch((Object)(new Integer(var15)));
- JDPTreeBranch var14 = this.getBranch((Object)(new Integer(var15 + var5)));
- var13.name = var14.name;
- var13.icon = var14.icon;
- var13.selected = var14.selected;
- var13.dragAndDrop = var14.dragAndDrop;
- var13.dropKey = var14.dropKey;
- var13.dropMessage = var14.dropMessage;
- }
-
- var6 = this.getBranch((Object)(new Integer(var2)));
- var6.name = var7;
- var6.icon = var8;
- var6.selected = var9;
- var6.dragAndDrop = var10;
- var6.dropKey = var11;
- var6.dropMessage = var12;
- return true;
- }
- }
-
- public String getSelectedItem() {
- if (!this.listOnly) {
- return this.currentBranchSelected.name;
- } else if (this.getSelectedIndex() >= 0) {
- return ((JDPTreeBranch)this.treeRoot.leaves.elementAt(this.getSelectedIndex())).name;
- } else if (this.listOnly && this.currentIndex >= 0) {
- return ((JDPTreeBranch)this.treeRoot.leaves.elementAt(this.currentIndex)).selected ? ((JDPTreeBranch)this.treeRoot.leaves.elementAt(this.currentIndex)).name : null;
- } else {
- return null;
- }
- }
-
- public int getVisibleIndex() {
- return this.currentBranchSelected != null && this.currentBranchSelected.selected ? this.currentIndex : -1;
- }
-
- public void setDropMessages(String[] var1) {
- this.dropMessages = var1;
- }
-
- public JDPTreeBranch[] getTreeBranchIgnoreCase(String[] var1) {
- if (var1 != null && var1[0] != null) {
- int var2;
- for(var2 = 0; var1.length > var2 && var1[var2] != null; ++var2) {
- }
-
- String[] var3;
- if (!var1[0].equals(this.treeRoot.name)) {
- var3 = new String[var2 + 1];
- var3[0] = this.treeRoot.name;
-
- for(int var4 = 0; var4 < var2; ++var4) {
- var3[var4 + 1] = var1[var4];
- }
- } else {
- var3 = new String[var2];
-
- for(int var5 = 0; var5 < var2; ++var5) {
- var3[var5] = var1[var5];
- }
- }
-
- JDPTreeBranch var6 = this.getTreeBranch(this.treeRoot, var3, 0, true);
- return var6 != null ? this.getTreeBranch(var6) : null;
- } else {
- return null;
- }
- }
-
- public void update(Graphics var1) {
- Dimension var2 = ((Component)this).size();
- if (this.Bounds == null || var2.width != this.Bounds.width || var2.height != this.Bounds.height || !((Component)this).getFont().equals(this.prevFont) || !this.prevForeground.equals(((Component)this).getForeground()) || !this.prevBackground.equals(((Component)this).getBackground())) {
- this.nothingChanged = false;
- }
-
- if (this.imageLoader != null && this.imageLoader.getImageReady()) {
- this.iconImage = this.imageLoader.thisImage;
- if (defaultIconImage == null) {
- defaultIconImage = this.iconImage;
- }
-
- this.imageLoader = null;
- this.nothingChanged = false;
- }
-
- if (defaultIconImage == null) {
- this.checkIconsLoaded();
- }
-
- if (this.iconImage == null && this.imageLoader == null) {
- this.checkIconsLoaded();
- }
-
- if (this.nothingChanged && this.offscreen != null && this.thisEvent == null) {
- var1.drawImage(this.offscreen1, 0, 0, (ImageObserver)null);
- } else {
- this.nothingChanged = true;
- this.prevFont = ((Component)this).getFont();
- this.prevForeground = ((Component)this).getForeground();
- this.prevBackground = ((Component)this).getBackground();
- this.controlColor = ((Component)this).getParent().getBackground();
- this.backColor = ((Component)this).getBackground();
- this.xpOffset = 0;
- this.ypOffset = 0;
- Object var3 = this;
- Rectangle var4 = ((Component)this).bounds();
-
- while(var3 != null && !var3.equals(this.targetPanel)) {
- var4 = ((Component)var3).bounds();
- this.xpOffset += var4.x;
- this.ypOffset += var4.y;
- var3 = ((Component)var3).getParent();
- if (var3 == null || !((Component)var3).isVisible()) {
- this.xpOffset += 1000;
- }
- }
-
- boolean var5 = false;
- Rectangle var6 = ((Component)this).bounds();
- if (this.offscreen == null || var6.width != this.offscreensize.width || var6.height != this.offscreensize.height) {
- if (var6.width < 10 || var6.height < 10) {
- var6.width = 1204;
- var6.height = 768;
- }
-
- try {
- this.offscreen = ((Component)this).createImage(var6.width + 200, var6.height);
- this.offscreen1 = ((Component)this).createImage(var6.width, var6.height);
- } catch (Exception var13) {
- return;
- }
-
- this.offscreensize = var6;
- this.field_0 = this.offscreen.getGraphics();
- this.field_0.setFont(((Component)this).getFont());
- var5 = true;
- }
-
- if (this.dragPanel != null) {
- this.dragPanel.removeAllComponents(this);
- }
-
- this.resetRectangles(this.treeRoot);
- this.Bounds = ((Component)this).bounds();
- if (this.maxWidth > 0 && this.xOffset > this.maxWidth + 20 - this.Bounds.width) {
- this.xOffset = this.maxWidth + 20 - this.Bounds.width;
- }
-
- if (this.xOffset < 0) {
- this.xOffset = 0;
- }
-
- if (this.maxHeight > 0 && this.yOffset > this.maxHeight + 20 - this.Bounds.height) {
- this.yOffset = this.maxHeight + 20 - this.Bounds.height;
- }
-
- if (this.yOffset < 0) {
- this.yOffset = 0;
- }
-
- this.currxpoint = -10 - this.xOffset;
- this.currypoint = 8 - this.yOffset;
- if (this.listOnly) {
- this.currypoint -= 3;
- }
-
- if (this.columnHeader != null && this.columnHeader.length > 0) {
- this.currypoint += this.colHeaderHeight + 2;
- }
-
- int var7 = this.maxHeight;
- int var8 = this.maxWidth;
- this.maxWidth = this.xOffset;
- this.maxHeight = 0;
- if (this.columnWidth != null && this.columnWidth.length > 0) {
- int var9 = 0;
-
- for(int var10 = 0; var10 < this.columnWidth.length; ++var10) {
- var9 += this.columnWidth[var10];
- }
-
- if (var9 + this.xOffset > this.maxWidth) {
- this.maxWidth = var9 + this.xOffset;
- }
- }
-
- this.onPage = false;
- this.field_0.setFont(((Component)this).getFont());
- this.field_0.setColor(this.backColor);
- this.currheight = this.StringHeight();
- this.colHeaderHeight = this.currheight + 2;
- if (!this.draggingColMouse) {
- this.field_0.fillRect(2, 2, this.Bounds.width + 200, this.Bounds.height);
- this.lastxpoint = this.currxpoint;
- this.lastypoint = this.currypoint;
- this.drawEntry(this.treeRoot);
- } else {
- this.field_0.fillRect(2, 2, this.Bounds.width + 200, this.colHeaderHeight + 2);
- }
-
- if (!this.listOnly) {
- this.maxHeight += 15;
- }
-
- this.maxWidth += 15;
- this.drawColumnHeader();
- byte var15 = 0;
- if (!this.threeDBorder) {
- var15 = 1;
- }
-
- if (this.yOffset == 1) {
- this.yOffset = 0;
- }
-
- if (this.Bounds.height > this.maxHeight - 1 && this.yOffset <= 0) {
- if (this.scrollEast != null) {
- this.scrollEast.hide();
- }
-
- if (this.resizingAllowed) {
- this.widthRect = new Rectangle(this.Bounds.width - 7, 0, 4, this.Bounds.height);
- }
- } else {
- if (this.scrollEast == null) {
- this.scrollEast = new Scrollbar(1, 0, 100, 0, 100);
- ((Container)this).add(this.scrollEast);
- this.scrollEast.setBackground(this.controlColor);
- }
-
- this.maxWidth += 15;
- int var16 = this.maxHeight;
- if (this.maxHeight < this.Bounds.height) {
- var16 += this.yOffset;
- }
-
- if (this.scrollEastDisabled) {
- this.scrollEast.hide();
- } else {
- int var11 = 0;
- if (System.getProperty("java.vendor").startsWith("Netscape") && System.getProperty("java.version").compareTo("1.1.5") < 0 || System.getProperty("java.vendor").startsWith("Microsoft") && System.getProperty("java.version").compareTo("1.1.4") < 0) {
- var11 = this.Bounds.height;
- }
-
- this.scrollEast.setValues(this.yOffset, this.Bounds.height, 0, var16 - var11);
- if (this.maxHeight != var7 || var5 || !this.scrollEast.isVisible()) {
- if ((this.Bounds.width <= this.maxWidth || this.xOffset > 0) && !this.scrollSouthDisabled) {
- this.scrollEast.reshape(this.Bounds.width - 13 + var15, 2 - var15, 12, this.Bounds.height - 15 + var15 * 2);
- } else {
- this.scrollEast.reshape(this.Bounds.width - 13 + var15, 2 - var15, 12, this.Bounds.height - 3 + var15 * 2);
- }
-
- this.scrollEast.show();
- }
- }
-
- this.layout();
- if (this.resizingAllowed) {
- this.widthRect = new Rectangle(this.Bounds.width - 19, 0, 5, this.Bounds.height);
- }
- }
-
- if (this.Bounds.width > this.maxWidth && this.xOffset <= 0) {
- if (this.scrollSouth != null) {
- this.scrollSouth.hide();
- }
- } else {
- if (this.scrollSouth == null) {
- this.scrollSouth = new Scrollbar(0, 0, 100, 0, 100);
- ((Container)this).add(this.scrollSouth);
- this.scrollSouth.setBackground(this.controlColor);
- }
-
- this.maxHeight += 15;
- if (this.scrollSouthDisabled) {
- this.scrollSouth.hide();
- } else {
- int var17 = 0;
- if (System.getProperty("java.vendor").startsWith("Netscape") && System.getProperty("java.version").compareTo("1.1.5") < 0 || System.getProperty("java.vendor").startsWith("Microsoft") && System.getProperty("java.version").compareTo("1.1.4") < 0) {
- var17 = this.Bounds.width;
- }
-
- this.scrollSouth.setValues(this.xOffset, this.Bounds.width, 0, this.maxWidth - var17 + 15);
- if (this.maxWidth != var8 || var5 || !this.scrollSouth.isVisible()) {
- if (this.scrollEast != null && this.scrollEast.isVisible()) {
- this.scrollSouth.reshape(2 - var15, this.Bounds.height - 13 + var15, this.Bounds.width - 3 + var15 * 2 - 12, 12);
- } else {
- this.scrollSouth.reshape(2 - var15, this.Bounds.height - 13 + var15, this.Bounds.width - 3 + var15 * 2, 12);
- }
-
- this.scrollSouth.show();
- }
- }
- }
-
- Graphics var18 = this.offscreen1.getGraphics();
- var18.drawImage(this.offscreen, -100, 0, (ImageObserver)null);
- if (this.scrollEast != null && this.scrollSouth != null && this.scrollEast.isVisible() && this.scrollSouth.isVisible()) {
- var18.setColor(this.controlColor);
- var18.fillRect(this.Bounds.width - 14, this.Bounds.height - 14, 13, 13);
- }
-
- this.drawBorder(var18);
- var1.drawImage(this.offscreen1, 0, 0, (ImageObserver)null);
- if (this.thisEvent != null) {
- Event var19 = this.thisEvent;
- this.thisEvent = null;
- super.postEvent(var19);
- }
-
- this.stillDragging = false;
- if ((this.scrollDown >= 0 || this.yOffset <= 0) && this.scrollDown <= 0) {
- this.drawnSelected = false;
- } else {
- if (!this.listOnly || this.makeVisibleRequest >= 0) {
- if (this.currypoint - this.scrollDown < this.Bounds.height) {
- this.scrollDown = this.currypoint - this.Bounds.height;
- if (this.scrollSouth != null && this.scrollSouth.isVisible()) {
- this.scrollDown += 15;
- }
- }
-
- this.yOffset += this.scrollDown;
- this.scrollDown = 0;
- this.makeVisibleRequest = -1;
- this.nothingChanged = false;
- ((Component)this).repaint();
- }
-
- this.scrollDown = 0;
- }
-
- if (this.dragPanelEvent != null && this.dragPanel != null) {
- this.dragPanel.dropRects = null;
- this.dragPanel.postEvent(this.dragPanelEvent);
- this.dragPanelEvent = null;
- }
-
- if (this.performRedraw) {
- try {
- Thread.sleep(20L);
- } catch (Exception var12) {
- }
-
- this.reDraw();
- this.performRedraw = false;
- }
-
- }
- }
-
- public String getTitle() {
- return this.treeRoot.name;
- }
-
- public void setTitle(String var1) {
- this.treeRoot.name = var1;
- this.reDraw();
- }
-
- public int getSelectedIcon() {
- return this.currentBranchSelected != null ? this.currentBranchSelected.icon : -1;
- }
-
- Object getDropKey(Rectangle var1) {
- return this.getDropKeyBranch(this.treeRoot, var1);
- }
-
- public int getMinWidth() {
- return this.minimumWidth;
- }
-
- public void setMinWidth(int var1) {
- this.minimumWidth = var1;
- this.layout();
-
- for(Container var2 = ((Component)this).getParent(); var2 != null; var2 = ((Component)var2).getParent()) {
- ((Component)var2).layout();
- ((Component)var2).paintAll(((Component)var2).getGraphics());
- }
-
- this.nothingChanged = false;
- ((Component)this).repaint();
- if (this.user.jdpMenuPanel != null) {
- this.user.jdpMenuPanel.reloadTab();
- }
-
- }
-
- void loadBeanInfo(JDPTreeBranch var1) {
- try {
- Class var2 = JDPUtils.getClass(var1.compType);
- BeanInfo var3 = Introspector.getBeanInfo(var2, var2.getSuperclass());
- var1.iconImage = var3.getIcon(1);
- if (var1.iconImage == null) {
- var1.icon = 5;
- return;
- }
- } catch (Exception var4) {
- var1.icon = 5;
- }
-
- }
-
- public Dimension minimumSize() {
- Dimension var1 = new Dimension(this.minimumWidth, this.minimumHeight);
- return var1;
- }
-
- void checkIconsLoaded() {
- if (defaultIconImage == null || this.iconImage == null) {
- String var1 = "JDPICONS.gif";
- int var2 = JDPUtils.getNumColors();
- if (System.getProperty("java.vendor").startsWith("Microsoft") && var2 <= 8) {
- var1 = "JDPICON1.gif";
- }
-
- if (this.imageLoader == null) {
- this.setIconImagePath("Images/" + var1);
- }
- }
-
- }
-
- public JDPTreeBranch[] getTreeBranch(Object var1) {
- JDPTreeBranch[] var2 = new JDPTreeBranch[100];
- JDPTreeBranch[] var3 = this.getBranch(this.treeRoot, (Object)var1, 0, (JDPTreeBranch[])var2);
- if (var3 == null) {
- return null;
- } else {
- int var4 = 0;
- var4 = 0;
-
- while(var3[var4] != null && var3[var4].name != null) {
- ++var4;
- if (var4 >= 100) {
- break;
- }
- }
-
- var2 = new JDPTreeBranch[var4];
-
- for(int var5 = 0; var5 < var4; ++var5) {
- var2[var5] = var3[var5];
- }
-
- return var2;
- }
- }
-
- public void selectLastAddedBranch() {
- this.select(this.getTreeBranchNames(this.getLastAddedBranch()));
- }
-
- public JDPTreeBranch getLastAddedBranch() {
- return this.lastAddedBranch;
- }
-
- public void setDropKeys(Object[] var1) {
- this.dropKeys = var1;
- }
-
- public void addBranch(JDPTreeBranch var1, String var2, int var3, boolean var4, Object var5, String var6, boolean var7) {
- this.addNewBranch(var1, var2, var3, var4, var5, var6, var7);
- }
-
- public void addBranch(JDPTreeBranch var1, String var2, int var3) {
- this.addNewBranch(var1, var2, var3);
- }
-
- public void addBranch(JDPTreeBranch var1, String var2, int var3, Object var4, String var5) {
- this.addNewBranch(var1, var2, var3, var4, var5, (String)null);
- }
-
- JDPTreeBranch getTreeBranch(JDPTreeBranch var1, String[] var2, int var3) {
- return this.getTreeBranch(var1, var2, var3, false);
- }
-
- JDPTreeBranch getTreeBranch(JDPTreeBranch var1, String[] var2, int var3, boolean var4) {
- boolean var5 = false;
- if (!var4 && var1.name.equals(var2[var3])) {
- var5 = true;
- } else if (var4 && var1.name.toUpperCase().equals(var2[var3].toUpperCase())) {
- var5 = true;
- }
-
- if (var1.leaves != null && var5) {
- for(int var6 = 0; var6 < var1.leaves.size(); ++var6) {
- JDPTreeBranch var7 = (JDPTreeBranch)var1.leaves.elementAt(var6);
- if (var2.length > var3 + 1 && var7.name.equals(var2[var3 + 1])) {
- if (var3 + 2 == var2.length || var2[var3 + 2] == null) {
- return var7;
- }
-
- JDPTreeBranch var8 = this.getTreeBranch(var7, var2, var3 + 1, var4);
- if (var8 != null) {
- return var8;
- }
- }
- }
- }
-
- return null;
- }
-
- Object getDropKeyBranch(JDPTreeBranch var1, Rectangle var2) {
- if (var1.textRect != null && var1.textRect.equals(var2)) {
- return var1.dropKey;
- } else {
- if (var1.leaves != null) {
- for(int var3 = 0; var3 < var1.leaves.size(); ++var3) {
- JDPTreeBranch var4 = (JDPTreeBranch)var1.leaves.elementAt(var3);
- Object var5 = this.getDropKeyBranch(var4, var2);
- if (var5 != null) {
- return var5;
- }
- }
- }
-
- return null;
- }
- }
-
- public void setScrollSouthDisabled(boolean var1) {
- this.scrollSouthDisabled = var1;
- this.reDraw();
- }
-
- public boolean getScrollSouthDisabled() {
- return this.scrollSouthDisabled;
- }
- }
-