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. 24
      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);
}
}
creator.adjustCompWidth((double) creator.getBounds().width / rec.width);
toData().setBounds(creator.toData(), creator.getBounds());
}
@ -504,6 +505,7 @@ public class XWFitLayout extends XLayoutContainer {
needAddHeight = Math.max(needAddHeight, MIN_HEIGHT-h);
}
}
creator.adjustCompHeight((double) creator.getBounds().height / rec.height);
toData().setBounds(creator.toData(), creator.getBounds());
}

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

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

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());
return;
}
if (formDesign.isReportBlockEditing()) {
if (elementCaseDesign != null) {
EastRegionContainerPane.getInstance().removeParameterPane();
EastRegionContainerPane.getInstance().replaceDownPane(elementCaseDesign.getEastDownPane());
EastRegionContainerPane.getInstance().replaceUpPane(elementCaseDesign.getEastUpPane());
return;
}
}
EastRegionContainerPane.getInstance().replaceUpPane(WidgetPropertyPane.getInstance(formDesign));
EastRegionContainerPane.getInstance().addParameterPane(ParameterPropertyPane.getInstance(formDesign));
if (EastRegionContainerPane.getInstance().getDownPane() == null) {

Loading…
Cancel
Save