Browse Source

Merge pull request #6639 in DESIGN/design from release/11.0 to feature/x

* commit '9473a3013d1078e408852fd94f7514bf667d941c':
  REPORT-60789【开发者预览支持调整模板布局】新自适应-本地环境模板进入开发者调试,路径处显示已锁定但模板图标上没有锁图标,远程下是有的
  REPORT-61844 【设计器11.0】高分屏修改dpi,切换帆软账号,弹窗没有自适应,鼠标点击串行
  REPORT-62133 mac设计器安装包起不来
  REPORT-60748 决策报表-属性-坐标尺寸交互问题
feature/x
superman 3 years ago
parent
commit
daae1a99e0
  1. 16
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  2. 11
      designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java
  3. 42
      designer-base/src/main/java/com/fr/design/icon/LocalFileIcon.java
  4. 5
      designer-base/src/main/java/com/fr/design/icon/LockIcon.java
  5. 6
      designer-base/src/main/java/com/fr/design/widget/WidgetBoundsPaneFactory.java
  6. BIN
      designer-base/src/main/resources/com/fr/design/images/gui/file_lock.png
  7. 15
      designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java
  8. 12
      designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java
  9. 19
      designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java
  10. 5
      designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java
  11. 5
      designer-form/src/main/java/com/fr/design/designer/creator/XLayoutContainer.java
  12. 13
      designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java
  13. 2
      designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java
  14. 15
      designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java

16
designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java

