Browse Source

Merge pull request #6707 in DESIGN/design from release/10.0 to bugfix/10.0

* commit '66ca0d8d92c427830a70929fb8caaa4d5b4ffceb':
  REPORT-60748 决策报表-属性-坐标尺寸交互问题
bugfix/10.0
superman 3 years ago
parent
commit
d96b43ad59
  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;
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) {

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

@ -363,4 +363,9 @@ public class XChartEditor extends XBorderStyleWidgetCreator {
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 是否是组件
*/
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;
}
/**
* 把控件例如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() {
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) {
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() {
XCreator innerCreator = getXCreatorDedicated();
XCreator innerCreator = XCreatorUtils.getXCreatorInnerWidget(this.xCreator);
attriCardPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
content.add(attriCardPane, BorderLayout.CENTER);
@ -166,7 +166,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 +190,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 +278,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