Browse Source

Merge pull request #6531 in DESIGN/design from release/10.0 to final/10.0

* commit '44dec138f9aa9d812cff3f789518fb4faebcc035': (23 commits)
  REPORT-60528 修复之前在弹窗提示tablayout高度有问题的时候,判断处理逻辑不正确的问题
  REPORT-61654 弹窗内容显示不全
  REPORT-61610 fix:回退最开始关于 相同的图表类型,不会新建图表配置界面 的逻辑改动
  REPORT-62016 BI插件匹配检测
  REPORT-61410 数据集预览时可复制-表头复制问题 && REPORT-61409 数据集预览时可复制-赋值空值时显示成Null
  update
  代码质量:每个实例各自监听插件事件
  REPORT-61695
  REPORT-61618 复用组件生成时带“-”,导致部分公式失效@Jaimme
  REPORT-61695 决策报表-自适应布局下组件右侧设置面板显示“组件大小”,绝对布局下显示的是“控件位置”“控件大小”
  REPORT-61610 fix:插件重新加载 图表配置界面报错 A.class can not cast to A.class
  CHART-21418 fix:第二次修改 区分弹框在上面还是下面 如果在上面 则是从displayComponent下面离开 隐藏弹框
  REPORT-59744 聚合报表块手动修改位置以后,点击空白处位置偏移
  REPORT-61306 设计器缩放时,显示通知的弹窗未跟随设计器内部界面,而是固定显示在右侧
  REPORT-60887 MAC OS x电脑上 编辑按钮飘移
  REPORT-61654 设计器-非中文设计器-字体缺失检测的弹窗内容显示不全
  REPORT-61654 设计器-非中文设计器-字体缺失检测的弹窗内容显示不全
  REPORT-59614 远程设计下无推送日志
  update
  CHART-20951 fix:大屏模板中的图表 警戒线文字默认样式
  ...
final/10.0
superman 3 years ago
parent
commit
e00b8b9977
  1. 2
      designer-base/src/main/java/com/fr/design/data/BasicTableDataUtils.java
  2. 23
      designer-base/src/main/java/com/fr/design/data/datapane/preview/CopyableJTable.java
  3. 5
      designer-base/src/main/java/com/fr/design/mainframe/share/collect/ComponentCollector.java
  4. 5
      designer-base/src/main/java/com/fr/design/notification/ui/NotificationCenterDialog.java
  5. 61
      designer-base/src/main/java/com/fr/design/style/AbstractSelectBox.java
  6. 16
      designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java
  7. 2
      designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties
  8. 2
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties
  9. 4
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties
  10. 2
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties
  11. 2
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties
  12. 9
      designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java
  13. 2
      designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleConstants.java
  14. 8
      designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java
  15. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/style/background/ChartNameObjectCreator.java
  16. 15
      designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java
  17. 3
      designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java
  18. 47
      designer-form/src/main/java/com/fr/design/designer/ui/PopupDialogContext.java
  19. 17
      designer-form/src/main/java/com/fr/design/designer/ui/SelectedPopupDialog.java
  20. 1
      designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java
  21. 4
      designer-realize/src/main/java/com/fr/poly/group/PolyBoundsGroup.java

2
designer-base/src/main/java/com/fr/design/data/BasicTableDataUtils.java

