Browse Source

Merge pull request #15268 in DESIGN/design from fbp/release to fbp/feature

* commit '1a243d5afc5a2e631a6c6e3265e280caabc12938':
  REPORT-137540 远程设计下地图加载卡慢 回退改动
  REPORT-138856 fix: 序号列为居中展示,不需要文字左间距了
  REPORT-138740 fix:存储过程鼠标悬浮无法选中问题修复
  REPORT-138763 fix: 代码质量问题
  REPORT-138763 fix: 控件顺序展示框 高度调整。漏翻面板,优化了一下 render
fbp/feature
superman 2 months ago
parent
commit
56ba68d564
  1. 8
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java
  2. 5
      designer-base/src/main/java/com/fr/design/foldablepane/UIExpandablePane.java
  3. 24
      designer-base/src/main/java/com/fr/design/gui/controlpane/UISimpleListControlPane.java
  4. 12
      designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java
  5. 3
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java
  6. 4
      designer-realize/src/main/java/com/fanruan/boot/env/function/DesignChartBaseComponent.java

8
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java

@ -16,9 +16,11 @@ import com.fr.general.DateUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.DefaultCellEditor; import javax.swing.DefaultCellEditor;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JTable; import javax.swing.JTable;
import javax.swing.UIManager;
import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelEvent;
import javax.swing.event.TableModelListener; import javax.swing.event.TableModelListener;
import javax.swing.table.AbstractTableModel; import javax.swing.table.AbstractTableModel;
@ -350,10 +352,12 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
private class CellRenderer extends DefaultTableCellRenderer { private class CellRenderer extends DefaultTableCellRenderer {
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
if (column == 0) { if (column == 0) {
setBackground(new Color(229, 229, 229));
setHorizontalAlignment(CENTER); setHorizontalAlignment(CENTER);
} }
return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); Component component = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
//居中文本不需要设置 borderInsets
setBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, UIManager.getColor("defaultBorderColor")));
return component;
} }
} }

5
designer-base/src/main/java/com/fr/design/foldablepane/UIExpandablePane.java