@ -167,6 +167,7 @@ public class PreferencePane extends BasicPane {
private UICheckBox oracleSpace;
private UISpinner cachingTemplateSpinner;
private UICheckBox useOptimizedUPMCheckbox;
private UICheckBox useNewVersionLoginCheckbox;
private UICheckBox useUniverseDBMCheckbox;
private UICheckBox joinProductImproveCheckBox;
private UICheckBox autoPushUpdateCheckBox;
@ -233,6 +234,13 @@ public class PreferencePane extends BasicPane {
advancePane.add(upmSelectorPane);
}
if (SupportOSImpl.DESIGNER_LOGIN.support()) {
JPanel loginSelectorPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Login_Manager"));
useNewVersionLoginCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_New_Login_Manager"));
loginSelectorPane.add(useNewVersionLoginCheckbox);
advancePane.add(loginSelectorPane);
}
JPanel dbmSelectorPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Database_Manager"));
useUniverseDBMCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_Universe_Database_Manager"));
//dbmSelectorPane.add(useUniverseDBMCheckbox);
@ -726,6 +734,10 @@ public class PreferencePane extends BasicPane {
useOptimizedUPMCheckbox.setSelected(ServerPreferenceConfig.getInstance().isUseOptimizedUPM());
}
if (useNewVersionLoginCheckbox != null) {
useNewVersionLoginCheckbox.setSelected(!DesignerEnvManager.getEnvManager().isUseOldVersionLogin());
}
useUniverseDBMCheckbox.setSelected(ServerPreferenceConfig.getInstance().isUseUniverseDBM());
this.oracleSpace.setSelected(designerEnvManager.isOracleSystemSpace());
@ -820,6 +832,10 @@ public class PreferencePane extends BasicPane {
designerEnvManager.setAutoPushUpdateEnabled(this.autoPushUpdateCheckBox.isSelected());
}
if (useNewVersionLoginCheckbox != null) {
designerEnvManager.setUseOldVersionLogin(!this.useNewVersionLoginCheckbox.isSelected());
}
designerEnvManager.setUndoLimit(maxUndoLimit.getSelectedIndex() * SELECTED_INDEX_5);
if (maxUndoLimit.getSelectedIndex() == SELECTED_INDEX_5) {
designerEnvManager.setUndoLimit(MAX_UNDO_LIMIT_50);

11
designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java

@ -2,6 +2,7 @@ package com.fr.design.gui.itree.filetree;
import com.fr.base.BaseUtils;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.icon.LocalFileIcon;
import com.fr.design.icon.LockIcon;
import com.fr.design.fun.ReportSupportedFileUIProvider;
import com.fr.file.filetree.FileNode;
@ -19,6 +20,8 @@ public class FileTreeIcon {
private FileTreeIcon() {
}
public static final String FILE_LOCKED_ICON_PATH = "/com/fr/design/images/gui/file_lock.png";
public static final Icon BLANK_IMAGE_ICON = BaseUtils.readIcon("/com/fr/design/images/gui/blank.gif");
public static final Icon FOLDER_IMAGE_ICON = BaseUtils.readIcon("/com/fr/design/images/gui/folder.png");
@ -153,7 +156,7 @@ public class FileTreeIcon {
if (node.isDirectory()) {
return FileTreeIcon.FOLDER_IMAGE_ICON;
}
return getLocalFileIcon(path);
return getLocalFileIcon(path, isShowLock);
}
}
if (node.isDirectory()) {
@ -163,12 +166,12 @@ public class FileTreeIcon {
}
}
private static Icon getLocalFileIcon(String path) {
Icon icon = getExtraIcon(path, false);
private static Icon getLocalFileIcon(String path, boolean isShowLock) {
Icon icon = getExtraIcon(path, isShowLock);
if (icon != null) {
return icon;
}
return FileSystemView.getFileSystemView().getSystemIcon(new File(path));
return new LocalFileIcon(FileSystemView.getFileSystemView().getSystemIcon(new File(path)), isShowLock);
}
private static Icon getRemoteFileIcon(FileNode node, boolean isShowLock) {

42
designer-base/src/main/java/com/fr/design/icon/LocalFileIcon.java

@ -0,0 +1,42 @@
package com.fr.design.icon;
import com.fr.base.BaseUtils;
import com.fr.design.gui.itree.filetree.FileTreeIcon;
import javax.swing.Icon;
import java.awt.Component;
import java.awt.Graphics;
/**
* Created by kerry on 2021/11/11
*/
public class LocalFileIcon implements Icon {
private static final Icon FILE_LOCKED_ICON = BaseUtils.readIcon(FileTreeIcon.FILE_LOCKED_ICON_PATH);
private static final int OFFSET_X = 9;
private static final int OFFSET_Y = 8;
private final Icon mainIcon;
private final boolean showLock;
public LocalFileIcon(Icon mainIcon, boolean showLock) {
this.mainIcon = mainIcon;
this.showLock = showLock;
}
@Override
public void paintIcon(Component c, Graphics g, int x, int y) {
mainIcon.paintIcon(c, g, x, y);
if (showLock) {
FILE_LOCKED_ICON.paintIcon(c, g, OFFSET_X, OFFSET_Y);
}
}
@Override
public int getIconWidth() {
return mainIcon.getIconWidth();
}
@Override
public int getIconHeight() {
return mainIcon.getIconHeight();
}
}

5
designer-base/src/main/java/com/fr/design/icon/LockIcon.java

@ -1,6 +1,7 @@
package com.fr.design.icon;
import com.fr.base.BaseUtils;
import com.fr.design.gui.itree.filetree.FileTreeIcon;
import com.fr.log.FineLoggerFactory;
import javax.swing.GrayFilter;
@ -12,7 +13,7 @@ import java.awt.MediaTracker;
import java.awt.image.ImageObserver;
public class LockIcon extends ImageIcon {
private final static Image lockImage = BaseUtils.readImage("/com/fr/design/images/gui/locked.gif");
private final static Image lockImage = BaseUtils.readImage(FileTreeIcon.FILE_LOCKED_ICON_PATH);
private Image mainImage = null;
@ -107,4 +108,4 @@ public class LockIcon extends ImageIcon {
{
loadImage(lockImage);
}
}
}

6
designer-base/src/main/java/com/fr/design/widget/WidgetBoundsPaneFactory.java

@ -46,12 +46,12 @@ public class WidgetBoundsPaneFactory {
private static final int RIGHT_PANE_WIDTH = 145;
public static UIExpandablePane createBoundsPane(UISpinner width, UISpinner height, JComponent ratioLocked) {
public static UIExpandablePane createBoundsPane(UISpinner width, UISpinner height, JComponent ratioLocked, NameAttribute nameAttribute) {
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Basic_Component_Size")),
new Component[]{FRWidgetFactory.createLineWrapLabel(nameAttribute.getSizeName()),
ratioLocked != null ? createRightPane(width, ratioLocked, height) : createRightPane(width, height)},
new Component[]{null, createRightPane(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Tree_Width"), SwingConstants.CENTER), new UILabel(Toolkit.i18nText("Fine-Design_Basic_Tree_Height"), SwingConstants.CENTER))},
};
@ -65,7 +65,7 @@ public class WidgetBoundsPaneFactory {
}
public static UIExpandablePane createBoundsPane(UISpinner width, UISpinner height) {
return createBoundsPane(width, height, null);
return createBoundsPane(width, height, null, NameAttribute.DEFAULT);
}
public static JPanel createRightPane(Component com1, Component com2) {

BIN
designer-base/src/main/resources/com/fr/design/images/gui/file_lock.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

15
designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java

@ -20,7 +20,6 @@ import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor;
import com.fr.design.module.DesignModuleFactory;
import com.fr.form.ui.BaseChartEditor;
import com.fr.form.ui.PaddingMargin;
import com.fr.form.ui.Widget;
import com.fr.stable.Constants;
import com.fr.stable.core.PropertyChangeAdapter;
@ -29,9 +28,15 @@ import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import java.awt.*;
import java.beans.IntrospectionException;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import java.beans.IntrospectionException;
/**
* form中的图表按钮弹出的控件, 创建初始化图表内容.
@ -367,4 +372,8 @@ public class XChartEditor extends XBorderStyleWidgetCreator {
return false;
}
@Override
public boolean isComponent() {
return true;
}
}

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

@ -9,8 +9,8 @@ import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction;
import com.fr.design.designer.beans.events.DesignerEditor;
import com.fr.design.designer.beans.models.SelectionModel;
import com.fr.design.designer.creator.operate.XCreatorBaseOperate;
import com.fr.design.designer.creator.operate.DefaultXCreatorBaseOperate;
import com.fr.design.designer.creator.operate.XCreatorBaseOperate;
import com.fr.design.designer.treeview.DefaultXCreatorTreeCellRender;
import com.fr.design.designer.treeview.XCreatorTreeCellRender;
import com.fr.design.designer.ui.PopupDialogContext;
@ -36,7 +36,6 @@ import com.fr.stable.Constants;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import java.awt.event.MouseListener;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JFrame;
@ -50,6 +49,7 @@ import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.beans.IntrospectionException;
import java.util.ArrayList;
import java.util.List;
@ -935,4 +935,12 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
return new DefaultXCreatorBaseOperate();
}
/**
* 是否是组件控件还是组件
* @return 是否是组件
*/
public boolean isComponent() {
return false;
}
}

19
designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java

@ -427,4 +427,23 @@ public class XCreatorUtils {
}
return null;
}
/**
* 把控件例如textEditor外层的容器剥掉
* @param xCreator 控件
* @return 内层控件
*/
public static XCreator getXCreatorInnerWidget(XCreator xCreator) {
if (xCreator.acceptType(XWScaleLayout.class)) {
if (xCreator.getComponentCount() > 0 && ((XCreator) xCreator.getComponent(0)).shouldScaleCreator()) {
return (XCreator) xCreator.getComponent(0);
}
}
if (xCreator.acceptType(XWTitleLayout.class)) {
return (XCreator) xCreator.getComponent(0);
}
return xCreator;
}
}

5
designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java

@ -366,4 +366,9 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
public void releaseResources() {
imageLable.setIcon(null);
}
@Override
public boolean isComponent() {
return true;
}
}

5
designer-form/src/main/java/com/fr/design/designer/creator/XLayoutContainer.java

@ -612,4 +612,9 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme
public void replaceXcreator(XCreator newCreator, XCreator oldCreator){
}
@Override
public boolean isComponent() {
return true;
}
}

13
designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java

@ -10,8 +10,6 @@ import com.fr.design.designer.creator.XWAbsoluteBodyLayout;
import com.fr.design.designer.creator.XWAbsoluteLayout;
import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.designer.creator.XWScaleLayout;
import com.fr.design.designer.creator.XWTitleLayout;
import com.fr.design.designer.creator.cardlayout.XWCardTagLayout;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.foldablepane.UIExpandablePane;
@ -113,7 +111,7 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane {
}
private void initComponents() {
XCreator innerCreator = getXCreatorDedicated();
XCreator innerCreator = XCreatorUtils.getXCreatorInnerWidget(this.xCreator);
attriCardPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
content.add(attriCardPane, BorderLayout.CENTER);
@ -166,7 +164,7 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane {
private void initDefinePane() {
currentEditorDefinePane = null;
XCreator creator = getXCreatorDedicated();
XCreator creator = XCreatorUtils.getXCreatorInnerWidget(this.xCreator);
FormWidgetDefinePaneFactoryBase.RN rn = FormWidgetDefinePaneFactoryBase.createWidgetDefinePane(creator, designer, creator.toData(), new Operator() {
@Override
public void did(DataCreatorUI ui, String cardName) {
@ -190,11 +188,6 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane {
currentEditorDefinePane = definePane;
}
private XCreator getXCreatorDedicated() {
boolean dedicateLayout = xCreator.acceptType(XWScaleLayout.class) && xCreator.getComponentCount() > 0 && ((XCreator) xCreator.getComponent(0)).shouldScaleCreator() || xCreator.acceptType(XWTitleLayout.class);
return dedicateLayout ? (XCreator) xCreator.getComponent(0) : xCreator;
}
@Override
public String title4PopupWindow() {
return "Widget";
@ -283,7 +276,7 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane {
}
public void fireValueChanged() {
XCreator creator = getXCreatorDedicated();
XCreator creator = XCreatorUtils.getXCreatorInnerWidget(this.xCreator);
creator.firePropertyChange();
}

2
designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java

@ -35,7 +35,7 @@ public class WidgetAbsoluteBoundPane extends WidgetBoundPane {
width.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Coords_And_Size"));
height.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Coords_And_Size"));
ratioLockedButton.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Coords_And_Size"));
this.add(WidgetBoundsPaneFactory.createAbsoluteBoundsPane(x, y, width, height, ratioLockedButton, WidgetBoundsPaneFactory.NameAttribute.WIDGET));
this.add(WidgetBoundsPaneFactory.createAbsoluteBoundsPane(x, y, width, height, ratioLockedButton, getNameAttribute()));
}
@Override

15
designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java

@ -89,7 +89,20 @@ public class WidgetBoundPane extends BasicPane {
ratioLockedButton.setLockEnabled(false);
}
this.add(WidgetBoundsPaneFactory.createBoundsPane(width, height, ratioLockedButton));
this.add(WidgetBoundsPaneFactory.createBoundsPane(width, height, ratioLockedButton, getNameAttribute()));
}
protected WidgetBoundsPaneFactory.NameAttribute getNameAttribute() {
WidgetBoundsPaneFactory.NameAttribute nameAttribute = WidgetBoundsPaneFactory.NameAttribute.DEFAULT;
if (!isComponent()) {
nameAttribute = WidgetBoundsPaneFactory.NameAttribute.WIDGET;
}
return nameAttribute;
}
protected boolean isComponent() {
XCreator creator = XCreatorUtils.getXCreatorInnerWidget(this.creator);
return creator.isComponent();
}

Loading…
Cancel
Save