Browse Source

Pull request #14610: REPORT-130921 & REPORT-130922 & REPORT-130807 【NewUI】测试验收问题修复

Merge in DESIGN/design from ~LEVY.XIE/design:newui to newui

* commit '190bf5c73dd4b48788c89dbbec84f4faae9d7b3d':
  REPORT-130921 & REPORT-130922 & REPORT-130807 【NewUI】测试验收问题修复
  REPORT-130921 & REPORT-130922 & REPORT-130807 【NewUI】测试验收问题修复
newui
Levy.Xie-解安森 3 months ago
parent
commit
46b34fe996
  1. 15
      designer-base/src/main/java/com/fr/design/gui/frpane/JTreeControlPane.java
  2. 30
      designer-base/src/main/java/com/fr/design/gui/frpane/tree/layer/config/LayerDataControlPane.java
  3. 11
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/MapDataTree.java
  4. 33
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/axis/GanttProcessAxisPane.java
  5. 18
      designer-chart/src/main/java/com/fr/van/chart/range/component/SectionLegendPane.java

15
designer-base/src/main/java/com/fr/design/gui/frpane/JTreeControlPane.java

@ -1,11 +1,15 @@
package com.fr.design.gui.frpane; package com.fr.design.gui.frpane;
import com.fine.theme.icon.LazyIcon; 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.base.BaseUtils;
import com.fr.data.impl.TreeNodeAttr; import com.fr.data.impl.TreeNodeAttr;
import com.fr.data.impl.TreeNodeWrapper; import com.fr.data.impl.TreeNodeWrapper;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.controlpane.ControlPane; import com.fr.design.gui.controlpane.ControlPane;
import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableCreator;
@ -26,7 +30,6 @@ import javax.swing.JPanel;
import javax.swing.event.TreeSelectionEvent; import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener; import javax.swing.event.TreeSelectionListener;
import javax.swing.JTree; import javax.swing.JTree;
import javax.swing.BorderFactory;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreePath; import javax.swing.tree.TreePath;
@ -41,6 +44,8 @@ import java.awt.event.ActionEvent;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import static com.fine.theme.utils.FineUIScale.scale;
public class JTreeControlPane extends ControlPane { public class JTreeControlPane extends ControlPane {
// 添加一个treeNode // 添加一个treeNode
private AddTreeNodeAction addTreeNode; private AddTreeNodeAction addTreeNode;
@ -59,7 +64,7 @@ public class JTreeControlPane extends ControlPane {
} }
private void initComponents(NameableCreator[] creators, BasicBeanPane updatePane) { private void initComponents(NameableCreator[] creators, BasicBeanPane updatePane) {
this.setLayout(new BorderLayout(2, 2)); this.setLayout(new BorderLayout(FineUIScale.scale(10), 0));
this.updatePane = updatePane; this.updatePane = updatePane;
// LeftPane // LeftPane
JPanel leftPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel leftPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
@ -79,8 +84,10 @@ public class JTreeControlPane extends ControlPane {
checkButtonEnabled(); checkButtonEnabled();
} }
}); });
tree.setPreferredSize(new Dimension(170, 350)); tree.setPreferredSize(scale(new Dimension(170, 350)));
tree.setCellRenderer(renderer); tree.setCellRenderer(renderer);
leftPane.setBorder(FineBorderFactory.createWrappedRoundBorder());
FineUIStyle.setStyle(tree, FineUIStyle.PURE_TREE);
// JTreeControlPane控制栏 // JTreeControlPane控制栏
ToolBarDef toolbarDef = new ToolBarDef(); ToolBarDef toolbarDef = new ToolBarDef();
@ -256,7 +263,7 @@ public class JTreeControlPane extends ControlPane {
this.setText(((NameObject) userObj).getName()); this.setText(((NameObject) userObj).getName());
} }
} }
this.setBorder(BorderFactory.createEmptyBorder(0, 0, 2, 0)); this.setBorder(new ScaledEmptyBorder(0, 0, 2, 0));
return this; return this;
} }
}; };

30
designer-base/src/main/java/com/fr/design/gui/frpane/tree/layer/config/LayerDataControlPane.java

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

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

