fr_shine 8 years ago
parent
commit
064586d5c0
  1. 16
      designer_form/src/com/fr/design/designer/creator/XCreator.java
  2. 32
      designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java
  3. 2
      designer_form/src/com/fr/design/designer/creator/XWFitLayout.java
  4. 8
      designer_form/src/com/fr/design/mainframe/EditingMouseListener.java
  5. 3
      designer_form/src/com/fr/design/mainframe/JForm.java

16
designer_form/src/com/fr/design/designer/creator/XCreator.java

@ -601,4 +601,20 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
} }
} }
/**
* 按照比例调整组件的宽度
* @param percent 比例
*/
public void adjustCompWidth(double percent){
return;
}
/**
* 按照比例调整组件的高度
* @param percent 比例
*/
public void adjustCompHeight(double percent) {
return;
}
} }

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

@ -444,4 +444,36 @@ public class XWAbsoluteLayout extends XLayoutContainer {
} }
} }
} }
/**
* body大小手动调整的时候
* 按照比例调整组件的宽度
* @param percent 比例
*/
@Override
public void adjustCompWidth(double percent) {
for (int i = 0; i < getComponentCount(); i++) {
XCreator xCreator = (XCreator) getComponent(i);
Rectangle rectangle = xCreator.getBounds();
xCreator.setBounds((int) (rectangle.x * percent), rectangle.y, (int) (rectangle.width * percent), rectangle.height);
BoundsWidget widget = toData().getBoundsWidget(xCreator.toData());
widget.setBounds(xCreator.getBounds());
}
}
/**
* body大小手动调整的时候
* 按照比例调整组件的高度
* @param percent 比例
*/
@Override
public void adjustCompHeight(double percent) {
for (int i = 0; i < getComponentCount(); i++) {
XCreator xCreator = (XCreator) getComponent(i);
Rectangle rectangle = xCreator.getBounds();
xCreator.setBounds(rectangle.x, (int) (rectangle.y * percent), rectangle.width, (int) (rectangle.height * percent));
BoundsWidget widget = toData().getBoundsWidget(xCreator.toData());
widget.setBounds(xCreator.getBounds());
}
}
} }

2
designer_form/src/com/fr/design/designer/creator/XWFitLayout.java

@ -381,6 +381,7 @@ public class XWFitLayout extends XLayoutContainer {
needAddWidth = Math.max(needAddWidth, MIN_WIDTH-width); needAddWidth = Math.max(needAddWidth, MIN_WIDTH-width);
} }
} }
creator.adjustCompWidth((double) creator.getBounds().width / rec.width);
toData().setBounds(creator.toData(), creator.getBounds()); toData().setBounds(creator.toData(), creator.getBounds());
} }
@ -504,6 +505,7 @@ public class XWFitLayout extends XLayoutContainer {
needAddHeight = Math.max(needAddHeight, MIN_HEIGHT-h); needAddHeight = Math.max(needAddHeight, MIN_HEIGHT-h);
} }
} }
creator.adjustCompHeight((double) creator.getBounds().height / rec.height);
toData().setBounds(creator.toData(), creator.getBounds()); toData().setBounds(creator.toData(), creator.getBounds());
} }

8
designer_form/src/com/fr/design/mainframe/EditingMouseListener.java

