|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
package com.fr.design.cell; |
|
|
|
|
|
|
|
|
|
import com.fr.report.cell.CellElementBorderSourceFlag; |
|
|
|
|
import com.fr.base.CellBorderSourceFlag; |
|
|
|
|
import com.fr.base.CellBorderStyle; |
|
|
|
|
import com.fr.base.Style; |
|
|
|
|
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase; |
|
|
|
@ -20,6 +20,7 @@ public class CellRectangleStylePreviewPane extends JPanel {
|
|
|
|
|
private static final int COLUMN_COUNT = 2; |
|
|
|
|
|
|
|
|
|
private final TemplateCellElement[][] cellElementGrid = new TemplateCellElement[ROW_COUNT][COLUMN_COUNT]; |
|
|
|
|
private final int[][] borderSourceFlags = new int[ROW_COUNT][COLUMN_COUNT]; |
|
|
|
|
private final CellStylePreviewPane[][] cellStylePreviewPaneGrid = new CellStylePreviewPane[ROW_COUNT][COLUMN_COUNT]; |
|
|
|
|
|
|
|
|
|
public CellRectangleStylePreviewPane() { |
|
|
|
@ -29,25 +30,25 @@ public class CellRectangleStylePreviewPane extends JPanel {
|
|
|
|
|
for (int c = 0; c < COLUMN_COUNT; c++) { |
|
|
|
|
CellStylePreviewPane pane = new CellStylePreviewPane(); |
|
|
|
|
TemplateCellElement cellElement = DefaultThemedTemplateCellElementCase.createInstance(c, r); |
|
|
|
|
int flags = CellElementBorderSourceFlag.ALL_BORDER_SOURCE_OUTER; |
|
|
|
|
int flags = CellBorderSourceFlag.ALL_BORDER_SOURCE_OUTER; |
|
|
|
|
if (r != 0) { |
|
|
|
|
flags |= CellElementBorderSourceFlag.TOP_BORDER_SOURCE_INNER; |
|
|
|
|
flags |= CellBorderSourceFlag.TOP_BORDER_SOURCE_INNER; |
|
|
|
|
} |
|
|
|
|
if (r != ROW_COUNT - 1) { |
|
|
|
|
flags |= CellElementBorderSourceFlag.BOTTOM_BORDER_SOURCE_INNER; |
|
|
|
|
flags |= CellBorderSourceFlag.BOTTOM_BORDER_SOURCE_INNER; |
|
|
|
|
} |
|
|
|
|
if (c != 0) { |
|
|
|
|
flags |= CellElementBorderSourceFlag.LEFT_BORDER_SOURCE_INNER; |
|
|
|
|
flags |= CellBorderSourceFlag.LEFT_BORDER_SOURCE_INNER; |
|
|
|
|
} |
|
|
|
|
if (c != COLUMN_COUNT - 1) { |
|
|
|
|
flags |= CellElementBorderSourceFlag.RIGHT_BORDER_SOURCE_INNER; |
|
|
|
|
flags |= CellBorderSourceFlag.RIGHT_BORDER_SOURCE_INNER; |
|
|
|
|
} |
|
|
|
|
cellElement.setBorderSourceFlags(flags); |
|
|
|
|
|
|
|
|
|
pane.setStyle(cellElement.getStyle()); |
|
|
|
|
add(pane); |
|
|
|
|
|
|
|
|
|
cellElementGrid[r][c] = cellElement; |
|
|
|
|
borderSourceFlags[r][c] = flags; |
|
|
|
|
cellStylePreviewPaneGrid[r][c] = pane; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -64,7 +65,8 @@ public class CellRectangleStylePreviewPane extends JPanel {
|
|
|
|
|
for (int j = 0; j < COLUMN_COUNT; j++) { |
|
|
|
|
CellStylePreviewPane pane = cellStylePreviewPaneGrid[i][j]; |
|
|
|
|
TemplateCellElement cellElement = cellElementGrid[i][j]; |
|
|
|
|
cellElement.setStyle(style, borderStyle); |
|
|
|
|
int flag = borderSourceFlags[i][j]; |
|
|
|
|
cellElement.setStyle(CellBorderSourceFlag.deriveBorderedStyle(style, borderStyle, flag)); |
|
|
|
|
|
|
|
|
|
pane.setStyle(cellElement.getStyle()); |
|
|
|
|
} |
|
|
|
|