@ -11,7 +11,7 @@ import com.fr.stable.StringUtils;
* Created by hades on 2020/4/27
*/
public abstract class BasicTableDataUtils {
private static final String SEPARATOR = "-";
private static final String SEPARATOR = "_";
private static final int LEN = 2;

23
designer-base/src/main/java/com/fr/design/data/datapane/preview/CopyableJTable.java

@ -106,6 +106,7 @@ public class CopyableJTable extends SortableJTable {
self.updateEndPoint(-1, column);
self.refreshTable();
}
self.requestFocusInWindow();
}
private int getColumn(MouseEvent e) {
@ -249,14 +250,29 @@ public class CopyableJTable extends SortableJTable {
FineLoggerFactory.getLogger().info("copy cell value");
java.util.List<java.util.List<Object>> table = new ArrayList<>();
if ((startRow != endRow || startCol != endCol) && Math.min(startCol, endCol) > -1) {
copyAreaData(table);
} else if (pointList.size() > 0) {
copyPointsData(table);
}
Clipboard clip = Toolkit.getDefaultToolkit().getSystemClipboard();
Transferable tText = new StringSelection(ClipboardHelper.formatExcelString(table));
clip.setContents(tText, null);
}
private void copyAreaData(java.util.List<java.util.List<Object>> table) {
for (int i = Math.min(startRow, endRow); i <= Math.max(startRow, endRow); i++) {
table.add(new ArrayList<>());
for (int j = Math.min(startCol, endCol); j <= Math.max(startCol, endCol); j++) {
Object text = this.getTableValue(i, j);
if (text != null) {
table.get(table.size() - 1).add(text);
}
}
} else if (pointList.size() > 0) {
}
}
private void copyPointsData(java.util.List<java.util.List<Object>> table) {
Collections.sort(pointList, Comparator.comparing(Point::getX).thenComparing(Point::getY));
int startRow = pointList.get(0).x;
int currentRow = startRow;
@ -267,13 +283,10 @@ public class CopyableJTable extends SortableJTable {
currentRow++;
}
Object text = this.getTableValue(point.x, point.y);
if (text != null) {
table.get(table.size() - 1).add(text);
}
}
Clipboard clip = Toolkit.getDefaultToolkit().getSystemClipboard();
Transferable tText = new StringSelection(ClipboardHelper.formatExcelString(table));
clip.setContents(tText, null);
}
private Object getTableValue(int row, int col) {

5
designer-base/src/main/java/com/fr/design/mainframe/share/collect/ComponentCollector.java

@ -288,6 +288,8 @@ public class ComponentCollector implements XMLable {
private JSONArray getGroupingDetail() {
JSONArray ja = JSONFactory.createJSON(JSON.ARRAY);
try {
DefaultShareGroupManager.getInstance().refresh();
Group[] groups = DefaultShareGroupManager.getInstance().getAllGroup();
for(Group group : groups) {
JSONObject jo = JSONFactory.createJSON(JSON.OBJECT);
@ -295,6 +297,9 @@ public class ComponentCollector implements XMLable {
jo.put(CONTAIN_AMOUNT, group.getAllBindInfoList().length);
ja.add(jo);
}
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage());
}
return ja;
}

5
designer-base/src/main/java/com/fr/design/notification/ui/NotificationCenterDialog.java

@ -2,6 +2,7 @@ package com.fr.design.notification.ui;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.notification.Notification;
import com.fr.design.notification.NotificationCenter;
import java.awt.BorderLayout;
@ -119,7 +120,7 @@ public class NotificationCenterDialog extends JDialog {
if (winSize.width > screenSize.width) {
winSize.width = screenSize.width;
}
//这里设置位置:水平居中,竖直偏上
win.setLocation(screenSize.width - winSize.width - 90, 50);
win.setLocation((DesignerContext.getDesignerFrame().getWidth() - winSize.width - 100 + DesignerContext.getDesignerFrame().getX()),
DesignerContext.getDesignerFrame().getY() + winSize.height);
}
}

61
designer-base/src/main/java/com/fr/design/style/AbstractSelectBox.java

@ -1,30 +1,33 @@
package com.fr.design.style;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIButtonUI;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.style.background.BackgroundJComponent;
import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.stable.Constants;
import javax.swing.AbstractButton;
import javax.swing.JPanel;
import javax.swing.JWindow;
import javax.swing.border.AbstractBorder;
import javax.swing.event.AncestorEvent;
import javax.swing.event.AncestorListener;
import javax.swing.plaf.ButtonUI;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.AbstractButton;
import javax.swing.JPanel;
import javax.swing.border.AbstractBorder;
import javax.swing.event.AncestorEvent;
import javax.swing.event.AncestorListener;
import javax.swing.plaf.ButtonUI;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIButtonUI;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.design.style.background.BackgroundJComponent;
import com.fr.stable.Constants;
/**
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2011-10-31 下午03:28:31 类说明: 抽象出来的弹出box. 可以弹出颜色选择, 图案选择, 纹理选择.
@ -94,6 +97,34 @@ public abstract class AbstractSelectBox<T> extends AbstractPopBox implements Mou
hidePopupMenu();
}
});
displayComponent.addMouseListener(new MouseAdapter() {
@Override
public void mouseExited(MouseEvent e) {
if (!isPopupVisible()) {
//如果弹出框==null 或者 弹出框不可见 直接return
return;
}
Point popMenuP = getControlWindow().getLocation();
Point displayComponentP = displayComponent.getLocationOnScreen();
if (popMenuP.getX() < displayComponentP.getX() - 1) {
//如果 弹出框横向超出屏幕 往左调整了 和displayComponent横向错开 就不处理了
return;
}
Rectangle rectangle = displayComponent.getBounds();
boolean bottomPopAndExitTop = displayComponentP.getY() < popMenuP.getY() && e.getY() <= rectangle.y;
boolean topPopAndExitBottom = displayComponentP.getY() > popMenuP.getY() && e.getY() >= rectangle.y + rectangle.getHeight();
boolean exitLeftOrRight = rectangle.x > e.getX() || rectangle.x + rectangle.getWidth() < e.getX();
if (bottomPopAndExitTop || topPopAndExitBottom || exitLeftOrRight) {
//弹出框在displayComponent下面 且 鼠标是从displayComponent上面离开的,隐藏弹出界面。
//弹出框在displayComponent上面 且 鼠标是从displayComponent下面离开的,隐藏弹出界面。
//鼠标从displayComponent左边 或者 右边 离开,隐藏弹出界面。
hidePopupMenu();
}
}
});
}
public void setEnabled(boolean enabled) {

16
designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java

@ -64,6 +64,11 @@ public class VersionCheckUtils {
private static final String ID = "id";
private static final String VERSION = "version";
private static final String NAME = "name";
private static final String RUNNING = "running";
private static final String SYNC = "sync";
private static final String GROUP = "group";
private static final String BI = "bi";
private static final String BIPREFIX = "com.finebi";
private static final Set<String> pluginsNeedIgnore = new HashSet<>();
static {
pluginsNeedIgnore.addAll(Arrays.asList(
@ -263,13 +268,10 @@ public class VersionCheckUtils {
Map<String, String> pluginsNameMap = ReportHelper.getPluginNameMap();
for (int i = 0; i < remotePlugins.size(); i++) {
remotePlugin = remotePlugins.getJSONObject(i);
if (ComparatorUtils.equals(remotePlugin.getString("running"), "false") || (remotePlugin.containsKey("sync") && !remotePlugin.getBoolean("sync"))) {
if (isPluginNeedIgnore(remotePlugin)) {
continue;
}
String remotePluginID = remotePlugin.getString(ID);
if (pluginsNeedIgnore.contains(remotePluginID)) {
continue;
}
if (localPluginsMap.containsKey(remotePluginID)) {
if (ComparatorUtils.equals(localPluginsMap.get(remotePluginID).getVersion(), remotePlugin.getString(VERSION))) {
continue;
@ -290,6 +292,12 @@ public class VersionCheckUtils {
return differentPlugins;
}
private static boolean isPluginNeedIgnore(JSONObject remotePlugin) {
return ComparatorUtils.equals(remotePlugin.getString(RUNNING), "false") || (remotePlugin.containsKey(SYNC) && !remotePlugin.getBoolean(SYNC))
|| (remotePlugin.containsKey(GROUP) && ComparatorUtils.equals(remotePlugin.containsKey(GROUP), BI) || remotePlugin.getString(ID).startsWith(BIPREFIX)
|| pluginsNeedIgnore.contains(remotePlugin.getString(ID)));
}
public static JSONArray syncPlugins(JSONArray differentPlugins) {
Set<String> uninstallFailed = uninstallPlugins(differentPlugins);
List<PluginMarker> plugins = getSyncPlugins(differentPlugins, uninstallFailed);

2
designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties

@ -1,6 +1,6 @@
com.fr.design.mainframe.check.CheckButton=305*118
com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=630*185
com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=630*31
com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=570*31
com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=630*280
com.fr.design.report.ReportColumnsPane=800*600
com.fr.env.RemoteEnvPane.dialog=458*132

2
designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties

@ -1,6 +1,6 @@
com.fr.design.mainframe.check.CheckButton=280*118
com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=610*185
com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=610*31
com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=550*31
com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=610*280
com.fr.env.RemoteEnvPane.dialog=458*132
com.fr.design.version.check.dialog=430*95

4
designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties

@ -1,7 +1,7 @@
com.fr.design.mainframe.check.CheckButton=230*118
com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=490*185
com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=550*185
com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=490*35
com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=490*280
com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=550*280
com.fr.env.RemoteEnvPane.dialog=458*132
com.fr.design.version.check.dialog=450*95
com.fr.design.version.detail.label=700*30

2
designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties

@ -1,7 +1,7 @@
# \u9ED8\u8BA4\u4E3A\u7C7B\u7684\u5168\u9650\u5B9A\u540D\uFF08\u53EF\u81EA\u5B9A\u4E49key\uFF09= width * height
com.fr.design.mainframe.check.CheckButton=250*118
com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=385*185
com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=385*31
com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=325*31
com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=385*280
com.fr.env.RemoteEnvPane.dialog=308*132
com.fr.design.version.check.dialog=230*95

2
designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties

@ -1,6 +1,6 @@
com.fr.design.mainframe.check.CheckButton=250*118
com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=385*185
com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=385*31
com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=325*31
com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=385*280
com.fr.env.RemoteEnvPane.dialog=308*132
com.fr.design.version.check.dialog=230*95

9
designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java

@ -16,7 +16,6 @@ import com.fr.design.gui.chart.ChartEditPaneProvider;
import com.fr.design.gui.frpane.UITitlePanel;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.AssistUtils;
import javax.swing.BorderFactory;
import javax.swing.Icon;
@ -36,9 +35,6 @@ public class ChartPropertyPane extends BaseChartPropertyPane {
protected ChartEditPane chartEditPane;
//ID一样的话 不用新建chartEditPane
private String currentID;
private ChartPropertyPane() {
initComponent();
}
@ -50,14 +46,9 @@ public class ChartPropertyPane extends BaseChartPropertyPane {
@Override
public void updateChartEditPane(String plotID) {
if (!AssistUtils.equals(currentID, plotID)) {
chartEditPane = ChartTypeInterfaceManager.getInstance().getChartEditPane(plotID);
chartEditPane.setContainer(container);
currentID = plotID;
resetChartEditPane();
} else {
chartEditPane.resetLastChartCollection();
}
}
@Override

2
designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleConstants.java

@ -26,6 +26,8 @@ public class DefaultStyleConstants {
static final Color AXIS_LINE = new Color(46, 75, 102);
static final Color GRID_LINE = new Color(30, 55, 78);
static final FRFont ALERT_FONT = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 9, new Color(255, 0, 0));
static final FRFont DATA_SHEET = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 9, new Color(159, 173, 191));
static final Color DATA_SHEET_BORDER = new Color(46, 75, 102);

8
designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java

@ -9,6 +9,7 @@ import com.fr.chart.chartglyph.DataSheet;
import com.fr.config.predefined.ColorFillStyle;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.plugin.chart.PiePlot4VanChart;
import com.fr.plugin.chart.attr.axis.VanChartAlertValue;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
@ -69,6 +70,13 @@ public class DefaultStyleHelper4Van {
return axis;
}
public static void dealAxisAlert(VanChartAlertValue vanChartAlertValue) {
if (!ChartEditContext.duchampMode()) {
return;
}
vanChartAlertValue.setAlertFont(DefaultStyleConstants.ALERT_FONT);
}
static void dealVanPlotCommonAttr(Plot plot) {
if (!ChartEditContext.duchampMode()) {
return;

4
designer-chart/src/main/java/com/fr/van/chart/designer/style/background/ChartNameObjectCreator.java

@ -3,10 +3,11 @@ package com.fr.van.chart.designer.style.background;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.UnrepeatedNameHelper;
import com.fr.log.FineLoggerFactory;
import com.fr.general.NameObject;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.axis.VanChartAlertValue;
import com.fr.stable.Nameable;
import com.fr.van.chart.config.DefaultStyleHelper4Van;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
@ -37,6 +38,7 @@ public class ChartNameObjectCreator extends NameObjectCreator {
VanChartAlertValue vanChartAlertValue = constructor.newInstance();
vanChartAlertValue.setAxisNamesArray((String[]) object);
vanChartAlertValue.setAxisName(((String[]) object)[0]);
DefaultStyleHelper4Van.dealAxisAlert(vanChartAlertValue);
return new NameObject(helper.createUnrepeatedName(this.menuName()), vanChartAlertValue);
} catch (NoSuchMethodException e) {

15
designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java

@ -64,21 +64,18 @@ public class FRCardMainBorderLayoutAdapter extends FRBorderLayoutAdapter {
private boolean isBeyondMinConstraint(int minConstraint, int value) {
if (minConstraint > value) {
FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds"));
if (container.getBackupBound() != null) {
// 手动拖动导致变矮的场景
container.setSize(container.getBackupBound().getSize());
} else {
// 自适应布局平分高度导致变矮的场景
JTemplate<?, ?> jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (jt != null && jt.getUndoManager().canUndo()) {
// 自适应布局平分高度导致变矮的场景,优先做撤销
UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override
public void run() {
JTemplate<?, ?> jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (jt != null) {
jt.undo();
}
}
});
} else if (container.getBackupBound() != null) {
// 手动拖动导致变矮的场景
container.setSize(container.getBackupBound().getSize());
}
return true;
} else {

3
designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java

@ -11,6 +11,7 @@ import com.fr.design.designer.beans.AdapterBus;
import com.fr.design.designer.beans.ComponentAdapter;
import com.fr.design.designer.beans.events.DesignerEditor;
import com.fr.design.designer.beans.models.SelectionModel;
import com.fr.design.designer.ui.PopupDialogContext;
import com.fr.design.designer.ui.SelectedPopupDialog;
import com.fr.design.fun.ShareWidgetUIProcessor;
import com.fr.design.fun.WidgetPropertyUIProvider;
@ -778,6 +779,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
if (popup == null) {
popup = new SelectedPopupDialog(this, designer);
}
PopupDialogContext.checkSelectedPop(this);
JFrame frame = LogMessageBar.getInstance().getLogFrame();
if (frame!= null && frame.isActive()) {
return;
@ -876,6 +878,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
if (popup != null) {
popup.setVisible(false);
}
PopupDialogContext.checkSelectedPop(this);
}
public void processPopup(boolean canVisible) {

47
designer-form/src/main/java/com/fr/design/designer/ui/PopupDialogContext.java

@ -0,0 +1,47 @@
package com.fr.design.designer.ui;
import com.fr.design.designer.creator.XCreator;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
* 把弹窗统一管理起来 防止出现异常情况下游离的弹窗
*
* @author hades
* @version 10.0
* Created by hades on 2021/11/02
*/
public class PopupDialogContext {
private static List<SelectedPopupDialog> dialogs = new ArrayList<>();
public static void add(SelectedPopupDialog selectedPopupDialog) {
if (dialogs.contains(selectedPopupDialog)) {
return;
}
dialogs.add(selectedPopupDialog);
}
public static void remove(SelectedPopupDialog selectedPopupDialog) {
dialogs.remove(selectedPopupDialog);
}
public static void checkSelectedPop(XCreator creator) {
Iterator<SelectedPopupDialog> iterator = dialogs.iterator();
List<SelectedPopupDialog> removedDialog = new ArrayList<>();
while (iterator.hasNext()) {
SelectedPopupDialog dialog = iterator.next();
if (dialog.isVisible() && creator != dialog.getCreator()) {
iterator.remove();
removedDialog.add(dialog);
}
}
for (SelectedPopupDialog dialog : removedDialog) {
dialog.setVisible(false);
}
}
}

17
designer-form/src/main/java/com/fr/design/designer/ui/SelectedPopupDialog.java

@ -25,11 +25,14 @@ public class SelectedPopupDialog extends JDialog {
private boolean canVisible = true;
private final XCreator creator;
public SelectedPopupDialog(XCreator creator, FormDesigner designer) {
super(OperatingSystem.isMacos() ? new JFrame() : DesignerContext.getDesignerFrame());
this.setUndecorated(true);
this.setModal(false);
this.setFocusableWindowState(false);
this.creator = creator;
controlPanel = new PopupControlPanel(creator, designer);
this.getContentPane().add(controlPanel);
this.setSize(controlPanel.getDefaultDimension());
@ -44,6 +47,16 @@ public class SelectedPopupDialog extends JDialog {
return controlPanel.hasVisibleButtons();
}
@Override
public void setVisible(boolean visible) {
super.setVisible(visible);
if (visible) {
PopupDialogContext.add(this);
} else {
PopupDialogContext.remove(this);
}
}
public void setRelativeBounds(Rectangle rectangle) {
this.controlPanel.setRelativeBounds(rectangle);
}
@ -55,4 +68,8 @@ public class SelectedPopupDialog extends JDialog {
public void setCanVisible(boolean canVisible) {
this.canVisible = canVisible;
}
public XCreator getCreator() {
return this.creator;
}
}

1
designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java

@ -115,6 +115,7 @@ public class DesignerSocketIO {
private static IO.Options createOptions() {
IO.Options options = new IO.Options();
options.path = WebSocketConfig.getInstance().getSocketContext();
try {
if (ComparatorUtils.equals(currentProtocol, HTTPS)) {
options.sslContext = getSSLContext();

4
designer-realize/src/main/java/com/fr/poly/group/PolyBoundsGroup.java

@ -52,7 +52,7 @@ public class PolyBoundsGroup implements GroupModel {
@Override
public Object getValue(int row, int column) {
UnitRectangle ur = block.getBounds();
Rectangle r = ur.toRectangle(resolution);
Rectangle r = ur.toRoundRectangle(resolution);
if (column == 0) {
switch (row) {
case 0:
@ -83,7 +83,7 @@ public class PolyBoundsGroup implements GroupModel {
if (column == 1) {
int v = value == null ? 0 : ((Number) value).intValue();
UnitRectangle ur = block.getBounds();
Rectangle r = ur.toRectangle(resolution);
Rectangle r = ur.toRoundRectangle(resolution);
switch (row) {
case 0:
r.x = v;

Loading…
Cancel
Save