Browse Source

Merge branch 'release/11.0' of ssh://code.fineres.com:7999/~zheng/C-design into release/11.0

bugfix/11.0
shine 3 years ago
parent
commit
6150090535
  1. 2
      build.gradle
  2. 8
      designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
  3. 16
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java
  4. 51
      designer-base/src/main/java/com/fr/design/data/datapane/preview/CopyableJTable.java
  5. 2
      designer-base/src/main/java/com/fr/design/dialog/UIDetailErrorLinkDialog.java
  6. 2
      designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java
  7. 2
      designer-base/src/main/java/com/fr/design/login/DesignerLoginHelper.java
  8. 14
      designer-base/src/main/java/com/fr/design/login/config/DesignerLoginConfigManager.java
  9. 16
      designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideHelper.java
  10. 4
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  11. 5
      designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java
  12. 17
      designer-base/src/main/java/com/fr/design/mainframe/share/collect/ComponentCollector.java
  13. 3
      designer-base/src/main/java/com/fr/design/mainframe/toast/DesignerToastMsgUtil.java
  14. 3
      designer-base/src/main/java/com/fr/design/mainframe/toast/ToastMsgDialog.java
  15. 4
      designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AbstractTemplateStylePane.java
  16. 5
      designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleTemplateStyleEditor.java
  17. 7
      designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/MobileTemplateStylePane.java
  18. 5
      designer-base/src/main/java/com/fr/design/notification/ui/NotificationCenterDialog.java
  19. 61
      designer-base/src/main/java/com/fr/design/style/AbstractSelectBox.java
  20. 16
      designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java
  21. 22
      designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java
  22. 2
      designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties
  23. 2
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties
  24. 4
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties
  25. 2
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties
  26. 2
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties
  27. 15
      designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java
  28. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java
  29. 91
      designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleConstants.java
  30. 186
      designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java
  31. 3
      designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartCustomPlotSelectPane.java
  32. 7
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPane.java
  33. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartImageMarkerPane.java
  34. 7
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisPane.java
  35. 7
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java
  36. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/style/background/ChartNameObjectCreator.java
  37. 3
      designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java
  38. 47
      designer-form/src/main/java/com/fr/design/designer/ui/PopupDialogContext.java
  39. 17
      designer-form/src/main/java/com/fr/design/designer/ui/SelectedPopupDialog.java
  40. 3
      designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java
  41. 2
      designer-realize/src/main/java/com/fr/design/actions/server/ServerConfigManagerAction.java
  42. 3
      designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java
  43. 1
      designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java
  44. 9
      designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java

2
build.gradle

