|
|
@ -1,22 +1,14 @@ |
|
|
|
package com.fr.design.gui.icombobox; |
|
|
|
package com.fr.design.gui.icombobox; |
|
|
|
|
|
|
|
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
import com.fr.design.constants.UIConstants; |
|
|
|
import java.awt.Color; |
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
import java.awt.Component; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
import java.awt.Dimension; |
|
|
|
import com.fr.design.gui.itextfield.UITextField; |
|
|
|
import java.awt.Graphics; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import java.awt.Graphics2D; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
import java.awt.IllegalComponentStateException; |
|
|
|
import com.fr.general.NameObject; |
|
|
|
import java.awt.RenderingHints; |
|
|
|
import com.fr.stable.Constants; |
|
|
|
import java.awt.event.KeyAdapter; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import java.awt.event.KeyEvent; |
|
|
|
|
|
|
|
import java.awt.event.KeyListener; |
|
|
|
|
|
|
|
import java.awt.event.MouseAdapter; |
|
|
|
|
|
|
|
import java.awt.event.MouseEvent; |
|
|
|
|
|
|
|
import java.awt.event.MouseListener; |
|
|
|
|
|
|
|
import java.awt.event.MouseMotionAdapter; |
|
|
|
|
|
|
|
import java.awt.event.MouseMotionListener; |
|
|
|
|
|
|
|
import java.util.Enumeration; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
import javax.swing.BorderFactory; |
|
|
|
import javax.swing.DefaultListCellRenderer; |
|
|
|
import javax.swing.DefaultListCellRenderer; |
|
|
@ -38,16 +30,23 @@ import javax.swing.tree.DefaultTreeModel; |
|
|
|
import javax.swing.tree.TreeCellRenderer; |
|
|
|
import javax.swing.tree.TreeCellRenderer; |
|
|
|
import javax.swing.tree.TreeNode; |
|
|
|
import javax.swing.tree.TreeNode; |
|
|
|
import javax.swing.tree.TreePath; |
|
|
|
import javax.swing.tree.TreePath; |
|
|
|
|
|
|
|
import java.util.Enumeration; |
|
|
|
import com.fr.design.constants.UIConstants; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
import java.awt.Color; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
import java.awt.Component; |
|
|
|
import com.fr.design.gui.itextfield.UITextField; |
|
|
|
import java.awt.Dimension; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import java.awt.Graphics; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
import java.awt.Graphics2D; |
|
|
|
import com.fr.general.NameObject; |
|
|
|
import java.awt.IllegalComponentStateException; |
|
|
|
import com.fr.stable.Constants; |
|
|
|
import java.awt.RenderingHints; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import java.awt.event.KeyAdapter; |
|
|
|
|
|
|
|
import java.awt.event.KeyEvent; |
|
|
|
|
|
|
|
import java.awt.event.KeyListener; |
|
|
|
|
|
|
|
import java.awt.event.MouseAdapter; |
|
|
|
|
|
|
|
import java.awt.event.MouseEvent; |
|
|
|
|
|
|
|
import java.awt.event.MouseListener; |
|
|
|
|
|
|
|
import java.awt.event.MouseMotionAdapter; |
|
|
|
|
|
|
|
import java.awt.event.MouseMotionListener; |
|
|
|
|
|
|
|
|
|
|
|
public class FRTreeComboBox extends UIComboBox { |
|
|
|
public class FRTreeComboBox extends UIComboBox { |
|
|
|
|
|
|
|
|
|
|
@ -79,7 +78,7 @@ public class FRTreeComboBox extends UIComboBox { |
|
|
|
boolean showRoot, boolean editable) { |
|
|
|
boolean showRoot, boolean editable) { |
|
|
|
this.setTree(tree); |
|
|
|
this.setTree(tree); |
|
|
|
this.tree.setCellRenderer(renderer); |
|
|
|
this.tree.setCellRenderer(renderer); |
|
|
|
this.setEditor(new FrTreeSearchComboBoxEditor(this)); |
|
|
|
this.setEditor(createEditor()); |
|
|
|
if (!showRoot) { |
|
|
|
if (!showRoot) { |
|
|
|
tree.expandPath(new TreePath(tree.getModel().getRoot())); |
|
|
|
tree.expandPath(new TreePath(tree.getModel().getRoot())); |
|
|
|
tree.setRootVisible(false); |
|
|
|
tree.setRootVisible(false); |
|
|
@ -101,6 +100,10 @@ public class FRTreeComboBox extends UIComboBox { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected UIComboBoxEditor createEditor() { |
|
|
|
|
|
|
|
return new FrTreeSearchComboBoxEditor(this); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setTree(JTree tree) { |
|
|
|
public void setTree(JTree tree) { |
|
|
|
this.tree = tree; |
|
|
|
this.tree = tree; |
|
|
|
if (tree != null) { |
|
|
|
if (tree != null) { |
|
|
@ -529,7 +532,7 @@ public class FRTreeComboBox extends UIComboBox { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
class FrTreeSearchComboBoxEditor extends UIComboBoxEditor implements DocumentListener { |
|
|
|
public class FrTreeSearchComboBoxEditor extends UIComboBoxEditor implements DocumentListener { |
|
|
|
private volatile boolean setting = false; |
|
|
|
private volatile boolean setting = false; |
|
|
|
private FRTreeComboBox comboBox; |
|
|
|
private FRTreeComboBox comboBox; |
|
|
|
private Object item; |
|
|
|
private Object item; |
|
|
|