Browse Source

REPORT-60748 决策报表-属性-坐标尺寸交互问题

bugfix/11.0
方磊 3 years ago
parent
commit
c5feb03896
  1. 6
      designer-base/src/main/java/com/fr/design/widget/WidgetBoundsPaneFactory.java
  2. 15
      designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java
  3. 12
      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. 13
      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) {

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