Browse Source

Merge pull request #6711 in DESIGN/design from bugfix/10.0 to feature/10.0

* commit 'd96b43ad5971fd553d88e8cd5e26b521ae1d05de':
  REPORT-60748 决策报表-属性-坐标尺寸交互问题
feature/10.0
superman 3 years ago
parent
commit
c3c4374039
  1. 6
      designer-base/src/main/java/com/fr/design/widget/WidgetBoundsPaneFactory.java
  2. 5
      designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java
  3. 8
      designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java
  4. 19
      designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java
  5. 5
      designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java
  6. 5
      designer-form/src/main/java/com/fr/design/designer/creator/XLayoutContainer.java
  7. 11
      designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java
  8. 2
      designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java
  9. 15
      designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java

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; 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(); JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ 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)}, 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))}, 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) { 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) { public static JPanel createRightPane(Component com1, Component com2) {

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

@ -363,4 +363,9 @@ public class XChartEditor extends XBorderStyleWidgetCreator {
return false; return false;
} }
@Override
public boolean isComponent() {
return true;
}
} }

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

@ -897,4 +897,12 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
} }
return ((XCreator) this.getParent()).getLevel() + 1; return ((XCreator) this.getParent()).getLevel() + 1;
} }
/**
* 是否是组件控件还是组件
* @return 是否是组件
*/
public boolean isComponent() {
return false;
}
} }

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

@ -356,4 +356,23 @@ public class XCreatorUtils {
} }
return null; 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

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

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

@ -586,4 +586,9 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme
public void setDragInAble(boolean dragInAble) { public void setDragInAble(boolean dragInAble) {
this.dragInAble = dragInAble; this.dragInAble = dragInAble;
} }
@Override
public boolean isComponent() {
return true;
}
} }

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

@ -113,7 +113,7 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane {
} }
private void initComponents() { private void initComponents() {
XCreator innerCreator = getXCreatorDedicated(); XCreator innerCreator = XCreatorUtils.getXCreatorInnerWidget(this.xCreator);
attriCardPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); attriCardPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
content.add(attriCardPane, BorderLayout.CENTER); content.add(attriCardPane, BorderLayout.CENTER);
@ -166,7 +166,7 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane {
private void initDefinePane() { private void initDefinePane() {
currentEditorDefinePane = null; currentEditorDefinePane = null;
XCreator creator = getXCreatorDedicated(); XCreator creator = XCreatorUtils.getXCreatorInnerWidget(this.xCreator);
FormWidgetDefinePaneFactoryBase.RN rn = FormWidgetDefinePaneFactoryBase.createWidgetDefinePane(creator, designer, creator.toData(), new Operator() { FormWidgetDefinePaneFactoryBase.RN rn = FormWidgetDefinePaneFactoryBase.createWidgetDefinePane(creator, designer, creator.toData(), new Operator() {
@Override @Override
public void did(DataCreatorUI ui, String cardName) { public void did(DataCreatorUI ui, String cardName) {
@ -190,11 +190,6 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane {
currentEditorDefinePane = definePane; 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 @Override
public String title4PopupWindow() { public String title4PopupWindow() {
return "Widget"; return "Widget";
@ -283,7 +278,7 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane {
} }
public void fireValueChanged() { public void fireValueChanged() {
XCreator creator = getXCreatorDedicated(); XCreator creator = XCreatorUtils.getXCreatorInnerWidget(this.xCreator);
creator.firePropertyChange(); 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")); 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")); 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")); 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 @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); 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