@ -288,26 +288,28 @@ public class EditingMouseListener extends MouseInputAdapter {
if (component.isReport()) { if (component.isReport()) {
xElementCase = (XElementCase)component; xElementCase = (XElementCase)component;
UIButton button = (UIButton)xElementCase.getCoverPane().getComponent(0); UIButton button = (UIButton)xElementCase.getCoverPane().getComponent(0);
JComponent button1= (JComponent) xElementCase.getCoverPane().getComponent(1);
if(designer.getCursor().getType() ==Cursor.HAND_CURSOR) { if(designer.getCursor().getType() ==Cursor.HAND_CURSOR) {
designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
} // component.getParent() 是报表块所在的XWTitleLayout } // component.getParent() 是报表块所在的XWTitleLayout
int minX = button.getX() + getParentPositionX(component, 0) - designer.getArea().getHorizontalValue(); int minX = button.getX() + getParentPositionX(component, 0) - designer.getArea().getHorizontalValue();
int minX1 = button1.getX() + getParentPositionX(component, 0) - designer.getArea().getHorizontalValue();
int minY = button.getY() + getParentPositionY(component, 0) - designer.getArea().getVerticalValue(); int minY = button.getY() + getParentPositionY(component, 0) - designer.getArea().getVerticalValue();
int minY1 = button1.getY() + getParentPositionY(component, 0) - designer.getArea().getVerticalValue();
if (e.getX() + GAP - xElementCase.getInsets().left > minX && e.getX() - GAP - xElementCase.getInsets().left < minX + button.getWidth()) { if (e.getX() + GAP - xElementCase.getInsets().left > minX && e.getX() - GAP - xElementCase.getInsets().left < minX + button.getWidth()) {
if (e.getY() + GAP - xElementCase.getInsets().top > minY && e.getY() - GAP - xElementCase.getInsets().top < minY + button.getHeight()) { if (e.getY() + GAP - xElementCase.getInsets().top > minY && e.getY() - GAP - xElementCase.getInsets().top < minY + button.getHeight()) {
designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
} }
} }
xElementCase.setHelpBtnOnFocus(false); xElementCase.setHelpBtnOnFocus(false);
if (xElementCase.getCoverPane().getComponentCount() > 1) {
JComponent button1 = (JComponent) xElementCase.getCoverPane().getComponent(1);
int minX1 = button1.getX() + getParentPositionX(component, 0) - designer.getArea().getHorizontalValue();
int minY1 = button1.getY() + getParentPositionY(component, 0) - designer.getArea().getVerticalValue();
if (e.getX() + GAP - xElementCase.getInsets().left > minX1 && e.getX() - GAP - xElementCase.getInsets().left < minX1 + button1.getWidth()) { if (e.getX() + GAP - xElementCase.getInsets().left > minX1 && e.getX() - GAP - xElementCase.getInsets().left < minX1 + button1.getWidth()) {
if (e.getY() + GAP - xElementCase.getInsets().top > minY1 && e.getY() - GAP - xElementCase.getInsets().top < minY1 + button1.getHeight()) { if (e.getY() + GAP - xElementCase.getInsets().top > minY1 && e.getY() - GAP - xElementCase.getInsets().top < minY1 + button1.getHeight()) {
designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
xElementCase.setHelpBtnOnFocus(true); xElementCase.setHelpBtnOnFocus(true);
} }
} }
}
xElementCase.displayCoverPane(true); xElementCase.displayCoverPane(true);
xElementCase.setDirections(Direction.TOP_BOTTOM_LEFT_RIGHT); xElementCase.setDirections(Direction.TOP_BOTTOM_LEFT_RIGHT);

3
designer_form/src/com/fr/design/mainframe/JForm.java

@ -609,15 +609,16 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance()); EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance());
return; return;
} }
if (formDesign.isReportBlockEditing()) { if (formDesign.isReportBlockEditing()) {
if (elementCaseDesign != null) { if (elementCaseDesign != null) {
EastRegionContainerPane.getInstance().removeParameterPane();
EastRegionContainerPane.getInstance().replaceDownPane(elementCaseDesign.getEastDownPane()); EastRegionContainerPane.getInstance().replaceDownPane(elementCaseDesign.getEastDownPane());
EastRegionContainerPane.getInstance().replaceUpPane(elementCaseDesign.getEastUpPane()); EastRegionContainerPane.getInstance().replaceUpPane(elementCaseDesign.getEastUpPane());
return; return;
} }
} }
EastRegionContainerPane.getInstance().replaceUpPane(WidgetPropertyPane.getInstance(formDesign)); EastRegionContainerPane.getInstance().replaceUpPane(WidgetPropertyPane.getInstance(formDesign));
EastRegionContainerPane.getInstance().addParameterPane(ParameterPropertyPane.getInstance(formDesign)); EastRegionContainerPane.getInstance().addParameterPane(ParameterPropertyPane.getInstance(formDesign));
if (EastRegionContainerPane.getInstance().getDownPane() == null) { if (EastRegionContainerPane.getInstance().getDownPane() == null) {

Loading…
Cancel
Save