@ -59,15 +59,14 @@ public class UIExpandablePane extends JPanel {
headerPanel = new HeaderPane(title); headerPanel = new HeaderPane(title);
headerPanel.addMouseListener(new PanelAction()); headerPanel.addMouseListener(new PanelAction());
setcontentPanelontentPanelBorder(); setcontentPanelontentPanelBorder();
this.add(headerPanel, BorderLayout.NORTH);
this.add(contentPanel, BorderLayout.CENTER);
if (withUnderline) { if (withUnderline) {
this.add(column( this.add(column(
cell(headerPanel), cell(contentPanel).with(it -> it.setBorder(new ScaledEmptyBorder(0, 0, 10, 0))), cell(headerPanel), cell(contentPanel).with(it -> it.setBorder(new ScaledEmptyBorder(0, 0, 10, 0))),
fix(1).with(it -> it.setBorder(FineBorderFactory.createDefaultUnderlineBorder()))) fix(1).with(it -> it.setBorder(FineBorderFactory.createDefaultUnderlineBorder())))
.getComponent()); .getComponent());
} else { } else {
this.add(column(cell(headerPanel), cell(contentPanel)).getComponent()); this.add(headerPanel, BorderLayout.NORTH);
this.add(contentPanel, BorderLayout.CENTER);
} }
setOpaque(false); setOpaque(false);

24
designer-base/src/main/java/com/fr/design/gui/controlpane/UISimpleListControlPane.java

@ -1,6 +1,9 @@
package com.fr.design.gui.controlpane; package com.fr.design.gui.controlpane;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.border.FineBorderFactory; import com.fr.design.border.FineBorderFactory;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
@ -9,6 +12,7 @@ import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.gui.ilist.ListModelElement;
import com.fr.design.gui.ilist.UIList; import com.fr.design.gui.ilist.UIList;
import com.fr.design.gui.ilist.UINameEdList;
import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.menu.ShortCut; import com.fr.design.menu.ShortCut;
@ -26,12 +30,14 @@ import javax.swing.JList;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.ListCellRenderer; import javax.swing.ListCellRenderer;
import javax.swing.ListSelectionModel; import javax.swing.ListSelectionModel;
import javax.swing.UIManager;
import javax.swing.border.Border; import javax.swing.border.Border;
import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener; import javax.swing.event.ListSelectionListener;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension;
import java.awt.Point; import java.awt.Point;
import java.awt.Toolkit; import java.awt.Toolkit;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -49,7 +55,7 @@ import java.util.Comparator;
public class UISimpleListControlPane extends BasicPane { public class UISimpleListControlPane extends BasicPane {
public static final String LIST_NAME = "UISimpleControl_List"; public static final String LIST_NAME = "UISimpleControl_List";
protected UIList nameList; protected UINameEdList nameList;
protected String selectedName; protected String selectedName;
private ShortCut4JControlPane[] shorts; private ShortCut4JControlPane[] shorts;
private ToolBarDef toolbarDef; private ToolBarDef toolbarDef;
@ -108,10 +114,8 @@ public class UISimpleListControlPane extends BasicPane {
protected void initListPane(JPanel listPane) { protected void initListPane(JPanel listPane) {
nameList = createJNameList(); nameList = createJNameList();
nameList.setName(LIST_NAME); nameList.setName(LIST_NAME);
nameList.setSelectionBackground(UIConstants.ATTRIBUTE_PRESS);
listPane.add(new UIScrollPane(nameList), BorderLayout.CENTER); listPane.add(new UIScrollPane(nameList), BorderLayout.CENTER);
nameList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); nameList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
nameList.addMouseListener(listMouseListener); nameList.addMouseListener(listMouseListener);
nameList.addListSelectionListener(new ListSelectionListener() { nameList.addListSelectionListener(new ListSelectionListener() {
@ -124,8 +128,12 @@ public class UISimpleListControlPane extends BasicPane {
}); });
} }
public UIList createJNameList() { /**
UIList nameList = new UIList(new DefaultListModel()) { * 构造 list设置 render
* @return UINameEdList
*/
public UINameEdList createJNameList() {
UINameEdList nameList = new UINameEdList(new DefaultListModel()) {
@Override @Override
public int locationToIndex(Point location) { public int locationToIndex(Point location) {
int index = super.locationToIndex(location); int index = super.locationToIndex(location);
@ -411,6 +419,7 @@ public class UISimpleListControlPane extends BasicPane {
label = new UILabel(); label = new UILabel();
initialLabelForeground = label.getForeground(); initialLabelForeground = label.getForeground();
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
label.setBorder(new ScaledEmptyBorder(0, 6, 0, 0));
this.add(label, BorderLayout.CENTER); this.add(label, BorderLayout.CENTER);
} }
@ -425,6 +434,7 @@ public class UISimpleListControlPane extends BasicPane {
@Override @Override
public Component getListCellRendererComponent(JList list, Object value, public Component getListCellRendererComponent(JList list, Object value,
int index, boolean isSelected, boolean cellHasFocus) { int index, boolean isSelected, boolean cellHasFocus) {
setPreferredSize(new Dimension(list.getWidth(), FineUIScale.scale(UIManager.getInt("List.cellRender.height"))));
setComponentOrientation(list.getComponentOrientation()); setComponentOrientation(list.getComponentOrientation());
Color bg = null; Color bg = null;
@ -442,9 +452,7 @@ public class UISimpleListControlPane extends BasicPane {
} }
if (isSelected) { if (isSelected) {
setBackground(bg == null ? list.getSelectionBackground() : bg); setBackground(FlatUIUtils.getUIColor("List.selectionInactiveBackground", Color.GRAY));
setForeground(fg == null ? list.getSelectionForeground() : fg);
label.setForeground(Color.WHITE);
} }
else { else {
setBackground(list.getBackground()); setBackground(list.getBackground());

12
designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java

@ -3,8 +3,6 @@ package com.fr.design.gui.ilist;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fanruan.config.impl.data.ConnectionConfigProviderFactory;
import com.fr.base.BaseUtils;
import com.fr.data.core.DataCoreUtils; import com.fr.data.core.DataCoreUtils;
import com.fr.data.core.db.TableProcedure; import com.fr.data.core.db.TableProcedure;
import com.fr.data.core.db.dialect.base.key.check.DataBaseDetail; import com.fr.data.core.db.dialect.base.key.check.DataBaseDetail;
@ -19,7 +17,6 @@ import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.workspace.server.entity.connection.ConnectionBean;
import com.fr.workspace.server.repository.connection.ConnectionRepository; import com.fr.workspace.server.repository.connection.ConnectionRepository;
import javax.swing.DefaultListCellRenderer; import javax.swing.DefaultListCellRenderer;
@ -47,9 +44,10 @@ import java.util.concurrent.CancellationException;
* 表或者视图或者存储过程组成的一个下拉列表 * 表或者视图或者存储过程组成的一个下拉列表
* *
* @author zhou * @author zhou
* @since 2012-3-28下午10:07:34 * @Created on 2012-3-28下午10:07:34
* @since 11.0
*/ */
public class TableViewList extends UIList { public class TableViewList extends JList {
/** /**
* *
@ -162,7 +160,7 @@ public class TableViewList extends UIList {
* augustdatabaseName是数据库名字searchFilter是输入的过滤条件,typesFilter是视图 * augustdatabaseName是数据库名字searchFilter是输入的过滤条件,typesFilter是视图
* 存储过程中的一者或者几者 * 存储过程中的一者或者几者
* *
* @param databaseName * @param datasource
* @param searchFilter * @param searchFilter
* @param typesFilter * @param typesFilter
*/ */
@ -267,7 +265,7 @@ public class TableViewList extends UIList {
icon = new LazyIcon("store_procedure"); icon = new LazyIcon("store_procedure");
} }
this.setIcon(icon); this.setIcon(icon);
this.setToolTipText(getPreferredSize().width > list.getVisibleRect().width ? this.getText() : null);
return this; return this;
} }

3
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java

@ -1,6 +1,7 @@
package com.fr.design.widget.ui.designer.mobile; package com.fr.design.widget.ui.designer.mobile;
import com.fine.theme.utils.FineLayoutBuilder; import com.fine.theme.utils.FineLayoutBuilder;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
@ -77,7 +78,7 @@ public class ParaMobileDefinePane extends MobileWidgetDefinePane {
mobileWidgetListPane = new MobileWidgetListPane(designer, (WSortLayout) paraCreator.toData()); mobileWidgetListPane = new MobileWidgetListPane(designer, (WSortLayout) paraCreator.toData());
JPanel panelWrapper = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel panelWrapper = FRGUIPaneFactory.createBorderLayout_S_Pane();
panelWrapper.add(mobileWidgetListPane, BorderLayout.CENTER); panelWrapper.add(mobileWidgetListPane, BorderLayout.CENTER);
panelWrapper.setBorder(new ScaledEmptyBorder(0, 0, 10, 0));
return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Order"), 280, 20, panelWrapper); return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Order"), 280, 20, panelWrapper);
} }

4
designer-realize/src/main/java/com/fanruan/boot/env/function/DesignChartBaseComponent.java vendored

@ -1,14 +1,11 @@
package com.fanruan.boot.env.function; package com.fanruan.boot.env.function;
import com.fanruan.boot.ChartBaseComponent; import com.fanruan.boot.ChartBaseComponent;
import com.fanruan.carina.Carina;
import com.fanruan.carina.annotions.DependsOn; import com.fanruan.carina.annotions.DependsOn;
import com.fanruan.carina.annotions.FineComponent; import com.fanruan.carina.annotions.FineComponent;
import com.fanruan.carina.annotions.Start; import com.fanruan.carina.annotions.Start;
import com.fanruan.carina.annotions.Stop; import com.fanruan.carina.annotions.Stop;
import com.fanruan.carina.annotions.Supplemental; import com.fanruan.carina.annotions.Supplemental;
import com.fanruan.map.DesignGEOJSONHelper;
import com.fr.decision.webservice.v10.map.geojson.helper.GEOJSONHelperShell;
/** /**
@ -45,7 +42,6 @@ public class DesignChartBaseComponent extends ChartBaseComponent {
@Supplemental @Supplemental
public void prepare() { public void prepare() {
super.prepare(); super.prepare();
Carina.getApplicationContext().singleton(GEOJSONHelperShell.class).set(DesignGEOJSONHelper.class);
} }
} }

Loading…
Cancel
Save