diff --git a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java index ab86a0d6f2..f7eb9bacc4 100644 --- a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java +++ b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java @@ -47,9 +47,11 @@ import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashMap; +import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -71,8 +73,8 @@ public abstract class DesignTableDataManager { * 其实globalDsCache没有绝对的必要,只是为了操作方便。如果没有它,那么每次清空服务器数据集或者存储过程的时候,还要去遍历找一下, * 这个操作可能比较复杂 。 从减少代码复杂度的角度看,还是很有必要的 */ - private static java.util.Map globalDsCache = new java.util.HashMap(); - private static java.util.Map dsNameChangedMap = new HashMap(); + private static Map globalDsCache = new java.util.HashMap(); + private static Set dsNameChangedSet = new LinkedHashSet<>(); private static List globalDsListeners = new ArrayList<>(); private static Map> dsListenersMap = new ConcurrentHashMap<>(); @@ -123,7 +125,7 @@ public abstract class DesignTableDataManager { public static void envChange() { columnCache.clear(); dsListenersMap.clear(); - dsNameChangedMap.clear(); + dsNameChangedSet.clear(); clearGlobalDs(); } @@ -136,17 +138,17 @@ public abstract class DesignTableDataManager { public static void fireDSChanged(Map dsNameChangedMap) { clearGlobalDs(); if (!dsNameChangedMap.isEmpty()) { - setDsNameChangedMap(dsNameChangedMap); + setDsNameChangedSet(dsNameChangedMap); } fireDsChanged(); dsNameChangedMap.clear(); } - private static void setDsNameChangedMap(Map map) { + private static void setDsNameChangedSet(Map map) { Iterator iterator = map.keySet().iterator(); while (iterator.hasNext()) { String key = (String) iterator.next(); - dsNameChangedMap.put(key, map.get(key)); + dsNameChangedSet.add(new NameChangeBean(key, map.get(key))); } } @@ -157,23 +159,21 @@ public abstract class DesignTableDataManager { * @return 是则返回true */ public static boolean isDsNameChanged(String oldDsName) { - return dsNameChangedMap.containsKey(oldDsName); - } - - public static String getChangedDsNameByOldDsName(String oldDsName) { - String changeName; - - if (isDsNameChanged(oldDsName)) { - changeName = dsNameChangedMap.get(oldDsName); - } else { - changeName = StringUtils.EMPTY; + for (NameChangeBean bean : dsNameChangedSet) { + if (ComparatorUtils.equals(oldDsName, bean.getOldName())) { + return true; + } } + return false; + } - if (StringUtils.isNotEmpty(changeName)) { - return getChangedDsNameByOldDsName(changeName); - } else { - return oldDsName; + public static String getChangedDsNameByOldDsName(String dsName) { + for (NameChangeBean bean : dsNameChangedSet) { + if (ComparatorUtils.equals(dsName, bean.getOldName())) { + dsName = bean.getChangedName(); + } } + return dsName; } public static void addGlobalDsChangeListener(ChangeListener l) { diff --git a/designer-base/src/main/java/com/fr/design/data/NameChangeBean.java b/designer-base/src/main/java/com/fr/design/data/NameChangeBean.java new file mode 100644 index 0000000000..2d4caf44e3 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/data/NameChangeBean.java @@ -0,0 +1,27 @@ +package com.fr.design.data; + +public class NameChangeBean { + private String oldName; + private String changedName; + + public NameChangeBean(String oldName, String changedName) { + this.oldName = oldName; + this.changedName = changedName; + } + + public String getOldName() { + return oldName; + } + + public void setOldName(String oldName) { + this.oldName = oldName; + } + + public String getChangedName() { + return changedName; + } + + public void setChangedName(String changedName) { + this.changedName = changedName; + } +} diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/UITabbedPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/UITabbedPane.java index c1021321b9..fd2fcc3755 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/UITabbedPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/UITabbedPane.java @@ -21,6 +21,8 @@ public class UITabbedPane extends JTabbedPane{ private String classPath; //panel对象的类名 private String tabName; //Tab名称 private int tabSize = 0; + private Color tabBorderColor; + public UITabbedPane() { super(); } @@ -93,6 +95,16 @@ public class UITabbedPane extends JTabbedPane{ public int getTabSize(){ return tabSize; } + + public Color getTabBorderColor() { + return tabBorderColor; + } + + public void setTabBorderColor(Color tabBorderColor) { + this.tabBorderColor = tabBorderColor; + repaint(); + } + @Override /** * 获取UI对象 diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/UITabbedPaneUI.java b/designer-base/src/main/java/com/fr/design/gui/frpane/UITabbedPaneUI.java index 5798a864b0..d31107c2ce 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/UITabbedPaneUI.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/UITabbedPaneUI.java @@ -31,9 +31,20 @@ public class UITabbedPaneUI extends BasicTabbedPaneUI { private int addX = -1; private int addY = -1; private int rollover = -1; - private Color tabBorderColor = new Color(143, 160, 183); + private final Color DEFAULT_TAB_BORDER_COLOR = new Color(143, 160, 183); private Color[] tabSelectedColor = {UIConstants.NORMAL_BLUE, UIConstants.NORMAL_BLUE, UIConstants.NORMAL_BLUE}; + public Color getTabBorderColor() { + Color color = null; + if (tabPane instanceof UITabbedPane) { + color = ((UITabbedPane) tabPane).getTabBorderColor(); + } + if (color == null) { + color = DEFAULT_TAB_BORDER_COLOR; + } + return color; + } + /** * 创建UI对象 * @@ -252,9 +263,9 @@ public class UITabbedPaneUI extends BasicTabbedPaneUI { private void drawUITabBorder(Graphics g, int tabPlacement, int x, int y, int w, int h, boolean isSelected, boolean isEnabled, boolean isRollover) { if (!isEnabled) { - drawUITabBorder(g, tabBorderColor, x, y, w, h, tabPlacement); + drawUITabBorder(g, getTabBorderColor(), x, y, w, h, tabPlacement); } else if (isSelected || isRollover) { - drawSelectedUITabBorder(g, tabBorderColor, x, y, w, h, tabPlacement); + drawSelectedUITabBorder(g, getTabBorderColor(), x, y, w, h, tabPlacement); if (isRollover && canClose()) { closeX = x + w - closeIcon.getIconWidth() - 3; closeY = 0; @@ -269,7 +280,7 @@ public class UITabbedPaneUI extends BasicTabbedPaneUI { closeIcon.paintIcon(tabPane, g, closeX, closeY); } } else { - drawUITabBorder(g, tabBorderColor, x, y, w, h, tabPlacement); + drawUITabBorder(g, getTabBorderColor(), x, y, w, h, tabPlacement); } } @@ -322,7 +333,7 @@ public class UITabbedPaneUI extends BasicTabbedPaneUI { } private void drawUIContentBorder(Graphics g, int x, int y, int w, int h) { - g.setColor(tabBorderColor); + g.setColor(getTabBorderColor()); g.drawRect(x, y, w - 3, h - 3); // Shadow g.setColor(new Color(204, 204, 204)); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPagesPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPagesPane.java index fa82076965..40838dbd83 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPagesPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPagesPane.java @@ -293,6 +293,7 @@ public class TemplateThemeGridPagesPane extends JPanel { setLayout(FRGUIPaneFactory.createBorderLayout()); tabbedPane = new UITabbedPane(); + tabbedPane.setTabBorderColor(new Color(0xE0E0E1)); add(tabbedPane, BorderLayout.CENTER); formThemesManagerPane = TemplateThemeGridControlPane.createFormThemesManagerPane(); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ComponentPreviewPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ComponentPreviewPane.java index 20e418960c..cfd2781aa8 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ComponentPreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ComponentPreviewPane.java @@ -90,6 +90,37 @@ public abstract class ComponentPreviewPane extends UINoOpaquePanel implements Th } + @Override + protected void paintBorder(Graphics g) { + super.paintBorder(g); + + paintSeparator((Graphics2D) g); + } + + private void paintSeparator(Graphics2D g2d) { + Border border = getBorder(); + if (border instanceof LineBorder && titlePane != null) { + Border containerBorder = container.getBorder(); + Insets insets = containerBorder.getBorderInsets(container); + int y = titlePane.getHeight() + insets.top; + + Color oldColor = g2d.getColor(); + Stroke oldStroke = g2d.getStroke(); + + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + + Color lineColor = ((LineBorder) border).getLineColor(); + int thickness = ((LineBorder) border).getThickness(); + g2d.setColor(lineColor); + g2d.setStroke(new BasicStroke(thickness * 2)); + g2d.drawLine(0, y, getWidth(), y); + + g2d.setStroke(oldStroke); + g2d.setColor(oldColor); + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); + } + } + @Override public void paint(Graphics g) { Graphics2D g2d = (Graphics2D) g; @@ -144,7 +175,6 @@ public abstract class ComponentPreviewPane extends UINoOpaquePanel implements Th data.setInsetImagePadding(titlePacker.getInsetImagePadding()); data.setInsetRelativeTextLeft(titlePacker.isInsetRelativeTextLeft()); data.setInsetRelativeTextRight(titlePacker.isInsetRelativeTextRight()); - this.setBorder(new BottomLineBorder(componentStyle.getStyle().getColor(), componentStyle.getStyle().getBorder())); } public Label getData(){ @@ -172,31 +202,6 @@ public abstract class ComponentPreviewPane extends UINoOpaquePanel implements Th } - public static class BottomLineBorder extends LineBorder { - - private BottomLineBorder(Color color, int thickness) { - super(color, thickness); - } - - @Override - public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { - Graphics2D g2d = (Graphics2D) g; - - Color oldColor = g2d.getColor(); - Stroke oldStroke = g2d.getStroke(); - - g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); - - g2d.setColor(getLineColor()); - g2d.setStroke(new BasicStroke(getThickness() * 2)); - g2d.drawLine(0, height, width, height); - - g2d.setStroke(oldStroke); - g2d.setColor(oldColor); - g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); - } - } - private static class Utils { private static void paintBackground(Graphics2D g2d, Background background, Shape shape, float opacity) { diff --git a/designer-base/src/main/java/com/fr/design/report/fit/BaseFitAttrPane.java b/designer-base/src/main/java/com/fr/design/report/fit/BaseFitAttrPane.java index c170347ff9..dbf078b68d 100644 --- a/designer-base/src/main/java/com/fr/design/report/fit/BaseFitAttrPane.java +++ b/designer-base/src/main/java/com/fr/design/report/fit/BaseFitAttrPane.java @@ -15,9 +15,7 @@ import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; import com.fr.report.fit.ReportFitAttr; - import javax.swing.*; -import javax.swing.border.EmptyBorder; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -33,6 +31,7 @@ import static com.fr.design.i18n.Toolkit.i18nText; public abstract class BaseFitAttrPane extends BasicBeanPane { protected JPanel contentJPanel; + protected UILabel belowSetLabel; protected UIComboBox itemChoose; protected java.util.List fitAttrModelList = new ArrayList<>(); @@ -98,7 +97,7 @@ public abstract class BaseFitAttrPane extends BasicBeanPane { } attrJPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - attrJPanel.setBorder(new EmptyBorder(0, 100, 10, 100)); + attrJPanel.setBorder(BorderFactory.createEmptyBorder(5, 0, 10, 0)); contentJPanel.add(attrJPanel); } @@ -137,9 +136,18 @@ public abstract class BaseFitAttrPane extends BasicBeanPane { protected void initPreviewJPanel() { previewJPanel = new FitPreviewPane(); + previewJPanel.setBorder(BorderFactory.createEmptyBorder(0, getPreviewJPanelLeft(), 0, 0)); contentJPanel.add(previewJPanel); } + private int getPreviewJPanelLeft() { + int left = 0; + if (belowSetLabel.getPreferredSize() != null) { + left = belowSetLabel.getPreferredSize().width + BELOW_SET_COMPONENT_HSPACE; + } + return left; + } + protected int getStateInPC(int index) { FitType[] fitTypes = fitAttrModel.getFitTypes(); return fitTypes[index].getState(); @@ -189,29 +197,26 @@ public abstract class BaseFitAttrPane extends BasicBeanPane { protected void initComponents() { this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); - contentJPanel = new JPanel(); - contentJPanel.setLayout(FRGUIPaneFactory.createCenterFlowLayout()); + contentJPanel = FRGUIPaneFactory.createVerticalFlowLayout_Pane(false, FlowLayout.LEFT, 0, 0); this.add(contentJPanel); initItemChoose(); + initPrompt(); } private void initItemChoose() { - JPanel chooseJPanel = new JPanel(); - chooseJPanel.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); + JPanel chooseJPanel = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); ItemListener itemListener = getItemListener(); itemChoose = new UIComboBox(getItemNames()); itemChoose.addItemListener(itemListener); - UILabel belowSetLabel = new UILabel(i18nText("Fine-Design_Report_Blow_Set")); + belowSetLabel = new UILabel(i18nText("Fine-Design_Report_Blow_Set")); + JPanel hSpaceLabel = new JPanel(); + hSpaceLabel.setSize(BELOW_SET_COMPONENT_HSPACE, 0); JPanel buttonPane = GUICoreUtils.createFlowPane(new Component[]{ - belowSetLabel, itemChoose}, FlowLayout.LEFT, BELOW_SET_COMPONENT_HSPACE); + belowSetLabel, hSpaceLabel, itemChoose}, FlowLayout.LEFT); chooseJPanel.add(buttonPane); - chooseJPanel.setPreferredSize(new Dimension(500, 50)); - JPanel jPanel = new JPanel(); - jPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); - jPanel.add(chooseJPanel, BorderLayout.WEST); - - contentJPanel.add(jPanel); + chooseJPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0)); + contentJPanel.add(chooseJPanel); } @@ -222,6 +227,9 @@ public abstract class BaseFitAttrPane extends BasicBeanPane { } + protected void initPrompt() { + } + protected void refresh() { validate(); repaint(); diff --git a/designer-form/src/main/java/com/fr/design/actions/FormFitAttrAction.java b/designer-form/src/main/java/com/fr/design/actions/FormFitAttrAction.java deleted file mode 100644 index 21b7bfdcb6..0000000000 --- a/designer-form/src/main/java/com/fr/design/actions/FormFitAttrAction.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.fr.design.actions; - -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.dialog.DialogActionAdapter; -import com.fr.design.dialog.UIDialog; -import com.fr.design.fit.DesignerUIModeConfig; -import com.fr.design.mainframe.DesignerContext; -import com.fr.design.mainframe.JTemplate; -import com.fr.design.menu.MenuKeySet; -import com.fr.design.report.fit.menupane.TemplateFitAttrPane; -import com.fr.report.fit.FitProvider; -import com.fr.report.fit.ReportFitAttr; - -import javax.swing.KeyStroke; -import java.awt.event.ActionEvent; - -/** - * Created by Administrator on 2015/7/6 0006. - */ -public class FormFitAttrAction extends JTemplateAction { - private static final MenuKeySet REPORT_FIT_ATTR_ELEMENTCASE = new MenuKeySet() { - @Override - public char getMnemonic() { - return 'T'; - } - - @Override - public String getMenuName() { - return DesignerUIModeConfig.getInstance().newUIMode() ? - com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit_PC_Adaptive_Attr") : - com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_PC_Element_Case_Fit_Attr"); - } - - @Override - public KeyStroke getKeyStroke() { - return null; - } - }; - - public FormFitAttrAction(JTemplate jTemplate) { - super(jTemplate); - initMenuStyle(); - } - - private void initMenuStyle() { - this.setMenuKeySet(REPORT_FIT_ATTR_ELEMENTCASE); - this.setName(getMenuKeySet().getMenuKeySetName() + "..."); - this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(DesignerUIModeConfig.getInstance().newUIMode() ? - "/com/fr/design/images/reportfit/fit.png" : - "/com/fr/design/images/reportfit/fit"); - } - - @Override - public void actionPerformed(ActionEvent e) { - final JTemplate jwb = getEditingComponent(); - if (jwb == null) { - return; - } - final FitProvider wbTpl = (FitProvider) jwb.getTarget(); - ReportFitAttr fitAttr = wbTpl.getReportFitAttr(); - TemplateFitAttrPane templateFitAttrPane = new TemplateFitAttrPane(jwb); - showFitDialog(fitAttr, jwb, wbTpl, templateFitAttrPane); - } - - private void showFitDialog(ReportFitAttr fitAttr, final JTemplate jwb, final FitProvider wbTpl, final BasicBeanPane attrPane) { - attrPane.populateBean(fitAttr); - UIDialog dialog = attrPane.showMediumWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { - @Override - public void doOk() { - wbTpl.setReportFitAttr(attrPane.updateBean()); - jwb.fireTargetModified(); - } - }); - dialog.setVisible(true); - } -} diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XBorderStyleWidgetCreator.java b/designer-form/src/main/java/com/fr/design/designer/creator/XBorderStyleWidgetCreator.java index 60434f2cb8..f99864c629 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XBorderStyleWidgetCreator.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XBorderStyleWidgetCreator.java @@ -273,12 +273,7 @@ public class XBorderStyleWidgetCreator extends XWidgetCreator{ parentCreator.setBorder(border); // 容器绘制完整边框 bodyCreator.setBorder(BorderFactory.createEmptyBorder()); // body不绘制边框 - titleCreator.setBorder(BorderFactory.createEmptyBorder()); // title绘制底部边框 - if (border instanceof LineBorder) { - Color color = ((LineBorder) border).getLineColor(); - int thickness = ((LineBorder) border).getThickness(); - titleCreator.setBorder(new BottomLineBorder(color, thickness)); - } + titleCreator.setBorder(BorderFactory.createEmptyBorder()); // title不绘制边框 if (bodyCreator instanceof XBorderStyleWidgetCreator) { XBorderStyleWidgetCreator styledBodyXCreator = (XBorderStyleWidgetCreator) bodyCreator; @@ -407,32 +402,6 @@ public class XBorderStyleWidgetCreator extends XWidgetCreator{ } - // 适用于标题栏的底部边框 - public static class BottomLineBorder extends LineBorder { - - private BottomLineBorder(Color color, int thickness) { - super(color, thickness); - } - - @Override - public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { - Graphics2D g2d = (Graphics2D)g; - - Color oldColor = g2d.getColor(); - Stroke oldStroke = g2d.getStroke(); - - g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); - - g2d.setColor(getLineColor()); - g2d.setStroke(new BasicStroke(getThickness() * 2)); - g2d.drawLine(0, height, width, height); - - g2d.setStroke(oldStroke); - g2d.setColor(oldColor); - g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); - } - } - public static class NoBackgroundPaneUI extends BasicPanelUI { @Override public void update(Graphics g, JComponent c) { diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWTitleLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWTitleLayout.java index 7655095b18..d4757c184a 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWTitleLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWTitleLayout.java @@ -15,6 +15,8 @@ import com.fr.form.ui.container.WTitleLayout; import com.fr.general.Background; import com.fr.general.ComparatorUtils; +import javax.swing.border.Border; +import javax.swing.border.LineBorder; import java.awt.*; import java.awt.event.ContainerEvent; import java.awt.geom.Rectangle2D; @@ -187,6 +189,37 @@ public class XWTitleLayout extends DedicateLayoutContainer { } + @Override + protected void paintBorder(Graphics g) { + super.paintBorder(g); + paintSeparator((Graphics2D) g); + } + + private void paintSeparator(Graphics2D g2d) { + Border border = getBorder(); + XCreator titleCreator = getTitleCreator(); + if (border instanceof LineBorder && titleCreator != null) { + int height = titleCreator.getHeight(); + Insets paddingInsets = getInsets(); + int y = height + paddingInsets.top; + + Color oldColor = g2d.getColor(); + Stroke oldStroke = g2d.getStroke(); + + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + + Color lineColor = ((LineBorder) border).getLineColor(); + int thickness = ((LineBorder) border).getThickness(); + g2d.setColor(lineColor); + g2d.setStroke(new BasicStroke(thickness * 2)); + g2d.drawLine(0, y, getWidth(), y); + + g2d.setStroke(oldStroke); + g2d.setColor(oldColor); + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); + } + } + @Override public void paintBackground(Graphics2D g2d) { if (getComponentCount() > 1) { diff --git a/designer-form/src/main/java/com/fr/design/fit/NewJForm.java b/designer-form/src/main/java/com/fr/design/fit/NewJForm.java index 8f52fbaf00..6859c12310 100644 --- a/designer-form/src/main/java/com/fr/design/fit/NewJForm.java +++ b/designer-form/src/main/java/com/fr/design/fit/NewJForm.java @@ -13,7 +13,6 @@ import com.fr.design.fit.common.AdaptiveSwitchUtil; import com.fr.design.fit.common.LayoutTool; import com.fr.form.fit.NewFormMarkAttr; import com.fr.design.fit.common.TemplateTool; -import com.fr.design.actions.FormFitAttrAction; import com.fr.design.actions.NewFormMobileAttrAction; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.preview.DeveloperPreview; @@ -92,7 +91,7 @@ public class NewJForm extends JForm { Rectangle rectangle = LayoutTool.getAbsoluteBodySize(this); if (!isNewJFrom() && (rectangle.width != bodyWidth || rectangle.height != bodyHeight)) { TemplateTool.onlyChangeAbsoluteBodySize(bodyHeight, bodyWidth, this); - } else if(isNewJFrom()){ + } else if (isNewJFrom()) { if (rectangle.width > bodyWidth && rectangle.height > bodyHeight) { TemplateTool.onlyChangeAbsoluteBodySize(rectangle.height, rectangle.width, this); } else if (rectangle.width > bodyWidth) { @@ -129,9 +128,9 @@ public class NewJForm extends JForm { @Override public ShortCut[] shortcut4TemplateMenu() { if (this.index == FORM_TAB) { - return ArrayUtils.addAll(new ShortCut[]{new TemplateParameterAction(this), new NewFormMobileAttrAction(this), new FormFitAttrAction(this)}, new ShortCut[0]); + return ArrayUtils.addAll(new ShortCut[]{new TemplateParameterAction(this), new NewFormMobileAttrAction(this), getReportFitAttrAction()}, new ShortCut[0]); } else { - return ArrayUtils.addAll(new ShortCut[]{new TemplateParameterAction(this), new NewFormMobileAttrAction(this), new FormFitAttrAction(this)}, this.getElementCaseDesign().shortcut4TemplateMenu()); + return ArrayUtils.addAll(new ShortCut[]{new TemplateParameterAction(this), new NewFormMobileAttrAction(this), getReportFitAttrAction()}, this.getElementCaseDesign().shortcut4TemplateMenu()); } } @@ -183,7 +182,7 @@ public class NewJForm extends JForm { private void processColumnAbsorbingEffect(XWTitleLayout xwTitleLayout, DynamicUnitList columnUnitList, Dimension bound) { int temp = 0; - int resolution = DesignerUIModeConfig.getInstance().getScreenResolution();; + int resolution = DesignerUIModeConfig.getInstance().getScreenResolution(); int difference = 0; int i = 0; while (true) { @@ -207,7 +206,7 @@ public class NewJForm extends JForm { private void processRowAbsorbingEffect(XWTitleLayout xwTitleLayout, DynamicUnitList rowUnitList, Dimension bound) { int temp = hasTitle(xwTitleLayout) ? TITLE_HEIGHT : 0; - int resolution =DesignerUIModeConfig.getInstance().getScreenResolution(); + int resolution = DesignerUIModeConfig.getInstance().getScreenResolution(); int difference = 0; int i = 0; while (true) { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index a3ea4583ff..bc0c75b30d 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -597,7 +597,7 @@ public class JForm extends JTemplate implements BaseJForm implements BaseJForm implements BaseJForm