@ -68,7 +68,7 @@ allprojects {
implementation 'org.swingexplorer:swexpl:2.0.1'
implementation 'org.swingexplorer:swag:1.0'
implementation 'net.java.dev.jna:jna:5.4.0'
implementation 'org.apache.tomcat:tomcat-catalina:8.5.69'
implementation 'org.apache.tomcat:tomcat-catalina:8.5.72'
implementation 'io.socket:socket.io-client:0.7.0'
implementation 'com.fr.third:fine-third:' + frVersion
implementation 'com.fr.core:fine-core:' + frDevVersion

8
designer-base/src/main/java/com/fr/design/DesignerEnvManager.java

@ -885,6 +885,14 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
designerLoginConfigManager.setPluginRemindOnFirstLaunch(pluginRemindOnFirstLaunch);
}
public boolean isUseOldVersionLogin() {
return designerLoginConfigManager.isUseOldVersionLogin();
}
public void setUseOldVersionLogin(boolean useOldVersionLogin) {
designerLoginConfigManager.setUseOldVersionLogin(useOldVersionLogin);
}
/**
* 内置服务器是否使用时启动
*

16
designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java

@ -11,6 +11,7 @@ import com.fr.design.fun.ConnectionProvider;
import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.ilist.ListModelElement;
import com.fr.design.i18n.Toolkit;
import com.fr.event.EventDispatcher;
import com.fr.file.ConnectionConfig;
@ -30,6 +31,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
/**
* Connection List Pane.
@ -190,4 +192,18 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
connectionListDialog.addDialogActionListener(new ConnectionListDialogActionAdapter(connectionManagerPane, connectionListDialog, connectionConfig));
connectionListDialog.setVisible(true);
}
@Override
public void onCopyItem() {
super.onCopyItem();
ListModelElement selectedValue = getSelectedValue();
// identity 需要重置
if (selectedValue != null && selectedValue.wrapper != null) {
Object temp = ((NameObject) selectedValue.wrapper).getObject();
if (temp instanceof JDBCDatabaseConnection) {
JDBCDatabaseConnection object = (JDBCDatabaseConnection) temp;
object.setIdentity(UUID.randomUUID().toString());
}
}
}
}

51
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,26 +250,9 @@ 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) {
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);
table.get(table.size() - 1).add(text);
}
}
copyAreaData(table);
} else if (pointList.size() > 0) {
Collections.sort(pointList, Comparator.comparing(Point::getX).thenComparing(Point::getY));
int startRow = pointList.get(0).x;
int currentRow = startRow;
table.add(new ArrayList<>());
for (Point point : pointList) {
while (currentRow < point.x) {
table.add(new ArrayList<>());
currentRow++;
}
Object text = this.getTableValue(point.x, point.y);
table.get(table.size() - 1).add(text);
}
copyPointsData(table);
}
Clipboard clip = Toolkit.getDefaultToolkit().getSystemClipboard();
@ -276,6 +260,35 @@ public class CopyableJTable extends SortableJTable {
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);
}
}
}
}
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;
table.add(new ArrayList<>());
for (Point point : pointList) {
while (currentRow < point.x) {
table.add(new ArrayList<>());
currentRow++;
}
Object text = this.getTableValue(point.x, point.y);
if (text != null) {
table.get(table.size() - 1).add(text);
}
}
}
private Object getTableValue(int row, int col) {
Object value = null;
if (col > -1) {

2
designer-base/src/main/java/com/fr/design/dialog/UIDetailErrorLinkDialog.java

@ -92,7 +92,7 @@ public class UIDetailErrorLinkDialog extends UIDialog {
contentPane.add(link, BorderLayout.SOUTH);
// 确定 + 取消
JPanel actionPane = new JPanel(new FlowLayout(FlowLayout.RIGHT, GAP_10, GAP_10));
JPanel actionPane = new JPanel(new FlowLayout(FlowLayout.RIGHT, GAP_10, GAP_5));
actionPane.add(createButton(Toolkit.i18nText("Fine-Design_Report_OK")));
actionPane.add(createButton(Toolkit.i18nText("Fine-Design_Basic_Cancel")));
this.getContentPane().add(topPane, BorderLayout.NORTH);

2
designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java

@ -163,6 +163,8 @@ public class JavaFxNativeFileChooser implements FileChooserProvider {
try {
latch.await();
} catch (InterruptedException ignore) {
} finally {
setShowDialogState(false);
}
return selectedFiles.length > 0 ? JFileChooser.APPROVE_OPTION : JFileChooser.CANCEL_OPTION;
}

2
designer-base/src/main/java/com/fr/design/login/DesignerLoginHelper.java

@ -47,7 +47,7 @@ public class DesignerLoginHelper {
}
public static void showLoginDialog(DesignerLoginSource source, Map<String, String> params, Window window) {
if (!SupportOSImpl.DESIGNER_LOGIN.support()) {
if (!SupportOSImpl.DESIGNER_LOGIN.support() || DesignerEnvManager.getEnvManager().isUseOldVersionLogin()) {
WebViewDlgHelper.createLoginDialog(window);
return;
}

14
designer-base/src/main/java/com/fr/design/login/config/DesignerLoginConfigManager.java

@ -70,6 +70,10 @@ public class DesignerLoginConfigManager implements XMLReadable, XMLWriter {
* 插件管理第一次启动时的提醒
*/
private boolean pluginRemindOnFirstLaunch = true;
/**
* 使用旧版登录
*/
private boolean useOldVersionLogin = false;
private DesignerLoginConfigManager() {
@ -98,6 +102,7 @@ public class DesignerLoginConfigManager implements XMLReadable, XMLWriter {
this.setLastLoginAccount(reader.getAttrAsString("lastLoginAccount", StringUtils.EMPTY));
this.setLoginRemindBeforeJumpBBS(reader.getAttrAsBoolean("loginRemindBeforeJumpBBS", true));
this.setPluginRemindOnFirstLaunch(reader.getAttrAsBoolean("pluginRemindOnFirstLaunch", true));
this.setUseOldVersionLogin(reader.getAttrAsBoolean("useOldVersionLogin", false));
}
}
@ -117,6 +122,7 @@ public class DesignerLoginConfigManager implements XMLReadable, XMLWriter {
writer.attr("lastLoginAccount", lastLoginAccount);
writer.attr("loginRemindBeforeJumpBBS", loginRemindBeforeJumpBBS);
writer.attr("pluginRemindOnFirstLaunch", pluginRemindOnFirstLaunch);
writer.attr("useOldVersionLogin", useOldVersionLogin);
writer.end();
}
@ -223,4 +229,12 @@ public class DesignerLoginConfigManager implements XMLReadable, XMLWriter {
public void setPluginRemindOnFirstLaunch(boolean pluginRemindOnFirstLaunch) {
this.pluginRemindOnFirstLaunch = pluginRemindOnFirstLaunch;
}
public boolean isUseOldVersionLogin() {
return useOldVersionLogin;
}
public void setUseOldVersionLogin(boolean useOldVersionLogin) {
this.useOldVersionLogin = useOldVersionLogin;
}
}

