Browse Source

KERNEL-3999 10.0.7设计器可使用JDK11构建

persist/11.0
Harrison 4 years ago
parent
commit
7997b8f973
  1. 16
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/MapDataTree.java
  2. 48
      designer-form/src/main/java/com/fr/design/mainframe/widget/UITreeComboBox.java
  3. 28
      designer-realize/src/main/java/com/fr/poly/PolyComponentsBar.java

16
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/MapDataTree.java

@ -45,9 +45,9 @@ public class MapDataTree extends JTree {
public void selectDefaultTreeNode() {
DefaultTreeModel m_model = (DefaultTreeModel) this.getModel();
DefaultMutableTreeNode root = (DefaultMutableTreeNode) m_model.getRoot();
Enumeration<DefaultMutableTreeNode> children = root.children();
Enumeration<TreeNode> children = root.children();
if (children.hasMoreElements()) {
DefaultMutableTreeNode child = children.nextElement();
DefaultMutableTreeNode child = (DefaultMutableTreeNode) children.nextElement();
if(GEOJSONTreeHelper.getInstance().isSelectableTreeNode(child)){
selectTreeNode(child, m_model);
@ -59,9 +59,9 @@ public class MapDataTree extends JTree {
}
private void setFirstChildTreeNode(DefaultMutableTreeNode parent, DefaultTreeModel m_model){
Enumeration<DefaultMutableTreeNode> children = parent.children();
Enumeration<TreeNode> children = parent.children();
if (children.hasMoreElements()){
DefaultMutableTreeNode node = children.nextElement();
DefaultMutableTreeNode node = (DefaultMutableTreeNode) children.nextElement();
selectTreeNode(node, m_model);
}
}
@ -89,9 +89,9 @@ public class MapDataTree extends JTree {
DefaultTreeModel m_model = (DefaultTreeModel) this.getModel();
DefaultMutableTreeNode root = (DefaultMutableTreeNode) m_model.getRoot();
Enumeration<DefaultMutableTreeNode> els = root.postorderEnumeration();
Enumeration<TreeNode> els = root.postorderEnumeration();
while(els.hasMoreElements()){
DefaultMutableTreeNode el = els.nextElement();
DefaultMutableTreeNode el = (DefaultMutableTreeNode) els.nextElement();
if(el == null || el.getUserObject() == null){
return null;
}
@ -145,10 +145,10 @@ public class MapDataTree extends JTree {
DefaultTreeModel m_model = (DefaultTreeModel) this.getModel();
DefaultMutableTreeNode root = (DefaultMutableTreeNode) m_model.getRoot();
Enumeration<DefaultMutableTreeNode> els = root.postorderEnumeration();
Enumeration<TreeNode> els = root.postorderEnumeration();
while(els.hasMoreElements()){
DefaultMutableTreeNode el = els.nextElement();
DefaultMutableTreeNode el = (DefaultMutableTreeNode) els.nextElement();
String path = el.getUserObject().toString();
String fileName = ChartGEOJSONHelper.getPresentNameWithPath(path);
if (StringUtils.contains(fileName, text) && GEOJSONTreeHelper.isValidDirPath(path)) {

48
designer-form/src/main/java/com/fr/design/mainframe/widget/UITreeComboBox.java

@ -3,16 +3,8 @@ package com.fr.design.mainframe.widget;
/**
* Created by xiaxiang on 2016/9/30.
*/
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.plaf.*;
import javax.swing.plaf.basic.*;
import javax.swing.plaf.metal.*;
import javax.swing.tree.*;
import com.fr.design.constants.UIConstants;
import com.fr.design.designer.beans.*;
import com.fr.design.designer.beans.AdapterBus;
import com.fr.design.designer.beans.events.DesignerEditListener;
import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.XCreator;
@ -20,8 +12,36 @@ import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.UIComboBoxUI;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.mainframe.ComponentTree;
import com.sun.java.swing.plaf.motif.*;
import com.sun.java.swing.plaf.windows.*;
import com.sun.java.swing.plaf.motif.MotifComboBoxUI;
import javax.swing.DefaultListCellRenderer;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPopupMenu;
import javax.swing.JScrollPane;
import javax.swing.JTree;
import javax.swing.ListCellRenderer;
import javax.swing.MenuSelectionManager;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.plaf.ComboBoxUI;
import javax.swing.plaf.basic.ComboPopup;
import javax.swing.plaf.metal.MetalComboBoxUI;
import javax.swing.tree.TreeCellRenderer;
import javax.swing.tree.TreePath;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Rectangle;
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;
/**
* 控件树下拉列表框
@ -111,12 +131,6 @@ public class UITreeComboBox extends UIComboBox {
}
}
class WindowsJTreeComboBoxUI extends WindowsComboBoxUI{
protected ComboPopup createPopup() {
return new TreePopup(comboBox);
}
}
class UIJTreeComboBoxUI extends UIComboBoxUI {
protected ComboPopup createPopup() {
return new TreePopup(comboBox);

28
designer-realize/src/main/java/com/fr/poly/PolyComponentsBar.java

@ -12,19 +12,12 @@ import com.fr.design.gui.itooltip.MultiLineToolTip;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.dnd.SerializableTransferable;
import com.fr.log.FineLoggerFactory;
import com.fr.report.poly.PolyECBlock;
import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JToolBar;
import javax.swing.JToolTip;
import javax.swing.SwingConstants;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.datatransfer.Transferable;
import java.awt.dnd.DnDConstants;
@ -147,25 +140,4 @@ public class PolyComponentsBar extends JToolBar {
}
}
/**
* 测试下
*
* @param args 参数
*/
public static void main(String... args) {
try {
UIManager.setLookAndFeel(new WindowsLookAndFeel());
} catch (UnsupportedLookAndFeelException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
JFrame f = new JFrame();
JPanel p = (JPanel) f.getContentPane();
p.setLayout(FRGUIPaneFactory.createBorderLayout());
PolyComponentsBar pbp = new PolyComponentsBar();
p.add(pbp, BorderLayout.CENTER);
f.setSize(400, 300);
f.setVisible(true);
}
}

Loading…
Cancel
Save