@ -1,5 +1,6 @@
package com.fr.van.chart.drillmap.designer.data.comp; package com.fr.van.chart.drillmap.designer.data.comp;
import com.fine.theme.icon.LazyIcon;
import com.fr.design.border.FineBorderFactory; import com.fr.design.border.FineBorderFactory;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.map.designer.type.GEOJSONTreeHelper; import com.fr.plugin.chart.map.designer.type.GEOJSONTreeHelper;
@ -7,6 +8,7 @@ import com.fr.plugin.chart.map.server.ChartGEOJSONHelper;
import com.fr.plugin.chart.map.server.CompatibleGEOJSONHelper; import com.fr.plugin.chart.map.server.CompatibleGEOJSONHelper;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.Icon;
import javax.swing.JTree; import javax.swing.JTree;
import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.DefaultTreeCellRenderer;
@ -117,8 +119,17 @@ public class MapDataTree extends JTree {
DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) value; DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) value;
String name = getPresentName(treeNode); String name = getPresentName(treeNode);
this.setText(name); this.setText(name);
this.setIcon(getTreeIcon(expanded, treeNode));
return this; return this;
} }
private Icon getTreeIcon(boolean expanded, DefaultMutableTreeNode treeNode) {
boolean folderFile = treeNode.getChildCount() != 0;
if (folderFile) {
return expanded ? new LazyIcon("folder_open") : new LazyIcon("folder");
}
return new LazyIcon("file");
}
}; };
protected String getPresentName(DefaultMutableTreeNode treeNode) { protected String getPresentName(DefaultMutableTreeNode treeNode) {

33
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/axis/GanttProcessAxisPane.java

@ -13,17 +13,21 @@ import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.van.chart.designer.AbstractVanChartScrollPane; import com.fr.van.chart.designer.AbstractVanChartScrollPane;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
/** /**
* Created by hufan on 2017/1/12. * Created by hufan on 2017/1/12.
*/ */
public class GanttProcessAxisPane extends AbstractVanChartScrollPane<VanChart> { public class GanttProcessAxisPane extends AbstractVanChartScrollPane<VanChart> {
private UIButtonGroup typeButton; private UIButtonGroup typeButton;
private UISpinner horizontalProportion; private UISpinner horizontalProportion;
private JPanel horizontalProportionRow;
private GanttAxisStylePane horizontalHeaderPane; private GanttAxisStylePane horizontalHeaderPane;
private GanttAxisStylePaneWithPosition verticalHeaderPane; private GanttAxisStylePaneWithPosition verticalHeaderPane;
@ -70,26 +74,25 @@ public class GanttProcessAxisPane extends AbstractVanChartScrollPane<VanChart> {
proportionPane.add(horizontalProportion, BorderLayout.CENTER); proportionPane.add(horizontalProportion, BorderLayout.CENTER);
proportionPane.add(new UILabel("%"), BorderLayout.EAST); proportionPane.add(new UILabel("%"), BorderLayout.EAST);
JPanel panel = new JPanel(new BorderLayout(0, 5)); horizontalProportionRow = row(
flex(1.2), cell(proportionPane).weight(3)
panel.add(typeButton, BorderLayout.NORTH); ).getComponent();
panel.add(horizontalProportion, BorderLayout.CENTER);
typeButton.addChangeListener(new ChangeListener() { typeButton.addChangeListener(e -> checkoutPaneVisible());
@Override
public void stateChanged(ChangeEvent e) {
checkoutPaneVisible();
}
});
JPanel jPanel = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, JPanel jPanel = column(10,
new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Horizontal_Proportion")), panel); row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Horizontal_Proportion"))).weight(1.2),
cell(typeButton).weight(3)
),
cell(horizontalProportionRow)
).getComponent();
return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Function_Percent"), jPanel, true); return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Function_Percent"), jPanel, true);
} }
private void checkoutPaneVisible() { private void checkoutPaneVisible() {
horizontalProportion.setVisible(typeButton.getSelectedIndex() == 1); horizontalProportionRow.setVisible(typeButton.getSelectedIndex() == 1);
} }
@Override @Override

18
designer-chart/src/main/java/com/fr/van/chart/range/component/SectionLegendPane.java

@ -1,14 +1,12 @@
package com.fr.van.chart.range.component; package com.fr.van.chart.range.component;
import com.fine.theme.utils.FineUIScale;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.style.series.MapColorPickerPaneWithFormula; import com.fr.design.mainframe.chart.gui.style.series.MapColorPickerPaneWithFormula;
import com.fr.plugin.chart.range.SectionLegend; import com.fr.plugin.chart.range.SectionLegend;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component;
public class SectionLegendPane extends JPanel { public class SectionLegendPane extends JPanel {
private static final long serialVersionUID = 1614283200308877353L; private static final long serialVersionUID = 1614283200308877353L;
@ -24,18 +22,8 @@ public class SectionLegendPane extends JPanel {
private void initComponents() { private void initComponents() {
intervalConfigPane = createSectionIntervalConfigPane(this.parent); intervalConfigPane = createSectionIntervalConfigPane(this.parent);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] col = {f};
double[] row = {p};
Component[][] components = new Component[][]{
new Component[]{intervalConfigPane},
};
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.CENTER); this.add(intervalConfigPane, BorderLayout.CENTER);
} }
protected MapColorPickerPaneWithFormula createSectionIntervalConfigPane(AbstractAttrNoScrollPane parent) { protected MapColorPickerPaneWithFormula createSectionIntervalConfigPane(AbstractAttrNoScrollPane parent) {
@ -54,7 +42,7 @@ public class SectionLegendPane extends JPanel {
@Override @Override
protected int getBoundWidth() { protected int getBoundWidth() {
return WIDTH; return FineUIScale.scale(WIDTH);
} }
}; };
} }

Loading…
Cancel
Save