16
designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideHelper.java

@ -8,9 +8,7 @@ import com.fr.design.login.utils.DesignerLoginUtils;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.os.impl.SupportOSImpl;
import com.fr.design.update.push.DesignerPushUpdateManager;
import com.fr.general.CloudCenter;
import com.fr.general.CloudCenterConfig;
import com.fr.general.http.HttpToolbox;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import javax.swing.WindowConstants;
@ -39,7 +37,11 @@ public class DesignerGuideHelper {
public static void prepareShowGuideDialog() {
// 如果存在更新升级的弹窗,则不显示引导页面
if (!DesignerLoginUtils.isOnline() || !SupportOSImpl.DESIGNER_LOGIN.support() || !FRContext.isChineseEnv() || DesignerPushUpdateManager.getInstance().isShouldPopUp()) {
if (!DesignerLoginUtils.isOnline()
|| !SupportOSImpl.DESIGNER_LOGIN.support()
|| !FRContext.isChineseEnv()
|| DesignerPushUpdateManager.getInstance().isShouldPopUp()
|| DesignerEnvManager.getEnvManager().isUseOldVersionLogin()) {
return;
}
if (isActivatedForOneWeek()) {
@ -52,7 +54,11 @@ public class DesignerGuideHelper {
DesignerContext.getDesignerFrame().addDesignerOpenedListener(new DesignerOpenedListener() {
@Override
public void designerOpened() {
showGuideDialog();
try {
showGuideDialog();
} catch (Throwable t) {
FineLoggerFactory.getLogger().warn(t.getMessage(), t);
}
}
});
}

4
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -441,7 +441,9 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
*/
@Deprecated
public void refreshResource() {
refreshResource(this.editingFILE);
if (JTemplateFactory.isAvailable()) {
refreshResource(this.editingFILE);
}
}
public void refreshResource(FILE file) {

5
designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java

@ -93,4 +93,7 @@ public final class JTemplateFactory {
ALL_APP.remove(app);
}
}
}
public static boolean isAvailable() {
return !ALL_APP.isEmpty();
}}

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

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

3
designer-base/src/main/java/com/fr/design/mainframe/toast/DesignerToastMsgUtil.java

@ -31,6 +31,7 @@ public class DesignerToastMsgUtil {
}
public static void toastPrompt(JPanel contendPane) {
toastPane(PROMPT_ICON, contendPane, DesignerContext.getDesignerFrame());
}
@ -117,4 +118,4 @@ public class DesignerToastMsgUtil {
.toString();
}
}
}

3
designer-base/src/main/java/com/fr/design/mainframe/toast/ToastMsgDialog.java

@ -159,4 +159,5 @@ public class ToastMsgDialog extends UIDialog {
super.dispose();
}
}
}

4
designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AbstractTemplateStylePane.java

@ -7,4 +7,8 @@ public abstract class AbstractTemplateStylePane<T> extends BasicPane {
public abstract void populate(T ob);
public abstract T update();
public AbstractTemplateStylePane<T> generateCleanPane() {
return this;
}
}

5
designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleTemplateStyleEditor.java

@ -32,6 +32,11 @@ public class AccessibleTemplateStyleEditor extends UneditableAccessibleEditor {
setValue(stylePane.update());
fireStateChanged();
}
@Override
public void doCancel() {
stylePane = stylePane.generateCleanPane();
}
});
stylePane.populate(getValue());
dlg.setVisible(true);

7
designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/MobileTemplateStylePane.java

@ -44,12 +44,14 @@ public class MobileTemplateStylePane extends AbstractTemplateStylePane<MobileTem
private JPanel right;
private CardLayout card;
private Set<Class<? extends MobileTemplateStyle>> extraStyle = new HashSet<>();
private WCardTagLayout tagLayout;
public MobileTemplateStylePane(WCardTagLayout tagLayout){
init(tagLayout);
}
public void init(WCardTagLayout tagLayout){
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.tagLayout = tagLayout;
listModel = new DefaultListModel();
card = new CardLayout();
right = FRGUIPaneFactory.createCardLayout_S_Pane();
@ -147,4 +149,9 @@ public class MobileTemplateStylePane extends AbstractTemplateStylePane<MobileTem
list.addAll(sets);
return Collections.unmodifiableList(list);
}
@Override
public AbstractTemplateStylePane<MobileTemplateStyle> generateCleanPane() {
return new MobileTemplateStylePane(this.tagLayout);
}
}

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. 可以弹出颜色选择, 图案选择, 纹理选择.
@ -93,6 +96,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);

