|
|
|
@ -1,8 +1,12 @@
|
|
|
|
|
package com.fr.design.gui.frpane.tree.layer.config; |
|
|
|
|
|
|
|
|
|
import com.fine.theme.icon.LazyIcon; |
|
|
|
|
import com.fine.theme.utils.FineUIScale; |
|
|
|
|
import com.fine.theme.utils.FineUIStyle; |
|
|
|
|
import com.formdev.flatlaf.util.ScaledEmptyBorder; |
|
|
|
|
import com.fr.base.BaseUtils; |
|
|
|
|
import com.fr.design.actions.UpdateAction; |
|
|
|
|
import com.fr.design.border.FineBorderFactory; |
|
|
|
|
import com.fr.design.dialog.FineJOptionPane; |
|
|
|
|
import com.fr.design.gui.controlpane.ControlPane; |
|
|
|
|
import com.fr.design.gui.icontainer.UIScrollPane; |
|
|
|
@ -15,14 +19,25 @@ import com.fr.general.ComparatorUtils;
|
|
|
|
|
|
|
|
|
|
import com.fr.general.NameObject; |
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
|
import javax.swing.JOptionPane; |
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
import javax.swing.JTree; |
|
|
|
|
import javax.swing.event.TreeSelectionEvent; |
|
|
|
|
import javax.swing.event.TreeSelectionListener; |
|
|
|
|
import javax.swing.tree.*; |
|
|
|
|
import java.awt.*; |
|
|
|
|
import javax.swing.tree.DefaultMutableTreeNode; |
|
|
|
|
import javax.swing.tree.DefaultTreeCellRenderer; |
|
|
|
|
import javax.swing.tree.DefaultTreeModel; |
|
|
|
|
import javax.swing.tree.TreeCellRenderer; |
|
|
|
|
import javax.swing.tree.TreePath; |
|
|
|
|
import javax.swing.tree.TreeSelectionModel; |
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
import java.awt.Component; |
|
|
|
|
import java.awt.Dimension; |
|
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
|
|
import static com.fine.theme.utils.FineUIScale.scale; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Created by juhaoyu on 16/9/21. |
|
|
|
|
*/ |
|
|
|
@ -44,7 +59,7 @@ public class LayerDataControlPane extends ControlPane {
|
|
|
|
|
|
|
|
|
|
public LayerDataControlPane() { |
|
|
|
|
|
|
|
|
|
this.setLayout(new BorderLayout(2, 2)); |
|
|
|
|
this.setLayout(new BorderLayout(FineUIScale.scale(10), 0)); |
|
|
|
|
//创建层编辑panel
|
|
|
|
|
configPane = new LayerDataConfigPane(); |
|
|
|
|
//创建树结构及树控件
|
|
|
|
@ -58,7 +73,7 @@ public class LayerDataControlPane extends ControlPane {
|
|
|
|
|
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); |
|
|
|
|
leftPane.add(new UIScrollPane(tree), BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
tree.setPreferredSize(new Dimension(170, 350)); |
|
|
|
|
tree.setPreferredSize(scale(new Dimension(170, 350))); |
|
|
|
|
tree.setCellRenderer(renderer); |
|
|
|
|
|
|
|
|
|
tree.addTreeSelectionListener(new TreeSelectionListener() { |
|
|
|
@ -70,6 +85,7 @@ public class LayerDataControlPane extends ControlPane {
|
|
|
|
|
checkButtonEnabled(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
FineUIStyle.setStyle(tree, FineUIStyle.PURE_TREE); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// JTreeControlPane控制栏
|
|
|
|
@ -79,7 +95,7 @@ public class LayerDataControlPane extends ControlPane {
|
|
|
|
|
UIToolbar toolBar = ToolBarDef.createJToolBar(); |
|
|
|
|
toolbarDef.updateToolBar(toolBar); |
|
|
|
|
leftPane.add(toolBar, BorderLayout.NORTH); |
|
|
|
|
|
|
|
|
|
leftPane.setBorder(FineBorderFactory.createWrappedRoundBorder()); |
|
|
|
|
|
|
|
|
|
this.add(leftPane, BorderLayout.WEST); |
|
|
|
|
this.add(this.configPane, BorderLayout.CENTER); |
|
|
|
@ -122,7 +138,7 @@ public class LayerDataControlPane extends ControlPane {
|
|
|
|
|
this.setText(((NameObject) userObj).getName()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.setBorder(BorderFactory.createEmptyBorder(0, 0, 2, 0)); |
|
|
|
|
this.setBorder(new ScaledEmptyBorder(0, 0, 2, 0)); |
|
|
|
|
return this; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|