Browse Source

Merge remote-tracking branch 'origin/release/10.0' into release/10.0

zheng-1641779399395
Yuan.Wang 3 years ago
parent
commit
4b0b05729f
  1. 5
      designer-base/src/main/java/com/fr/design/report/fit/BaseFitAttrPane.java
  2. 23
      designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java
  3. 1
      designer-base/src/main/java/com/fr/design/worker/open/OpenWorker.java
  4. 49
      designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java

5
designer-base/src/main/java/com/fr/design/report/fit/BaseFitAttrPane.java

@ -41,6 +41,7 @@ public abstract class BaseFitAttrPane extends BasicBeanPane<ReportFitAttr> {
public JPanel attrJPanel; public JPanel attrJPanel;
public FitPreviewPane previewJPanel; public FitPreviewPane previewJPanel;
public FitAttrModel fitAttrModel; public FitAttrModel fitAttrModel;
private static final int BELOW_SET_COMPONENT_HSPACE = 8;
protected BaseFitAttrPane() { protected BaseFitAttrPane() {
@ -179,7 +180,7 @@ public abstract class BaseFitAttrPane extends BasicBeanPane<ReportFitAttr> {
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return i18nText("Fine-Designer_PC_Element_Case_Fit_Attr"); return i18nText("Fine-Designer_PC_Fit_Attr");
} }
protected abstract String[] getItemNames(); protected abstract String[] getItemNames();
@ -202,7 +203,7 @@ public abstract class BaseFitAttrPane extends BasicBeanPane<ReportFitAttr> {
itemChoose.addItemListener(itemListener); itemChoose.addItemListener(itemListener);
UILabel belowSetLabel = new UILabel(i18nText("Fine-Design_Report_Blow_Set")); UILabel belowSetLabel = new UILabel(i18nText("Fine-Design_Report_Blow_Set"));
JPanel buttonPane = GUICoreUtils.createFlowPane(new Component[]{ JPanel buttonPane = GUICoreUtils.createFlowPane(new Component[]{
belowSetLabel, itemChoose}, FlowLayout.LEFT, 0, 0); belowSetLabel, itemChoose}, FlowLayout.LEFT, BELOW_SET_COMPONENT_HSPACE);
chooseJPanel.add(buttonPane); chooseJPanel.add(buttonPane);
chooseJPanel.setPreferredSize(new Dimension(500, 50)); chooseJPanel.setPreferredSize(new Dimension(500, 50));
JPanel jPanel = new JPanel(); JPanel jPanel = new JPanel();

23
designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java

@ -34,22 +34,6 @@ public class ReportFitAttrAction extends JTemplateAction {
return null; return null;
} }
}; };
private static final MenuKeySet REPORT_FIT_ATTR_ELEMENTCASE = new MenuKeySet() {
@Override
public char getMnemonic() {
return 'T';
}
@Override
public String getMenuName() {
return Toolkit.i18nText("Fine-Designer_PC_Element_Case_Fit_Attr");
}
@Override
public KeyStroke getKeyStroke() {
return null;
}
};
public ReportFitAttrAction(JTemplate jTemplate) { public ReportFitAttrAction(JTemplate jTemplate) {
super(jTemplate); super(jTemplate);
@ -57,12 +41,7 @@ public class ReportFitAttrAction extends JTemplateAction {
} }
private void initMenuStyle() { private void initMenuStyle() {
JTemplate jTemplate = getEditingComponent(); this.setMenuKeySet(REPORT_FIT_ATTR);
if (jTemplate.isJWorkBook()) {
this.setMenuKeySet(REPORT_FIT_ATTR);
} else {
this.setMenuKeySet(REPORT_FIT_ATTR_ELEMENTCASE);
}
this.setName(getMenuKeySet().getMenuKeySetName() + "..."); this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setMnemonic(getMenuKeySet().getMnemonic()); this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon("/com/fr/design/images/reportfit/fit"); this.setSmallIcon("/com/fr/design/images/reportfit/fit");

1
designer-base/src/main/java/com/fr/design/worker/open/OpenWorker.java

@ -53,7 +53,6 @@ public class OpenWorker<T> extends SwingWorker<T, Void> {
@Override @Override
protected T doInBackground() throws Exception { protected T doInBackground() throws Exception {
TimeUnit.SECONDS.sleep(5);
return this.callable.call(); return this.callable.call();
} }

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

@ -4,11 +4,12 @@ import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.cardlayout.XWCardTagLayout; import com.fr.design.designer.creator.cardlayout.XWCardTagLayout;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.form.layout.FRBorderLayout; import com.fr.design.form.layout.FRBorderLayout;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.ui.util.UIUtil;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import javax.swing.JOptionPane;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Rectangle; import java.awt.Rectangle;
@ -46,18 +47,42 @@ public class FRCardMainBorderLayoutAdapter extends FRBorderLayoutAdapter {
Rectangle rectangle = creator.getBounds(); Rectangle rectangle = creator.getBounds();
//不能超出控件边界 //不能超出控件边界
if (ComparatorUtils.equals(constraints, BorderLayout.NORTH) || ComparatorUtils.equals(constraints, BorderLayout.SOUTH)) { if (ComparatorUtils.equals(constraints, BorderLayout.NORTH) || ComparatorUtils.equals(constraints, BorderLayout.SOUTH)) {
int containerHeight = container.getHeight(); return isBeyondMinConstraint(rectangle.height, container.getHeight());
if (rectangle.height > containerHeight) {
FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds"));
return true;
}
} else if (ComparatorUtils.equals(constraints, BorderLayout.EAST) || ComparatorUtils.equals(constraints, BorderLayout.WEST)) { } else if (ComparatorUtils.equals(constraints, BorderLayout.EAST) || ComparatorUtils.equals(constraints, BorderLayout.WEST)) {
int containerWidth = container.getWidth(); return isBeyondMinConstraint(rectangle.width, container.getWidth());
if (rectangle.width > containerWidth) {
FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds"));
return true;
}
} }
return false; return false;
} }
/**
* 是否超出最小限制
*
* @param minConstraint 最小限制
* @param value 数值
* @return 是否超出最小限制
*/
private boolean isBeyondMinConstraint(int minConstraint, int value) {
if (minConstraint > value) {
FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds"));
if (container.getBackupBound() != null) {
// 手动拖动导致变矮的场景
container.setSize(container.getBackupBound().getSize());
} else {
// 自适应布局平分高度导致变矮的场景
UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override
public void run() {
JTemplate<?, ?> jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (jt != null) {
jt.undo();
}
}
});
}
return true;
} else {
return false;
}
}
} }

Loading…
Cancel
Save