22
designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java

@ -1,6 +1,10 @@
package com.fr.design.widget.component;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.ErrorMsgTextFieldAdapter;
import com.fr.design.beans.UITextFieldAdapter;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.fun.TextFieldAdapterProvider;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
@ -9,6 +13,7 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.NumberEditor;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.AssistUtils;
import com.fr.stable.StringUtils;
@ -35,7 +40,7 @@ public class NumberEditorValidatePane extends JPanel {
private UISpinner minValueSpinner;
private UISpinner decimalLength;
private JPanel limitNumberPane;
private UITextField errorMsgTextField;
private ErrorMsgTextFieldAdapter errorMsgTextField;
private JPanel errorMsgTextFieldPane;
private ActionListener allowDecimalsListener;
@ -100,9 +105,20 @@ public class NumberEditorValidatePane extends JPanel {
}
private void initErrorMsgPane() {
errorMsgTextField = new UITextField();
TextFieldAdapterProvider provider = ExtraDesignClassManager.getInstance().getSingle(TextFieldAdapterProvider.XML_TAG);
if (provider != null) {
try {
errorMsgTextField = provider.createTextFieldAdapter();
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
errorMsgTextField = new UITextFieldAdapter();
}
} else {
errorMsgTextField = new UITextFieldAdapter();
}
errorMsgTextFieldPane = TableLayoutHelper.createGapTableLayoutPane(
new Component[][]{new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Error_Tip")), errorMsgTextField}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
new Component[][]{new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Error_Tip")), errorMsgTextField.getErrorMsgTextField()}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
}

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

15
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();
}
chartEditPane = ChartTypeInterfaceManager.getInstance().getChartEditPane(plotID);
chartEditPane.setContainer(container);
resetChartEditPane();
}
@Override

7
designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java

@ -22,9 +22,11 @@ import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.ChartTypePane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.design.mainframe.chart.info.ChartInfoCollector;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.form.main.Form;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.custom.VanChartCustomPlot;
import com.fr.plugin.chart.vanchart.VanChart;
import javax.swing.JPanel;
@ -334,7 +336,10 @@ public class ChartEditPane extends BasicPane implements AttributeChange, Prepare
String chartID = chart.getID();
boolean currentPane = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(chartID);
return (currentPane != isDefaultPane) || (!currentPane && lastIndex != currentIndex);
boolean duchampCustomChart = ChartEditContext.duchampMode()
&& VanChartCustomPlot.VAN_CHART_CUSTOM_PLOT_ID.equals(chartID);
return (currentPane != isDefaultPane) || (!currentPane && lastIndex != currentIndex) || duchampCustomChart;
}
return false;
}

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

