Browse Source

REPORT-6048 [设计器]绝对画布块中的组件不跟随自适应

MoMeak 8 years ago
parent
commit
a5279b0a07
  1. 10
      designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java
  2. 8
      designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java
  3. 9
      designer_form/src/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java
  4. 1
      designer_form/src/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java

10
designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java

@ -171,16 +171,14 @@ public class XWAbsoluteLayout extends XLayoutContainer {
tabLayout.updateBoundsWidget();
}
}
BoundsWidget boundsWidget = (BoundsWidget) layout.getBoundsWidget(xCreator.toData());
Rectangle rectangle = dealWidgetBound(xCreator.getBounds());
}
private Rectangle calculateBound(Rectangle rec, double pw, double ph) {
Rectangle calRec = new Rectangle(0, 0, 0, 0);
calRec.x = (int) (rec.x / pw);
calRec.y = (int) (rec.y / ph);
calRec.width = (int) (rec.width / pw);
calRec.height = (int) (rec.height / ph);
calRec.x = (int) Math.round(rec.x / pw);
calRec.y = (int) Math.round(rec.y / ph);
calRec.width = (int) Math.round(rec.width / pw);
calRec.height = (int) Math.round(rec.height / ph);
return calRec;
}

8
designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java

@ -17,7 +17,6 @@ import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget;
import com.fr.form.ui.container.WBorderLayout;
import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout;
import com.fr.general.IOUtils;
import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget;
import com.fr.general.Inter;
import java.awt.*;
@ -274,4 +273,11 @@ public class XWCardMainBorderLayout extends XWBorderLayout{
return this;
}
}
/**
* data属性改变触发其他操作
*
*/
public void firePropertyChange(){
}
}

9
designer_form/src/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java

@ -1,7 +1,11 @@
package com.fr.design.widget.ui.designer.component;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XWAbsoluteLayout;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.utils.gui.LayoutUtils;
import com.fr.design.widget.WidgetBoundsPaneFactory;
import com.fr.form.ui.container.WLayout;
import com.fr.general.Inter;
@ -35,6 +39,8 @@ public class WidgetAbsoluteBoundPane extends WidgetBoundPane {
@Override
public void update() {
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
formDesigner.getSelectionModel().getSelection().backupBounds();
super.update();
Rectangle bounds = new Rectangle(creator.getBounds());
bounds.x = (int) x.getValue();
@ -45,6 +51,9 @@ public class WidgetAbsoluteBoundPane extends WidgetBoundPane {
WLayout wabs = parent.toData();
wabs.setBounds(creator.toData(), bounds);
creator.setBounds(bounds);
LayoutUtils.layoutContainer(creator);
XWAbsoluteLayout layout = (XWAbsoluteLayout) parent;
layout.updateBoundsWidget(creator);
}
@Override

1
designer_form/src/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java

@ -81,6 +81,7 @@ public class WidgetBoundPane extends BasicPane {
public void fix() {
Rectangle bounds = new Rectangle(creator.getBounds());
creator.setBackupBound(creator.getBounds());
int w = (int) width.getValue();
int h = (int) height.getValue();
Rectangle rec = ComponentUtils.getRelativeBounds(parent);

Loading…
Cancel
Save