Browse Source

REPORT-7111 设计器— 表单—开启“设计手机端专属模板”功能,在报表块中新增了多条画布边缘线

plough 7 years ago
parent
commit
3fca8d2ad1
  1. 9
      designer/src/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java
  2. 14
      designer/src/com/fr/grid/Grid.java
  3. 8
      designer/src/com/fr/grid/GridUI.java

9
designer/src/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java

@ -21,6 +21,7 @@ import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef;
import com.fr.design.present.ConditionAttributesGroupPane;
import com.fr.form.main.Form;
import com.fr.grid.Grid;
import com.fr.js.NameJavaScriptGroup;
import com.fr.page.ReportSettingsProvider;
import com.fr.report.elementcase.TemplateElementCase;
@ -34,7 +35,13 @@ public class FormElementCasePaneDelegate extends ElementCasePane<FormElementCase
public FormElementCasePaneDelegate(FormElementCase sheet, Form form) {
super(sheet);
this.getGrid().setShowPaginateLine(form.getFormMobileAttr().isMobileOnly());
if (form.getFormMobileAttr().isMobileOnly()) {
this.getGrid().setShowPaginateLine(true);
this.getGrid().setPaginateLineShowType(Grid.SINGLE_HORIZONTAL_PAGINATE_LINE);
} else {
this.getGrid().setShowPaginateLine(false);
}
this.addSelectionChangeListener(new SelectionListener() {
@Override
public void selectionChanged(SelectionEvent e) {

14
designer/src/com/fr/grid/Grid.java

@ -48,6 +48,8 @@ public class Grid extends BaseGridComponent {
/**
* If editing, the <code>Component</code> that is handling the editing.
*/
public static final int MULTIPLE_PAGINATE_LINE = 1; // 绘制多条分页线
public static final int SINGLE_HORIZONTAL_PAGINATE_LINE = 2; // 仅绘制一条水平分页线
private static final int VERTICAL_EXTENT_INITIAL_VALUE = 50;
private static final int HORIZONTAL_EXTENT_INITIAL_VALUE = 40;
transient protected Component editorComponent;
@ -58,6 +60,7 @@ public class Grid extends BaseGridComponent {
private Color gridLineColor = UIConstants.RULER_LINE_COLOR; // line color.
private boolean isShowPaginateLine = true;
private int paginateLineShowType = MULTIPLE_PAGINATE_LINE; // 如何绘制分页线
private Color paginationLineColor = Color.RED; // line color of paper
private boolean isShowVerticalFrozenLine = true;
@ -1432,8 +1435,11 @@ public class Grid extends BaseGridComponent {
this.tooltipLocation.setLocation(x, y);
}
// @Override
// public void requestFocus() {
// super.requestFocus();
// }
public int getPaginateLineShowType() {
return paginateLineShowType;
}
public void setPaginateLineShowType(int paginateLineShowType) {
this.paginateLineShowType = paginateLineShowType;
}
}

8
designer/src/com/fr/grid/GridUI.java

@ -237,8 +237,10 @@ public class GridUI extends ComponentUI {
// 分页线
paginateLineList.clear();
boolean isShowVerticalPaginateLine = grid.isShowPaginateLine() && grid.getPaginateLineShowType() == Grid.MULTIPLE_PAGINATE_LINE;
new DrawVerticalLineHelper(grid.getVerticalBeginValue(), verticalEndValue,
grid.isShowGridLine(), grid.isShowPaginateLine(), rowHeightList, paperPaintHeight,
grid.isShowGridLine(), isShowVerticalPaginateLine, rowHeightList, paperPaintHeight,
paginateLineList, realWidth, resolution).iterateStart2End(g2d);
new DrawHorizontalLineHelper(grid.getHorizontalBeginValue(), horizontalEndValue,
@ -607,9 +609,13 @@ public class GridUI extends ComponentUI {
//g2d.setXORMode(Utils.getXORColor(grid.getPaginationLineColor()));
GraphHelper.setStroke(g2d, GraphHelper.getStroke(Constants.LINE_DASH_DOT));
if (grid.getPaginateLineShowType() == Grid.SINGLE_HORIZONTAL_PAGINATE_LINE) {
g2d.draw((Shape) paginateLineList.get(0));
} else {
for (int i = 0, len = paginateLineList.size(); i < len; i++) {
g2d.draw((Shape) paginateLineList.get(i));
}
}
g2d.setPaintMode();
}

Loading…
Cancel
Save