Browse Source

Pull request #7105: REPORT-64062 & REPORT-64079 & REPORT-64112

Merge in DESIGN/design from ~STARRYI/design:REPORT-62689/feature/x to feature/x

* commit '77ba71a7be6404f60122114043416b1c89c2420a':
  REPORT-64112 【模板主题】悬浮元素样式切换,上方的预览图没有即时生效
  REPORT-64079 【主题边框】悬浮元素的样式效果跟交互稿不一致
  REPORT-64062 【主题边框】上一个样式设置边框颜色后,新增的样式默认边框色会记录
feature/x
starryi 3 years ago
parent
commit
9944abee2c
  1. 30
      designer-base/src/main/java/com/fr/design/cell/CellRectangleStylePreviewPane.java
  2. 3
      designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java
  3. 38
      designer-base/src/main/java/com/fr/design/mainframe/theme/ThemedCellStyleListPane.java
  4. 2
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java
  5. 7
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/NameStyleListPane.java
  6. 3
      designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java

30
designer-base/src/main/java/com/fr/design/cell/CellRectangleStylePreviewPane.java

@ -23,27 +23,31 @@ public class CellRectangleStylePreviewPane extends JPanel {
private final int[][] borderSourceFlags = new int[ROW_COUNT][COLUMN_COUNT];
private final CellStylePreviewPane[][] cellStylePreviewPaneGrid = new CellStylePreviewPane[ROW_COUNT][COLUMN_COUNT];
public CellRectangleStylePreviewPane() {
public CellRectangleStylePreviewPane(boolean supportInnerBorder) {
setLayout(new GridLayout(2, 2));
for (int r = 0; r < ROW_COUNT; r++) {
for (int c = 0; c < COLUMN_COUNT; c++) {
CellStylePreviewPane pane = new CellStylePreviewPane();
TemplateCellElement cellElement = DefaultThemedTemplateCellElementCase.createInstance(c, r);
int flags = CellBorderSourceFlag.ALL_BORDER_SOURCE_OUTER;
if (r != 0) {
flags |= CellBorderSourceFlag.TOP_BORDER_SOURCE_INNER;
}
if (r != ROW_COUNT - 1) {
flags |= CellBorderSourceFlag.BOTTOM_BORDER_SOURCE_INNER;
}
if (c != 0) {
flags |= CellBorderSourceFlag.LEFT_BORDER_SOURCE_INNER;
}
if (c != COLUMN_COUNT - 1) {
flags |= CellBorderSourceFlag.RIGHT_BORDER_SOURCE_INNER;
int flags = CellBorderSourceFlag.INVALID_BORDER_SOURCE;
if (supportInnerBorder) {
flags = CellBorderSourceFlag.ALL_BORDER_SOURCE_OUTER;
if (r != 0) {
flags |= CellBorderSourceFlag.TOP_BORDER_SOURCE_INNER;
}
if (r != ROW_COUNT - 1) {
flags |= CellBorderSourceFlag.BOTTOM_BORDER_SOURCE_INNER;
}
if (c != 0) {
flags |= CellBorderSourceFlag.LEFT_BORDER_SOURCE_INNER;
}
if (c != COLUMN_COUNT - 1) {
flags |= CellBorderSourceFlag.RIGHT_BORDER_SOURCE_INNER;
}
}
pane.setStyle(cellElement.getStyle());
add(pane);

3
designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java

@ -223,6 +223,9 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse
} else if (cellBorderStyle.getHorizontalStyle() != Constants.LINE_NONE) {
this.currentLineCombo.setSelectedLineStyle(cellBorderStyle.getHorizontalStyle());
this.currentLineColorPane.setSelectObject(cellBorderStyle.getHorizontalColor());
} else {
this.currentLineCombo.setSelectedLineStyle(Constants.LINE_NONE);
this.currentLineColorPane.setSelectObject(Color.BLACK);
}
}

38
designer-base/src/main/java/com/fr/design/mainframe/theme/ThemedCellStyleListPane.java

@ -4,7 +4,6 @@ import com.fr.base.theme.TemplateTheme;
import com.fr.base.theme.settings.ThemedCellStyle;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.cell.CellRectangleStylePreviewPane;
import com.fr.design.cell.CellStylePreviewPane;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.i18n.Toolkit;
@ -36,14 +35,10 @@ public class ThemedCellStyleListPane extends FurtherBasicBeanPane<ThemedCellStyl
private final JList<ThemedCellStyle> styleList;
private ChangeListener changeListener;
public ThemedCellStyleListPane() {
this(false);
}
public ThemedCellStyleListPane(boolean supportCellRange) {
public ThemedCellStyleListPane(boolean supportInnerBorder) {
defaultListModel = new DefaultListModel<>();
styleList = new JList<>(defaultListModel);
styleList.setCellRenderer(supportCellRange ? new RadioButtonListCellRangeRenderer() : new RadioButtonListCellRenderer());
styleList.setCellRenderer(new RadioButtonListCellRangeRenderer(supportInnerBorder));
styleList.setOpaque(false);
styleList.setBackground(null);
styleList.addListSelectionListener(new ListSelectionListener() {
@ -115,43 +110,18 @@ public class ThemedCellStyleListPane extends FurtherBasicBeanPane<ThemedCellStyl
styleList.setModel(defaultListModel);
}
private static class RadioButtonListCellRenderer extends JPanel implements ListCellRenderer<ThemedCellStyle>, Serializable {
private final UIRadioButton button;
private final CellStylePreviewPane previewArea;
public RadioButtonListCellRenderer() {
super();
setLayout(new BorderLayout(20, 0));
setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
setPreferredSize(new Dimension(getPreferredSize().width, 40));
button = new UIRadioButton();
previewArea = new CellStylePreviewPane();
add(button, BorderLayout.WEST);
add(previewArea, BorderLayout.CENTER);
}
@Override
public Component getListCellRendererComponent(JList<? extends ThemedCellStyle> list, ThemedCellStyle value, int index, boolean isSelected, boolean cellHasFocus) {
button.setSelected(isSelected);
previewArea.setPaintText(value.getName());
previewArea.setStyle(value.getStyle());
return this;
}
}
private static class RadioButtonListCellRangeRenderer extends JPanel implements ListCellRenderer<ThemedCellStyle>, Serializable {
private final UIRadioButton button;
private final CellRectangleStylePreviewPane previewArea;
public RadioButtonListCellRangeRenderer() {
public RadioButtonListCellRangeRenderer(boolean supportInnerBorder) {
super();
setLayout(new BorderLayout(5, 0));
setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0));
button = new UIRadioButton();
button.setBorder(BorderFactory.createEmptyBorder());
previewArea = new CellRectangleStylePreviewPane();
previewArea = new CellRectangleStylePreviewPane(supportInnerBorder);
add(button, BorderLayout.WEST);
add(previewArea, BorderLayout.CENTER);
}

2
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java

@ -116,7 +116,7 @@ public class CellStyleEditPane extends MultiTabPane<ThemedCellStyle> {
jPanel.setLayout(new BorderLayout(0, 4));
JPanel previewPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
previewArea = new CellRectangleStylePreviewPane();
previewArea = new CellRectangleStylePreviewPane(true);
previewArea.setPreferredSize(new Dimension(223, 60));
previewPane.setBorder(BorderUtils.createTitleBorder(i18nText("Fine-Design_Basic_Preview")));
previewPane.add(previewArea, BorderLayout.CENTER);

7
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/NameStyleListPane.java

@ -16,11 +16,8 @@ import com.fr.design.mainframe.theme.ThemedCellStyleListPane;
*/
public class NameStyleListPane extends ThemedCellStyleListPane {
public NameStyleListPane() {
}
public NameStyleListPane(boolean supportCellRange) {
super(supportCellRange);
public NameStyleListPane(boolean supportInnerBorder) {
super(supportInnerBorder);
}
public void populateNameStyle(NameStyle style) {

3
designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java

@ -541,7 +541,8 @@ public class ReportStylePane extends BasicPane {
UITabbedPane mainTabbedPane = new UITabbedPane();
setLayout(FRGUIPaneFactory.createBorderLayout());
nameStyleListPane = new NameStyleListPane();
nameStyleListPane = new NameStyleListPane(false);
nameStyleListPane.addChangeListener(this);
nameStyleListPane.setBorder(BorderFactory.createEmptyBorder());
UIScrollPane scrollPane = new UIScrollPane(nameStyleListPane);
scrollPane.setBorder(BorderFactory.createEmptyBorder(10, 5, 5, 0));

Loading…
Cancel
Save