@ -0,0 +1,91 @@
package com.fr.van.chart.config;
import com.fr.base.ChartPreStyleConfig;
import com.fr.chart.base.ChartBaseUtils;
import com.fr.chart.base.ChartConstants;
import com.fr.general.Background;
import com.fr.general.FRFont;
import com.fr.general.GeneralUtils;
import com.fr.stable.CodeUtils;
import com.fr.stable.Constants;
import java.awt.Color;
import java.awt.Font;
/**
* @author shine
* @version 10.0
* Created by shine on 2021/6/25
*/
public class DefaultStyleConstants {
static final FRFont TITLE = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.BOLD, 14, new Color(241, 246, 255));
static final FRFont LEGEND = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 9, new Color(159, 173, 191));
static final FRFont AXIS_LABEL = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 9, new Color(159, 173, 191));
static final FRFont AXIS_TITLE = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 9, new Color(200, 211, 228));
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);
static final Color BORDER = Color.BLACK;
static final int BORDER_WIDTH = Constants.LINE_NONE;
static final int SPECIAL_BORDER_WIDTH = Constants.LINE_THIN;
static final FRFont PIE_CATEGORY_LABEL = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 10, new Color(232, 232, 232));
static final Color GAUGE_PANE_BACK_COLOR = null;
static final Color GAUGE_HINGE = null;
static final Color GAUGE_PANE_BACK_COLOR_4_RING = new Color(72, 73, 79);
static final Color GAUGE_SLOT_BACKGROUND_COLOR = new Color(72, 73, 79);
private static final String FONT_NAME = ChartBaseUtils.getLocalDefaultFont("verdana");
static final FRFont THERMOMETER_LABEL_FONT = FRFont.getInstance(FONT_NAME, Font.BOLD, 9, new Color(232, 232, 232));//试管仪表盘标签的默认样式
static final FRFont THERMOMETER_AXIS_LABEL = FRFont.getInstance(FONT_NAME, Font.PLAIN, 8, new Color(159, 173, 191));
static final FRFont RING_VALUE_LABEL_FONT = FRFont.getInstance(FONT_NAME, Font.PLAIN, ChartConstants.AUTO_FONT_SIZE, new Color(232, 232, 232));//百分比圆环仪表盘值标签的默认样式
static final FRFont POINTER_VALUE_LABEL_FONT = FRFont.getInstance(FONT_NAME, Font.PLAIN, ChartConstants.AUTO_FONT_SIZE, new Color(232, 232, 232));//多指针仪表盘值标签的默认样式
static final FRFont POINTER_CATE_LABEL_FONT = FRFont.getInstance(FONT_NAME, Font.PLAIN, 10, new Color(232, 232, 232));//多指针仪表盘分类标签的默认样式
static final Color MAP_NULL_VALUE_COLOR = new Color(168, 168, 168);
static final Color MAP_BORDER = Color.BLACK;
static final Color MAP_LEGEND_BACK = Color.BLACK;
static final Color MAP_TITLE_BACK = Color.BLACK;
static final Color DRILL_MAP_DRILL_TOOLS_BACK = Color.BLACK;
static final float DRILL_MAP_DRILL_TOOLS_BACK_OPACITY = 0.8f;
//todo vancharts
private static final Color GANTT_OUT_LINE = GRID_LINE;
private static final FRFont GANTT_LABEL = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 8, new Color(217, 217, 217));
private static final Color GANTT_BORDER_LINE = new Color(30, 36, 58);
private static final Color GAUGE_TICK = new Color(39, 49, 71);
static final Background BACK = null;
static String COLORS = null;
static {
ChartPreStyleConfig config = ChartPreStyleConfig.getInstance();
try {
DefaultStyleConstants.COLORS = CodeUtils.cjkDecode("\u7ecf\u5178\u9ad8\u4eae");
// 没有经典高亮, 用新特性
if (config.getPreStyle(DefaultStyleConstants.COLORS) == null) {
DefaultStyleConstants.COLORS = CodeUtils.cjkDecode("\u65b0\u7279\u6027");
}
// 没有新特性, 用第一个配色
if (config.getPreStyle(DefaultStyleConstants.COLORS) == null) {
if (config.names().hasNext()) {
String name = GeneralUtils.objectToString(config.names().next());
if (config.getPreStyle(name) != null) {
DefaultStyleConstants.COLORS = name;
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}

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

@ -0,0 +1,186 @@
package com.fr.van.chart.config;
import com.fr.chart.base.AttrBorder;
import com.fr.chart.base.AttrFillStyle;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
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;
import com.fr.plugin.chart.base.AttrLabel;
import com.fr.plugin.chart.base.AttrLabelDetail;
import com.fr.plugin.chart.custom.type.CustomPlotType;
import com.fr.plugin.chart.gauge.VanChartGaugePlot;
import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.type.GaugeStyle;
/**
* @author shine
* @version 10.0
* Created by shine on 2021/10/22
* vanchart的抽出来因为主体代码 新增y轴 组合图新增图表都要用
*/
public class DefaultStyleHelper4Van {
public static void dealVanPlot4Custom(VanChartPlot plot, CustomPlotType customPlotType) {
if (!ChartEditContext.duchampMode()) {
return;
}
dealVanPlotCommonAttr(plot);
switch (customPlotType) {
case PIE:
case DIFFERENT_PIE:
case SAME_PIE:
dealPie(plot);
break;
case SLOT:
case POINTER_360:
case POINTER_180:
case CUVETTE:
case RING:
dealGauge(plot);
break;
case COLUMN:
case LINE:
case AREA:
case BUBBLE:
case RADAR:
case STACK_RADAR:
case SCATTER:
default:
break;
}
}
public static VanChartAxis dealAxisDefault(VanChartAxis axis) {
if (!ChartEditContext.duchampMode()) {
return axis;
}
axis.getTitle().getTextAttr().setFRFont(DefaultStyleConstants.AXIS_TITLE);
axis.getTextAttr().setFRFont(DefaultStyleConstants.AXIS_LABEL);
axis.setAxisColor(DefaultStyleConstants.AXIS_LINE);
axis.setMainGridColor(DefaultStyleConstants.GRID_LINE);
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;
}
if (plot instanceof VanChartPlot) {
VanChartPlot vanChartPlot = (VanChartPlot) plot;
ColorFillStyle colorFillStyle = new ColorFillStyle();
colorFillStyle.setColorStyle(ChartConstants.COLOR_ACC);
colorFillStyle.setFillStyleName(DefaultStyleConstants.COLORS);
AttrFillStyle plotFillStyle = vanChartPlot.getPlotFillStyle();
if (plotFillStyle == null) {
plotFillStyle = new AttrFillStyle();
vanChartPlot.setPlotFillStyle(plotFillStyle);
}
plotFillStyle.setColorFillStyle(colorFillStyle);
if (vanChartPlot.getLegend() != null) {
vanChartPlot.getLegend().setFRFont(DefaultStyleConstants.LEGEND);
}
if (vanChartPlot instanceof VanChartRectanglePlot) {
VanChartRectanglePlot vanChartRectanglePlot = (VanChartRectanglePlot) vanChartPlot;
for (VanChartAxis axis : vanChartRectanglePlot.getXAxisList()) {
dealAxisDefault(axis);
}
for (VanChartAxis axis : vanChartRectanglePlot.getYAxisList()) {
dealAxisDefault(axis);
}
}
dealBorder(vanChartPlot);
DataSheet dataSheet = vanChartPlot.getDataSheet();
dataSheet.getTextAttr().setFRFont(DefaultStyleConstants.DATA_SHEET);
dataSheet.setBorderColor(DefaultStyleConstants.DATA_SHEET_BORDER);
}
}
private static void dealBorder(VanChartPlot vanChartPlot) {
ConditionAttr defaultAttr = vanChartPlot.getConditionCollection().getDefaultAttr();
AttrBorder attrBorder = defaultAttr.getExisted(AttrBorder.class);
if (attrBorder != null) {
attrBorder.setBorderColor(DefaultStyleConstants.BORDER);
attrBorder.setBorderStyle(defaultBorderWidth(vanChartPlot));
}
}
private static int defaultBorderWidth(VanChartPlot vanChartPlot) {
//pie multipie treemap map drillmap heatmap
if (vanChartPlot instanceof PiePlot4VanChart
|| vanChartPlot instanceof VanChartMapPlot) {
return DefaultStyleConstants.SPECIAL_BORDER_WIDTH;
}
return DefaultStyleConstants.BORDER_WIDTH;
}
static void dealPie(Plot plot) {
if (plot instanceof PiePlot4VanChart) {
ConditionAttr defaultAttr = plot.getConditionCollection().getDefaultAttr();
AttrLabel attrLabel = defaultAttr.getExisted(AttrLabel.class);
if (attrLabel == null) {
attrLabel = ((PiePlot4VanChart) plot).getDefaultAttrLabel();
defaultAttr.addDataSeriesCondition(attrLabel);
}
attrLabel.getSecondLabelDetail().getTextAttr().setFRFont(DefaultStyleConstants.PIE_CATEGORY_LABEL);
}
}
static void dealGauge(Plot param) {
if (!(param instanceof VanChartGaugePlot)) {
return;
}
VanChartGaugePlot plot = (VanChartGaugePlot) param;
plot.getGaugeDetailStyle().setPaneBackgroundColor(plot.getGaugeStyle() == GaugeStyle.RING ? DefaultStyleConstants.GAUGE_PANE_BACK_COLOR_4_RING : DefaultStyleConstants.GAUGE_PANE_BACK_COLOR);
plot.getGaugeDetailStyle().setSlotBackgroundColor(DefaultStyleConstants.GAUGE_SLOT_BACKGROUND_COLOR);
plot.getGaugeDetailStyle().setHingeColor(DefaultStyleConstants.GAUGE_HINGE);
ConditionAttr defaultAttr = plot.getConditionCollection().getDefaultAttr();
AttrLabel attrLabel = defaultAttr.getExisted(AttrLabel.class);
if (attrLabel != null) {
AttrLabelDetail detail = attrLabel.getAttrLabelDetail();
AttrLabelDetail valueDetail = attrLabel.getGaugeValueLabelDetail();
switch (plot.getGaugeStyle()) {
case POINTER:
case POINTER_SEMI:
detail.getContent().getCategoryFormat().setEnable(false);
detail.getTextAttr().setFRFont(DefaultStyleConstants.POINTER_CATE_LABEL_FONT);
valueDetail.getTextAttr().setFRFont(DefaultStyleConstants.POINTER_VALUE_LABEL_FONT);
break;
case RING:
case SLOT:
valueDetail.getTextAttr().setFRFont(DefaultStyleConstants.RING_VALUE_LABEL_FONT);
break;
case THERMOMETER:
detail.getTextAttr().setFRFont(DefaultStyleConstants.THERMOMETER_LABEL_FONT);
valueDetail.getTextAttr().setFRFont(DefaultStyleConstants.THERMOMETER_LABEL_FONT);
plot.getGaugeAxis().getTextAttr().setFRFont(DefaultStyleConstants.THERMOMETER_AXIS_LABEL);
break;
}
}
}
}

3
designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartCustomPlotSelectPane.java

@ -6,13 +6,13 @@ import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
import com.fr.plugin.chart.custom.CustomPlotFactory;
import com.fr.plugin.chart.custom.VanChartCustomPlot;
import com.fr.plugin.chart.custom.type.CustomPlotType;
import com.fr.plugin.chart.custom.type.CustomStyle;
import com.fr.van.chart.config.DefaultStyleHelper4Van;
import com.fr.van.chart.custom.CustomPlotDesignerPaneFactory;
import javax.swing.JOptionPane;
@ -260,6 +260,7 @@ public class VanChartCustomPlotSelectPane extends BasicBeanPane<Chart> {
CustomPlotType customPlotType = selectedPlotTypeList.get(i);
if (!CustomPlotFactory.customPlotContains(newCustomPlotList, customPlotType)){
VanChartPlot vanChartPlot = CustomPlotFactory.getCustomPlot(customPlotType);
DefaultStyleHelper4Van.dealVanPlot4Custom(vanChartPlot, customPlotType);
vanChartPlot.setCustomType(CustomStyle.CUSTOM.toString());
//设置公共属性
setCommonAttr(vanChartPlot, customPlot);

7
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPane.java

@ -5,6 +5,7 @@ import com.fr.design.constants.KeyWords;
import com.fr.design.gui.autocomplete.AutoCompletion;
import com.fr.design.gui.autocomplete.BasicCompletion;
import com.fr.design.gui.autocomplete.DefaultCompletionProvider;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icontainer.UIScrollPane;
@ -45,7 +46,7 @@ public class VanChartHtmlLabelPane extends JPanel {
private UICheckBox isCustomHeight;
private UITextField customHeight;
private VanChartStylePane parent;
private AbstractAttrNoScrollPane parent;
private JPanel widthAndHeightPane;
@ -53,7 +54,7 @@ public class VanChartHtmlLabelPane extends JPanel {
contentTextArea.setText(text);
}
public void setParent(VanChartStylePane parent) {
public void setParent(AbstractAttrNoScrollPane parent) {
this.parent = parent;
}
@ -126,7 +127,7 @@ public class VanChartHtmlLabelPane extends JPanel {
};
}
private void fireJSChange() {
protected void fireJSChange() {
if (parent != null) {
parent.attributeChanged();
}

4
designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartImageMarkerPane.java

@ -31,8 +31,8 @@ public class VanChartImageMarkerPane extends BasicBeanPane<VanChartAttrMarker> {
public VanChartImageMarkerPane() {
imageBackgroundPane = new ImageBackgroundQuickPane(false);
imageBackgroundPane.setPreferredSize(getImageBackgroundPreferredSize(imageBackgroundPane.getPreferredSize()));
width = new UISpinnerWithPx(0, 100, 0.5, 30);
height = new UISpinnerWithPx(0, 100, 0.5, 30);
width = new UISpinnerWithPx(0, Integer.MAX_VALUE, 0.5, 30);
height = new UISpinnerWithPx(0, Integer.MAX_VALUE, 0.5, 30);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;

7
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisPane.java

@ -14,16 +14,17 @@ import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
import com.fr.plugin.chart.base.AttrSeriesStackAndAxis;
import com.fr.plugin.chart.base.VanChartConstants;
import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.van.chart.config.DefaultStyleHelper4Van;
import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.designer.style.axis.component.VanChartAxisButtonPane;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.awt.BorderLayout;
import java.awt.CardLayout;
/**
* 样式-坐标轴界面
@ -104,6 +105,7 @@ public class VanChartAxisPane extends BasicBeanPane<VanChart> {
List<VanChartAxis> xAxisList = editingPlot.getXAxisList();
VanChartAxis axis = editingPlot.createXAxis(name, VanChartConstants.AXIS_BOTTOM);
xAxisList.add(axis);
DefaultStyleHelper4Van.dealAxisDefault(axis);
VanChartXYAxisPaneInterface axisPane = initXAxisPane(axis);
axisPane.populate(axis);
@ -119,6 +121,7 @@ public class VanChartAxisPane extends BasicBeanPane<VanChart> {
List<VanChartAxis> yAxisList = editingPlot.getYAxisList();
VanChartAxis axis = editingPlot.createYAxis(name, VanChartConstants.AXIS_LEFT);
yAxisList.add(axis);
DefaultStyleHelper4Van.dealAxisDefault(axis);
VanChartXYAxisPaneInterface axisPane = initYAxisPane(axis);
axisPane.populate(axis);

7
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java

@ -11,6 +11,7 @@ import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.axis.VanChartTimeAxis;
import com.fr.plugin.chart.attr.axis.VanChartValueAxis;
import com.fr.plugin.chart.type.AxisType;
import com.fr.van.chart.config.DefaultStyleHelper4Van;
import com.fr.van.chart.designer.AbstractVanChartScrollPane;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.style.VanChartStylePane;
@ -84,9 +85,9 @@ public class VanChartAxisScrollPaneWithTypeSelect extends AbstractVanChartScroll
public void populate(VanChartAxis axis){
AxisType axisType = axis.getAxisType();
textAxisPane.populateBean(new VanChartAxis(axis.getAxisName(), axis.getPosition()));
timeAxisPane.populateBean(new VanChartTimeAxis(axis.getAxisName(), axis.getPosition()));
valueAxisPane.populateBean(new VanChartValueAxis(axis.getAxisName(), axis.getPosition()));
textAxisPane.populateBean(DefaultStyleHelper4Van.dealAxisDefault(new VanChartAxis(axis.getAxisName(), axis.getPosition())));
timeAxisPane.populateBean(DefaultStyleHelper4Van.dealAxisDefault(new VanChartTimeAxis(axis.getAxisName(), axis.getPosition())));
valueAxisPane.populateBean(DefaultStyleHelper4Van.dealAxisDefault(new VanChartValueAxis(axis.getAxisName(), axis.getPosition())));
if(ComparatorUtils.equals(axisType, AxisType.AXIS_CATEGORY)){
textAxisPane.populateBean(axis);
} else if(ComparatorUtils.equals(axisType, AxisType.AXIS_TIME)){

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) {

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

@ -13,6 +13,7 @@ import com.fr.design.designer.creator.operate.XCreatorBaseOperate;
import com.fr.design.designer.creator.operate.DefaultXCreatorBaseOperate;
import com.fr.design.designer.treeview.DefaultXCreatorTreeCellRender;
import com.fr.design.designer.treeview.XCreatorTreeCellRender;
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;
@ -796,6 +797,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;
@ -894,6 +896,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;
}
}

3
designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java

@ -97,7 +97,8 @@ public class FormWidgetDetailPane extends FormDockView{
}
headGroup = new UIHeadGroup(paneNames) {
protected void tabChanged(int newSelectedIndex) {
if (newSelectedIndex == 1) {
//初始化还未展示的时候不需要收集其 marketClick
if (this.isShowing() && newSelectedIndex == 1) {
ComponentCollector.getInstance().collectMarkerClick();
}
cardLayout.show(centerPane, paneList.get(newSelectedIndex).getTitle());

2
designer-realize/src/main/java/com/fr/design/actions/server/ServerConfigManagerAction.java

@ -27,7 +27,7 @@ import java.awt.event.WindowEvent;
* Server Config Manager
*/
public class ServerConfigManagerAction extends UpdateAction {
public static final Dimension DEFAULT = new Dimension(700, 630);
public static final Dimension DEFAULT = DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.actions.server.dialog");
public ServerConfigManagerAction() {
this.setMenuKeySet(SERVER_CONFIG_MANAGER);

3
designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java

@ -105,8 +105,7 @@ class CptApp extends AbstractWorkBookApp {
final JDialog jd = new JDialog();
// 模态一下,因为可能会多个样式丢失
// jd.setModal(true);
jd.setAlwaysOnTop(true);
jd.setModal(true);
jd.setSize(450, 150);
jd.setResizable(false);
jd.setIconImage(BaseUtils.readImage("/com/fr/base/images/oem/logo.png"));

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();

9
designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java

@ -431,7 +431,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
if (oriCellSelection != null && isSameStartPoint(cellselection, oriCellSelection)) {
dealDragSelection(add, cellselection, newValue);
} else if (cellselection.getSelectedType() == CellSelection.CHOOSE_ROW || cellselection.getSelectedType() == CellSelection.CHOOSE_COLUMN) {
dealSelectColRow(add, cellselection);
dealSelectColRow(add, cellselection, newValue);
} else {
ColumnRow columnRow = ColumnRow.valueOf(cellselection.getColumn(), cellselection.getRow());
String allColumnRow = newValue.toString();
@ -503,12 +503,15 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
return cs1.getColumn() == cs2.getColumn() && cs1.getRow() == cs2.getRow();
}
private void dealSelectColRow(ColumnRowGroup add, CellSelection se) {
private void dealSelectColRow(ColumnRowGroup add, CellSelection se, ColumnRowGroup newValue) {
int c = se.getColumn(), cs = se.getColumnSpan(),
r = se.getRow(), rs = se.getRowSpan();
for (int i = 0; i < cs; i++) {
for (int j = 0; j < rs; j++) {
add.addColumnRow(ColumnRow.valueOf(c + i, r + j));
ColumnRow columnRow = ColumnRow.valueOf(c + i, r + j);
if (!newValue.contains(columnRow)) {
add.addColumnRow(columnRow);
}
}
}
}

Loading…
Cancel
Save