Browse Source

控件管理/报表填报属性/超级链接/服务器参数

newui
renekton 5 months ago
parent
commit
f968d68262
  1. 1
      designer-base/src/main/java/com/fr/design/condition/ConditionAttrSingleConditionPane.java
  2. 53
      designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java
  3. 1
      designer-base/src/main/java/com/fr/design/condition/HighLightConditionAction.java
  4. 5
      designer-base/src/main/java/com/fr/design/condition/SingleConditionPane.java
  5. 40
      designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java
  6. 52
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionTableProcedurePane.java
  7. 13
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ItemEditableComboBoxPanel.java
  8. 5
      designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java
  9. 54
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java
  10. 19
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java
  11. 44
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/StoreProcedureParameterPane.java
  12. 3
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/StoreProcedureTableModel.java
  13. 4
      designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java
  14. 9
      designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java
  15. 7
      designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java
  16. 27
      designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableEditorPane.java
  17. 50
      designer-base/src/main/java/com/fr/design/gui/itree/checkboxtree/CheckBoxTreeCellRenderer.java
  18. 1
      designer-base/src/main/java/com/fr/design/gui/style/FollowingThemePane.java
  19. 25
      designer-base/src/main/java/com/fr/design/roleAuthority/ReportAndFSManagePane.java
  20. 156
      designer-base/src/main/java/com/fr/design/style/BorderPane.java
  21. 212
      designer-base/src/main/java/com/fr/design/style/FRFontPane.java
  22. 23
      designer-base/src/main/java/com/fr/design/style/FontFamilyPane.java
  23. 91
      designer-base/src/main/java/com/fr/design/style/FontSizeStylePane.java
  24. 73
      designer-base/src/main/java/com/fr/design/style/FormatPane.java
  25. 8
      designer-base/src/main/java/com/fr/design/style/background/BackgroundButtonPane.java
  26. 7
      designer-base/src/main/java/com/fr/design/style/background/BackgroundCardSwitchButtonPane.java
  27. 47
      designer-base/src/main/java/com/fr/design/style/background/BackgroundPane.java
  28. 7
      designer-base/src/main/java/com/fr/design/style/background/BackgroundPane4Browser.java
  29. 7
      designer-base/src/main/java/com/fr/design/style/background/BackgroundTabPane.java
  30. 56
      designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBackgroundPane.java
  31. 20
      designer-base/src/main/java/com/fr/design/style/background/impl/BPane.java
  32. 50
      designer-base/src/main/java/com/fr/design/style/background/impl/ImageBackgroundPane.java
  33. 3
      designer-base/src/main/java/com/fr/design/style/background/impl/NullBackgroundPane.java
  34. 40
      designer-base/src/main/java/com/fr/design/style/background/impl/PatternBackgroundPane.java
  35. 9
      designer-base/src/main/java/com/fr/design/style/color/ColorAdjustPane.java
  36. 62
      designer-base/src/main/java/com/fr/design/style/color/ColorSelectDetailPane.java
  37. 160
      designer-base/src/main/java/com/fr/design/style/color/CustomChooserPanel.java
  38. 41
      designer-base/src/main/java/com/fr/design/style/color/DetailColorSelectPane.java
  39. 75
      designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java
  40. 9
      designer-base/src/main/java/com/fr/design/style/color/RecentUseColorPane.java
  41. 1
      designer-base/src/main/java/com/fr/design/style/color/UsedColorPane.java
  42. 7
      designer-base/src/main/resources/com/fine/theme/icon/digitalPlatform.svg
  43. 4
      designer-base/src/main/resources/com/fine/theme/icon/logo.svg
  44. 3
      designer-base/src/main/resources/com/fine/theme/icon/pages.svg
  45. 14
      designer-base/src/main/resources/com/fine/theme/icon/previewSql.svg
  46. 8
      designer-base/src/main/resources/com/fine/theme/icon/tables.svg
  47. 3
      designer-base/src/main/resources/com/fine/theme/icon/time.svg
  48. 11
      designer-base/src/main/resources/com/fine/theme/icon/views.svg
  49. 8
      designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json
  50. 41
      designer-chart/src/main/java/com/fr/design/module/ChartEmptyDataStylePane.java
  51. 33
      designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java
  52. 21
      designer-chart/src/main/java/com/fr/design/module/ChartPreStylePane.java
  53. 179
      designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java
  54. 2
      designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java
  55. 29
      designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java
  56. 14
      designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java
  57. 24
      designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditor.java
  58. 44
      designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java
  59. 17
      designer-realize/src/main/java/com/fr/design/condition/BackPane.java
  60. 15
      designer-realize/src/main/java/com/fr/design/condition/BorderHighlightPane.java
  61. 18
      designer-realize/src/main/java/com/fr/design/condition/FontPane.java
  62. 15
      designer-realize/src/main/java/com/fr/design/condition/ForeGroundPane.java
  63. 6
      designer-realize/src/main/java/com/fr/design/condition/HighLightConditionAttributesPane.java
  64. 18
      designer-realize/src/main/java/com/fr/design/condition/HyperlinkPane.java
  65. 15
      designer-realize/src/main/java/com/fr/design/condition/NewRealValuePane.java
  66. 21
      designer-realize/src/main/java/com/fr/design/condition/PaddingPane.java
  67. 15
      designer-realize/src/main/java/com/fr/design/condition/PagePane.java
  68. 16
      designer-realize/src/main/java/com/fr/design/condition/PresentHighlightPane.java
  69. 19
      designer-realize/src/main/java/com/fr/design/condition/WHPane.java
  70. 19
      designer-realize/src/main/java/com/fr/design/condition/WidgetHighlightPane.java
  71. 36
      designer-realize/src/main/java/com/fr/design/headerfooter/HFAttributesEditDialog.java
  72. 13
      designer-realize/src/main/java/com/fr/design/headerfooter/HFComponent.java
  73. 161
      designer-realize/src/main/java/com/fr/design/headerfooter/HeaderFooterEditPane.java
  74. 13
      designer-realize/src/main/java/com/fr/design/headerfooter/HeaderFooterPane.java
  75. 42
      designer-realize/src/main/java/com/fr/design/headerfooter/ImagePane.java
  76. 37
      designer-realize/src/main/java/com/fr/design/mainframe/AuthorityToolBarPane.java
  77. 1
      designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneAuthorityEditPane.java
  78. 44
      designer-realize/src/main/java/com/fr/design/report/NewReportBackgroundPane.java
  79. 149
      designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java
  80. 2
      designer-realize/src/main/java/com/fr/design/report/freeze/FreezeAndRepeatPane.java
  81. 277
      designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java

1
designer-base/src/main/java/com/fr/design/condition/ConditionAttrSingleConditionPane.java

@ -40,6 +40,7 @@ public abstract class ConditionAttrSingleConditionPane<T> extends SingleConditio
conditionAttributesPane.resetUseAbleActionList();
conditionAttributesPane.updateMenuDef();
conditionAttributesPane.checkConditionPane();
conditionAttributesPane.resetWindow();
conditionAttributesPane.redraw();
}

53
designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java

@ -1,6 +1,10 @@
package com.fr.design.condition;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.common.annotations.Open;
import com.fr.design.actions.UpdateAction;
import com.fr.design.beans.BasicBeanPane;
@ -10,14 +14,21 @@ import com.fr.design.menu.ToolBarDef;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.log.FineLoggerFactory;
import javax.swing.BoxLayout;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.awt.Dimension;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
@Open
public abstract class ConditionAttributesPane<T> extends BasicBeanPane<T> {
@ -33,44 +44,47 @@ public abstract class ConditionAttributesPane<T> extends BasicBeanPane<T> {
//可用的Actions.
protected java.util.List<UpdateAction> useAbleActionList = new java.util.ArrayList<UpdateAction>();
protected void initComponents() {
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
// 属性 界面
JPanel propertyChangePane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
this.add(propertyChangePane);
protected JScrollPane selectedItemScrollPane = new JScrollPane();
propertyChangePane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Property") + ":", null));
protected void initComponents() {
this.setLayout(new BorderLayout());
// 选择要改变的属性.
JPanel addItemPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
JPanel addItemPane = new JPanel(new BorderLayout());
ToolBarDef toolbarDef = new ToolBarDef();
menuDef = new CellHighlightAddMenuDef();
menuDef.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Highlight_Click_to_Choose_Property_To_Modify"));
menuDef.setIconPath("com/fr/design/images/control/addPopup.png");
menuDef.setIcon(new LazyIcon("add_popup"));
toolbarDef.addShortCut(menuDef);
updateMenuDef();
UIToolbar toolBar = ToolBarDef.createJToolBar();
toolBar.setLayout(new BorderLayout());
toolBar.setBorder(new FineRoundBorder());
toolBar.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
toolbarDef.updateToolBar(toolBar);
addItemPane.add(toolBar);
addItemPane.add(toolBar, BorderLayout.WEST);
propertyChangePane.add(addItemPane);
addItemPane.setBorder(new FineRoundBorder());
selectedItemPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
// selectedItemPane.setLayout(new BoxLayout(selectedItemPane,BoxLayout.Y_AXIS));
// 选中的添加Itempane
JScrollPane selectedItemScrollPane = new JScrollPane();
selectedItemScrollPane.setViewportView(selectedItemPane);
selectedItemScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
selectedItemScrollPane.setMinimumSize(new Dimension((int) selectedItemScrollPane.getPreferredSize().getWidth(), MIN_HEIGHT));
dealScrollPane(selectedItemScrollPane);
propertyChangePane.add(selectedItemScrollPane);
this.add(FineUIUtils.wrapComponentWithTitle(column(
10,
row(cell(addItemPane),flex()),
cell(selectedItemScrollPane).with(it -> it.setBorder(new FineRoundBorder())),
fix(10)
).getComponent(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Property")), BorderLayout.NORTH);
}
protected void dealScrollPane(JScrollPane scrollPane){
@ -125,6 +139,13 @@ public abstract class ConditionAttributesPane<T> extends BasicBeanPane<T> {
}
}
/**
* 根据所需属性个数设置属性布局大小
*/
public void resetWindow() {
selectedItemScrollPane.setPreferredSize(new Dimension(selectedItemScrollPane.getWidth(), Math.min(35 * (classPaneMap.size() - useAbleActionList.size()), 150)));
}
public void removeConditionAttrSingleConditionPane(JComponent component) {
selectedItemPane.remove(component);
}

1
designer-base/src/main/java/com/fr/design/condition/HighLightConditionAction.java

@ -29,6 +29,7 @@ public class HighLightConditionAction extends UpdateAction {
conditionAttributesPane.removeUpdateActionFromUsableList(this);
conditionAttributesPane.updateMenuDef();
conditionAttributesPane.checkConditionPane();
conditionAttributesPane.resetWindow();
conditionAttributesPane.redraw();
conditionAttrSingleConditionPane.setDefault();
}

5
designer-base/src/main/java/com/fr/design/condition/SingleConditionPane.java

@ -5,6 +5,7 @@ import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import com.fine.theme.icon.LazyIcon;
import com.fr.base.BaseUtils;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.layout.FRGUIPaneFactory;
@ -25,13 +26,11 @@ public abstract class SingleConditionPane<T> extends BasicPane {
if (isRemove) {
if(cancel == null) {
cancel = new UIButton(BaseUtils.readIcon("/com/fr/base/images/cell/control/remove.png"));
cancel = new UIButton(new LazyIcon("remove"));
cancel.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Remove"));
cancel.addActionListener(cancleListener);
cancel.setMargin(new Insets(0, 0, 0, 0));
}
this.add(cancel);
}
}

40
designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java

@ -1,5 +1,7 @@
package com.fr.design.data.datapane;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.icheckbox.UICheckBox;
@ -33,6 +35,9 @@ import java.util.Collections;
import java.util.Date;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
/**
* @author rinoux
* @version 10.0
@ -72,21 +77,24 @@ public class ESDStrategyConfigPane extends BasicBeanPane<StrategyConfig> {
setLayout(FRGUIPaneFactory.createM_BorderLayout());
this.selectAutoUpdate = new UIRadioButton(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Every_Interval"));
this.updateInterval = new UITextField(4);
this.shouldEvolve = new UICheckBox(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Auto_Evolved_Strategy"), false);
this.shouldEvolve.setEnabled(false);
this.shouldEvolve.setBorder(new ScaledEmptyBorder(0, 4, 0, 0));
this.updateIntervalCheckTips = new UILabel(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Error_Interval_Format"));
this.updateIntervalCheckTips.setForeground(Color.RED);
this.updateIntervalCheckTips.setVisible(false);
this.selectBySchema = new UIRadioButton(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Cron"));
this.schemaTime = new UITextField(10);
this.schemaTimeCheckTips = new UILabel(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Error_Time_Format"));
this.schemaTimeCheckTips.setVisible(false);
this.schemaTimeCheckTips.setForeground(Color.RED);
addListener();
addCenterPanel();
}
private void addListener() {
this.selectAutoUpdate.addActionListener(new AbstractAction() {
public void actionPerformed(ActionEvent e) {
ESDStrategyConfigPane.this.selectBySchema.setSelected(!ESDStrategyConfigPane.this.selectAutoUpdate.isSelected());
@ -105,19 +113,7 @@ public class ESDStrategyConfigPane extends BasicBeanPane<StrategyConfig> {
}
});
JPanel pane = FRGUIPaneFactory.createVerticalTitledBorderPane(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Cache_Update_Strategy"));
add(pane, BorderLayout.NORTH);
JPanel row1 = GUICoreUtils.createFlowPane(new Component[]{
this.selectAutoUpdate,
this.updateInterval,
new UILabel(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Minute_Update_Cache")),
this.shouldEvolve,
this.updateIntervalCheckTips
}, 0, 5);
pane.add(row1);
ActionLabel actionLabel = new ActionLabel(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Cron_Help"));
actionLabel = new ActionLabel(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Cron_Help"));
actionLabel.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
@ -128,6 +124,16 @@ public class ESDStrategyConfigPane extends BasicBeanPane<StrategyConfig> {
}
}
});
}
private void addCenterPanel() {
JPanel row1 = GUICoreUtils.createFlowPane(new Component[]{
this.selectAutoUpdate,
this.updateInterval,
new UILabel(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Minute_Update_Cache")),
this.shouldEvolve,
this.updateIntervalCheckTips
}, 0, 5);
JPanel row2 = GUICoreUtils.createFlowPane(new Component[]{
this.selectBySchema,
@ -135,7 +141,9 @@ public class ESDStrategyConfigPane extends BasicBeanPane<StrategyConfig> {
actionLabel,
this.schemaTimeCheckTips
}, 0, 5);
pane.add(row2);
add(FineUIUtils.wrapComponentWithTitle(column(10, cell(row1), cell(row2)).getComponent(),
InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Cache_Update_Strategy")), BorderLayout.NORTH);
}

52
designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionTableProcedurePane.java

@ -1,5 +1,8 @@
package com.fr.design.data.datapane.connect;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineRoundBorder;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.base.BaseUtils;
import com.fr.base.svg.IconUtils;
import com.fr.data.core.db.TableProcedure;
@ -23,9 +26,11 @@ import javax.swing.BorderFactory;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JPanel;
import javax.swing.ToolTipManager;
import javax.swing.UIManager;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -34,6 +39,9 @@ import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* 数据集编辑面板左边的部分
*
@ -62,7 +70,7 @@ public class ConnectionTableProcedurePane extends BasicPane {
}
private void init(SwitchableTableDataPane parent) {
this.setLayout(new BorderLayout(4, 4));
this.setLayout(new BorderLayout(4, 10));
// 初始化数据连接下拉框
initConnectionComboBox(parent);
// 初始化中间的面板
@ -75,6 +83,7 @@ public class ConnectionTableProcedurePane extends BasicPane {
private JPanel initCenterPane() {
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
centerPane.setLayout(new BorderLayout(0, 5));
// 搜索面板
centerPane.add(createSearchPane(), BorderLayout.NORTH);
// 数据库表视图面板
@ -144,8 +153,9 @@ public class ConnectionTableProcedurePane extends BasicPane {
}
});
UIScrollPane tableViewListPane = new UIScrollPane(tableViewList);
tableViewListPane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, UIConstants.ARC));
tableViewListPane.setBorder(new UIRoundedBorder(UIManager.getColor("defaultBorderColor"), 1, UIConstants.ARC));
JPanel tableViewBorderPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
tableViewBorderPane.setLayout(new BorderLayout(0, 5));
tableViewBorderPane.add(tableViewListPane, BorderLayout.CENTER);
JPanel checkBoxgroupPane = createCheckBoxgroupPane();
if (checkBoxgroupPane != null) {
@ -160,32 +170,15 @@ public class ConnectionTableProcedurePane extends BasicPane {
*/
private JPanel createSearchPane() {
JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel searchPane = new JPanel(new BorderLayout(10, 0));
searchPane.setBorder(BorderFactory.createLineBorder(UIConstants.TOOLBAR_BORDER_COLOR));
// searchPane.setBackground(Color.WHITE);
searchField = new UITextField();
searchField.setBorderPainted(false);
searchField.setPlaceholder(Toolkit.i18nText("Fine-Design_Basic_Table_Search"));
searchField.getDocument().addDocumentListener(searchListener);
searchField.addMouseListener(new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent e) {
super.mouseEntered(e);
searchPane.setBorder(BorderFactory.createLineBorder(UIConstants.CHECKBOX_HOVER_SELECTED));
}
@Override
public void mouseExited(MouseEvent e) {
super.mouseExited(e);
searchPane.setBorder(BorderFactory.createLineBorder(UIConstants.TOOLBAR_BORDER_COLOR));
}
});
// 搜索图标
UILabel searchLabel = new UILabel(IconUtils.readIcon("/com/fr/design/images/data/search"));
searchLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));
searchPane.add(searchField, BorderLayout.CENTER);
searchPane.add(searchLabel, BorderLayout.EAST);
panel.add(searchPane, BorderLayout.CENTER);
searchLabel.setBorder(BorderFactory.createEmptyBorder(0, 3, 0, 3));
searchField.setBorder(null);
panel.add(row(cell(searchLabel), cell(searchField).weight(1)).with(it -> it.setBorder(new FineRoundBorder())).getComponent());
panel.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
return panel;
}
@ -199,6 +192,7 @@ public class ConnectionTableProcedurePane extends BasicPane {
protected JPanel createCheckBoxgroupPane() {
JPanel checkBoxgroupPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(2);
checkBoxgroupPane.setLayout(new BorderLayout(20, 0));
JPanel first = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
tableCheckBox = new UICheckBox();
tableCheckBox.setSelected(true);
@ -214,19 +208,19 @@ public class ConnectionTableProcedurePane extends BasicPane {
// 根据环境是否为中文设置不同的显示
if (GeneralContext.isChineseEnv()) {
first.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_SQL_Table"),
BaseUtils.readIcon("/com/fr/design/images/data/tables.png"), UILabel.LEADING));
new LazyIcon("tables"), UILabel.LEADING));
second.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_SQL_View"),
BaseUtils.readIcon("/com/fr/design/images/data/views.png"), UILabel.LEADING));
new LazyIcon("views"), UILabel.LEADING));
} else {
UILabel ui1 = new UILabel(BaseUtils.readIcon("/com/fr/design/images/data/tables.png"), UILabel.LEADING);
UILabel ui2 = new UILabel(BaseUtils.readIcon("/com/fr/design/images/data/views.png"), UILabel.LEADING);
UILabel ui1 = new UILabel(new LazyIcon("tables"), UILabel.LEADING);
UILabel ui2 = new UILabel(new LazyIcon("views"), UILabel.LEADING);
ui1.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_SQL_Table"));
ui2.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_SQL_View"));
first.add(ui1);
second.add(ui2);
}
checkBoxgroupPane.add(first);
checkBoxgroupPane.add(second);
checkBoxgroupPane.add(first, BorderLayout.WEST);
checkBoxgroupPane.add(second, BorderLayout.CENTER);
return checkBoxgroupPane;
}

13
designer-base/src/main/java/com/fr/design/data/datapane/connect/ItemEditableComboBoxPanel.java

@ -1,5 +1,6 @@
package com.fr.design.data.datapane.connect;
import com.fine.theme.icon.LazyIcon;
import com.fr.base.BaseUtils;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.UIComboBox;
@ -7,7 +8,9 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.log.FineLoggerFactory;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.util.Iterator;
import java.util.concurrent.CancellationException;
@ -45,17 +48,21 @@ public abstract class ItemEditableComboBoxPanel extends JPanel {
protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createM_BorderLayout());
Dimension buttonSize = new Dimension(26, 20);
Dimension buttonSize = new Dimension(24, 24);
itemComboBox = new UIComboBox();
itemComboBox.setEnabled(true);
this.add(itemComboBox, BorderLayout.CENTER);
refreshButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/control/refresh.png"));
JPanel jPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_Pane(2, 4 ,4);
refreshButton = new UIButton(new LazyIcon("refresh"));
JPanel jPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_Pane(2, 0 ,4);
editButton = initEditButton(editButton, buttonSize);
editButton.setBorder(null);
editButton.setBackground(new Color(246, 248, 250, 255));
jPanel.add(editButton);
jPanel.add(refreshButton);
this.add(jPanel, BorderLayout.EAST);
refreshButton.setPreferredSize(buttonSize);
refreshButton.setBorder(null);
refreshButton.setBackground(new Color(246, 248, 250, 255));
refreshButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
refreshItems();

5
designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java

@ -1,5 +1,6 @@
package com.fr.design.data.datapane.preview.sql;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.base.Parameter;
import com.fr.base.ParameterHelper;
import com.fr.base.ParameterMapNameSpace;
@ -117,8 +118,7 @@ public class PreviewPerformedSqlPane extends JDialog implements ActionListener {
}
imagePanel.add(imageLabel);
topPanel.add(imagePanel, BorderLayout.WEST);
topPanel.add(messagePanel, BorderLayout.CENTER);
topPanel.add(messagePanel, BorderLayout.WEST);
topPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10));
//中间的SQL面板
@ -141,6 +141,7 @@ public class PreviewPerformedSqlPane extends JDialog implements ActionListener {
}
scrollPane.setViewportView(checkArea);
scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
checkArea.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
centerPanel.add(scrollPane);
//底部的按钮面板

54
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java

@ -1,5 +1,6 @@
package com.fr.design.data.tabledata.tabledatapane;
import com.fine.theme.icon.LazyIcon;
import com.fr.base.Parameter;
import com.fr.base.ParameterHelper;
import com.fr.data.core.db.TableProcedure;
@ -71,6 +72,7 @@ import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.JToolBar;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
import java.awt.BorderLayout;
@ -93,7 +95,7 @@ import java.util.List;
*/
public class DBTableDataPane extends AbstractTableDataPane<DBTableData> implements SwitchableTableDataPane {
private static final int BOTTOM = 6;
private static final int BOTTOM = 9;
private static final String PREVIEW_BUTTON = Toolkit.i18nText("Fine-Design_Basic_Preview");
private static final String REFRESH_BUTTON = Toolkit.i18nText("Fine-Design_Basic_Refresh");
private ConnectionTableProcedurePane connectionTableProcedurePane;
@ -162,7 +164,25 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> implemen
};
editorPane = new UITableEditorPane<>(model);
initConnectionTableProcedurePane();
this.sqlTextPane.addFocusListener(new FocusListener() {
@Override
public void focusGained(FocusEvent e) {
barErrorTips.setVisible(false);
}
@Override
public void focusLost(FocusEvent e) {
if (DBTableDataPane.this.isPreviewOrRefreshButton(e)) {
DBTableDataPane.this.checkParameter();
}
}
});
}
private void initConnectionTableProcedurePane() {
this.connectionTableProcedurePane = new ConnectionTableProcedurePane(this) {
@Override
protected void filter(Connection connection, String conName, List<String> nameList) {
@ -172,7 +192,6 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> implemen
});
}
@Override
protected void addKeyMonitor() {
this.searchField.addKeyListener(new KeyListener() {
@ -196,6 +215,10 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> implemen
});
}
};
addConnectionTableProcedurePaneListener();
}
private void addConnectionTableProcedurePaneListener() {
this.connectionTableProcedurePane.addDoubleClickListener(new ConnectionTableProcedurePane.DoubleClickSelectedNodeOnTreeListener() {
@Override
public void actionPerformed(TableProcedure target) {
@ -210,35 +233,20 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> implemen
DBTableDataPane.this.sqlTextPane.requestFocus();
}
});
this.sqlTextPane.addFocusListener(new FocusListener() {
@Override
public void focusGained(FocusEvent e) {
barErrorTips.setVisible(false);
}
@Override
public void focusLost(FocusEvent e) {
if (DBTableDataPane.this.isPreviewOrRefreshButton(e)) {
DBTableDataPane.this.checkParameter();
}
}
});
}
private void initMainSplitPane() {
Box box = new Box(BoxLayout.Y_AXIS);
JPanel northPane = new JPanel(new BorderLayout(4, 4));
JToolBar editToolBar = createToolBar();
editToolBar.setBorder(null);
northPane.add(editToolBar, BorderLayout.CENTER);
northPane.setBorder(BorderFactory.createEmptyBorder(0, 0, BOTTOM, 0));
RTextScrollPane sqlTextScrollPane = new RTextScrollPane(this.sqlTextPane);
sqlTextScrollPane.setLineNumbersEnabled(true);
sqlTextScrollPane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, UIConstants.ARC));
sqlTextScrollPane.setBorder(new UIRoundedBorder(UIManager.getColor("defaultBorderColor"), 1, UIConstants.ARC));
sqlTextScrollPane.setPreferredSize(new Dimension(680, 600));
JPanel paraMeanPane = new JPanel(new BorderLayout());
@ -262,7 +270,6 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> implemen
this.connectionTableProcedurePane.setMaximumSize(new Dimension(500, 400));
JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, this.connectionTableProcedurePane, sqlSplitPane);
mainSplitPane.setBorder(BorderFactory.createLineBorder(GUICoreUtils.getTitleLineBorderColor()));
mainSplitPane.setOneTouchExpandable(true);
contentPane.add(mainSplitPane, BorderLayout.CENTER);
}
@ -333,6 +340,7 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> implemen
this.barErrorTips.setVisible(false);
esdSettingsBtn = new UIButton(Toolkit.i18nText("Fine-Design_ESD_Strategy_Config"));
esdSettingsBtn.setPreferredSize(new Dimension(72, 24));
esdSettingsBtn.addActionListener(new ActionListener() {
@Override
@ -594,7 +602,7 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> implemen
public PreviewAction() {
setName(PREVIEW_BUTTON);
setMnemonic('P');
setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_file/preview.png"));
setSmallIcon(new LazyIcon("preview"));
}
@ -609,7 +617,7 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> implemen
public PreviewPerformedSQLAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview_Performed_Sql"));
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_file/preview_sql.png"));
this.setSmallIcon(new LazyIcon("preview_sql"));
}
@Override
@ -623,7 +631,7 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> implemen
public EditPageQueryAction() {
this.setName(Toolkit.i18nText("Fine-Design_Basic_Layer_Page_Report_Page_Query"));
this.setMnemonic('L');
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_file/text.png"));
this.setSmallIcon(new LazyIcon("text"));
}
@Override

19
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java

@ -1,5 +1,6 @@
package com.fr.design.data.tabledata.tabledatapane;
import com.fine.theme.icon.LazyIcon;
import com.fr.base.BaseUtils;
import com.fr.base.StoreProcedureParameter;
import com.fr.data.core.db.TableProcedure;
@ -42,6 +43,7 @@ import javax.swing.JPanel;
import javax.swing.JSplitPane;
import javax.swing.JToolBar;
import javax.swing.SwingWorker;
import javax.swing.UIManager;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Dimension;
@ -89,13 +91,15 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
queryText = new UILabel(StringUtils.EMPTY);
Box box = new Box(BoxLayout.Y_AXIS);
JPanel northpane = new JPanel(new BorderLayout(4, 4));
northpane.add(creatToolBar(), BorderLayout.CENTER);
JToolBar editToolBar = creatToolBar();
editToolBar.setBorder(null);
northpane.add(editToolBar, BorderLayout.NORTH);
northpane.setBorder(BorderFactory.createEmptyBorder(0, 0, 6, 0));
storeProcedureContext = new SQLEditPane(SQLEditPane.UNREQUEST_DROPTARGET);
storeProcedureContext.setEditable(false);
UIScrollPane storeProcedureContextPane = new UIScrollPane(storeProcedureContext);
storeProcedureContextPane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, UIConstants.ARC));
storeProcedureContextPane.setBorder(new UIRoundedBorder(UIManager.getColor("defaultBorderColor"), 1, UIConstants.ARC));
storeProcedureContextPane.setPreferredSize(new Dimension(680, 600));
JPanel namePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
@ -122,11 +126,11 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
// 左边的Panel,上面是选择DatabaseConnection的ComboBox,下面DatabaseConnection对应的Table
initconnectionTableProcedurePane();
this.setLayout(new BorderLayout(4, 4));
connectionTableProcedurePane.setMinimumSize(new Dimension(155, 500));
box.setMinimumSize(new Dimension(310, 400));
this.connectionTableProcedurePane.setMinimumSize(new Dimension(230, 400));
this.connectionTableProcedurePane.setMaximumSize(new Dimension(500, 400));
box.setMinimumSize(new Dimension(300, 400));
// 使用SplitPane
JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, connectionTableProcedurePane, sqlSplitPane);
mainSplitPane.setBorder(BorderFactory.createLineBorder(GUICoreUtils.getTitleLineBorderColor()));
mainSplitPane.setOneTouchExpandable(true);
this.add(mainSplitPane, BorderLayout.CENTER);
}
@ -167,6 +171,7 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
isShareCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Is_Share_DBTableData"));
maxPanel = new MaxMemRowCountPanel();
maxPanel.setBorder(null);
maxPanel.setBackground(null);
UIToolbar toolbar = ToolBarDef.createJToolBar();
toolBarDef.updateToolBar(toolbar);
toolbar.add(isShareCheckBox);
@ -376,7 +381,7 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
public PreviewAction(ProcedureDataPane procedureDataPane) {
this.setName(PREVIEW_BUTTON);
this.setMnemonic('P');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/preview.png"));
this.setSmallIcon(new LazyIcon("preview"));
this.procedureDataPane = procedureDataPane;
}
@ -391,7 +396,7 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
protected class RefreshAction extends UITableEditAction {
public RefreshAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Refresh"));
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/refresh.png"));
this.setSmallIcon(new LazyIcon("refresh"));
}
@Override

44
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/StoreProcedureParameterPane.java

@ -1,5 +1,6 @@
package com.fr.design.data.tabledata.tabledatapane;
import com.fine.theme.utils.FineUIUtils;
import com.fr.base.BaseFormula;
import com.fr.base.StoreProcedureParameter;
import com.fr.data.impl.storeproc.StoreProcedureConstants;
@ -21,6 +22,11 @@ import java.awt.*;
import java.util.Date;
import java.util.HashMap;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
public class StoreProcedureParameterPane extends BasicPane {
@ -70,27 +76,25 @@ public class StoreProcedureParameterPane extends BasicPane {
schemaCombo = new UIComboBox();
initUIComboBox(schemaCombo, schemaName);
JPanel namePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
namePane.add(new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name") + ":"), BorderLayout.WEST);
nameField = new UITextField(10);
namePane.add(nameField, BorderLayout.CENTER);
namePane.add(new UILabel(" "), BorderLayout.EAST);
valuePane.add(new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_CellWrite_InsertRow_Default") + ":"), BorderLayout.WEST);
valuePane.add(valueEditPane, BorderLayout.CENTER);
valuePane.add(new UILabel(" "), BorderLayout.EAST);
Component[][] components = {{null},
{namePane},
{addPane("Fine-Design_Basic_Model", 1, schemaCombo)},
{valuePane},
{null}
};
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p, p, p};
double[] columnSize = {p};
JPanel centerPane = TableLayoutHelper.createGapTableLayoutPane(
components, rowSize, columnSize, 20, 10);
this.add(centerPane, BorderLayout.CENTER);
this.add(FineUIUtils.wrapComponentWithTitle(column(
10,
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name"))).weight(0.07),
cell(nameField).weight(0.2),
flex(0.2)
),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Model"))).weight(0.07),
cell(schemaCombo).weight(0.2),
flex(0.2)
),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_CellWrite_InsertRow_Default"))).weight(0.07),
cell(valueEditPane).weight(0.2),
flex(0.2)
)).getComponent(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter")));
}
private JPanel addPane(String s, int i, UIComboBox combo){

3
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/StoreProcedureTableModel.java

@ -35,7 +35,6 @@ public class StoreProcedureTableModel extends UITableModelAdapter<StoreProcedure
final StoreProcedureParameterPane pane = new StoreProcedureParameterPane();
pane.populate(spp);
pane.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter")));
BasicDialog stpEditDialog = pane.showWindow(DesignerContext.getDesignerFrame());
stpEditDialog.addDialogActionListener(new DialogActionAdapter() {
@ -89,7 +88,6 @@ public class StoreProcedureTableModel extends UITableModelAdapter<StoreProcedure
StoreProcedureParameter para = new StoreProcedureParameter();
final StoreProcedureParameterPane pane = new StoreProcedureParameterPane();
pane.populate(para);
pane.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter")));
BasicDialog stpEditDialog = pane.showWindow(DesignerContext.getDesignerFrame());
stpEditDialog.addDialogActionListener(new DialogActionAdapter() {
@ -111,7 +109,6 @@ public class StoreProcedureTableModel extends UITableModelAdapter<StoreProcedure
StoreProcedureParameter para = getSelectedValue();
final StoreProcedureParameterPane pane = new StoreProcedureParameterPane();
pane.populate(para);
pane.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter")));
BasicDialog stpEditDialog = pane.showWindow(DesignerContext.getDesignerFrame());
stpEditDialog.addDialogActionListener(new DialogActionAdapter() {

4
designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java

@ -35,6 +35,7 @@ import javax.swing.event.ListSelectionListener;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
@ -377,13 +378,12 @@ public abstract class JListControlPane extends JControlPane implements ListContr
//iconLabel和textLabel的背景颜色不会被JList背景颜色覆盖,开发者自定义
this.textLabel.setOpaque(true);
this.iconLabel.setOpaque(true);
this.setBorder(FineBorderFactory.createUnderlineBorder(FlatUIUtils.getUIColor("defaultBorderColor", Color.GRAY)));
}
@Override
public Component getListCellRendererComponent(JList list, Object value,
int index, boolean isSelected, boolean cellHasFocus) {
setPreferredSize(new Dimension(list.getWidth(), 24));
if (value instanceof ListModelElement) {
ListModelElement element = ((ListModelElement) value);
Nameable nameable = element.wrapper;

9
designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java

@ -167,4 +167,13 @@ public class FineTabbedPane extends Column {
public Component getSelectedComponent() {
return tabComponents.get(String.valueOf(tabGroup.getSelectedItem()));
}
/**
* 获取当前选中的Tab组件下标
*
* @return indx
*/
public int getSelectedIndex() {
return tabGroup.getSelectedIndex();
}
}

7
designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java

@ -1,6 +1,7 @@
package com.fr.design.gui.ilist;
import com.fine.theme.icon.LazyIcon;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.base.BaseUtils;
import com.fr.data.core.DataCoreUtils;
import com.fr.data.core.db.TableProcedure;
@ -23,6 +24,7 @@ import javax.swing.Icon;
import javax.swing.JList;
import javax.swing.ListSelectionModel;
import javax.swing.SwingWorker;
import java.awt.Color;
import java.awt.Component;
import java.awt.dnd.DnDConstants;
import java.awt.dnd.DragGestureEvent;
@ -57,6 +59,7 @@ public class TableViewList extends UIList {
// this.setBackground(UIConstants.NORMAL_BACKGROUND);
this.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
this.setCellRenderer(new TableListCellRenderer());
this.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
new TableProcessorTreeDragSource(this, DnDConstants.ACTION_COPY);
this.addFocusListener(new FocusAdapter() {
@ -248,9 +251,9 @@ public class TableViewList extends UIList {
String type = tableProcedure == null ? null : tableProcedure.getType();
Icon icon = null;
if (ComparatorUtils.equals(type, TableProcedure.TABLE)) {
icon = BaseUtils.readIcon("/com/fr/design/images/data/tables.png");
icon = new LazyIcon("tables");
} else if (ComparatorUtils.equals(type, TableProcedure.VIEW)) {
icon = BaseUtils.readIcon("/com/fr/design/images/data/views.png");
icon = new LazyIcon("views");
} else {
icon = new LazyIcon("store_procedure");
}

27
designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableEditorPane.java

@ -6,13 +6,15 @@ import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import sun.swing.table.DefaultTableCellHeaderRenderer;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.SwingConstants;
import javax.swing.UIManager;
import javax.swing.event.TableModelListener;
import javax.swing.table.DefaultTableCellRenderer;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.GridLayout;
import java.awt.Insets;
import java.util.List;
@ -37,6 +39,7 @@ public class UITableEditorPane<T> extends BasicPane {
public UITableEditorPane(UITableModelAdapter<T> model) {
this.tableModel = model;
this.initComponent(model.createAction());
this.editTable.getTableHeader().setDefaultRenderer(new TableHeaderRenderer());
}
public UITableEditorPane(UITableModelAdapter<T> model, JPanel panel) {
@ -48,6 +51,7 @@ public class UITableEditorPane<T> extends BasicPane {
leftLabelName = s;
this.tableModel = model;
this.initComponent(model.createAction());
this.editTable.getTableHeader().setDefaultRenderer(new TableHeaderRenderer());
}
protected void initComponent(UITableEditAction[] action) {
@ -62,9 +66,7 @@ public class UITableEditorPane<T> extends BasicPane {
UILabel l = new UILabel(leftLabelName);
editTable = tableModel.createTable();
DefaultTableCellHeaderRenderer headerRenderer = new DefaultTableCellHeaderRenderer();
headerRenderer.setHorizontalAlignment(SwingConstants.LEFT);
editTable.getTableHeader().setDefaultRenderer(headerRenderer);
UIScrollPane scrollPane = new UIScrollPane(editTable);
scrollPane.setBorder(new FineRoundBorder());
pane.add(scrollPane, BorderLayout.CENTER);
@ -86,7 +88,7 @@ public class UITableEditorPane<T> extends BasicPane {
buttonPane = new JPanel();
if (action != null) {
buttonPane.setLayout(new GridLayout(1, action.length, 6, 3));
buttonPane.setLayout(new GridLayout(1, action.length, 3, 3));
for (int i = 0; i < action.length; i++) {
final UIButton newButton = new UIButton(action[i]);
newButton.set4ToolbarButton();
@ -185,4 +187,19 @@ public class UITableEditorPane<T> extends BasicPane {
editTable.getTableHeader().setResizingAllowed(resizingAllowed);
}
/**
* 设置 TableHeader 文字左对齐
*/
public static class TableHeaderRenderer extends DefaultTableCellRenderer {
public TableHeaderRenderer() {
setHorizontalAlignment(SwingConstants.LEFT);
}
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
setBorder(UIManager.getBorder("TableHeader.cellBorder"));
return this;
}
}
}

50
designer-base/src/main/java/com/fr/design/gui/itree/checkboxtree/CheckBoxTreeCellRenderer.java

@ -6,12 +6,14 @@
package com.fr.design.gui.itree.checkboxtree;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JTree;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
@ -54,12 +56,15 @@ public class CheckBoxTreeCellRenderer extends NullPanel implements TreeCellRende
public CheckBoxTreeCellRenderer(TreeCellRenderer renderer) {
if (noFocusBorder == null) {
noFocusBorder = new EmptyBorder(1, 1, 1, 1);
noFocusBorder = new ScaledEmptyBorder(1, 1, 1, 10);
}
_checkBox.setOpaque(false);
setBorder(noFocusBorder);
setLayout(FRGUIPaneFactory.createBorderLayout());
add(_checkBox, BorderLayout.BEFORE_LINE_BEGINS);
add(_checkBox, BorderLayout.WEST);
JPanel gapPanel = new JPanel();
gapPanel.setPreferredSize(new Dimension(4, 20));
add(gapPanel, BorderLayout.CENTER);
_actualTreeRenderer = renderer;
}
@ -76,19 +81,7 @@ public class CheckBoxTreeCellRenderer extends NullPanel implements TreeCellRende
setComponentOrientation(tree.getComponentOrientation());
TreePath path = tree.getPathForRow(row);
if (path != null && tree instanceof CheckBoxTree) {
CheckBoxTreeSelectionModel selectionModel = ((CheckBoxTree) tree).getCheckBoxTreeSelectionModel();
if (selectionModel != null) {
_checkBox.setEnabled(((CheckBoxTree) tree).isCheckBoxEnabled() && ((CheckBoxTree) tree).isCheckBoxEnabled(path));
if (selectionModel.isPathSelected(path, selectionModel.isDigIn())) {
_checkBox.setState(TristateCheckBox.SELECTED);
} else if (selectionModel.isDigIn() && selectionModel.isPartiallySelected(path)) {
_checkBox.setState(TristateCheckBox.DO_NOT_CARE);
} else {
_checkBox.setState(TristateCheckBox.NOT_SELECTED);
}
}
}
handleCheckBox(tree, path);
if (_actualTreeRenderer != null) {
JComponent treeCellRendererComponent = (JComponent) _actualTreeRenderer.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
@ -103,12 +96,37 @@ public class CheckBoxTreeCellRenderer extends NullPanel implements TreeCellRende
remove((Component) this._actualTreeRenderer);
add(treeCellRendererComponent);
add(treeCellRendererComponent, BorderLayout.EAST);
}
return this;
}
private void handleCheckBox(JTree tree, TreePath path) {
if (path == null || !(tree instanceof CheckBoxTree)) {
return;
}
CheckBoxTree checkBoxTree = (CheckBoxTree) tree;
CheckBoxTreeSelectionModel selectionModel = checkBoxTree.getCheckBoxTreeSelectionModel();
if (selectionModel == null) {
return;
}
setCheckBoxState(path, selectionModel, checkBoxTree);
}
private void setCheckBoxState(TreePath path, CheckBoxTreeSelectionModel selectionModel, CheckBoxTree checkBoxTree) {
_checkBox.setEnabled(checkBoxTree.isCheckBoxEnabled() && checkBoxTree.isCheckBoxEnabled(path));
if (selectionModel.isPathSelected(path, selectionModel.isDigIn())) {
_checkBox.setState(TristateCheckBox.SELECTED);
} else if (selectionModel.isDigIn() && selectionModel.isPartiallySelected(path)) {
_checkBox.setState(TristateCheckBox.DO_NOT_CARE);
} else {
_checkBox.setState(TristateCheckBox.NOT_SELECTED);
}
}
public String getToolTipText(MouseEvent event) {
if (_actualTreeRenderer instanceof JComponent) {
Point p = event.getPoint();

1
designer-base/src/main/java/com/fr/design/gui/style/FollowingThemePane.java

@ -75,7 +75,6 @@ public class FollowingThemePane extends BasicPane implements UIObserver {
JPanel followingThemePane =
TableLayoutHelper.createGapTableLayoutPane( new Component[][]{new Component[] { followingThemeLabel, FRGUIPaneFactory.createBorderLayoutNorthPaneWithComponent(followingThemeButtonGroup)}},
new double[] { p }, new double[] { SETTING_LABEL_WIDTH, f }, 10, 0);
followingThemePane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
followingThemePane.setVisible(false);
add(followingThemePane, BorderLayout.NORTH);

25
designer-base/src/main/java/com/fr/design/roleAuthority/ReportAndFSManagePane.java

@ -1,5 +1,7 @@
package com.fr.design.roleAuthority;
import com.fine.theme.icon.LazyIcon;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseUtils;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.actions.UpdateAction;
@ -9,6 +11,7 @@ import com.fr.design.data.tabledata.Prepare4DataSourceChange;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.ibutton.UIHeadGroup;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.design.layout.FRGUIPaneFactory;
@ -40,6 +43,10 @@ import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Enumeration;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* 设计器左下角面板用于在权限编辑时存放角色
* Author : daisy
@ -80,17 +87,20 @@ public class ReportAndFSManagePane extends DockingView implements Prepare4DataSo
this.add(iniToolBarPane(), BorderLayout.NORTH);
refreshAction.setEnabled(true);
UIScrollPane scrollPane = new UIScrollPane(roleTree);
scrollPane.setBorder(BorderFactory.createEmptyBorder(0, 24, 0, 0));
scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
initbuttonGroup();
JPanel jPanel = new JPanel(new BorderLayout(4, 4));
JPanel buttonPane = new JPanel(new GridLayout());
buttonPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR));
buttonPane.add(buttonGroup, BorderLayout.CENTER);
jPanel.add(buttonPane, BorderLayout.NORTH);
jPanel.add(scrollPane, BorderLayout.CENTER);
buttonGroup.setBorder(null);
buttonGroup.setOpaque(false);
jPanel.setOpaque(true);
jPanel.add(column(
4,
row(2, cell(new UILabel(new LazyIcon("digitalPlatform"))), cell(buttonGroup)),
cell(scrollPane)
).getComponent());
this.add(jPanel, BorderLayout.CENTER);
jPanel.setBorder(new ScaledEmptyBorder(0, 4, 4, 4));
registerDSChangeListener();
}
@ -197,7 +207,6 @@ public class ReportAndFSManagePane extends DockingView implements Prepare4DataSo
}
}
};
buttonGroup.setBorder(BorderFactory.createMatteBorder(1, LEFT_GAP, 0, 0, UIConstants.LINE_COLOR));
}
/**
@ -253,7 +262,7 @@ public class ReportAndFSManagePane extends DockingView implements Prepare4DataSo
public RefreshAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Refresh"));
this.setSmallIcon("/com/fr/design/images/buttonicon/refresh");
this.setSmallIcon(new LazyIcon("refresh"));
}
@Override

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

@ -3,25 +3,24 @@
*/
package com.fr.design.style;
import com.fine.theme.utils.FineUIUtils;
import com.fr.base.BaseUtils;
import com.fr.base.CellBorderStyle;
import com.fr.base.GraphHelper;
import com.fr.base.Style;
import com.fr.design.border.UITitledBorder;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.VerticalFlowLayout;
import com.fr.design.style.color.ColorSelectBox;
import com.fr.design.style.color.NewColorSelectBox;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.Constants;
import com.fr.stable.CoreConstants;
import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JPanel;
@ -29,10 +28,9 @@ import javax.swing.JToggleButton;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.EventListenerList;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.event.ActionEvent;
@ -40,6 +38,11 @@ import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* CellBorder Pane.
*/
@ -73,7 +76,6 @@ public class BorderPane extends BasicPane {
private LineComboBox currentLineCombo;
private NewColorSelectBox currentLineColorPane;
private UIButton insidebutton;
public BorderPane() {
@ -81,89 +83,57 @@ public class BorderPane extends BasicPane {
}
protected void initComponents() {
borderComponent = new BorderComponent();
topToggleButton = new ToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/top.png"), BorderPane.TOP_BORDER);
horizontalToggleButton = new ToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/horizontal.png"), BorderPane.HORIZONTAL_BORDER);
bottomToggleButton = new ToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/bottom.png"), BorderPane.BOTTOM_BORDER);
initBasicComponents();
JPanel borderAllControlPane = initButtonPanel();
JPanel borderLeftPane = column(flex(), cell(topToggleButton), cell(horizontalToggleButton), cell(bottomToggleButton), flex()).getComponent();
JPanel borderBottomPane = row(flex(), cell(leftToggleButton), cell(verticalToggleButton), cell(rightToggleButton), flex()).getComponent();
this.currentLineColorPane.setSelectObject(Color.BLUE);
Component northPane1 = initNorthPanel();
Component centerPane1 = FineUIUtils.wrapComponentWithTitle(row(5, cell(borderLeftPane),
column(5, row(flex(), cell(borderAllControlPane),flex()), cell(borderComponent).with(it -> it.setPreferredSize(new Dimension(600, 300))), cell(borderBottomPane))
).getComponent(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"));
this.add(column(10, cell(northPane1), cell(centerPane1)).getComponent());
}
leftToggleButton = new ToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/left.png"), BorderPane.LEFT_BORDER);
verticalToggleButton = new ToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/vertical.png"), BorderPane.VERTICAL_BORDER);
rightToggleButton = new ToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/right.png"), BorderPane.RIGHT_BORDER);
private void initBasicComponents() {
borderComponent = new BorderComponent();
topToggleButton = new ToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/top.png"), BorderPane.TOP_BORDER, false);
horizontalToggleButton = new ToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/horizontal.png"), BorderPane.HORIZONTAL_BORDER, false);
bottomToggleButton = new ToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/bottom.png"), BorderPane.BOTTOM_BORDER, false);
leftToggleButton = new ToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/left.png"), BorderPane.LEFT_BORDER, true);
verticalToggleButton = new ToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/vertical.png"), BorderPane.VERTICAL_BORDER, true);
rightToggleButton = new ToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/right.png"), BorderPane.RIGHT_BORDER, true);
this.currentLineCombo = new LineComboBox(CoreConstants.UNDERLINE_STYLE_ARRAY);
this.currentLineColorPane = new NewColorSelectBox(100);
this.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
centerPane.setBorder(UITitledBorder.createBorderWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview")));
JPanel borderAllControlPane = FRGUIPaneFactory.createCenterFlowInnerContainer_S_Pane();
centerPane.add(borderAllControlPane, BorderLayout.NORTH);
borderAllControlPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 4, 0));
borderAllControlPane.add(new UILabel(" "));
// Button reseting borders
borderAllControlPane.add(createVerButtonPane(NO_BORDERS, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_No")));
// Button setting all borders to active with
// current color and current style excepting inside borders
borderAllControlPane.add(createVerButtonPane(EXTERNAL_BORDERS, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_External")));
borderAllControlPane.add(createVerButtonPane(INSIDE_BORDERS, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Inner")));
// Control
JPanel borderPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
centerPane.add(borderPane, BorderLayout.CENTER);
borderPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 4));
borderComponent.addBorderChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
fireStateChanged();
}
});
}
borderPane.add(borderComponent, BorderLayout.CENTER);
JPanel borderLeftPane = new JPanel();
JPanel borderCornerPane = new JPanel();
JPanel borderBottomPane = new JPanel();
borderPane.add(borderLeftPane, BorderLayout.WEST);
JPanel tmpBorderBottomPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
borderPane.add(tmpBorderBottomPane, BorderLayout.SOUTH);
tmpBorderBottomPane.add(borderBottomPane, BorderLayout.CENTER);
tmpBorderBottomPane.add(borderCornerPane, BorderLayout.WEST);
borderLeftPane.setLayout(new VerticalFlowLayout(VerticalFlowLayout.CENTER, 4, 16));
borderLeftPane.add(topToggleButton);
borderLeftPane.add(horizontalToggleButton);
borderLeftPane.add(bottomToggleButton);
borderBottomPane.setLayout(new /**/FlowLayout(FlowLayout.CENTER, 42, 5));
borderBottomPane.add(leftToggleButton);
borderBottomPane.add(verticalToggleButton);
borderBottomPane.add(rightToggleButton);
borderCornerPane.setPreferredSize(new Dimension(borderLeftPane.getPreferredSize().width, borderBottomPane.getPreferredSize().height));
JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
northPane.setBorder(UITitledBorder.createBorderWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Line")));
JPanel rightTopPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
northPane.add(rightTopPane, BorderLayout.NORTH);
JPanel first = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
first.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Style") + ":"));
first.add(this.currentLineCombo);
rightTopPane.add(first, BorderLayout.NORTH);
JPanel second = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
second.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Color") + ":"));
private JPanel initButtonPanel() {
UIButton button1 = createVerButtonPane(NO_BORDERS, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_No"));
UIButton button2 = createVerButtonPane(EXTERNAL_BORDERS, "");
UIButton button3 = createVerButtonPane(INSIDE_BORDERS, "");
ButtonGroup buttonGroup = new ButtonGroup();
buttonGroup.add(button1);
buttonGroup.add(button2);
buttonGroup.add(button3);
return row(cell(button1), cell(button2), cell(button3)).getComponent();
}
second.add(this.currentLineColorPane);
rightTopPane.add(second, BorderLayout.CENTER);
this.currentLineColorPane.setSelectObject(Color.BLACK);
this.add(northPane, BorderLayout.NORTH);
this.add(centerPane, BorderLayout.CENTER);
private Component initNorthPanel() {
return FineUIUtils.wrapComponentWithTitle(column(
10, row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Style"))).weight(0.1),
cell(this.currentLineCombo).weight(0.25),
flex(0.5)),
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Color"))).weight(0.1),
cell(this.currentLineColorPane).weight(0.25),
flex(0.5))
).getComponent(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Line"));
}
public void addChangeListener(ChangeListener changeListener) {
@ -186,15 +156,16 @@ public class BorderPane extends BasicPane {
}
}
private JPanel createVerButtonPane(int display, String text) {
private UIButton createVerButtonPane(int display, String text) {
JPanel verPane = new JPanel();
verPane.setLayout(new VerticalFlowLayout(VerticalFlowLayout.CENTER, 2, 2));
BorderButton button = new BorderButton(display);
if (StringUtils.isNotEmpty(text)) {
button.setText(text);
}
verPane.add(button);
verPane.add(new UILabel(text));
insidebutton = button;
return verPane;
return button;
}
private void refreshAllToggleButtons() {
@ -206,14 +177,6 @@ public class BorderPane extends BasicPane {
rightToggleButton.setSelected(this.cellBorderStyle.getRightStyle() != Constants.LINE_NONE);
}
public CellBorderStyle getCellBorderStyle() {
return this.cellBorderStyle;
}
public void setCellBorderStyle(CellBorderStyle cellBorderStyle) {
this.cellBorderStyle = cellBorderStyle;
}
@Override
protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Border");
@ -282,11 +245,18 @@ public class BorderPane extends BasicPane {
private class ToggleButton extends JToggleButton implements ActionListener {
private int borderType = 0;
public ToggleButton(Icon icon, int borderType) {
/**
* 根据水平 或者 垂直布局设置控件大小
*/
public ToggleButton(Icon icon, int borderType, boolean horizontal) {
super(icon);
this.borderType = borderType;
this.setPreferredSize(new Dimension(32, 32));
if (horizontal) {
this.setPreferredSize(new Dimension(40, 24));
} else {
this.setPreferredSize(new Dimension(24, 40));
}
this.addActionListener(this);
}
@ -346,7 +316,7 @@ public class BorderPane extends BasicPane {
this.setIcon(BaseUtils.readIcon("com/fr/design/images/m_format/in.png"));
}
this.addActionListener(this);
setPreferredSize(new Dimension(32, 32));
setPreferredSize(new Dimension(36, 24));
setFocusPainted(false);
}

212
designer-base/src/main/java/com/fr/design/style/FRFontPane.java

@ -3,34 +3,31 @@
*/
package com.fr.design.style;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.FRContext;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.style.color.ColorSelectBox;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.DesignUtils;
import com.fr.general.DefaultValues;
import com.fr.general.FRFont;
import com.fr.stable.CoreConstants;
import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.JComponent;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.event.EventListenerList;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.ActionEvent;
@ -38,17 +35,24 @@ import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* Pane to edit Font.
*/
public class FRFontPane extends BasicPane {
private FontFamilyPane familyPane;
private FontSizeStylePane fontSizeStylePane;
//foreground.
private ColorSelectBox foregroundColorPane;
private UIComboBox fontNameComboBox;
//underline
private LineComboBox underlineCombo;
@ -76,88 +80,37 @@ public class FRFontPane extends BasicPane {
protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
// 纵向布局 放置list 和 下划线 颜色
JPanel listVPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
this.add(listVPane, BorderLayout.NORTH);
JPanel listHPane =FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(2);
listVPane.add(listHPane);
// 名字
familyPane = new FontFamilyPane();
listHPane.add(familyPane);
fontNameComboBox = new UIComboBox(DesignUtils.getAvailableFontFamilyNames4Report());
this.fontNameComboBox.addActionListener(actionListener);
// 字形和大小
fontSizeStylePane = new FontSizeStylePane();
listHPane.add(fontSizeStylePane);
fontSizeStylePane.getStyleList().addListSelectionListener(listSelectionListener);
//Richie:直接输入FRFont的size.
fontSizeStylePane.getSizeField().getDocument().addDocumentListener(documentListener);
fontSizeStylePane.getSizeField().getDocument().addDocumentListener(new DocumentListener() {
public void changedUpdate(DocumentEvent e) {// 这是更改操作的处理
updatePreviewLabel();
}
public void insertUpdate(DocumentEvent e) {// 这是插入操作的处理
updatePreviewLabel();
}
public void removeUpdate(DocumentEvent e) {// 这是删除操作的处理
updatePreviewLabel();
}
});
fontSizeStylePane.getSizeList().addListSelectionListener(listSelectionListener);
// 下划线 和 颜色
JPanel listVBottomPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(2);
listVPane.add(listVBottomPane);
// underline pane
JPanel underlinePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
listVBottomPane.add(underlinePane);
underlinePane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FRFont_Underline"), null));
this.underlineCombo = new LineComboBox(CoreConstants.UNDERLINE_STYLE_ARRAY);
this.underlineCombo.addActionListener(actionListener);
underlinePane.add(this.underlineCombo, BorderLayout.CENTER);
// foreground
JPanel foregroundPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
listVBottomPane.add(foregroundPane);
foregroundPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Font_Foreground"),null));
foregroundColorPane = new ColorSelectBox(140);
foregroundColorPane.addSelectChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
fireStateChanged();
}
});
foregroundPane.add(foregroundColorPane, BorderLayout.WEST);
// center pane
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.add(centerPane, BorderLayout.CENTER);
centerPane.setLayout(FRGUIPaneFactory.createM_BorderLayout());
// other reportFont dialog
JPanel otherFontPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
centerPane.add(otherFontPane, BorderLayout.WEST);
// otherFontPane.setLayout(FRGUIPaneFactory.createBorderLayout());
initCheckbox();
// preview pane.
preview = new FRFontPreviewArea();
preview.setPreferredSize(FineUIScale.scale(new Dimension(640, 240)));
// effects pane
JPanel effectsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
otherFontPane.add(effectsPane, BorderLayout.CENTER);
// effectsPane.setLayout(FRGUIPaneFactory.createBorderLayout());
effectsPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Font_Effects"),null));
//peteter:这里主动从Context, 获得默认的FRFont的值.
DefaultValues defaultValues = FRContext.getDefaultValues();
populate(defaultValues.getFRFont());
JPanel effectsPane2 = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1);
effectsPane.add(effectsPane2, BorderLayout.NORTH);
addCenterPanel();
}
private void initCheckbox() {
isStrikethroughCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Font_Strikethrough") + " ");
isStrikethroughCheckBox.addChangeListener(changeListener);
isStrikethroughCheckBox.setMnemonic('K');
@ -170,23 +123,6 @@ public class FRFontPane extends BasicPane {
isSubscriptCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Font_Subscript"));
isSubscriptCheckBox.addChangeListener(changeListener);
isSubscriptCheckBox.setMnemonic('B');
effectsPane2.add(this.getLeftJustPane(isStrikethroughCheckBox));
effectsPane2.add(this.getLeftJustPane(isShadowCheckBox));
effectsPane2.add(this.getLeftJustPane(isSuperscriptCheckBox));
effectsPane2.add(this.getLeftJustPane(isSubscriptCheckBox));
// right pane
JPanel rightPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
centerPane.add(rightPane, BorderLayout.CENTER);
// rightPane.setLayout(FRGUIPaneFactory.createBorderLayout());
// preview pane.
preview = new FRFontPreviewArea();
preview.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview")));
rightPane.add(preview, BorderLayout.CENTER);
// Cannot select superscript and subscript in the same time.
this.isSuperscriptCheckBox.addChangeListener(changeListener);
this.isSuperscriptCheckBox.addChangeListener(new ChangeListener() {
@ -204,10 +140,34 @@ public class FRFontPane extends BasicPane {
}
}
});
}
//peteter:这里主动从Context, 获得默认的FRFont的值.
DefaultValues defaultValues = FRContext.getDefaultValues();
populate(defaultValues.getFRFont());
private void addCenterPanel() {
add(column(10,
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FRFont_Family"))).weight(0.1),
cell(fontNameComboBox).weight(0.2),
flex(0.4)
),
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Style_Font_Size"))).weight(0.1),
cell(fontSizeStylePane.fontComboBox).weight(0.25),
fix(5),
cell(fontSizeStylePane.fontSizeComboBox).weight(0.2),
flex(0.15)
),
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FRFont_Underline"))).weight(0.1),
cell(underlineCombo).weight(0.2),
flex(0.4)
),
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Font_Foreground"))).weight(0.1),
cell(foregroundColorPane).weight(0.2),
flex(0.4)
),
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Font_Effects"))).weight(0.1),
row(cell(this.isStrikethroughCheckBox), fix(5), cell(this.isShadowCheckBox), fix(5),
cell(this.isSuperscriptCheckBox), fix(5), cell(this.isSubscriptCheckBox), flex()).weight(0.6)
),
column(5, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"))), cell(preview))
).getComponent());
}
public void addChangeListener(ChangeListener changeListener) {
@ -242,37 +202,6 @@ public class FRFontPane extends BasicPane {
}
};
ListSelectionListener listSelectionListener = new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
fireStateChanged();
}
};
DocumentListener documentListener = new DocumentListener() {
public void changedUpdate(DocumentEvent e) {
fireStateChanged();
}
public void insertUpdate(DocumentEvent e) {
fireStateChanged();
}
public void removeUpdate(DocumentEvent e) {
fireStateChanged();
}
};
//use the method to make all checkbox donot margin == 0.
private JPanel getLeftJustPane(JComponent comp) {
JPanel leftJustPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
// leftJustPane.setLayout(FRGUIPaneFactory.createBorderLayout());
leftJustPane.add(comp, BorderLayout.CENTER);
leftJustPane.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0));
return leftJustPane;
}
@Override
protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Sytle_FRFont");
@ -282,9 +211,24 @@ public class FRFontPane extends BasicPane {
* Use font to populate pane.
*/
public void populate(FRFont frFont) {
familyPane.populate(frFont);
fontSizeStylePane.populate(frFont);
this.fontNameComboBox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
updatePreviewLabel();
}
});
this.fontSizeStylePane.fontComboBox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
updatePreviewLabel();
}
});
this.fontSizeStylePane.fontSizeComboBox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
updatePreviewLabel();
}
});
//foreground.
this.foregroundColorPane.setSelectObject(frFont.getForeground());
@ -297,12 +241,6 @@ public class FRFontPane extends BasicPane {
this.isSuperscriptCheckBox.setSelected(frFont.isSuperscript());
this.isSubscriptCheckBox.setSelected(frFont.isSubscript());
//添加ListHandler.
ListHandler listHandler = new ListHandler();
familyPane.addListSelectionListener(listHandler);
fontSizeStylePane.getStyleList().addListSelectionListener(listHandler);
fontSizeStylePane.getSizeList().addListSelectionListener(listHandler);
//actionlistner
ActionListener updatePreviewActionListener = new ActionListener() {
@ -336,13 +274,13 @@ public class FRFontPane extends BasicPane {
* Update pane to get new font.
*/
public FRFont update() {
double fs = fontSizeStylePane.getSizeField().getValue();
double fs = (double)((int)fontSizeStylePane.fontSizeComboBox.getSelectedItem());
if (!(fs + "").endsWith(".5")) {
fs = (int)fs;
}
return FRFont.getInstance(this.familyPane.getText(),
this.fontSizeStylePane.getStyleList().getSelectedIndex(),
(float)fs,
return FRFont.getInstance((String) this.fontNameComboBox.getSelectedItem(),
this.fontSizeStylePane.fontComboBox.getSelectedIndex(),
(float)((int)fontSizeStylePane.fontSizeComboBox.getSelectedItem()),
this.foregroundColorPane.getSelectObject(),
this.underlineCombo.getSelectedLineStyle(),
@ -393,10 +331,4 @@ public class FRFontPane extends BasicPane {
private void updatePreviewLabel() {
preview.setFontObject(this.update());
}
class ListHandler implements ListSelectionListener {
public void valueChanged(ListSelectionEvent evt) {
updatePreviewLabel();
}
}
}

23
designer-base/src/main/java/com/fr/design/style/FontFamilyPane.java

@ -1,6 +1,8 @@
package com.fr.design.style;
import com.fr.base.Utils;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.DesignUtils;
@ -13,32 +15,35 @@ import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.BorderLayout;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
public class FontFamilyPane extends JPanel {
private UITextField familyField;
private JList familyList;
private UIComboBox familyComBox;
public FontFamilyPane() {
this.init();
}
private void init() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setLayout(new BorderLayout());
// 名字
familyField = new UITextField();
familyField.setEditable(false);
familyList = new JList(DesignUtils.getAvailableFontFamilyNames4Report());
familyList.setVisibleRowCount(4);
familyList.addListSelectionListener(listener);
JPanel familyPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
// familyPane.setLayout(FRGUIPaneFactory.createBorderLayout());
familyPane.add(FRFontPane.createTextFieldListPane("", familyField, familyList), BorderLayout.CENTER);
familyPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FRFont_Family"),null));
familyComBox = new UIComboBox(DesignUtils.getAvailableFontFamilyNames4Report());
this.add(familyPane);
familyList.addListSelectionListener(listener);
this.add(row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FRFont_Family"))).weight(0.1),
cell(familyComBox).weight(0.4)
).getComponent());
}
ListSelectionListener listener = new ListSelectionListener() {

91
designer-base/src/main/java/com/fr/design/style/FontSizeStylePane.java

@ -7,6 +7,8 @@ import javax.swing.JPanel;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UINumberField;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
@ -14,25 +16,22 @@ import com.fr.general.FRFont;
import com.fr.design.utils.gui.GUICoreUtils;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
public class FontSizeStylePane extends JPanel {
private UINumberField sizeField;
private JList sizeList;
private UITextField styleField;
private JList styleList;
public UIComboBox fontComboBox;
public UIComboBox fontSizeComboBox;
public FontSizeStylePane() {
this.init();
}
private void init() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel fontVSizPane = FRGUIPaneFactory.createX_AXISBoxInnerContainer_S_Pane();
this.add(fontVSizPane);
// fontVSizPane.setLayout(new BoxLayout(fontVSizPane, BoxLayout.X_AXIS));
fontVSizPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Style_Font_Size"), null));
String[] styles = {
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Font_Plain"),
@ -40,67 +39,15 @@ public class FontSizeStylePane extends JPanel {
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Font_Italic"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Font_Bold_Italic")};
styleField = new UITextField();
styleField.setEditable(false);
styleList = new JList(styles);
styleList.setVisibleRowCount(4);
JPanel stylePanel = FRFontPane.createTextFieldListPane("", styleField, styleList);
fontVSizPane.add(stylePanel);
fontVSizPane.add(Box.createHorizontalStrut(6));
fontComboBox = new UIComboBox(styles);
fontSizeComboBox = new UIComboBox(FRFontPane.Font_Sizes);
JPanel sizePanel = FRFontPane.createTextFieldListPane("", sizeField = new UINumberField(), sizeList = new JList(FRFontPane.Font_Sizes));
sizeField.setMaxDecimalLength(1);
sizeField.setEditable(false);
sizeList.setVisibleRowCount(4);
fontVSizPane.add(sizePanel);
styleField.setText((String) styleList.getSelectedValue());
sizeList.addListSelectionListener(listener);
styleList.addListSelectionListener(listener);
this.add(row(
10,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Style_Font_Size"))).weight(0.1),
cell(fontComboBox).weight(0.2),
cell(fontSizeComboBox).weight(0.2),
flex(0.2)
).getComponent());
}
ListSelectionListener listener = new ListSelectionListener() {
public void valueChanged(ListSelectionEvent evt) {
Object source = evt.getSource();
if (source == getSizeList()) {
Integer size = (Integer) getSizeList().getSelectedValue();
if (size != null) {
getSizeField().setValue(size.intValue());
}
} else if (source == getStyleList()) {
String style = (String) getStyleList().getSelectedValue();
if (style != null) getStyleField().setText(style);
}
}
};
public UINumberField getSizeField() {
return sizeField;
}
public JList getStyleList() {
return styleList;
}
public JList getSizeList() {
return sizeList;
}
public UITextField getStyleField() {
return styleField;
}
public void populate(FRFont frFont) {
styleList.setSelectedIndex(frFont.getStyle());
sizeList.setSelectedValue(new Integer(frFont.getSize()), true);
sizeField.setValue(frFont.getSize2D());
}
}

73
designer-base/src/main/java/com/fr/design/style/FormatPane.java

@ -3,6 +3,7 @@
*/
package com.fr.design.style;
import com.fine.theme.utils.FineUIUtils;
import com.fr.base.FRContext;
import com.fr.base.TextFormat;
import com.fr.data.core.FormatField;
@ -40,6 +41,10 @@ import java.text.Format;
import java.text.SimpleDateFormat;
import java.util.Date;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* 属性界面中的格式面板
*/
@ -81,43 +86,17 @@ public class FormatPane extends BasicPane {
this.setLayout(FRGUIPaneFactory.createM_BorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
//sample pane
JPanel samplePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.add(samplePane, BorderLayout.NORTH);
samplePane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_StyleFormat_Sample"), null));
samplePane.setLayout(FRGUIPaneFactory.createBorderLayout());
sampleLabel = new UILabel(FormatField.getInstance().getFormatValue());
samplePane.add(sampleLabel, BorderLayout.CENTER);
sampleLabel.setBorder(BorderFactory.createEmptyBorder(2, 4, 4, 4));
sampleLabel.setHorizontalAlignment(SwingConstants.CENTER);
sampleLabel.setFont(FRContext.getDefaultValues().getFRFont());
//left control pane
JPanel leftControlPane =FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1);
this.add(leftControlPane, BorderLayout.WEST);
leftControlPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Style_Format_Category"), null));
initRadioButton();
ButtonGroup categoryButtonGroup = new ButtonGroup();
categoryButtonGroup.add(nullRadioButton);
categoryButtonGroup.add(numberRadioButton);
categoryButtonGroup.add(currencyRadioButton);
categoryButtonGroup.add(percentRadioButton);
categoryButtonGroup.add(thousandthsRadioButton);
categoryButtonGroup.add(scientificRadioButton);
categoryButtonGroup.add(dateRadioButton);
categoryButtonGroup.add(timeRadioButton);
categoryButtonGroup.add(textRadioButton);
initRadioButtonGroup();
//left control pane
JPanel leftControlPane = initLeftControlPane();
leftControlPane.add(this.createRadioCenterPane(nullRadioButton));
leftControlPane.add(this.createRadioCenterPane(numberRadioButton));
leftControlPane.add(this.createRadioCenterPane(currencyRadioButton));
leftControlPane.add(this.createRadioCenterPane(percentRadioButton));
leftControlPane.add(this.createRadioCenterPane(thousandthsRadioButton));
leftControlPane.add(this.createRadioCenterPane(scientificRadioButton));
leftControlPane.add(this.createRadioCenterPane(dateRadioButton));
leftControlPane.add(this.createRadioCenterPane(timeRadioButton));
leftControlPane.add(this.createRadioCenterPane(textRadioButton));
//content pane.
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.add(contentPane, BorderLayout.CENTER);
contentPane.setBorder(BorderFactory.createEmptyBorder(4, 0, 2, 0));
patternTextField = new UITextField();
contentPane.add(patternTextField, BorderLayout.NORTH);
@ -128,6 +107,16 @@ public class FormatPane extends BasicPane {
//init values.
nullRadioButton.setSelected(true);
this.applyRadioActionListener(this.nullRadioButton);
this.add(column(
10,
cell(FineUIUtils.wrapComponentWithTitle(sampleLabel, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_StyleFormat_Sample"))),
row(
10,
cell(FineUIUtils.wrapComponentWithTitle(leftControlPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Style_Format_Category"))).weight(0.1),
cell(contentPane).weight(0.5)
)
).getComponent());
}
private void initRadioButton () {
@ -161,6 +150,32 @@ public class FormatPane extends BasicPane {
textRadioButton.addActionListener(radioActionListener);
}
private void initRadioButtonGroup() {
ButtonGroup categoryButtonGroup = new ButtonGroup();
categoryButtonGroup.add(nullRadioButton);
categoryButtonGroup.add(numberRadioButton);
categoryButtonGroup.add(currencyRadioButton);
categoryButtonGroup.add(percentRadioButton);
categoryButtonGroup.add(thousandthsRadioButton);
categoryButtonGroup.add(scientificRadioButton);
categoryButtonGroup.add(dateRadioButton);
categoryButtonGroup.add(timeRadioButton);
categoryButtonGroup.add(textRadioButton);
}
private JPanel initLeftControlPane() {
JPanel leftControlPane =FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1);
leftControlPane.add(this.createRadioCenterPane(nullRadioButton));
leftControlPane.add(this.createRadioCenterPane(numberRadioButton));
leftControlPane.add(this.createRadioCenterPane(currencyRadioButton));
leftControlPane.add(this.createRadioCenterPane(percentRadioButton));
leftControlPane.add(this.createRadioCenterPane(thousandthsRadioButton));
leftControlPane.add(this.createRadioCenterPane(scientificRadioButton));
leftControlPane.add(this.createRadioCenterPane(dateRadioButton));
leftControlPane.add(this.createRadioCenterPane(timeRadioButton));
leftControlPane.add(this.createRadioCenterPane(textRadioButton));
return leftControlPane;
}
/**
* Create radio center pane.
*/

8
designer-base/src/main/java/com/fr/design/style/background/BackgroundButtonPane.java

@ -19,7 +19,7 @@ public class BackgroundButtonPane extends BackgroundPane {
for (Class<? extends Background> key : BackgroundFactory.buttonKindsOfKey()) {
BackgroundUIWrapper wrapper = BackgroundFactory.getButtonWrapper(key);
wrapper.setIndex(index++);
tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText(wrapper.getTitle()), FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane());
tabbedPaneBuilder.addTab(com.fr.design.i18n.Toolkit.i18nText(wrapper.getTitle()), getTabItemPaneByIndex(wrapper.getIndex()));
}
}
@ -31,11 +31,7 @@ public class BackgroundButtonPane extends BackgroundPane {
BackgroundDetailPane quickPane = cacheMap.get(index);
if (quickPane == null) {
quickPane = BackgroundFactory.createButtonIfAbsent(background == null ? null : background.getClass());
quickPane.addChangeListener(backgroundChangeListener);
cacheMap.put(index, quickPane);
}
tabbedPane.setComponentAt(index, quickPane);
tabbedPane.setSelectedIndex(index);
return quickPane;
}
@ -43,9 +39,7 @@ public class BackgroundButtonPane extends BackgroundPane {
BackgroundDetailPane quickPane = cacheMap.get(index);
if (quickPane == null) {
quickPane = BackgroundFactory.createButtonIfAbsent(index);
tabbedPane.setComponentAt(index, quickPane);
cacheMap.put(index, quickPane);
quickPane.addChangeListener(backgroundChangeListener);
}
return quickPane;
}

7
designer-base/src/main/java/com/fr/design/style/background/BackgroundCardSwitchButtonPane.java

@ -47,7 +47,7 @@ public class BackgroundCardSwitchButtonPane extends BackgroundButtonPane {
for (Class<? extends Background> key : cardSwitchButton.keySet()) {
BackgroundUIWrapper wrapper = cardSwitchButton.get(key);
wrapper.setIndex(index++);
tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText(wrapper.getTitle()), FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane());
tabbedPaneBuilder.addTab(com.fr.design.i18n.Toolkit.i18nText(wrapper.getTitle()), getTabItemPaneByIndex(wrapper.getIndex()));
}
}
@ -63,11 +63,8 @@ public class BackgroundCardSwitchButtonPane extends BackgroundButtonPane {
if (quickPane == null) {
BackgroundUIWrapper uiWrapper = getBackgroundUIWrapper(background);
quickPane = BackgroundFactory.createByWrapper(uiWrapper);
quickPane.addChangeListener(backgroundChangeListener);
cacheMap.put(index, quickPane);
}
tabbedPane.setComponentAt(index, quickPane);
tabbedPane.setSelectedIndex(index);
return quickPane;
}
@ -76,9 +73,7 @@ public class BackgroundCardSwitchButtonPane extends BackgroundButtonPane {
BackgroundDetailPane quickPane = cacheMap.get(index);
if (quickPane == null) {
quickPane = createDetailPaneByIndex(index);
tabbedPane.setComponentAt(index, quickPane);
cacheMap.put(index, quickPane);
quickPane.addChangeListener(backgroundChangeListener);
}
return quickPane;
}

47
designer-base/src/main/java/com/fr/design/style/background/BackgroundPane.java

@ -3,13 +3,12 @@
*/
package com.fr.design.style.background;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.util.HashMap;
import java.util.Map;
import com.fr.base.background.ColorBackground;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.frpane.FineTabbedPane;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
@ -23,10 +22,14 @@ import com.fr.design.style.background.impl.ColorNoThemeBackgroundPane;
import com.fr.general.Background;
import com.fr.log.FineLoggerFactory;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
public class BackgroundPane extends BasicPane {
protected UITabbedPane tabbedPane = null;
protected FineTabbedPane.TabPaneBuilder tabbedPaneBuilder = new FineTabbedPane.TabPaneBuilder();
protected FineTabbedPane tabbedPane = null;
private EventListenerList eventChangeList = new EventListenerList();
protected Map<Integer, BackgroundDetailPane> cacheMap = new HashMap<>();
@ -42,21 +45,12 @@ public class BackgroundPane extends BasicPane {
protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
previewPane = new BackgroundPreviewLabel();
previewPane.addBackgroundChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
fireStateChanged();
}
});
tabbedPane = new UITabbedPane();
this.add(tabbedPane, BorderLayout.CENTER);
initTabPane();
tabbedPane = tabbedPaneBuilder.withHeadRatio(0.65f).build();
tabbedPane.addChangeListener(backgroundChangeListener);
tabbedPane.setPreferredSize(new Dimension(200, 210));
add(column(
cell(tabbedPane)
).getComponent());
}
protected void initTabPane() {
@ -64,7 +58,7 @@ public class BackgroundPane extends BasicPane {
for (Class<? extends Background> key : BackgroundFactory.kindsOfKey()) {
BackgroundUIWrapper wrapper = BackgroundFactory.getWrapper(key);
wrapper.setIndex(index++);
tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText(wrapper.getTitle()), FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane());
tabbedPaneBuilder.addTab(com.fr.design.i18n.Toolkit.i18nText(wrapper.getTitle()), getTabItemPaneByIndex(wrapper.getIndex()));
}
}
@ -98,11 +92,8 @@ public class BackgroundPane extends BasicPane {
BackgroundDetailPane quickPane = cacheMap.get(index);
if (quickPane == null) {
quickPane = BackgroundFactory.createIfAbsent(background == null ? null : background.getClass());
quickPane.addChangeListener(backgroundChangeListener);
cacheMap.put(index, quickPane);
}
tabbedPane.setComponentAt(index, quickPane);
tabbedPane.setSelectedIndex(index);
return quickPane;
}
@ -110,9 +101,7 @@ public class BackgroundPane extends BasicPane {
BackgroundDetailPane quickPane = cacheMap.get(index);
if (quickPane == null) {
quickPane = BackgroundFactory.createIfAbsent(index);
tabbedPane.setComponentAt(index, quickPane);
cacheMap.put(index, quickPane);
quickPane.addChangeListener(backgroundChangeListener);
}
return quickPane;
}
@ -129,9 +118,6 @@ public class BackgroundPane extends BasicPane {
int index = wrapper.getIndex();
BackgroundDetailPane quickPane = getTabItemPane(background, index);
quickPane.populate(background);
tabbedPane.doLayout();
tabbedPane.validate();
}
protected BackgroundUIWrapper getBackgroundUIWrapper(Background background) {
@ -151,16 +137,5 @@ public class BackgroundPane extends BasicPane {
}
return null;
}
/**
* Change listener.
*/
protected ChangeListener backgroundChangeListener = new ChangeListener() {
public void stateChanged(ChangeEvent evt) {
previewPane.setBackgroundObject(update());
previewPane.repaint();
}
};
private BackgroundPreviewLabel previewPane = null;
}

7
designer-base/src/main/java/com/fr/design/style/background/BackgroundPane4Browser.java

@ -18,7 +18,7 @@ public class BackgroundPane4Browser extends BackgroundPane {
for (Class<? extends Background> key : BackgroundFactory.browserKindsOfKey()) {
BackgroundUIWrapper wrapper = BackgroundFactory.getBrowserWrapper(key);
wrapper.setIndex(index++);
tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText(wrapper.getTitle()), FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane());
tabbedPaneBuilder.addTab(com.fr.design.i18n.Toolkit.i18nText(wrapper.getTitle()), getTabItemPaneByIndex(wrapper.getIndex()));
}
}
@ -30,11 +30,8 @@ public class BackgroundPane4Browser extends BackgroundPane {
BackgroundDetailPane quickPane = cacheMap.get(index);
if (quickPane == null) {
quickPane = BackgroundFactory.createBrowserIfAbsent(background == null ? null : background.getClass());
quickPane.addChangeListener(backgroundChangeListener);
cacheMap.put(index, quickPane);
}
tabbedPane.setComponentAt(index, quickPane);
tabbedPane.setSelectedIndex(index);
return quickPane;
}
@ -42,9 +39,7 @@ public class BackgroundPane4Browser extends BackgroundPane {
BackgroundDetailPane quickPane = cacheMap.get(index);
if (quickPane == null) {
quickPane = BackgroundFactory.createBrowserIfAbsent(index);
tabbedPane.setComponentAt(index, quickPane);
cacheMap.put(index, quickPane);
quickPane.addChangeListener(backgroundChangeListener);
}
return quickPane;
}

7
designer-base/src/main/java/com/fr/design/style/background/BackgroundTabPane.java

@ -44,7 +44,7 @@ public class BackgroundTabPane extends BackgroundPane {
for (Class<? extends Background> key : tabpane.keySet()) {
BackgroundUIWrapper wrapper = tabpane.get(key);
wrapper.setIndex(index++);
tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText(wrapper.getTitle()), FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane());
tabbedPaneBuilder.addTab(com.fr.design.i18n.Toolkit.i18nText(wrapper.getTitle()), getTabItemPaneByIndex(wrapper.getIndex()));
}
}
@ -57,11 +57,8 @@ public class BackgroundTabPane extends BackgroundPane {
if (quickPane == null) {
BackgroundUIWrapper uiWrapper = getBackgroundUIWrapper(background);
quickPane = BackgroundFactory.createByWrapper(uiWrapper);
quickPane.addChangeListener(backgroundChangeListener);
cacheMap.put(index, quickPane);
}
tabbedPane.setComponentAt(index, quickPane);
tabbedPane.setSelectedIndex(index);
return quickPane;
}
@ -69,9 +66,7 @@ public class BackgroundTabPane extends BackgroundPane {
BackgroundDetailPane quickPane = cacheMap.get(index);
if (quickPane == null) {
quickPane = createDetailPaneByIndex(index);
tabbedPane.setComponentAt(index, quickPane);
cacheMap.put(index, quickPane);
quickPane.addChangeListener(backgroundChangeListener);
}
return quickPane;
}

56
designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBackgroundPane.java

@ -1,5 +1,6 @@
package com.fr.design.style.background.gradient;
import com.fine.theme.utils.FineUIUtils;
import com.fr.base.background.GradientBackground;
import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel;
@ -20,6 +21,12 @@ import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* 渐变色的面板不是很pp面板应用显得繁琐有写可以写成控件类型比如色彩选择的可以做得花哨点
* @author ben
@ -33,45 +40,44 @@ public class GradientBackgroundPane extends BackgroundDetailPane {
private ChangeListener changeListener = null;
public GradientBackgroundPane() {
// bug 5452 简化GradientPane
JPanel jpanel = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Style_Background_Choose_Gradient_Color"));
jpanel.setPreferredSize(new Dimension(450, 320));
jpanel.setLayout(new BorderLayout());
// neil:增加渐变色拖动条
JPanel gradientPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel blankJp = new JPanel();
gradientBar = new GradientBar(4, DEFAULT_GRADIENT_WIDTH);
blankJp.add(gradientBar);
UILabel jl = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Drag_To_Select_Gradient"));
jl.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 20));
jl.setHorizontalAlignment(SwingConstants.CENTER);
gradientPanel.add(jl, BorderLayout.NORTH);
gradientPanel.add(blankJp, BorderLayout.SOUTH);
jpanel.add(gradientPanel, BorderLayout.NORTH);
JPanel centerPane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
JPanel innercenterPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
centerPane.add(new UILabel(" "));
centerPane.add(innercenterPane);
innercenterPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Gradient_Direction") + ":"));
left2right = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Page_Setup_Horizontal"));
innercenterPane.add(left2right);
left2right.setSelected(true);
left2right.addActionListener(reviewListener);
top2bottom = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Page_Setup_Vertical"));
innercenterPane.add(top2bottom);
top2bottom.addActionListener(reviewListener);
ButtonGroup toggle = new ButtonGroup();
toggle.add(left2right);
toggle.add(top2bottom);
jpanel.add(centerPane, BorderLayout.CENTER);
this.add(jpanel);
JPanel jpanel = column(
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Drag_To_Select_Gradient"))),
flex()
),
fix(100),
row(
flex(),
cell(gradientBar),
flex()
),
fix(100),
row(
5,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Gradient_Direction") + ":")),
cell(left2right),
cell(top2bottom),
flex()
)
).getComponent();
jpanel.setPreferredSize(new Dimension(600, 450));
this.add(FineUIUtils.wrapComponentWithTitle(jpanel, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Style_Background_Choose_Gradient_Color")));
}

20
designer-base/src/main/java/com/fr/design/style/background/impl/BPane.java

@ -1,11 +1,15 @@
package com.fr.design.style.background.impl;
import com.fine.theme.utils.FineUIUtils;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.style.background.BackgroundDetailPane;
import javax.swing.*;
import java.awt.*;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
/**
* Created by richie on 16/5/18.
*/
@ -18,20 +22,16 @@ public abstract class BPane extends BackgroundDetailPane {
protected void initComponents(int nColumn) {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
this.add(contentPane, BorderLayout.NORTH);
// contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS));
// type type.
JPanel typePane = FRGUIPaneFactory.createTitledBorderPane(titleOfTypePane());
contentPane.add(typePane);
JPanel typePane2 = new JPanel();
typePane.add(typePane2);
typePane2.setLayout(layoutOfTypePane(nColumn));
setChildrenOfTypePane(typePane2);
JPanel contentPane = column(
10,
cell(FineUIUtils.wrapComponentWithTitle(typePane2, titleOfTypePane()))
).getComponent();
this.add(contentPane, BorderLayout.NORTH);
setChildrenOfContentPane(contentPane);
}

50
designer-base/src/main/java/com/fr/design/style/background/impl/ImageBackgroundPane.java

@ -1,5 +1,6 @@
package com.fr.design.style.background.impl;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.Style;
import com.fr.base.background.ImageBackground;
import com.fr.base.background.ImageFileBackground;
@ -19,14 +20,20 @@ import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.UIManager;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* Image background pane.
*/
@ -47,36 +54,35 @@ public class ImageBackgroundPane extends BackgroundDetailPane {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
// preview pane
JPanel previewContainerPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
this.add(previewContainerPane, BorderLayout.CENTER);
JPanel previewOwnerPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"));
previewOwnerPane.setLayout(new BorderLayout());
previewContainerPane.add(previewOwnerPane, BorderLayout.CENTER);
previewContainerPane.add(initSelectFilePane(), BorderLayout.EAST);
previewPane = new ImagePreviewPane();
previewOwnerPane.add(new JScrollPane(previewPane));
previewPane.addChangeListener(imageSizeChangeListener);
// init image file chooser.
imageFileChooser = new ImageFileChooser();
imageFileChooser.setMultiSelectionEnabled(false);
this.add(column(
5,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"))),
row(
10,
cell(new JScrollPane(previewPane)).weight(0.65).with(it -> {
it.getViewport().setBackground(Color.WHITE);
it.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, UIManager.getColor("defaultBorderColor")));
}),
cell(initSelectFilePane()).weight(0.1)
).with(it -> it.setPreferredSize(new Dimension(it.getWidth(), 400)))
).with(it -> it.setBorder(new ScaledEmptyBorder(10,10,10,10))).getComponent());
}
public JPanel initSelectFilePane() {
JPanel selectFilePane = FRGUIPaneFactory.createBorderLayout_L_Pane();
selectFilePane.setBorder(BorderFactory.createEmptyBorder(8, 2, 4, 0));
UIButton selectPictureButton = new UIButton(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Image_Select"));
selectFilePane.add(selectPictureButton, BorderLayout.NORTH);
selectPictureButton.setMnemonic('S');
selectPictureButton.addActionListener(selectPictureActionListener);
JPanel layoutPane = FRGUIPaneFactory.createMediumHGapHighTopFlowInnerContainer_M_Pane();
selectFilePane.add(layoutPane, BorderLayout.CENTER);
//布局
defaultRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Layout_Default"));
tiledRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Layout_Image_Titled"));
@ -92,16 +98,20 @@ public class ImageBackgroundPane extends BackgroundDetailPane {
for (UIRadioButton button : imageLayoutButtons()) {
jp.add(button);
}
layoutPane.add(jp);
ButtonGroup layoutBG = new ButtonGroup();
layoutBG.add(defaultRadioButton);
layoutBG.add(tiledRadioButton);
layoutBG.add(extendRadioButton);
layoutBG.add(adjustRadioButton);
defaultRadioButton.setSelected(true);
return selectFilePane;
return column(
15,
cell(selectPictureButton),
column(
15,
cell(jp)
)
).getComponent();
}
protected UIRadioButton[] imageLayoutButtons() {

3
designer-base/src/main/java/com/fr/design/style/background/impl/NullBackgroundPane.java

@ -19,10 +19,9 @@ public class NullBackgroundPane extends BackgroundDetailPane {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
UILabel centerLabel = new UILabel(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Background_Is_Null") + "...");
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Background_Is_Null"));
this.add(centerLabel);
centerLabel.setHorizontalAlignment(SwingConstants.CENTER);
centerLabel.setBorder(BorderFactory.createLineBorder(GUICoreUtils.getTitleLineBorderColor()));
}
public void populate(Background background) {

40
designer-base/src/main/java/com/fr/design/style/background/impl/PatternBackgroundPane.java

@ -1,5 +1,6 @@
package com.fr.design.style.background.impl;
import com.fine.theme.utils.FineUIUtils;
import com.fr.base.GraphHelper;
import com.fr.base.background.PatternBackground;
import com.fr.design.gui.ilable.UILabel;
@ -16,6 +17,10 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.geom.Rectangle2D;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* Pattern background pane.
*/
@ -64,30 +69,27 @@ public class PatternBackgroundPane extends BPane {
protected void setChildrenOfContentPane(JPanel contentPane) {
// colors
JPanel colorPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Colors"));
contentPane.add(colorPane);
foregroundColorPane = new ColorSelectBox(80);
foregroundColorPane.setPreferredSize(new Dimension(80, 24));
backgroundColorPane = new ColorSelectBox(80);
backgroundColorPane.setPreferredSize(new Dimension(80, 24));
foregroundColorPane.setSelectObject(Color.lightGray);
backgroundColorPane.setSelectObject(Color.black);
colorPane.add(Box.createHorizontalStrut(2));
colorPane.add(this.createLabelColorPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Foreground")
+ ":", foregroundColorPane));
colorPane.add(Box.createHorizontalStrut(8));
colorPane.add(this.createLabelColorPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background")
+ ":", backgroundColorPane));
}
private JPanel createLabelColorPane(String text,
ColorSelectBox colorPane) {
JPanel labelColorPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
labelColorPane.add(new UILabel(text));
labelColorPane.add(colorPane);
return labelColorPane;
contentPane.add(FineUIUtils.wrapComponentWithTitle(row(
10,
row(
10,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Foreground") + ":")),
cell(foregroundColorPane)
).weight(0.1),
row(
10,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background") + ":")),
cell(backgroundColorPane)
).weight(0.1),
flex(0.1)
).getComponent(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Colors")));
}
public void populate(Background background) {

9
designer-base/src/main/java/com/fr/design/style/color/ColorAdjustPane.java

@ -1,5 +1,6 @@
package com.fr.design.style.color;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseUtils;
import com.fr.chart.base.ChartConstants;
import com.fr.design.DesignerEnvManager;
@ -13,6 +14,7 @@ import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
@ -36,7 +38,7 @@ public class ColorAdjustPane extends JPanel implements UIObserver {
public static final Color[] DEFAULT_COLORS = ChartConstants.NEW_FEATURES;
private static final int COUNT_OF_ROW = 8;
private static final int COUNT_OF_ROW = 20;
private static final int MAX_BUTTON = 40;
@ -81,10 +83,10 @@ public class ColorAdjustPane extends JPanel implements UIObserver {
private void createContentPane() {
VerticalFlowLayout layout = new VerticalFlowLayout(0, 0, 0);
layout.setAlignLeft(true);
this.setLayout(layout);
this.setLayout(new BorderLayout());
for (int i = 0, size = colorButtons.size(); i < size; i += COUNT_OF_ROW) {
JPanel panel = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
JPanel panel = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(2, 2);
int count = i + COUNT_OF_ROW > colorButtons.size() ? colorButtons.size() : i + COUNT_OF_ROW;
for (int j = i; j < count; j++) {
colorButtons.get(j).setLastButton(false);
@ -124,6 +126,7 @@ public class ColorAdjustPane extends JPanel implements UIObserver {
};
colorButton.addChangeListener(changeListener);
colorButton.setBorder(new ScaledEmptyBorder(0, 0, 0, 15));
return colorButton;
}

62
designer-base/src/main/java/com/fr/design/style/color/ColorSelectDetailPane.java

@ -1,6 +1,11 @@
package com.fr.design.style.color;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.frpane.FineTabbedPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
@ -11,6 +16,10 @@ import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fr.design.i18n.Toolkit.i18nText;
/**
@ -26,9 +35,6 @@ public class ColorSelectDetailPane extends BasicPane {
// 颜色选择器面板
private JColorChooser selectedPanel;
// 最近使用颜色面板
private JPanel recentUsePanel;
// 预览
private JPanel previewPanel;
@ -76,20 +82,12 @@ public class ColorSelectDetailPane extends BasicPane {
swatchChooserPanel = new SwatchChooserPanel();
customChooserPanel = new CustomChooserPanel();
selectedPanel.setChooserPanels(new AbstractColorChooserPanel[]{customChooserPanel, swatchChooserPanel});
this.add(selectedPanel, BorderLayout.NORTH);
// 最近使用面板
recentUsePanel = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Used"));
RecentUseColorPane recent = new RecentUseColorPane(selectedPanel);
recentUsePanel.add(recent);
this.add(recentUsePanel, BorderLayout.CENTER);
selectedPanel.setPreviewPanel(new JPanel());
// 预览
previewPanel = FRGUIPaneFactory.createTitledBorderPaneCenter(i18nText("Fine-Design_Basic_Preview"));
previewPanel = new JPanel(new BorderLayout());
final ColorChooserPreview colorChooserPreview = new ColorChooserPreview();
colorChooserPreview.setBackground(Color.WHITE);
ColorSelectionModel model = selectedPanel.getSelectionModel();
model.addChangeListener(new ChangeListener() {
@Override
@ -99,8 +97,42 @@ public class ColorSelectDetailPane extends BasicPane {
colorChooserPreview.repaint();
}
});
previewPanel.add(colorChooserPreview);
this.add(previewPanel, BorderLayout.SOUTH);
previewPanel.add(row(
flex(),
column(flex(), cell(colorChooserPreview), flex()),
flex()
).getComponent());
add(initCenterPane());
}
private FineTabbedPane buildTabbedPane() {
return FineTabbedPane.builder().withHeadRatio(0.3f)
.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom"), customChooserPanel)
.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Swatch"), swatchChooserPanel).build();
}
private JPanel initCenterPane() {
// 最近使用面板
RecentUseColorPane recent = new RecentUseColorPane(selectedPanel);
UILabel label = new UILabel( i18nText("Fine-Design_Basic_Used"));
FineUIUtils.wrapBoldLabelWithUnderline(label);
FineTabbedPane tabbedPane = buildTabbedPane();
return column(
cell(tabbedPane),
column(
10,
cell(label), cell(recent),
column(
2,
cell(new UILabel(i18nText("Fine-Design_Basic_Preview"))),
cell(previewPanel).with(it -> {
it.setBorder(new FineRoundBorder());
it.setPreferredSize(new Dimension(this.getPreferredSize().width, 120));
it.setBackground(Color.WHITE);
})
)).with(it -> it.setBorder(new ScaledEmptyBorder(0, 10, 0, 10)))
).getComponent();
}
public void populate(Color color){

160
designer-base/src/main/java/com/fr/design/style/color/CustomChooserPanel.java

@ -29,6 +29,12 @@ import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.log.FineLoggerFactory;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* 颜色选择器自定义面板
@ -114,17 +120,17 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
/**
* The default width of the gradient image.
*/
private static final int IMG_WIDTH = 200;
private static final int IMG_WIDTH = 180;
/**
* The default height of the gradient image.
*/
private static final int IMG_HEIGHT = 205;
private static final int IMG_HEIGHT = 180;
/**
* The default width of the track gradient.
*/
private static final int TRACK_WIDTH = 20;
private static final int TRACK_WIDTH = 12;
/**
* The UILabel for Red.
@ -156,6 +162,9 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
private static final int TWENTY_FOUR = 24;
private static final int HEX_FF = 0xff;
private static final int BUTTON_SPINNER_GAP = 5;
private static final int HSB_GAP = 10;
// 占位label
private static final UILabel PLACE_HOLDER_LABEL = new UILabel();
@ -583,8 +592,9 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
* This method builds the DefaultHSBChooserPanel.
*/
protected void buildChooser() {
setLayout(new BorderLayout());
add(buildRightPanel(), BorderLayout.EAST);
setLayout(new BorderLayout(10, 0));
setPreferredSize(new Dimension((int) this.getPreferredSize().getWidth(), 180));
add(buildRightPanel(), BorderLayout.CENTER);
JPanel container = new JPanel();
container.setLayout(new BorderLayout());
@ -679,47 +689,50 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
* @return The right side panel.
*/
private Container buildRightPanel() {
JPanel container = new JPanel();
container.setLayout(new FlowLayout(FlowLayout.RIGHT));
// 主面板
JPanel mainPanel = new JPanel();
mainPanel.setLayout(new BorderLayout(0, 10));
UILabel label = new UILabel();
label.setSize(200, 200);
container.add(label);
container.add(mainPanel);
// hsb和rgb面板
JPanel hsbAndRgbPanel = new JPanel();
hsbAndRgbPanel.setLayout(new BorderLayout(0, 16));
hsbAndRgbPanel.add(initialHSBPanel(), BorderLayout.CENTER);
hsbAndRgbPanel.add(initialRGBPanel(), BorderLayout.SOUTH);
// 十六进制面板
JPanel hexPanel = new JPanel();
hexPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 8, 0));
hexPanel.add(new UILabel("#"));
hexPanel.add(field);
mainPanel.add(hsbAndRgbPanel, BorderLayout.CENTER);
mainPanel.add(hexPanel, BorderLayout.SOUTH);
JPanel rightPane = new JPanel(new BorderLayout());
JPanel container = new JPanel(new BorderLayout());
JButton pickColorButton = PickColorButtonFactory.getPickColorButton(this, PickColorButtonFactory.IconType.ICON18, true);
JPanel blankArea = new JPanel();
blankArea.setPreferredSize(new Dimension(100, 175));
rightPane.add(blankArea, BorderLayout.CENTER);
JPanel buttonPane = new JPanel(new BorderLayout());
buttonPane.add(pickColorButton, BorderLayout.WEST);
rightPane.add(buttonPane, BorderLayout.SOUTH);
container.add(rightPane);
container.add(column(
10,
row(
10,
cell(initialHSBPanel()),
cell(initialRGBPanel()),
flex()
),
row(
BUTTON_SPINNER_GAP,
row(fix((int) hRadio.getPreferredSize().getHeight()), cell(new UILabel("#")), flex()).with(it -> it.setPreferredSize(hRadio.getPreferredSize())),
cell(field),
column(
flex(),
cell(pickColorButton),
flex()
)
)
).getComponent());
return container;
}
//初始化HSB部分
private JPanel initialHSBPanel() {
initButtonGroup();
initSpinner();
MouseAdapter cl = new RadioStateListener();
locked = HLOCKED;
hRadio.setSelected(true);
hRadio.addMouseListener(cl);
sRadio.addMouseListener(cl);
bRadio.addMouseListener(cl);
return column(HSB_GAP, row(BUTTON_SPINNER_GAP, cell(hRadio), cell(hSpinner)),
row(BUTTON_SPINNER_GAP, cell(sRadio), cell(sSpinner)),
row(BUTTON_SPINNER_GAP, cell(bRadio), cell(bSpinner))
).getComponent();
}
private void initButtonGroup() {
hRadio = new UIRadioButton("H");
sRadio = new UIRadioButton("S");
bRadio = new UIRadioButton("B");
@ -727,54 +740,37 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
group.add(hRadio);
group.add(sRadio);
group.add(bRadio);
}
private void initSpinner() {
hSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, 359, 1));
setBackground(hSpinner);
sSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, 100, 1));
setBackground(sSpinner);
bSpinner = new UIBasicSpinner(new SpinnerNumberModel(100, 0, 100, 1));
setBackground(bSpinner);
hSpinner.setEnabled(true);
sSpinner.setEnabled(false);
bSpinner.setEnabled(false);
MouseAdapter cl = new RadioStateListener();
locked = HLOCKED;
hRadio.setSelected(true);
hRadio.addMouseListener(cl);
sRadio.addMouseListener(cl);
bRadio.addMouseListener(cl);
ChangeListener scroll = new ImageScrollListener();
hSpinner.addChangeListener(scroll);
sSpinner.addChangeListener(scroll);
bSpinner.addChangeListener(scroll);
}
JPanel hsbPanel = new JPanel();
hsbPanel.setLayout(new GridLayout(3, 0, 0, 5));
JPanel hPanel = new JPanel();
hPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 10, 0));
hPanel.add(hRadio);
hPanel.add(hSpinner);
hsbPanel.add(hPanel);
JPanel sPanel = new JPanel();
sPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 10, 0));
sPanel.add(sRadio);
sPanel.add(sSpinner);
hsbPanel.add(sPanel);
JPanel lPanel = new JPanel();
lPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 10, 0));
lPanel.add(bRadio);
lPanel.add(bSpinner);
hsbPanel.add(lPanel);
return hsbPanel;
private void setBackground(Component component) {
component.setBackground(Color.WHITE);
}
private JPanel initialRGBPanel() {
// 初始化RGB部分
rSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, 255, 1));
setBackground(rSpinner);
gSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, 255, 1));
setBackground(gSpinner);
bbSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, 255, 1));
setBackground(bbSpinner);
rSpinner.setEnabled(true);
gSpinner.setEnabled(true);
@ -784,31 +780,15 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
TextDocumentListener listen = new TextDocumentListener();
field = new UITextField();
field.setPreferredSize(new Dimension(70, 18));
field.setPreferredSize(new Dimension(hSpinner.getPreferredSize()));
field.getDocument().addDocumentListener(listen);
JPanel rgbPanel = new JPanel();
rgbPanel.setLayout(new GridLayout(3, 0, 0, 5));
JPanel rPanel = new JPanel();
rPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 10, 0));
rPanel.add(R);
rPanel.add(rSpinner);
rgbPanel.add(rPanel);
JPanel gPanel = new JPanel();
gPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 10, 0));
gPanel.add(G);
gPanel.add(gSpinner);
rgbPanel.add(gPanel);
JPanel bPanel = new JPanel();
bPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 10, 0));
bPanel.add(B);
bPanel.add(bbSpinner);
rgbPanel.add(bPanel);
return rgbPanel;
return column(
HSB_GAP,
row(BUTTON_SPINNER_GAP, cell(R), cell(rSpinner)),
row(BUTTON_SPINNER_GAP, cell(G), cell(gSpinner)),
row(BUTTON_SPINNER_GAP, cell(B), cell(bbSpinner))
).getComponent();
}
/**

41
designer-base/src/main/java/com/fr/design/style/color/DetailColorSelectPane.java

@ -11,10 +11,12 @@ import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.geom.Rectangle2D;
import javax.swing.BorderFactory;
import javax.swing.Box;
import com.fine.theme.utils.FineUIUtils;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
@ -23,6 +25,10 @@ import com.fr.design.border.UITitledBorder;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.dialog.BasicPane;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* The detail color select pane.
@ -39,26 +45,12 @@ public class DetailColorSelectPane extends BasicPane {
public DetailColorSelectPane(boolean supportTheme) {
this.setBorder(BorderFactory.createEmptyBorder(4, 4, 0, 4));
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel titledefaultPane=FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Color"));
JPanel defaultPane =FRGUIPaneFactory.createX_AXISBoxInnerContainer_S_Pane();
this.add(titledefaultPane, BorderLayout.WEST);
titledefaultPane.add(defaultPane);
defaultPane.add(Box.createHorizontalStrut(4));
JPanel colorSelectContainPane =FRGUIPaneFactory.createBorderLayout_L_Pane();
defaultPane.add(colorSelectContainPane);
colorSelectPane = NewColorSelectPane.createColorSelectPaneWithTheme(supportTheme);
colorSelectContainPane.add(colorSelectPane, BorderLayout.NORTH);
defaultPane.add(Box.createHorizontalStrut(8));
//color preview
JPanel colorPreviewContainPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
defaultPane.add(colorPreviewContainPane);
JPanel colorPreviewPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
colorPreviewPane.setPreferredSize(new Dimension(180, 60));
colorPreviewContainPane.add(colorPreviewPane, BorderLayout.NORTH);
colorPreviewLabel = new UILabel(" ") {
@ -76,13 +68,26 @@ public class DetailColorSelectPane extends BasicPane {
this.getFont().getStyle(), this.getFont().getSize() + 4));
colorPreviewLabel.setBorder(BorderFactory.createEmptyBorder(0, 2, 2, 2));
colorPreviewPane.add(colorPreviewLabel, BorderLayout.CENTER);
UITitledBorder explainBorder = UITitledBorder.createBorderWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"));
colorPreviewPane.setBorder(explainBorder);
this.addChangeListener(colorPreviewLabelChangeListener);
//use the white as the default color.
this.populate(Color.WHITE);
JPanel center = column(
5,
row(
20,
cell(colorSelectPane.transparentButton).weight(0.2),
cell(new UILabel("<html><font color=gray>" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview") + "</font></html>")).weight(0.36)
),
row(
20,
cell(colorSelectPane.theme).weight(0.2).with(it -> it.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, UIManager.getColor("defaultBorderColor")))),
cell(colorPreviewPane).weight(0.36).with(it -> it.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, UIManager.getColor("defaultBorderColor"))))
)
).getComponent();
this.add(FineUIUtils.wrapComponentWithTitle(center, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Color")));
}
@Override

75
designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java

@ -1,6 +1,8 @@
package com.fr.design.style.color;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.FineColor;
import com.fr.base.theme.FineColorDeriveState;
@ -26,13 +28,15 @@ import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
/**
* @author zhou
@ -59,6 +63,12 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
private final JPanel menuColorPane;
private ColorCell[][] themeColorCellGrid;
// 透明
public UIButton transparentButton = new UIButton();
// 主题
public JPanel theme = new JPanel();
public static NewColorSelectPane createColorSelectPaneWithTheme(boolean supportTheme) {
return new NewColorSelectPane(true, supportTheme);
}
@ -82,34 +92,37 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
initSelectButton(isSupportTransparent);
// center
JPanel centerPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
centerPane.setBorder(new ScaledEmptyBorder(10, 6, 0, 6));
this.add(centerPane, BorderLayout.CENTER);
centerPane.setOpaque(false);
menuColorPane = getMenuColorPane();
if (isSupportThemeColor) {
JPanel themePane = initThemeColorPane();
themePane.setOpaque(false);
themePane.setBorder(new ScaledEmptyBorder(5, 6, 0, 6));
centerPane.add(themePane);
} else {
menuColorPane.setBorder(new ScaledEmptyBorder(5, 6, 0, 6));
centerPane.add(menuColorPane);
menuColorPane.setOpaque(false);
initMenuColorPane();
}
JPanel standardColorPane = new JPanel(new BorderLayout(0, 5));
standardColorPane.setBorder(new ScaledEmptyBorder(10, 0, 0, 0));
standardColorPane.setBorder(new ScaledEmptyBorder(10, 6, 0, 6));
standardColorPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Standard_Color")), BorderLayout.CENTER);
centerPane.add(standardColorPane);
JPanel colorSelectPane = createStandardColorPane();
standardColorPane.add(colorSelectPane, BorderLayout.SOUTH);
standardColorPane.setOpaque(false);
// 增加最近使用 pane
JPanel row1Pane = new JPanel(new BorderLayout(0, 5));
row1Pane.setBorder(new ScaledEmptyBorder(10, 0, 0, 0));
row1Pane.setBorder(new ScaledEmptyBorder(10, 6, 0, 6));
row1Pane.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Used")), BorderLayout.CENTER);
centerPane.add(row1Pane);
// 最近使用
usedColorPane = new NewUsedColorPane(9, this, selectRealTime());
row1Pane.add(usedColorPane.getPane(), BorderLayout.SOUTH);
row1Pane.setOpaque(false);
// mod by anchore 16/11/16
final UIButton customButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_More_Color"));
@ -127,9 +140,26 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
customButton.setCursor(new Cursor(Cursor.HAND_CURSOR));
JPanel centerPane1 = new JPanel(new BorderLayout(0, 0));
centerPane1.setBorder(new ScaledEmptyBorder(8, 0, 9, 0));
centerPane1.setBorder(new ScaledEmptyBorder(10, 6, 6, 6));
centerPane1.add(customButton, BorderLayout.CENTER);
centerPane.add(centerPane1);
centerPane1.setOpaque(false);
theme = column(
cell(centerPane),
cell(standardColorPane),
cell(row1Pane),
cell(centerPane1)
).with(it -> {
it.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
it.setOpaque(true);
if (!isSupportTransparent) {
it.setBorder(new FineRoundBorder());
}
}).getComponent();
this.add(theme, BorderLayout.CENTER);
}
private JPanel createStandardColorPane() {
@ -154,6 +184,9 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
JPanel centerPane = new JPanel(new GridLayout(1, 8, DEFAULT_COLOR_HOR_INTERVAL, 0));
menuColorPane.add(northPane, BorderLayout.NORTH);
menuColorPane.add(centerPane, BorderLayout.CENTER);
menuColorPane.setOpaque(false);
northPane.setOpaque(false);
centerPane.setOpaque(false);
Color[] colorArray = new Color[]{
// 8列主题色
@ -189,10 +222,11 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
northPane.add(themeColorCellGrid[i][0]);
}
for (int i = 0; i < colorArray.length; i++) {
JPanel columnPane = new JPanel(new GridLayout(DEFAULT_DERIVE_COUNT - 1, 1, 0, 0));
JPanel columnPane = new JPanel(new GridLayout(DEFAULT_DERIVE_COUNT - 1, 1, 4, 4));
for (int j = 1; j < DEFAULT_DERIVE_COUNT; j++) {
columnPane.add(themeColorCellGrid[i][j]);
}
columnPane.setOpaque(false);
centerPane.add(columnPane);
}
@ -237,7 +271,9 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
Color[] colorArray = this.getColorArray();
for (int i = 0; i < colorArray.length; i++) {
Color color = colorArray[i] == null ? UsedColorPane.DEFAULT_COLOR : colorArray[i];
menuColorPane.add(new ColorCell(color, this));
ColorCell c = new ColorCell(color, this);
c.setOpaque(false);
menuColorPane.add(c);
}
}
@ -257,11 +293,14 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
protected void initSelectButton(boolean isSupportTransparent) {
this.isSupportTransparent = isSupportTransparent;
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(new UIRoundedBorder(UIConstants.TOOLBAR_BORDER_COLOR, 1, 5));
if (isSupportTransparent) {
UIButton transparentButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_ChartF_Transparency"));
this.add(transparentButton, BorderLayout.NORTH);
JPanel transparentJpanel = new JPanel(new BorderLayout(0, 0));
transparentButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_ChartF_Transparency"));
transparentButton.addActionListener(e -> doTransparent());
transparentButton.setCursor(new Cursor(Cursor.HAND_CURSOR));
transparentJpanel.add(transparentButton, BorderLayout.CENTER);
transparentJpanel.setBorder(new ScaledEmptyBorder(6, 6, 6, 6));
this.add(transparentJpanel, BorderLayout.NORTH);
}
}
@ -397,6 +436,9 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
private void initialComponents() {
int total = columns;
JPanel panel = new JPanel();
// 取色按钮
JButton pickColorButton = PickColorButtonFactory.getPickColorButton(selectable, PickColorButtonFactory.IconType.ICON16, setColorRealTime);
panel.add(pickColorButton);
panel.setLayout(new GridLayout(1, columns + 1, DEFAULT_COLOR_HOR_INTERVAL, 0));
panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
//最近使用颜色
@ -407,9 +449,6 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
UsedColorPane.DEFAULT_COLOR;
panel.add(new ColorCell(color == null ? UsedColorPane.DEFAULT_COLOR : color, selectable));
}
// 取色按钮
JButton pickColorButton = PickColorButtonFactory.getPickColorButton(selectable, PickColorButtonFactory.IconType.ICON16, setColorRealTime);
panel.add(pickColorButton);
this.pane = panel;
}
@ -420,7 +459,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
int total = columns;
Color[] colors = DesignerEnvManager.getEnvManager().getColorConfigManager().getColors();
int size = colors.length;
for (int i = 0; i < total; i++) {
for (int i = 1; i <= total; i++) {
ColorCell cell = (ColorCell) this.pane.getComponent(i);
Color color = i < size ? colors[size - i - 1] : UsedColorPane.DEFAULT_COLOR;
cell.setColor(color == null ? UsedColorPane.DEFAULT_COLOR : color);

9
designer-base/src/main/java/com/fr/design/style/color/RecentUseColorPane.java

@ -18,13 +18,10 @@ public class RecentUseColorPane extends BasicPane implements ColorSelectable {
public RecentUseColorPane(JColorChooser chooser) {
this.chooser = chooser;
// center
JPanel centerPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
this.add(centerPane, BorderLayout.CENTER);
// 最近使用
UsedColorPane pane = new UsedColorPane(2, 10, this);
centerPane.add(pane.getPane());
setLayout(new BorderLayout());
UsedColorPane pane = new UsedColorPane(1, 20, this);
add(pane.getPane(), BorderLayout.WEST);
}
/**

1
designer-base/src/main/java/com/fr/design/style/color/UsedColorPane.java

@ -65,7 +65,6 @@ public class UsedColorPane extends BasicPane {
int total = columns * rows;
JPanel panel = new JPanel();
panel.setLayout(new GridLayout(rows, columns, 1, 1));
panel.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 8));
//最近使用颜色
Color[] colors = DesignerEnvManager.getEnvManager().getColorConfigManager().getColors();
int size = colors.length;

7
designer-base/src/main/resources/com/fine/theme/icon/digitalPlatform.svg

@ -0,0 +1,7 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="4" y="10" width="24" height="18" fill="#B3CFF9"/>
<rect x="4" y="3.99988" width="24" height="8" fill="#5493F2"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.99961 2.59998H26.9996C28.3251 2.59998 29.3996 3.67449 29.3996 4.99998V27C29.3996 28.3255 28.3251 29.4 26.9996 29.4H4.99961C3.67413 29.4 2.59961 28.3255 2.59961 27V4.99998C2.59961 3.67449 3.67413 2.59998 4.99961 2.59998ZM4.99961 3.99998C4.44732 3.99998 3.99961 4.44769 3.99961 4.99998V27C3.99961 27.5523 4.44733 28 4.99961 28H26.9996C27.5519 28 27.9996 27.5523 27.9996 27V4.99998C27.9996 4.44769 27.5519 3.99998 26.9996 3.99998H4.99961Z" fill="#105DD1"/>
<rect x="3" y="11" width="26" height="1.4" fill="#105DD1"/>
<path d="M18.3818 21.0044L23.6075 15.7112C23.9953 15.3184 24.628 15.3143 25.0208 15.7021C25.4136 16.0899 25.4176 16.7226 25.0299 17.1154L19.7943 22.4186C19.0256 23.1973 17.7711 23.2053 16.9924 22.4365L16.989 22.4399L14.1907 19.6599L9.12132 24.7293C8.7308 25.1198 8.09763 25.1198 7.70711 24.7293C7.31658 24.3388 7.31658 23.7056 7.70711 23.3151L12.8008 18.2214C13.5679 17.4543 14.8115 17.4543 15.5786 18.2214L15.5796 18.2204L18.3818 21.0044Z" fill="#105DD1"/>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

4
designer-base/src/main/resources/com/fine/theme/icon/logo.svg

@ -0,0 +1,4 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M10 12.6333H19.8C19.9105 12.6333 20 12.7199 20 12.8267V22.1067C20 22.2134 19.9105 22.3 19.8 22.3H10V30.8067C10 30.9134 9.91046 31 9.8 31H1.2C1.08954 31 1 30.9134 1 30.8067L1 8.76667C1 5.02954 4.13401 2 8 2H9.8C9.91046 2 10 2.08656 10 2.19333V12.6333Z" fill="#2576EF"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M31 2.19333V24.2333C31 27.9705 27.866 31 24 31H22V10.7H12.2C12.0895 10.7 12 10.6134 12 10.5067V2.19333C12 2.08656 12.0895 2 12.2 2H30.8C30.9105 2 31 2.08656 31 2.19333Z" fill="#34B3FA"/>
</svg>

After

Width:  |  Height:  |  Size: 657 B

3
designer-base/src/main/resources/com/fine/theme/icon/pages.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M27 28V13H20C18.8954 13 18 12.1045 18 11V4H5L5 28H27ZM20 4.82843L26.1716 11H20V4.82843ZM5 2C3.89543 2 3 2.89543 3 4V28C3 29.1046 3.89543 30 5 30H27C28.1046 30 29 29.1046 29 28V11.8284C29 11.298 28.7893 10.7893 28.4142 10.4142L20.5858 2.58579C20.2107 2.21071 19.702 2 19.1716 2H5ZM15.1257 23.4731H17.9056C18.0038 23.4731 18.0834 23.5635 18.0834 23.6751L18.0834 25.096C18.0834 25.2075 18.0038 25.298 17.9056 25.298H12.8535C12.7553 25.298 12.6756 25.2075 12.6756 25.096V24.0115L15.0422 20.8298C15.4491 20.2669 15.7311 19.8272 15.8882 19.5106C16.0524 19.1851 16.1345 18.8509 16.1345 18.5079C16.1345 18.1297 16.0488 17.8263 15.8775 17.5976C15.7061 17.369 15.4741 17.2546 15.1814 17.2546C14.8816 17.2546 14.6174 17.3909 14.389 17.6636C14.2022 17.8793 14.0512 18.1716 13.936 18.5402C13.8962 18.6675 13.7633 18.7261 13.6626 18.6543L12.7548 18.0069C12.6887 17.9597 12.657 17.8688 12.6798 17.7839C12.8713 17.0712 13.1948 16.521 13.6501 16.1332C14.1356 15.7111 14.696 15.5 15.3313 15.5C15.8311 15.5 16.263 15.6275 16.6271 15.8826C16.9983 16.1288 17.2803 16.4719 17.473 16.9116C17.6729 17.3514 17.7729 17.8527 17.7729 18.4156C17.7729 18.9697 17.6622 19.4886 17.4409 19.9723C17.2267 20.4472 16.8412 21.0673 16.2844 21.8325L15.1257 23.4731ZM7.26472 18.9072C7.14616 18.9826 7 18.8852 7 18.7309V17.3546C7 17.2845 7.03206 17.2193 7.08469 17.1825L9.35585 15.5962C9.38387 15.5766 9.41613 15.5662 9.44903 15.5662H10.6107C10.709 15.5662 10.7886 15.6567 10.7886 15.7683L10.7886 25.096C10.7886 25.2075 10.709 25.298 10.6107 25.298H9.21249C9.11425 25.298 9.03462 25.2075 9.03462 25.096V17.7823L7.26472 18.9072ZM24.6573 21.1992C24.4289 20.8034 24.0969 20.5044 23.6614 20.3021C24.0184 20.0998 24.2861 19.8184 24.4646 19.4578C24.6502 19.0972 24.743 18.6706 24.743 18.1781C24.743 17.6504 24.6395 17.1843 24.4324 16.7797C24.2254 16.3751 23.9327 16.0629 23.5543 15.843C23.1831 15.6143 22.7512 15.5 22.2586 15.5C21.6232 15.5 21.0735 15.6979 20.6095 16.0937C20.1765 16.4548 19.8647 16.969 19.6741 17.6365C19.6496 17.7223 19.6816 17.8152 19.749 17.8628L20.6169 18.4751C20.716 18.545 20.8462 18.4892 20.8887 18.3658C21.0022 18.0366 21.1483 17.7761 21.327 17.5844C21.5554 17.3382 21.8231 17.215 22.1301 17.215C22.4157 17.215 22.6477 17.3162 22.8262 17.5185C23.0046 17.7208 23.0939 17.989 23.0939 18.3232C23.0939 18.6838 22.9832 18.9872 22.7619 19.2335C22.5477 19.471 22.2372 19.5897 21.8303 19.5897H21.5905C21.4923 19.5897 21.4126 19.6802 21.4126 19.7917V20.9708C21.4126 21.0824 21.4923 21.1728 21.5905 21.1728H21.7018C22.8012 21.1728 23.3509 21.617 23.3509 22.5053C23.3509 22.9099 23.2402 23.2265 23.0189 23.4551C22.8047 23.6838 22.537 23.7982 22.2158 23.7982C21.8874 23.7982 21.5911 23.6838 21.327 23.4551C21.1142 23.2639 20.9501 23.0013 20.8346 22.6673C20.7913 22.5422 20.6593 22.4838 20.5588 22.5548L19.645 23.2009C19.5761 23.2496 19.5445 23.3454 19.5718 23.4322C19.7759 24.0807 20.1003 24.5809 20.5453 24.9327C21.0307 25.3109 21.5983 25.5 22.2479 25.5C22.7548 25.5 23.2152 25.3901 23.6293 25.1702C24.0505 24.9415 24.3825 24.6161 24.6252 24.1939C24.8751 23.763 25 23.2485 25 22.6504C25 22.0699 24.8858 21.5862 24.6573 21.1992Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

14
designer-base/src/main/resources/com/fine/theme/icon/previewSql.svg

@ -0,0 +1,14 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M3 4C3 2.89543 3.89543 2 5 2H27C28.1046 2 29 2.89543 29 4V19L27 17.4782V4H5V28.5H16.5V30.5H5C3.89543 30.5 3 29.6046 3 28.5V4Z" fill="#0A1C38" fill-opacity="0.9"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M27.633 23.8064L28.8657 22.2315C29.5356 22.7558 30 23.5626 30 24.5C30 25.4374 29.5356 26.2442 28.8657 26.7685L27.633 25.1936C28.1223 24.8105 28.1223 24.1895 27.633 23.8064ZM27.633 23.8064L28.8657 22.2315L24.372 18.7143C23.3609 17.9229 22.1047 17.8668 21.1568 18.1741C20.2461 18.4694 19 19.3602 19 20.9828L19 28.0172C19 29.6398 20.2462 30.5306 21.1568 30.8259C22.1047 31.1332 23.3609 31.0771 24.372 30.2857L28.8657 26.7685L27.633 25.1936L23.1393 28.7107C22.3499 29.3287 21 28.891 21 28.0172L21 20.9828C21 20.109 22.3499 19.6713 23.1393 20.2893L27.633 23.8064Z" fill="#0A1C38" fill-opacity="0.9"/>
<path d="M12.0019 9.14596C11.7009 9.14596 11.4666 8.90516 11.3069 8.65109C11.2241 8.51943 11.1122 8.40634 10.9711 8.31184C10.6767 8.11216 10.3063 8.01231 9.85971 8.01231C9.54 8.01231 9.26343 8.06287 9.02999 8.16397C8.79655 8.26255 8.61513 8.39904 8.48572 8.57345C8.35886 8.74533 8.29542 8.94122 8.29542 9.16112C8.29542 9.34564 8.33856 9.50488 8.42483 9.63884C8.51363 9.77281 8.62908 9.88529 8.77118 9.97628C8.91581 10.0647 9.07059 10.1393 9.23551 10.2C9.40044 10.2581 9.55903 10.3061 9.71127 10.344L10.4725 10.5412C10.7211 10.6019 10.9761 10.684 11.2375 10.7876C11.4988 10.8913 11.7412 11.0278 11.9645 11.1971C12.1877 11.3665 12.3679 11.5763 12.5049 11.8265C12.6445 12.0767 12.7142 12.3763 12.7142 12.7251C12.7142 13.1649 12.6001 13.5554 12.3717 13.8966C12.1459 14.2379 11.8173 14.5071 11.3859 14.7042C10.9571 14.9014 10.4382 14.9999 9.82926 14.9999C9.24566 14.9999 8.74073 14.9077 8.31445 14.7232C7.88817 14.5386 7.55451 14.277 7.31346 13.9383C7.18553 13.7572 7.08798 13.5583 7.02079 13.3416C6.91983 13.016 7.20139 12.7251 7.54353 12.7251C7.85432 12.7251 8.09329 12.9772 8.24376 13.248C8.27908 13.3116 8.32041 13.3711 8.36774 13.4265C8.53013 13.611 8.73692 13.7488 8.98812 13.8398C9.24186 13.9282 9.5197 13.9725 9.82165 13.9725C10.154 13.9725 10.4496 13.9206 10.7085 13.817C10.9698 13.7108 11.1753 13.5642 11.325 13.3772C11.4747 13.1876 11.5496 12.9665 11.5496 12.7137C11.5496 12.4837 11.4836 12.2954 11.3517 12.1488C11.2223 12.0022 11.0459 11.8808 10.8226 11.7848C10.6019 11.6887 10.352 11.6041 10.0728 11.5308L9.15178 11.2805C8.52759 11.1112 8.0328 10.8622 7.66742 10.5336C7.30458 10.205 7.12316 9.77028 7.12316 9.22937C7.12316 8.78198 7.24495 8.39146 7.48854 8.05781C7.73213 7.72416 8.06198 7.46508 8.47811 7.28057C8.89424 7.09352 9.36365 7 9.88635 7C10.4141 7 10.8797 7.09226 11.2832 7.27678C11.6891 7.46129 12.0089 7.71532 12.2423 8.03885C12.3583 8.19838 12.4467 8.36976 12.5076 8.553C12.6119 8.86715 12.334 9.14596 12.0019 9.14596Z" fill="#0A1C38" fill-opacity="0.9"/>
<path d="M11.3859 14.7042L11.4171 14.7724C11.859 14.5704 12.1993 14.2929 12.434 13.9383C12.6712 13.5839 12.7892 13.1786 12.7892 12.7251C12.7892 12.3664 12.7175 12.0538 12.5706 11.7902C12.4286 11.531 12.2416 11.3132 12.0098 11.1374C11.7811 10.9639 11.5328 10.8241 11.2651 10.7179C11.0011 10.6132 10.7429 10.53 10.4908 10.4685L9.73008 10.2714L9.73008 10.2714L9.7294 10.2713C9.57985 10.234 9.4237 10.1868 9.26093 10.1294C9.10088 10.0705 8.95093 9.99825 8.81097 9.91271C8.67767 9.82722 8.57021 9.72227 8.48762 9.59782C8.41049 9.47787 8.37042 9.33337 8.37042 9.16112C8.37042 8.95679 8.42899 8.77665 8.54599 8.61809C8.66616 8.45615 8.83601 8.3273 9.05917 8.23306L9.05917 8.23307L9.0598 8.23279C9.28174 8.13667 9.54771 8.08731 9.85971 8.08731C10.2951 8.08731 10.6499 8.18458 10.929 8.3739L10.9293 8.37415C11.0625 8.46334 11.1667 8.56904 11.2434 8.69102C11.4054 8.94867 11.6592 9.22096 12.0019 9.22096C12.1884 9.22096 12.3615 9.14284 12.4742 9.01742C12.5881 8.89067 12.6404 8.71476 12.5788 8.52936C12.5155 8.33872 12.4235 8.16053 12.3031 7.99497C12.0612 7.65965 11.7306 7.39776 11.3142 7.2085L11.2832 7.27678L11.3144 7.20857C10.8995 7.01881 10.4229 6.925 9.88635 6.925C9.35466 6.925 8.8746 7.02015 8.44754 7.21208C8.02073 7.40136 7.68004 7.66831 7.42797 8.01359C7.17421 8.36116 7.04816 8.76747 7.04816 9.22937C7.04816 9.78898 7.23679 10.2448 7.61708 10.5892L7.61727 10.5894C7.9937 10.9279 8.50006 11.1814 9.13214 11.3529L10.0532 11.6031L10.0538 11.6033C10.3299 11.6758 10.5761 11.7593 10.7927 11.8536L10.793 11.8537C11.0085 11.9464 11.1749 12.0619 11.2954 12.1984L11.2954 12.1984L11.2959 12.1989C11.4135 12.3295 11.4746 12.4989 11.4746 12.7137C11.4746 12.9504 11.405 13.1549 11.2663 13.3305C11.126 13.5058 10.9318 13.6453 10.6804 13.7474C10.4321 13.8469 10.1462 13.8975 9.82165 13.8975C9.52726 13.8975 9.25802 13.8544 9.01326 13.7691C8.77323 13.6821 8.57761 13.5513 8.4244 13.3774C8.38046 13.3259 8.34212 13.2707 8.30933 13.2116C8.15568 12.935 7.89736 12.6501 7.54353 12.6501C7.35157 12.6501 7.17502 12.7316 7.05987 12.8615C6.94376 12.9925 6.89014 13.1735 6.94916 13.3639C7.01862 13.5879 7.11963 13.7939 7.2522 13.9816L7.25236 13.9818C7.50224 14.3329 7.84734 14.6027 8.28466 14.792C8.72242 14.9815 9.23796 15.0749 9.82926 15.0749C10.446 15.0749 10.9762 14.9751 11.4173 14.7723L11.3859 14.7042ZM11.3859 14.7042C11.8173 14.5071 12.1459 14.2379 12.3717 13.8966L8.36774 13.4265C8.32041 13.3711 8.27908 13.3116 8.24376 13.248C8.09329 12.9772 7.85432 12.7251 7.54353 12.7251C7.20139 12.7251 6.91983 13.016 7.02079 13.3416C7.08798 13.5583 7.18553 13.7572 7.31346 13.9383C7.55451 14.277 7.88817 14.5386 8.31445 14.7232C8.74073 14.9077 9.24566 14.9999 9.82926 14.9999C10.4382 14.9999 10.9571 14.9014 11.3859 14.7042Z" stroke="#0A1C38" stroke-opacity="0.9" stroke-width="0.15"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M18.2857 12.4002C17.8176 12.7768 17.146 13 16.5155 13C14.9685 13 13.7144 11.6569 13.7144 10C13.7144 8.34316 14.9685 7.00001 16.5155 7.00001C17.146 7.00001 17.8176 7.24461 18.2857 7.62122V7.57143C18.2857 7.25582 18.5416 6.99997 18.8572 7C19.1728 7.00003 19.4286 7.25586 19.4286 7.57143V14.4286C19.4286 14.7442 19.1728 15 18.8572 15C18.5416 15 18.2857 14.7442 18.2857 14.4286V12.4002ZM18.1961 10C18.1961 11.1046 17.4437 12 16.5155 12C15.5873 12 14.8348 11.1046 14.8348 10C14.8348 8.89544 15.5873 8.00001 16.5155 8.00001C17.4437 8.00001 18.1961 8.89544 18.1961 10Z" fill="#0A1C38" fill-opacity="0.9"/>
<path d="M16.5155 13.085C17.1043 13.085 17.7282 12.8963 18.2007 12.5696V14.4286C18.2007 14.7911 18.4946 15.085 18.8572 15.085C19.2197 15.085 19.5136 14.7911 19.5136 14.4286V7.57143C19.5136 7.20892 19.2197 6.91503 18.8572 6.915C18.5333 6.91497 18.2641 7.14961 18.2105 7.45821C17.738 7.12516 17.11 6.91501 16.5155 6.91501C14.9161 6.91501 13.6294 8.3018 13.6294 10C13.6294 11.6982 14.9161 13.085 16.5155 13.085ZM18.1111 10C18.1111 11.0721 17.3835 11.915 16.5155 11.915C15.6474 11.915 14.9198 11.0721 14.9198 10C14.9198 8.92793 15.6474 8.08501 16.5155 8.08501C17.3835 8.08501 18.1111 8.92793 18.1111 10Z" stroke="#0A1C38" stroke-opacity="0.9" stroke-width="0.17"/>
<mask id="path-7-outside-1_8063_191727" maskUnits="userSpaceOnUse" x="20.2095" y="6" width="6" height="10" fill="black">
<rect fill="white" x="20.2095" y="6" width="6" height="10"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M22.2485 7.51948C22.2485 7.23258 22.0159 7 21.7291 7C21.4422 7 21.2096 7.23258 21.2096 7.51948V14.3143C21.2095 14.3177 21.2095 14.3212 21.2095 14.3247C21.2095 14.6116 21.4421 14.8441 21.7289 14.8441H25.2614C25.5483 14.8441 25.7809 14.6116 25.7809 14.3247C25.7809 14.0378 25.5483 13.8052 25.2614 13.8052H22.2485V7.51948Z"/>
</mask>
<path fill-rule="evenodd" clip-rule="evenodd" d="M22.2485 7.51948C22.2485 7.23258 22.0159 7 21.7291 7C21.4422 7 21.2096 7.23258 21.2096 7.51948V14.3143C21.2095 14.3177 21.2095 14.3212 21.2095 14.3247C21.2095 14.6116 21.4421 14.8441 21.7289 14.8441H25.2614C25.5483 14.8441 25.7809 14.6116 25.7809 14.3247C25.7809 14.0378 25.5483 13.8052 25.2614 13.8052H22.2485V7.51948Z" fill="#0A1C38" fill-opacity="0.9"/>
<path d="M21.2096 14.3143L21.3796 14.3176V14.3143H21.2096ZM22.2485 13.8052H22.0785V13.9752H22.2485V13.8052ZM21.7291 7.17C21.9221 7.17 22.0785 7.32647 22.0785 7.51948H22.4185C22.4185 7.13869 22.1098 6.83 21.7291 6.83V7.17ZM21.3796 7.51948C21.3796 7.32647 21.536 7.17 21.7291 7.17V6.83C21.3483 6.83 21.0396 7.13869 21.0396 7.51948H21.3796ZM21.3796 14.3143V7.51948H21.0396V14.3143H21.3796ZM21.3795 14.3247C21.3795 14.3223 21.3795 14.32 21.3795 14.3176L21.0396 14.311C21.0395 14.3155 21.0395 14.3201 21.0395 14.3247H21.3795ZM21.7289 14.6741C21.5359 14.6741 21.3795 14.5177 21.3795 14.3247H21.0395C21.0395 14.7055 21.3482 15.0141 21.7289 15.0141V14.6741ZM25.2614 14.6741H21.7289V15.0141H25.2614V14.6741ZM25.6109 14.3247C25.6109 14.5177 25.4544 14.6741 25.2614 14.6741V15.0141C25.6422 15.0141 25.9509 14.7055 25.9509 14.3247H25.6109ZM25.2614 13.9752C25.4544 13.9752 25.6109 14.1317 25.6109 14.3247H25.9509C25.9509 13.9439 25.6422 13.6352 25.2614 13.6352V13.9752ZM22.2485 13.9752H25.2614V13.6352H22.2485V13.9752ZM22.0785 7.51948V13.8052H22.4185V7.51948H22.0785Z" fill="#0A1C38" fill-opacity="0.9" mask="url(#path-7-outside-1_8063_191727)"/>
</svg>

After

Width:  |  Height:  |  Size: 8.9 KiB

8
designer-base/src/main/resources/com/fine/theme/icon/tables.svg

@ -0,0 +1,8 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 28V4.5C2 3.94772 2.44772 3.5 3 3.5H22.5858C22.851 3.5 23.1054 3.60536 23.2929 3.79289L28.2071 8.70711C28.3946 8.89464 28.5 9.149 28.5 9.41421V28C28.5 28.5523 28.0523 29 27.5 29H3C2.44772 29 2 28.5523 2 28Z" fill="#5493F2"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M1.2998 4.00005C1.2998 3.06116 2.06092 2.30005 2.9998 2.30005H23.0599C23.5364 2.30005 23.9911 2.50005 24.3131 2.85132L29.253 8.2403C29.5404 8.55383 29.6998 8.96371 29.6998 9.38903V28.5C29.6998 29.4389 28.9387 30.2001 27.9998 30.2001H2.9998C2.06092 30.2001 1.2998 29.4389 1.2998 28.5V4.00005ZM2.9998 3.70005C2.83412 3.70005 2.6998 3.83436 2.6998 4.00005V28.5C2.6998 28.6657 2.83412 28.8 2.9998 28.8H27.9998C28.1655 28.8 28.2998 28.6657 28.2998 28.5V9.38903C28.2998 9.31397 28.2717 9.24164 28.221 9.18632L23.281 3.79733C23.2242 3.73534 23.144 3.70005 23.0599 3.70005H2.9998Z" fill="#105DD1"/>
<rect x="7" y="14" width="17" height="5" fill="#B3CFF9"/>
<rect x="7" y="20" width="6" height="5" fill="#B3CFF9"/>
<rect x="13" y="20" width="11" height="5" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.4 14.4V19H12V14.4H7.4ZM13.4 14.4V19H23.6V14.4H13.4ZM12 20.4H7.4V24.6H12V20.4ZM13.4 24.6V20.4H23.6V24.6H13.4ZM13.4 26H12H7C6.44771 26 6 25.5523 6 25V20.4V19V14C6 13.4477 6.44772 13 7 13H24C24.5523 13 25 13.4477 25 14V25C25 25.5523 24.5523 26 24 26H13.4Z" fill="#105DD1"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

3
designer-base/src/main/resources/com/fine/theme/icon/time.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.31253 13.2667C5.5496 7.95624 10.3127 4 15.9999 4C22.6273 4 27.9999 9.37258 27.9999 16C27.9999 22.6274 22.6273 28 15.9999 28C12.7692 28 9.83665 26.7233 7.67932 24.6469L11.0842 21.6605L2.25293 18.6636C3.49688 25.1217 9.17867 30 15.9999 30C23.7318 30 29.9999 23.732 29.9999 16C29.9999 8.26801 23.7318 2 15.9999 2C9.30602 2 3.70943 6.69783 2.32722 12.9763C2.19558 13.5743 2.67012 14.1156 3.28241 14.1156C3.78026 14.1156 4.19958 13.7516 4.31253 13.2667ZM14.9999 17L14.9999 8C14.9999 7.44771 14.5521 7 13.9999 7C13.4476 7 12.9999 7.44771 12.9999 8L12.9999 17.9976V18C12.9999 18.5501 13.4441 18.9965 13.9934 19L13.9999 19L22.9999 19C23.5521 19 23.9999 18.5523 23.9999 18C23.9999 17.4477 23.5521 17 22.9999 17L14.9999 17Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 906 B

11
designer-base/src/main/resources/com/fine/theme/icon/views.svg

@ -0,0 +1,11 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M3 11H10V29H3V11Z" fill="#5493F2"/>
<path d="M3 10H10V15H3V10Z" fill="#B3CFF9"/>
<path d="M2 14H11V15.4H2V14Z" fill="#105DD1"/>
<path d="M22 4H29V22H22V4Z" fill="#5493F2"/>
<path d="M22 3H29V8H22V3Z" fill="#B3CFF9"/>
<path d="M21 7H30V8.4H21V7Z" fill="#105DD1"/>
<rect x="10" y="21.994" width="17" height="1.4" transform="rotate(-49.8493 10 21.994)" fill="#105DD1"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.49961 8.59998H9.49961C10.549 8.59998 11.3996 9.45063 11.3996 10.5V28.5C11.3996 29.5493 10.549 30.4 9.49961 30.4H3.49961C2.45027 30.4 1.59961 29.5493 1.59961 28.5V10.5C1.59961 9.45064 2.45027 8.59998 3.49961 8.59998ZM3.49961 9.99998C3.22347 9.99998 2.99961 10.2238 2.99961 10.5V28.5C2.99961 28.7761 3.22347 29 3.49961 29H9.49961C9.77575 29 9.99961 28.7761 9.99961 28.5V10.5C9.99961 10.2238 9.77575 9.99998 9.49961 9.99998H3.49961Z" fill="#105DD1"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M22.4996 1.59998H28.4996C29.549 1.59998 30.3996 2.45063 30.3996 3.49998V21.5C30.3996 22.5493 29.549 23.4 28.4996 23.4H22.4996C21.4503 23.4 20.5996 22.5493 20.5996 21.5V3.49998C20.5996 2.45064 21.4503 1.59998 22.4996 1.59998ZM22.4996 2.99998C22.2235 2.99998 21.9996 3.22383 21.9996 3.49998V21.5C21.9996 21.7761 22.2235 22 22.4996 22H28.4996C28.7758 22 28.9996 21.7761 28.9996 21.5V3.49998C28.9996 3.22383 28.7758 2.99998 28.4996 2.99998H22.4996Z" fill="#105DD1"/>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

8
designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json

@ -23,6 +23,13 @@
"up_arrow": "up_arrow.svg",
"select": "select.svg",
"recycle": "recycle.svg",
"time": "time.svg",
"logo": "logo.svg",
"pages": "pages.svg",
"digitalPlatform": "digitalPlatform.svg",
"tables": "tables.svg",
"views": "views.svg",
"preview_sql": "previewSql.svg",
"database": "dataset/database.svg",
"preview": "dataset/preview.svg",
"connection": "dataset/connection.svg",
@ -46,6 +53,7 @@
"minus": "filetree/minus.svg",
"plus": "filetree/plus.svg",
"locate": "filetree/locate.svg",
"locate_disable": "filetree/locate_disable.svg",
"rename": "filetree/rename.svg",
"collapse_all": "filetree/collapse_all.svg",
"vcs_list": "filetree/vcs_list.svg",

41
designer-chart/src/main/java/com/fr/design/module/ChartEmptyDataStylePane.java

@ -1,5 +1,6 @@
package com.fr.design.module;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fr.base.BaseUtils;
import com.fr.base.ChartEmptyDataStyleConf;
import com.fr.base.Style;
@ -26,21 +27,23 @@ import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.SwingWorker;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* Created by mengao on 2017/11/23.
*/
public class ChartEmptyDataStylePane extends AbstractAttrNoScrollPane {
private static final int WIDTH = 150;
private static final int HEIGHT = 20;
private static final int HEIGHT = 26;
private static final int FIVE = 5;
private static final int TEN = 10;
private static final int THIRTY = 30;
@ -75,6 +78,17 @@ public class ChartEmptyDataStylePane extends AbstractAttrNoScrollPane {
}
private JPanel creatNorthPane() {
initEmptyData();
initImageData();
UILabel promptContent = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Tip_Content"));
imageContent = new UILabel(Toolkit.i18nText("Fine-Design_Report_Image"));
return row(20,
row(10, cell(promptContent), cell(emptyData), fix(10), cell(imageContent), cell(imageData))
).getComponent();
}
private void initEmptyData() {
emptyData = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Open"), Toolkit.i18nText("Fine-Design_Chart_Close")});
emptyData.setSelectedIndex(0);
emptyData.setPreferredSize(new Dimension(WIDTH, HEIGHT));
@ -85,7 +99,9 @@ public class ChartEmptyDataStylePane extends AbstractAttrNoScrollPane {
repaintPreviewPane();
}
});
}
private void initImageData() {
imageData = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Mode_Auto"), Toolkit.i18nText("Fine-Design_Chart_Mode_Custom")});
imageData.setSelectedIndex(0);
imageData.setPreferredSize(new Dimension(WIDTH, HEIGHT));
@ -97,26 +113,19 @@ public class ChartEmptyDataStylePane extends AbstractAttrNoScrollPane {
repaintPreviewPane();
}
});
UILabel promptContent = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Tip_Content"));
imageContent = new UILabel(Toolkit.i18nText("Fine-Design_Report_Image"));
JPanel emptyPane = GUICoreUtils.createFlowPane(new Component[]{promptContent, emptyData}, FlowLayout.LEFT, TEN, 0);
JPanel imagePane = GUICoreUtils.createFlowPane(new Component[]{imageContent, imageData}, FlowLayout.LEFT, TEN, 0);
imagePane.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0));
JPanel northPane = GUICoreUtils.createFlowPane(new Component[]{emptyPane, imagePane}, FlowLayout.LEFT, 0, 0);
northPane.setBorder(BorderFactory.createEmptyBorder(0, FIVE, 0, 0));
return northPane;
}
private JPanel creatCenterPane() {
JPanel centerPane = new JPanel(FRGUIPaneFactory.createBorderLayout());
// preview pane
JPanel previewContainerPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
JPanel previewContainerPane = new JPanel(new BorderLayout());
centerPane.add(previewContainerPane, BorderLayout.CENTER);
centerPane.add(new UILabel((Toolkit.i18nText("Fine-Design_Basic_Preview"))), BorderLayout.NORTH);
JPanel previewOwnerPane = new JPanel(new BorderLayout());
previewOwnerPane.setBorder(new FineRoundBorder());
JPanel previewOwnerPane = FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Design_Basic_Preview"));
previewOwnerPane.setLayout(new BorderLayout());
previewContainerPane.add(previewOwnerPane, BorderLayout.CENTER);
previewContainerPane.add(initSelectFilePane(), BorderLayout.EAST);
previewPane = new ImagePreviewPane();
@ -133,7 +142,7 @@ public class ChartEmptyDataStylePane extends AbstractAttrNoScrollPane {
JPanel selectFilePane = FRGUIPaneFactory.createBorderLayout_L_Pane();
selectFilePane.setBorder(BorderFactory.createEmptyBorder(TEN, FIVE, 0, THIRTY));
selectFilePane.setBorder(BorderFactory.createEmptyBorder(0, FIVE, 0, THIRTY));
defaultRadioButton = new UIRadioButton(Toolkit.i18nText("Fine-Design_Report_Default"));
adjustRadioButton = new UIRadioButton(Toolkit.i18nText("Fine-Design_Report_Image_Adjust"));

33
designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java

@ -25,6 +25,11 @@ import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* 预定义的图表配色界面.
@ -50,35 +55,29 @@ public class ChartPreFillStylePane extends BasicBeanPane<ChartColorMatching> {
}
private void initComponents() {
JPanel customPane = new JPanel(FRGUIPaneFactory.createBorderLayout());
groupButton = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Custom_Color"), Toolkit.i18nText("Fine-Design_Chart_Gradient_Color")});
groupButton.setSelectedIndex(0);
customPane.add(groupButton, BorderLayout.NORTH);
changeColorSetPane = new JPanel(cardLayout = new CardLayout());
changeColorSetPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
changeColorSetPane.add(colorGradient = new FixedGradientBarNoTheme(4, 150), "gradient");
changeColorSetPane.add(colorAdjustPane = new ColorAdjustPane(), "acc");
cardLayout.show(changeColorSetPane, "acc");
customPane.add(changeColorSetPane, BorderLayout.CENTER);
customPane.setPreferredSize(new Dimension(155, 300));
colorGradient.setPreferredSize(new Dimension(155, 30));
colorGradient.getSelectColorPointBtnP1().setColorInner(Color.WHITE);
colorGradient.getSelectColorPointBtnP2().setColorInner(FixedGradientBar.NEW_CHARACTER);
double p = TableLayout.PREFERRED;
double[] columnSize = {p, p};
double[] rowSize = {p, p, p};
Component[][] components = new Component[][]{
new Component[]{new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color_Match")), null},
new Component[]{null, customPane},
};
this.setLayout(new BorderLayout());
this.add(TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize), BorderLayout.WEST);
this.add(column(
10,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color_Match"))),
row(
cell(groupButton).weight(0.1),
flex(0.2)
),
cell(changeColorSetPane)
).getComponent());
}
private void initListener() {

21
designer-chart/src/main/java/com/fr/design/module/ChartPreStylePane.java

@ -10,6 +10,7 @@ import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import javax.swing.JPanel;
@ -19,6 +20,9 @@ import java.awt.Container;
import java.awt.Dimension;
import java.awt.FlowLayout;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
/**
* 图表预定义风格界面, 服务器--图表风格.
* @author kunsnat E-mail:kunsnat@gmail.com
@ -45,19 +49,24 @@ public class ChartPreStylePane extends BasicBeanPane<ChartColorMatching> {
boxPane.add(pane, BorderLayout.SOUTH);
boxPane.add(fillStylePane, BorderLayout.CENTER);
this.add(boxPane, BorderLayout.CENTER);
ChartCollection cc = new ChartCollection();
demoPlot = new Bar2DPlot();
cc.addChart(new Chart(demoPlot));
chartComponent = new ChartComponent();
chartComponent.populate(cc);
chartComponent.setPreferredSize(new Dimension(400, 300));
chartComponent.setPreferredSize(new Dimension(441, 356));
chartComponent.setSupportEdit(false);
this.add(chartComponent, BorderLayout.SOUTH);
this.add(column(
20,
cell(fillStylePane),
column(
10,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"))),
cell(chartComponent)
)
).getComponent());
initListener(ChartPreStylePane.this);
}

179
designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java

@ -1,5 +1,6 @@
package com.fr.design.actions.replace.ui;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.svg.IconUtils;
import com.fr.design.actions.replace.action.setting.SettingContent;
import com.fr.design.actions.replace.action.setting.SettingController;
@ -7,7 +8,6 @@ import com.fr.design.data.datapane.TableDataComboBox;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
@ -15,15 +15,12 @@ import com.fr.general.GeneralUtils;
import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.ComboBoxEditor;
import javax.swing.Icon;
import javax.swing.JPanel;
import javax.swing.ScrollPaneConstants;
import javax.swing.event.PopupMenuEvent;
import javax.swing.event.PopupMenuListener;
import java.awt.CardLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
@ -32,6 +29,11 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* 上面板
*
@ -55,8 +57,8 @@ public class ITReplaceNorthPanel {
private UILabel iconLabel;
private UIComboBox findInputCombobox;
private UIComboBox replaceInputCombobox;
private UIScrollPane contentScrollPane;
private UIScrollPane settingScrollPane;
private JPanel contentScrollPane;
private JPanel settingScrollPane;
private UIButton replaceButton;
private UIButton searchButton;
@ -157,6 +159,7 @@ public class ITReplaceNorthPanel {
public ITReplaceNorthPanel() {
cardLayout = new CardLayout();
cardPanel = new JPanel(cardLayout);
cardPanel.setBorder(new ScaledEmptyBorder(20, 20, 20, 20));
upContentPanel = new JPanel(null);
upSettingPanel = new JPanel(null);
@ -191,6 +194,12 @@ public class ITReplaceNorthPanel {
super.setEditor(new ITComboBoxEditor());
}
};
initButton();
initUpContentPanel();
contentScrollPane = cell(upContentPanel).getComponent();
}
private void initButton() {
matchRadioButton = new UICheckBox(Toolkit.i18nText("Fine-Design_Replace_WildCard"));
matchRadioButton.addActionListener(new ActionListener() {
@Override
@ -198,23 +207,22 @@ public class ITReplaceNorthPanel {
ITReplaceMainDialog.setMatched(matchRadioButton.isSelected());
}
});
replaceButton = new UIButton(Toolkit.i18nText("Fine-Design_Replace_Button"));
searchButton = new UIButton(Toolkit.i18nText("Fine-Design_Search_Button"));
upContentPanel.setPreferredSize(new Dimension(LIMIT_WIDTH, HEIGHT));
contentScrollPane = new UIScrollPane(upContentPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
upContentPanel.add(findLabel);
upContentPanel.add(rangeLabel);
upContentPanel.add(resultLabel);
upContentPanel.add(findCombobox);
upContentPanel.add(rangeCombobox);
upContentPanel.add(findInputCombobox);
upContentPanel.add(replaceInputCombobox);
upContentPanel.add(matchRadioButton);
upContentPanel.add(replaceButton);
upContentPanel.add(searchButton);
upContentPanel.add(iconLabel);
contentScrollPane.setBorder(BorderFactory.createEmptyBorder());
}
private void initUpContentPanel() {
upContentPanel = column(10,
row(row(cell(findLabel).weight(0.1), cell(findCombobox).weight(0.5)).weight(0.45), flex(0.1),
row(cell(rangeLabel).weight(0.1), cell(rangeCombobox).weight(0.5)).weight(0.45)
),
row(cell(findInputCombobox).weight(0.45),
row(flex(0.2), cell(iconLabel).weight(0.6), flex(0.2)).weight(0.1),
cell(replaceInputCombobox).weight(0.45)
),
cell(matchRadioButton),
row(5, row(cell(resultLabel)), flex(), row(5, cell(searchButton), cell(replaceButton)))
).getComponent();
}
/**
@ -224,6 +232,19 @@ public class ITReplaceNorthPanel {
findSettingLabel = new UILabel(Toolkit.i18nText("Fine-Design_Replace_Search_Element"));
rangeSettingLabel = new UILabel(Toolkit.i18nText("Fine-Design_Replace_Search_Range"));
settingResultLabel = new UILabel();
initComboBox();
updateSettingPlaceholder(SettingContent.CELL_FORMAT_NAME);
iconSettingLabel = new UILabel(CHANGE_ICON);
searchSettingButton = new UIButton(Toolkit.i18nText("Fine-Design_Search_Button"));
replaceSettingButton = new UIButton(Toolkit.i18nText("Fine-Design_Replace_Button"));
replaceSettingButton.setEnabled(false);
initUpSettingPanel();
settingScrollPane = cell(upSettingPanel).getComponent();
initListener();
}
private void initComboBox() {
findSettingComboBox = new UIComboBox(findSettingItems.toArray());
rangeSettingComboBox = new UIComboBox(RANGE_ITEMS);
findSettingInputComboBox = new UIComboBox(formatItems.toArray()) {
@ -241,40 +262,100 @@ public class ITReplaceNorthPanel {
};
replaceSettingInputComboBox.setSelectedIndex(-1);
updateSettingPlaceholder(SettingContent.CELL_FORMAT_NAME);
findSettingInputComboBox.setEditable(true);
((UITextField) (findSettingInputComboBox.getEditor().getEditorComponent())).setEditable(false);
replaceSettingInputComboBox.setEditable(true);
((UITextField) (replaceSettingInputComboBox.getEditor().getEditorComponent())).setEditable(false);
iconSettingLabel = new UILabel(CHANGE_ICON);
findExtraSettingComboBox = new UIComboBox(groupItems.toArray());
findExtraSettingComboBox.setVisible(false);
replaceExtraSettingComboBox = new UIComboBox(groupItems.toArray());
replaceExtraSettingComboBox.setVisible(false);
searchSettingButton = new UIButton(Toolkit.i18nText("Fine-Design_Search_Button"));
replaceSettingButton = new UIButton(Toolkit.i18nText("Fine-Design_Replace_Button"));
replaceSettingButton.setEnabled(false);
upSettingPanel.setPreferredSize(new Dimension(LIMIT_WIDTH, HEIGHT));
upSettingPanel.add(findSettingLabel);
upSettingPanel.add(rangeSettingLabel);
upSettingPanel.add(findSettingComboBox);
upSettingPanel.add(rangeSettingComboBox);
upSettingPanel.add(findSettingInputComboBox);
upSettingPanel.add(replaceSettingInputComboBox);
upSettingPanel.add(iconSettingLabel);
upSettingPanel.add(findExtraSettingComboBox);
upSettingPanel.add(replaceExtraSettingComboBox);
upSettingPanel.add(searchSettingButton);
upSettingPanel.add(replaceSettingButton);
upSettingPanel.add(settingResultLabel);
settingScrollPane = new UIScrollPane(upSettingPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
settingScrollPane.setBorder(BorderFactory.createEmptyBorder());
}
initListener();
private void initUpSettingPanel() {
upSettingPanel = column(10,
cell(buildFirstLine()),
cell(buildSecondLine()),
row(
cell(findExtraSettingComboBox).weight(0.45),
flex(0.1),
cell(replaceExtraSettingComboBox).weight(0.45)
),
row(
5,
row(cell(settingResultLabel)),
flex(),
row(
5,
cell(searchSettingButton),
cell(replaceSettingButton)
)
)
).getComponent();
}
private JPanel buildFirstLine() {
return row(
row(
5,
cell(findSettingLabel).weight(0.1),
cell(findSettingComboBox).weight(0.5)
).weight(0.45),
flex(0.1),
row(
5,
cell(rangeSettingLabel).weight(0.1),
cell(rangeSettingComboBox).weight(0.5)
).weight(0.45)).getComponent();
}
private JPanel buildSecondLine() {
return row(
cell(findSettingInputComboBox).weight(0.45),
row(
flex(0.2),
cell(iconSettingLabel).weight(0.6),
flex(0.2)
).weight(0.1),
cell(replaceSettingInputComboBox).weight(0.45)
).getComponent();
}
/**
* 根据是否支持查找和替换重绘面板
* @param find 查找
* @param replace 替换
*/
public void repaintThirdPanel(boolean find, boolean replace) {
if (find && replace) {
settingScrollPane.remove(settingScrollPane.getComponent(2));
settingScrollPane.add(row(
cell(findExtraSettingComboBox).weight(0.45),
flex(0.1),
cell(replaceExtraSettingComboBox).weight(0.45)
).getComponent(), 2);
settingScrollPane.revalidate();
settingScrollPane.repaint();
}
if (!find && replace) {
settingScrollPane.remove(settingScrollPane.getComponent(2));
settingScrollPane.add(row(
flex(0.55),
cell(replaceExtraSettingComboBox).weight(0.45)
).getComponent(), 2);
settingScrollPane.revalidate();
settingScrollPane.repaint();
}
if (find && !replace) {
settingScrollPane.remove(settingScrollPane.getComponent(2));
settingScrollPane.add(row(
cell(findExtraSettingComboBox).weight(0.45),
flex(0.55)
).getComponent(), 2);
settingScrollPane.revalidate();
settingScrollPane.repaint();
}
}
/**
@ -413,6 +494,7 @@ public class ITReplaceNorthPanel {
} else {
extraComboBox.setVisible(false);
}
ITReplaceMainDialog.getInstance().getNorthPane().repaintThirdPanel(findExtraSettingComboBox.isVisible(), replaceExtraSettingComboBox.isVisible());
refreshSettingReplaceButtonStatus();
}
@ -544,15 +626,6 @@ public class ITReplaceNorthPanel {
}
}
public UIScrollPane getContentScrollPane() {
return contentScrollPane;
}
public void setContentScrollPane(UIScrollPane contentScrollPane) {
this.contentScrollPane = contentScrollPane;
}
private void setIconLabelBounds() {
iconX = inputLength + GAP;
iconY = SECOND_Y;

2
designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java

@ -33,8 +33,6 @@ public class ITReplaceSouthPanel {
}
};
tableEditorPane.getEditTable().setRowSorter(sorter);
tableEditorPane.getEditTable().setBorder(BorderFactory.createEmptyBorder());
tableEditorPane.getEditTable().setSelectionBackground(new Color(217, 235, 254));
tableEditorPane.getEditTable().setRowHeight(tableEditorPane.getEditTable().getRowHeight() / 2 + tableEditorPane.getEditTable().getRowHeight());
tableEditorPane.makeFace(tableEditorPane.getEditTable());
}

29
designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java

@ -22,6 +22,10 @@ import java.awt.GridLayout;
import java.awt.event.MouseEvent;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* 左侧面板
*
@ -46,7 +50,7 @@ public class ITReplaceWestPanel {
*/
private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design-CloudCenter_Template_Level_Search_Replace_Default";
private static final String HELP_URL = LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY, PROPS_LINK_KEY_DEFAULT);
private static final int FILL_COUNT = 11;
private static final int FILL_COUNT = 12;
public static final int LEFT_WIDTH = 100;
public static final String CONTENT_TEXT = "<html><font color = 'rgb(255,255,255)'>" + Toolkit.i18nText("Fine-Design_Basic_Templates_Content") + "</font></html>";
public static final String SETTING_TEXT = "<html><font color = 'rgb(255,255,255)'>" + Toolkit.i18nText("Fine-Design_Replace_Setting") + "</font></html>";
@ -58,6 +62,8 @@ public class ITReplaceWestPanel {
contentButton = new UIToggleButton(Toolkit.i18nText("Fine-Design_Basic_Templates_Content"));
settingButton = new UIToggleButton(Toolkit.i18nText("Fine-Design_Replace_Setting"));
contentButton.setHorizontalAlignment(SwingConstants.LEFT);
settingButton.setHorizontalAlignment(SwingConstants.LEFT);
contentButton.setText(CONTENT_TEXT);
contentButton.addChangeListener(new ChangeListener() {
@Override
@ -90,8 +96,16 @@ public class ITReplaceWestPanel {
//去除按钮的边框
contentButton.setBorderPainted(false);
settingButton.setBorderPainted(false);
leftPanel.add(contentButton);
leftPanel.add(settingButton);
leftPanel.add(row(
flex(0.07),
cell(contentButton).weight(1.0),
flex(0.07)
).getComponent());
leftPanel.add(row(
flex(0.07),
cell(settingButton).weight(1.0),
flex(0.07)
).getComponent());
leftPanel.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, new Color(218, 218, 221)));
//填充一下面板
for (int i = 0; i < FILL_COUNT; i++) {
@ -100,7 +114,7 @@ public class ITReplaceWestPanel {
//添加帮助文档按钮及超链
iconLabel.setToolTipText(Toolkit.i18nText("Fine-Design_Replace_Tooltip"));
iconLabel.setHorizontalAlignment(SwingConstants.CENTER);
iconLabel.setHorizontalAlignment(SwingConstants.LEFT);
//设置游标
iconLabel.setCursor(new Cursor(Cursor.HAND_CURSOR));
iconLabel.addMouseListener(new MouseClickListener() {
@ -109,8 +123,11 @@ public class ITReplaceWestPanel {
BrowseUtils.browser(HELP_URL);
}
});
leftPanel.add(iconLabel);
leftPanel.add(new UILabel(StringUtils.EMPTY));
leftPanel.add(row(
flex(0.23),
cell(iconLabel).weight(1.0),
flex(0.07)
).getComponent());
}
public JPanel getLeftPanel() {

14
designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java

@ -1,5 +1,6 @@
package com.fr.design.actions.replace.ui;
import com.fine.theme.icon.LazyIcon;
import com.fr.base.TRL;
import com.fr.design.actions.replace.info.base.ITContent;
import com.fr.design.file.HistoryTemplateListCache;
@ -14,7 +15,9 @@ import com.fr.stable.StringUtils;
import javax.swing.AbstractCellEditor;
import javax.swing.BorderFactory;
import javax.swing.JTable;
import javax.swing.UIManager;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer;
import java.awt.Component;
@ -35,9 +38,10 @@ public class ITTableButton extends AbstractCellEditor implements TableCellEditor
private UIButton paraButton;
public ITTableButton() {
paraButton = new UIButton("<html><font color = 'rgb(61,153,249)'>" + Toolkit.i18nText("Fine-Design_Chart_Location") + "</font> ");
paraButton = new UIButton();
paraButton.setVisible(true);
paraButton.setBorderPainted(false);
paraButton.setBorderPainted(true);
paraButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIManager.getColor("defaultBorderColor")));
}
@ -72,7 +76,11 @@ public class ITTableButton extends AbstractCellEditor implements TableCellEditor
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
ITContent content = (ITContent) table.getValueAt(row, ITReplaceSouthPanel.CONTENT_INDEX);
paraButton.setEnabled(content.isJumpAble());
if (content.isJumpAble()) {
paraButton.setIcon(new LazyIcon("locate"));
} else {
paraButton.setIcon(new LazyIcon("locate_disable"));
}
return paraButton;
}

24
designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditor.java

@ -1,5 +1,7 @@
package com.fr.design.actions.replace.ui;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.actions.replace.info.Info;
import com.fr.design.actions.replace.info.base.ITContent;
@ -15,9 +17,12 @@ import org.jetbrains.annotations.Nullable;
import javax.swing.BorderFactory;
import javax.swing.DefaultCellEditor;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.UIManager;
import javax.swing.plaf.UIResource;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellRenderer;
import java.awt.Color;
import java.awt.Component;
@ -56,13 +61,28 @@ public class ITTableEditor extends UITableModelAdapter {
ITTableButton.class,
});
DefaultTableCellRenderer cellRenderer = new DefaultTableCellRenderer() {
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
((JComponent) c).setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createMatteBorder(0, 0, 1, 1, UIManager.getColor("defaultBorderColor")),
new ScaledEmptyBorder(0,4,0,0)));
c.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
return c;
}
};
this.setDefaultRenderer(UILabel.class, cellRenderer);
this.setDefaultEditor(ITTableButton.class, new ITTableButton());
this.setDefaultRenderer(ITTableButton.class, new ITTableButton());
this.setDefaultEditor(Boolean.class, new ITBooleanEditor());
this.setDefaultRenderer(Boolean.class, new ITBooleanRenderer());
this.createTable().getColumnModel().getColumn(ITReplaceSouthPanel.CONTENT_INDEX).setMaxWidth(50);
this.createTable().getColumnModel().getColumn(ITReplaceSouthPanel.CHECKBOX_INDEX).setMaxWidth(50);
this.createTable().getColumnModel().getColumn(ITReplaceSouthPanel.CHECKBOX_INDEX).setMaxWidth(28);
this.createTable().getColumnModel().getColumn(ITReplaceSouthPanel.CHECKBOX_INDEX).setCellRenderer(new ITBooleanRenderer());
}
@ -263,7 +283,7 @@ public class ITTableEditor extends UITableModelAdapter {
setEnabled(!content.isReplaced());
setSelected((value != null && ((Boolean) value).booleanValue()));
setUI(getUICheckBoxUI());
setBorder(BorderFactory.createEmptyBorder());
setBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, UIManager.getColor("defaultBorderColor")));
setBackground(Color.WHITE);
return this;
}

44
designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java

@ -1,5 +1,7 @@
package com.fr.design.actions.replace.ui;
import com.fine.theme.icon.LazyIcon;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.base.TRL;
import com.fr.design.actions.replace.info.base.ITContent;
import com.fr.design.border.UIRoundedBorder;
@ -23,6 +25,7 @@ import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.SortOrder;
import javax.swing.SwingConstants;
import javax.swing.UIManager;
import javax.swing.table.JTableHeader;
@ -52,7 +55,6 @@ public class ITTableEditorPane<T> extends BasicPane {
public ITTableEditorPane(UITableModelAdapter<T> model) {
this.tableModel = model;
this.initComponent(model.createAction());
editTable.setGridColor(new Color(218, 218, 221));
}
@ -64,11 +66,7 @@ public class ITTableEditorPane<T> extends BasicPane {
*/
private void initComponent(UITableEditAction[] action) {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel pane = new JPanel(new BorderLayout(4, 4));
this.add(pane, BorderLayout.CENTER);
UILabel l = new UILabel(leftLabelName);
editTable = tableModel.createTable();
editTable.getTableHeader().setBackground(UIConstants.DEFAULT_BG_RULER);
editTable.addMouseListener(new MouseClickListener() {
@Override
public void mouseClicked(MouseEvent e) {
@ -94,7 +92,7 @@ public class ITTableEditorPane<T> extends BasicPane {
});
UIScrollPane scrollPane = new UIScrollPane(editTable);
scrollPane.setBorder(new UIRoundedBorder(UIConstants.TITLED_BORDER_COLOR, 1, UIConstants.ARC));
pane.add(scrollPane, BorderLayout.CENTER);
this.add(scrollPane, BorderLayout.CENTER);
}
/**
@ -143,6 +141,7 @@ public class ITTableEditorPane<T> extends BasicPane {
public static class ITHeaderRenderer implements TableCellRenderer {
JTableHeader tableHeader;
final UICheckBox selectBox;
private boolean ascSort = true;
public ITHeaderRenderer(JTable table) {
this.tableHeader = table.getTableHeader();
@ -155,15 +154,17 @@ public class ITTableEditorPane<T> extends BasicPane {
int selectColumn = tableHeader.columnAtPoint(e.getPoint());
if (selectColumn == ITReplaceSouthPanel.CHECKBOX_INDEX) {
boolean value = !selectBox.isSelected();
selectBox.setSelected(value);
selectAllOrNull(value);
if (value) {
ITReplaceMainDialog.selectCount = getEditTable().getRowCount();
} else {
ITReplaceMainDialog.selectCount = 0;
}
setHeaderStatus(value);
tableHeader.repaint();
table.repaint();
} else if (selectColumn != ITReplaceSouthPanel.CONTENT_INDEX) {
ascSort = table.getRowSorter().getSortKeys().get(0).getSortOrder() == SortOrder.ASCENDING;
}
}
}
@ -175,13 +176,27 @@ public class ITTableEditorPane<T> extends BasicPane {
*
* @param table
*/
public void refreshHeader(JTable table, boolean value) {
selectBox.setSelected(value);
public void refreshHeader(JTable table, boolean isAllSelected) {
setHeaderStatus(isAllSelected);
int rowHeight = table.getRowHeight();
table.updateUI();
table.setRowHeight(rowHeight);
}
public void setHeaderStatus(boolean isAllSelected) {
if (isAllSelected) {
selectBox.setSelected(true);
selectBox.setSelectedIcon(new LazyIcon("checkbox_checked"));
} else if (ITReplaceMainDialog.selectCount > 0 && ITReplaceMainDialog.selectCount < editTable.getRowCount()) {
selectBox.setSelected(true);
selectBox.setSelectedIcon(new LazyIcon("checkbox_part_checked"));
} else {
selectBox.setSelected(false);
selectBox.setSelectedIcon(new LazyIcon("checkbox_unchecked"));
}
}
@Override
public Component getTableCellRendererComponent(JTable table,
Object value,
@ -195,6 +210,15 @@ public class ITTableEditorPane<T> extends BasicPane {
label.setHorizontalAlignment(SwingConstants.LEFT);
selectBox.setHorizontalAlignment(SwingConstants.CENTER);
selectBox.setBorderPainted(true);
if (column != ITReplaceSouthPanel.CHECKBOX_INDEX && column != ITReplaceSouthPanel.CONTENT_INDEX) {
if (ascSort) {
label.setIcon(new LazyIcon("sort_asc"));
} else {
label.setIcon(new LazyIcon("sort_desc"));
}
}
label.setIconTextGap(5);
label.setHorizontalTextPosition(JLabel.LEFT);
JComponent component = (column == ITReplaceSouthPanel.CHECKBOX_INDEX) ? selectBox : label;
component.setForeground(tableHeader.getForeground());
component.setBackground(tableHeader.getBackground());
@ -216,7 +240,7 @@ public class ITTableEditorPane<T> extends BasicPane {
Dimension size = table.getTableHeader().getPreferredSize();
size.height = 26;//设置新的表头高度
table.getTableHeader().setBackground(new Color(232, 232, 233));
table.getTableHeader().setBackground(FlatUIUtils.getUIColor("TableHeader.background", Color.WHITE));
table.getTableHeader().setPreferredSize(size);

17
designer-realize/src/main/java/com/fr/design/condition/BackPane.java

@ -16,6 +16,9 @@ import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* @author richie
* @date 2015-03-26
@ -50,12 +53,16 @@ public class BackPane extends ConditionAttrSingleConditionPane<HighlightAction>
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Current_Cell"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Current_Row"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Current_Column") });
this.add(backgroundLabel);
this.add(backgroundPreviewPane);
this.add(editBackgroundButton);
this.add(this.backScopeComboBox);
this.backgroundPreviewPane.setBackgroundObject(ColorBackground.getInstance(Color.WHITE));
backgroundLabel.setPreferredSize(new Dimension(100, backgroundLabel.getHeight()));
this.add(row(10, cell(backgroundLabel), row(
10,
cell(backgroundPreviewPane),
cell(editBackgroundButton),
cell(backScopeComboBox),
cell(cancel))
).getComponent());
}
@Override

15
designer-realize/src/main/java/com/fr/design/condition/BorderHighlightPane.java

@ -16,6 +16,9 @@ import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* @author richie
* @date 2015-03-26
@ -47,9 +50,15 @@ public class BorderHighlightPane extends ConditionAttrSingleConditionPane<Highli
}
});
UILabel borderLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Border") + ":");
this.add(borderLabel);
this.add(borderButton);
UILabel borderLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Border"));
borderLabel.setPreferredSize(new Dimension(100, borderLabel.getHeight()));
this.add(row(10, cell(borderLabel), row(
10,
cell(borderButton),
cell(cancel))
).getComponent());
}
@Override

18
designer-realize/src/main/java/com/fr/design/condition/FontPane.java

@ -17,6 +17,9 @@ import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* @author richie
* @date 2015-03-26
@ -55,12 +58,17 @@ public class FontPane extends ConditionAttrSingleConditionPane<HighlightAction>
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Current_Cell"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Current_Row"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Current_Column") });
this.add(fontLabel);
this.add(frFontPreviewPane);
this.add(editFRFontButton);
this.add(this.fontScopeComboBox);
this.frFontPreviewPane.setFontObject(DesignUtils.getDefaultGUIFont());
fontLabel.setPreferredSize(new Dimension(100, fontLabel.getHeight()));
this.add(row(10, cell(fontLabel), row(
10,
cell(frFontPreviewPane),
cell(editFRFontButton),
cell(fontScopeComboBox),
cell(cancel))
).getComponent());
}
@Override

15
designer-realize/src/main/java/com/fr/design/condition/ForeGroundPane.java

@ -9,6 +9,9 @@ import com.fr.report.cell.cellattr.highlight.HighlightAction;
import java.awt.*;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* @author richie
* @date 2015-03-26
@ -23,15 +26,21 @@ public class ForeGroundPane extends ConditionAttrSingleConditionPane<HighlightAc
public ForeGroundPane(ConditionAttributesPane conditionAttributesPane) {
super(conditionAttributesPane);
foregroundLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Foreground") + ":");
foregroundLabel.setPreferredSize(new Dimension(100, foregroundLabel.getHeight()));
this.foregroundColorPane = new ColorSelectBox(80);
this.add(foregroundLabel);
this.add(this.foregroundColorPane);
foregroundColorPane.setPreferredSize(new Dimension(100,foregroundColorPane.getHeight()));
this.foreScopeComboBox = new UIComboBox(new String[] {
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Current_Cell"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Current_Row"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Current_Column") });
this.add(this.foreScopeComboBox);
this.foregroundColorPane.setSelectObject(Color.black);
this.add(row(10, cell(foregroundLabel), row(
10,
cell(foregroundColorPane),
cell(foreScopeComboBox),
cell(cancel))
).getComponent());
}
@Override

6
designer-realize/src/main/java/com/fr/design/condition/HighLightConditionAttributesPane.java

@ -28,11 +28,8 @@ public class HighLightConditionAttributesPane extends ConditionAttributesPane<De
protected void initLiteConditionPane() {
// 条件Panel
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.add(centerPane);
liteConditionPane = new ObjectLiteConditionPane();
centerPane.add(liteConditionPane, BorderLayout.CENTER);
this.add(liteConditionPane, BorderLayout.CENTER);
liteConditionPane.setPreferredSize(new Dimension(300, 300));
}
@ -86,6 +83,7 @@ public class HighLightConditionAttributesPane extends ConditionAttributesPane<De
checkConditionPane();
updateMenuDef();
resetWindow();
validate();
repaint(10);

18
designer-realize/src/main/java/com/fr/design/condition/HyperlinkPane.java

@ -19,9 +19,13 @@ import com.fr.report.cell.cellattr.highlight.HighlightAction;
import com.fr.report.cell.cellattr.highlight.HyperlinkHighlightAction;
import javax.swing.SwingUtilities;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* @author richie
* @date 2015-03-26
@ -59,13 +63,19 @@ public class HyperlinkPane extends ConditionAttrSingleConditionPane<HighlightAct
UILabel hyperlinkLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Hyperlink_Type") + ":");
typeField = new UITextField(12);
typeField.setEditable(false);
this.add(hyperlinkLabel);
this.add(typeField);
this.add(hyperlinkButton);
useHyperlink = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Use_Links"));
useHyperlink.addActionListener(l);
this.add(useHyperlink);
hyperlinkLabel.setPreferredSize(new Dimension(100, hyperlinkLabel.getHeight()));
this.add(row(10, cell(hyperlinkLabel), row(
10,
cell(typeField),
cell(hyperlinkButton),
cell(useHyperlink),
cell(cancel))
).getComponent());
}
@Override

15
designer-realize/src/main/java/com/fr/design/condition/NewRealValuePane.java

@ -7,6 +7,11 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.report.cell.cellattr.highlight.HighlightAction;
import com.fr.report.cell.cellattr.highlight.ValueHighlightAction;
import java.awt.Dimension;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* @author richie
* @date 2015-03-26
@ -17,9 +22,15 @@ public class NewRealValuePane extends ConditionAttrSingleConditionPane<Highlight
public NewRealValuePane(ConditionAttributesPane conditionAttributesPane) {
super(conditionAttributesPane);
this.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_New_Value") + ":"));
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_New_Value") + ":");
valueEditor = ValueEditorPaneFactory.createBasicValueEditorPane();
this.add(valueEditor);
label.setPreferredSize(new Dimension(100, label.getHeight()));
this.add(row(10, cell(label), row(
10,
cell(valueEditor),cell(cancel))
).getComponent());
}
@Override

21
designer-realize/src/main/java/com/fr/design/condition/PaddingPane.java

@ -16,6 +16,12 @@ import com.fr.report.cell.cellattr.highlight.HighlightAction;
import com.fr.report.cell.cellattr.highlight.PaddingHighlightAction;
import javax.swing.SpinnerNumberModel;
import java.awt.Dimension;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* @author richie
@ -38,15 +44,10 @@ public class PaddingPane extends ConditionAttrSingleConditionPane<HighlightActio
paddingRight = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Style_Right_Indent") + ":");
paddingRightSpinner = new UIBasicSpinner(new SpinnerNumberModel(2, 0, Integer.MAX_VALUE, 1));
GUICoreUtils.setColumnForSpinner(paddingRightSpinner, 5);
this.add(paddingLeft);
this.add(paddingLeftSpinner);
this.add(paddingRight);
this.add(paddingRightSpinner);
this.paddingScopeComboBox = new UIComboBox(new String[] {
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Current_Cell"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Current_Row"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Current_Column") });
this.add(this.paddingScopeComboBox);
this.paddingLeftSpinner.setValue(new Integer(0));
this.paddingRightSpinner.setValue(new Integer(0));
GeneralContext.listenPluginRunningChanged(new PluginEventListener() {
@ -63,6 +64,16 @@ public class PaddingPane extends ConditionAttrSingleConditionPane<HighlightActio
}
});
refreshIndentationUnit();
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Sytle_Indentation"));
label.setPreferredSize(new Dimension(100, label.getHeight()));
this.add(row(10, column(cell(label).weight(0.5), flex(0.5)), row(
10,
column(5, cell(paddingLeftSpinner).weight(0.5),cell(paddingLeft).weight(0.5)),
column(5, cell(paddingRightSpinner).weight(0.5),cell(paddingRight).weight(0.5)),
column(cell(paddingScopeComboBox).weight(0.5), flex(0.5)),
column(cell(cancel).weight(0.5), flex(0.5)))
).getComponent());
}
private void refreshIndentationUnit() {

15
designer-realize/src/main/java/com/fr/design/condition/PagePane.java

@ -6,6 +6,11 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.report.cell.cellattr.highlight.HighlightAction;
import com.fr.report.cell.cellattr.highlight.PageHighlightAction;
import java.awt.Dimension;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* @author richie
* @date 2015-03-26
@ -18,15 +23,21 @@ public class PagePane extends ConditionAttrSingleConditionPane<HighlightAction>
public PagePane(ConditionAttributesPane conditionAttributesPane) {
super(conditionAttributesPane);
pageLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Pagination") + ":");
this.add(pageLabel);
this.pageComboBox = new UIComboBox(new String[] {
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_No_Pagination"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Cell_Write_Page_After_Row"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Cell_Write_Page_Before_Row"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Cell_Write_Page_After_Column"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Cell_Write_Page_Before_Column") });
this.add(this.pageComboBox);
this.pageComboBox.setSelectedIndex(0);
pageLabel.setPreferredSize(new Dimension(100, pageLabel.getHeight()));
this.add(row(10, cell(pageLabel), row(
10,
cell(pageComboBox),
cell(cancel))
).getComponent());
}
@Override

16
designer-realize/src/main/java/com/fr/design/condition/PresentHighlightPane.java

@ -15,11 +15,15 @@ import com.fr.report.cell.cellattr.highlight.HighlightAction;
import com.fr.report.cell.cellattr.highlight.PresentHighlightAction;
import javax.swing.*;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* @author richie
* @date 2015-03-26
@ -33,11 +37,10 @@ public class PresentHighlightPane extends ConditionAttrSingleConditionPane<Highl
public PresentHighlightPane(final ConditionAttributesPane conditionAttributesPane) {
super(conditionAttributesPane);
this.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Present") + ":"));
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Present") + ":");
String[] typeArray = {PresentConstants.NORMAL, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Other_Present")};
presentComboBox = new UIComboBox(typeArray);
this.add(presentComboBox);
editButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit"));
// this.add(this.valueTextField);
@ -61,7 +64,6 @@ public class PresentHighlightPane extends ConditionAttrSingleConditionPane<Highl
});
// this.valueTextField.setText("");
valueEditor = ValueEditorPaneFactory.createBasicValueEditorPane();
this.add(valueEditor);
presentComboBox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
if (presentComboBox.getSelectedIndex() == 1){
@ -83,6 +85,14 @@ public class PresentHighlightPane extends ConditionAttrSingleConditionPane<Highl
}
}
});
label.setPreferredSize(new Dimension(100, label.getHeight()));
this.add(row(10, cell(label), row(
10,
cell(presentComboBox),
cell(valueEditor),
cell(cancel))
).getComponent());
}
@Override

19
designer-realize/src/main/java/com/fr/design/condition/WHPane.java

@ -12,8 +12,12 @@ import com.fr.stable.unit.UNIT;
import javax.swing.JSpinner;
import javax.swing.SpinnerNumberModel;
import java.awt.Dimension;
import java.math.BigDecimal;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* @author richie
* @date 2015-03-26
@ -26,12 +30,21 @@ public abstract class WHPane extends ConditionAttrSingleConditionPane<HighlightA
protected WHPane(ConditionAttributesPane conditionAttributesPane, String locString) {
super(conditionAttributesPane);
this.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText(locString) + ":"));
this.add(spinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0,Integer.MAX_VALUE, 1)));
this.add(this.unitLabel = new UILabel(getUnitString()));
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText(locString) + ":");
spinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0,Integer.MAX_VALUE, 1));
this.unitLabel = new UILabel(getUnitString());
GUICoreUtils.setColumnForSpinner(spinner, 5);
this.spinner.setValue(new Integer(0));
this.locString = locString;
label.setPreferredSize(new Dimension(100, label.getHeight()));
this.add(row(10, cell(label), row(
10,
cell(spinner),
cell(unitLabel),
cell(cancel))
).getComponent());
}
@Override

19
designer-realize/src/main/java/com/fr/design/condition/WidgetHighlightPane.java

@ -12,13 +12,18 @@ import com.fr.design.widget.WidgetManageCardPane;
import com.fr.design.widget.WidgetPane;
import com.fr.form.ui.*;
import com.fr.form.ui.TextArea;
import com.fr.report.cell.cellattr.highlight.HighlightAction;
import com.fr.report.cell.cellattr.highlight.WidgetHighlightAction;
import javax.swing.*;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* @author richie
* @date 2015-03-26
@ -58,7 +63,6 @@ public class WidgetHighlightPane extends ConditionAttrSingleConditionPane<Highli
});
UILabel widgetLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Widget") + ":");
this.add(widgetLabel);
String[] editorTypes = new String[] {
"",
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Text"),
@ -79,12 +83,9 @@ public class WidgetHighlightPane extends ConditionAttrSingleConditionPane<Highli
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_View_Tree")
};
box = new UIComboBox(editorTypes);
this.add(box);
box.setEnabled(false);
this.add(widgetButton);
widgetButton.setEnabled(false);
useWidget = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Use_Widget"));
this.add(useWidget);
useWidget.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (!useWidget.isSelected()) {
@ -97,6 +98,16 @@ public class WidgetHighlightPane extends ConditionAttrSingleConditionPane<Highli
}
});
widgetLabel.setPreferredSize(new Dimension(100, widgetLabel.getHeight()));
this.add(row(10, cell(widgetLabel), row(
10,
cell(box),
cell(widgetButton),
cell(useWidget),
cell(cancel))
).getComponent());
}
@Override

36
designer-realize/src/main/java/com/fr/design/headerfooter/HFAttributesEditDialog.java

@ -17,7 +17,7 @@ import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.formula.FormulaFactory;
import com.fr.design.formula.UIFormula;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.frpane.FineTabbedPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextarea.UITextArea;
@ -36,13 +36,17 @@ import java.awt.event.ActionListener;
import java.text.Format;
import java.util.ArrayList;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
/**
* The dialog used to edit
*/
public class HFAttributesEditDialog extends BasicPane {
private HFElement hfElement = null;
private UITabbedPane tabbedPane;
private FineTabbedPane.TabPaneBuilder tabbedPaneBuilder = new FineTabbedPane.TabPaneBuilder();
private JPanel centerPane;
//some tab pane.
private TextPane textPane;
private JPanel formulaPane;
@ -62,13 +66,11 @@ public class HFAttributesEditDialog extends BasicPane {
public HFAttributesEditDialog() {
this.setLayout(new BorderLayout(0, 4));
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.add(centerPane);
centerPane = new JPanel(new BorderLayout());
//top
JPanel topControlPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
centerPane.add(topControlPane, BorderLayout.NORTH);
// topControlPane.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel topControlButtonPane =FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane();
topControlPane.add(topControlButtonPane, BorderLayout.WEST);
@ -106,11 +108,6 @@ public class HFAttributesEditDialog extends BasicPane {
}
});
topControlButtonPane.add(deleteButton);
//tabbedpane
tabbedPane = new UITabbedPane();
centerPane.add(tabbedPane, BorderLayout.CENTER);
//init all tab panes.
textPane = new TextPane();
formulaPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
@ -178,7 +175,6 @@ public class HFAttributesEditDialog extends BasicPane {
*/
public void populate(HFElement hfElement, boolean isInsert) {
this.hfElement = hfElement;
this.tabbedPane.removeAll();
if (this.hfElement != null) {
if (ComparatorUtils.equals(this.hfElement.getClass(), TextHFElement.class)) {
this.addTextPaneToTab();
@ -213,7 +209,11 @@ public class HFAttributesEditDialog extends BasicPane {
this.addNewLinePaneToTab();
}
}
this.tabbedPane.revalidate();
this.revalidate();
add(column(
cell(centerPane),
cell(tabbedPaneBuilder.withHeadRatio(0.25f).build())
).getComponent());
if (isInsert) {
this.moveLeftButton.setEnabled(false);
this.moveRightButton.setEnabled(false);
@ -229,30 +229,30 @@ public class HFAttributesEditDialog extends BasicPane {
* Add text pane.
*/
private void addTextPaneToTab() {
this.tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Text"), this.textPane);
this.tabbedPaneBuilder.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Text"), this.textPane);
}
/**
* Add parameter pane.
*/
private void addFormulaPaneToTab() {
this.tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Formula"), this.formulaPane);
this.tabbedPaneBuilder.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Formula"), this.formulaPane);
}
private void addReportFontPaneToTab() {
this.tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Font"), this.frFontPane);
this.tabbedPaneBuilder.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Font"), this.frFontPane);
}
private void addFormatPaneToTab() {
this.tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Format"), this.formatPane);
this.tabbedPaneBuilder.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Format"), this.formatPane);
}
private void addImagePaneToTab() {
this.tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Image"), this.imagePane);
this.tabbedPaneBuilder.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Image"), this.imagePane);
}
private void addNewLinePaneToTab() {
this.tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_HF_New_Line"), this.newLinePane);
this.tabbedPaneBuilder.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_HF_New_Line"), this.newLinePane);
}
/**

13
designer-realize/src/main/java/com/fr/design/headerfooter/HFComponent.java

@ -3,6 +3,7 @@
*/
package com.fr.design.headerfooter;
import com.fine.theme.icon.LazyIcon;
import com.fr.base.BaseUtils;
import com.fr.base.headerfooter.DateHFElement;
import com.fr.base.headerfooter.FormulaHFElement;
@ -282,19 +283,19 @@ public class HFComponent extends UILabel implements MoveActionListener {
*/
public static Icon getHFElementIcon(HFElement hfElement) {
if (hfElement.getClass().equals(TextHFElement.class)) {
return BaseUtils.readIcon("/com/fr/base/images/dialog/headerfooter/text.png");
return new LazyIcon("text");
} else if (hfElement.getClass().equals(FormulaHFElement.class)) {
return BaseUtils.readIcon("/com/fr/base/images/dialog/headerfooter/formula.png");
return new LazyIcon("formula");
} else if (hfElement.getClass().equals(PageNumberHFElement.class)) {
return BaseUtils.readIcon("/com/fr/base/images/dialog/headerfooter/page.png");
} else if (hfElement.getClass().equals(NumberOfPageHFElement.class)) {
return BaseUtils.readIcon("/com/fr/base/images/dialog/headerfooter/pages.png");
return new LazyIcon("pages");
} else if (hfElement.getClass().equals(DateHFElement.class)) {
return BaseUtils.readIcon("/com/fr/base/images/dialog/headerfooter/date.png");
return new LazyIcon("date");
} else if (hfElement.getClass().equals(TimeHFElement.class)) {
return BaseUtils.readIcon("/com/fr/base/images/dialog/headerfooter/time.png");
return new LazyIcon("time");
} else if (hfElement.getClass().equals(ImageHFElement.class)) {
return BaseUtils.readIcon("/com/fr/base/images/dialog/headerfooter/image.png");
return new LazyIcon("image");
} else if (hfElement.getClass().equals(NewLineHFElement.class)) {
return BaseUtils.readIcon("/com/fr/base/images/dialog/headerfooter/newLine.png");
}

161
designer-realize/src/main/java/com/fr/design/headerfooter/HeaderFooterEditPane.java

@ -3,6 +3,8 @@
*/
package com.fr.design.headerfooter;
import com.fine.theme.icon.LazyIcon;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseUtils;
import com.fr.base.GraphHelper;
import com.fr.base.PaperSize;
@ -48,6 +50,7 @@ import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
@ -60,6 +63,10 @@ import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.geom.Rectangle2D;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* Edit header or footer(the object ReportHF).
*/
@ -78,6 +85,7 @@ public class HeaderFooterEditPane extends JPanel {
private UICheckBox printBackgroundCheckBox;
private Background background;
private JPanel iconToolPanel;
private double hfWidth;
/**
* Constructor
@ -92,24 +100,8 @@ public class HeaderFooterEditPane extends JPanel {
protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel centerPane =FRGUIPaneFactory.createBorderLayout_L_Pane();
this.add(centerPane, BorderLayout.CENTER);
JPanel hfPreviewContentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
centerPane.add(hfPreviewContentPane, BorderLayout.CENTER);
hfPreviewContentPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"),null));
hfPreviewPane = new HFPreviewPane();
scrollPreviewPane = new JScrollPane(hfPreviewPane);
hfPreviewContentPane.add(scrollPreviewPane, BorderLayout.CENTER);
JPanel controlPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
centerPane.add(controlPane, BorderLayout.NORTH);
controlPane.add(createToolbar(), BorderLayout.NORTH);
//center panel
JPanel controlContentPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(3);
controlPane.add(controlContentPane, BorderLayout.CENTER);
controlContentPane.setPreferredSize(new Dimension(centerPane.getPreferredSize().width, 120));
ChangeListener contentChangeListener = new ChangeListener() {
public void stateChanged(ChangeEvent e) {
@ -128,77 +120,128 @@ public class HeaderFooterEditPane extends JPanel {
leftHFContainer.setContentChangeListener(contentChangeListener);
centerHFContainer.setContentChangeListener(contentChangeListener);
rightHFContainer.setContentChangeListener(contentChangeListener);
controlContentPane.add(createContainerSection(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_HF_Left_Section") + ":", leftHFContainer));
controlContentPane.add(createContainerSection(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_HF_Center_Section") + ":", centerHFContainer));
controlContentPane.add(createContainerSection(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_HF_Right_Section") + ":", rightHFContainer));
addCenterPanel();
//set current HFContainer
setCurrentHFContainer(leftHFContainer);
}
private void addCenterPanel() {
JPanel controlContentPane = row(
2,
cell(createContainerSection(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_HF_Left_Section") + ":", leftHFContainer)).weight(0.1),
cell(createContainerSection(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_HF_Center_Section") + ":", centerHFContainer)).weight(0.1),
cell(createContainerSection(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_HF_Right_Section") + ":", rightHFContainer)).weight(0.1)
).getComponent();
JPanel centerPane =
column(
10,
cell(createToolbar()).weight(0.07),
cell(controlContentPane).weight(0.3),
column(
2,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"))).weight(0.1),
cell(scrollPreviewPane).weight(1.2)
).weight(0.6)
).with(it -> it.setBorder(new ScaledEmptyBorder(10,10,10,10))).getComponent();
this.add(centerPane, BorderLayout.CENTER);
}
private JToolBar createToolbar() {
//toolbar.
JToolBar toolbar = new JToolBar();
toolbar.setFloatable(false);
Dimension separatorDimension = new Dimension(6, 18);//Separator分隔线
toolbar.add(this.createHFInsertButton(new TextHFElement()));
toolbar.add(this.createHFInsertButton(new FormulaHFElement()));
toolbar.addSeparator(separatorDimension);
toolbar.add(this.createHFInsertButton(new PageNumberHFElement()));
toolbar.add(this.createHFInsertButton(new NumberOfPageHFElement()));
toolbar.addSeparator(separatorDimension);
toolbar.add(this.createHFInsertButton(new DateHFElement()));
toolbar.add(this.createHFInsertButton(new TimeHFElement()));
toolbar.addSeparator(separatorDimension);
toolbar.add(this.createHFInsertButton(new ImageHFElement()));
toolbar.add(this.createHFInsertButton(new NewLineHFElement()));
toolbar.addSeparator(separatorDimension);
printBackgroundCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportGUI_Print_Background"));
headerUnitFieldPane = new AdjustHeightPane();
footerUnitFieldPane = new AdjustHeightPane();
headFootUnitFieldPane = new AdjustHeightPane();
initIconToolPanel();
toolbar.add(iconToolPanel);
return toolbar;
}
private UIButton initCustomBackgroundButton() {
UIButton customBackgroundButton = new UIButton();
customBackgroundButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background"));
customBackgroundButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background"));
customBackgroundButton.set4ToolbarButton();
customBackgroundButton.setIcon(BaseUtils.readIcon("/com/fr/base/images/dialog/headerfooter/background.png"));
toolbar.add(customBackgroundButton);
customBackgroundButton.setIcon(new LazyIcon("background"));
customBackgroundButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
final BackgroundPane backgroundPane = new BackgroundPane();
BasicDialog backgroundDialog = backgroundPane.showWindow(
SwingUtilities.getWindowAncestor(HeaderFooterEditPane.this));
backgroundPane.populate(background);
backgroundPane.populate(background);
backgroundDialog.addDialogActionListener(new DialogActionAdapter() {
@Override
public void doOk() {
background = backgroundPane.update();
refreshPreivewPane();
}
}
});
backgroundDialog.setVisible(true);
}
});
printBackgroundCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportGUI_Print_Background"));
toolbar.add(printBackgroundCheckBox);
return customBackgroundButton;
}
toolbar.addSeparator(separatorDimension);
JPanel headerPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
headerUnitFieldPane = new AdjustHeightPane();
headerPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Header") + ":"));
headerPane.add(headerUnitFieldPane);
private void initIconToolPanel() {
iconToolPanel = row(
6,
cell(this.createHFInsertButton(new TextHFElement())),
cell(this.createHFInsertButton(new FormulaHFElement())),
cell(this.createHFInsertButton(new PageNumberHFElement())),
cell(this.createHFInsertButton(new NumberOfPageHFElement())),
cell(this.createHFInsertButton(new DateHFElement())),
cell(this.createHFInsertButton(new TimeHFElement())),
cell(this.createHFInsertButton(new ImageHFElement())),
cell(this.createHFInsertButton(new NewLineHFElement())),
cell(initCustomBackgroundButton()),
cell(printBackgroundCheckBox),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Height") + ":")),
cell(headFootUnitFieldPane)
).with(it -> it.setBorder(new ScaledEmptyBorder(2,0,2,0)))
).getComponent();
}
JPanel footerPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
footerUnitFieldPane = new AdjustHeightPane();
footerPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Footer") + ":"));
footerPane.add(footerUnitFieldPane);
/**
* icon 置灰
*/
public void disableIconToolPanel() {
if (iconToolPanel == null) {
return;
}
for (int i = 0; i < iconToolPanel.getComponentCount(); i++) {
Component component = iconToolPanel.getComponent(i);
if (!(component instanceof UIButton)) {
continue;
}
UIButton button = ((UIButton) component);
if (button.getIcon() instanceof LazyIcon) {
LazyIcon icon = ((LazyIcon) button.getIcon());;
button.setIcon(icon.disabled());
}
}
}
JPanel headerFooterPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
headFootUnitFieldPane = new AdjustHeightPane();
headerFooterPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Height") + ":"));
headerFooterPane.add(headFootUnitFieldPane);
toolbar.add(headerFooterPane);
return toolbar;
/**
* icon 取消置灰
*/
public void enableIconToolPanel() {
if (iconToolPanel == null) {
return;
}
for (int i = 0; i < iconToolPanel.getComponentCount(); i++) {
Component component = iconToolPanel.getComponent(i);
if (!(component instanceof UIButton)) {
continue;
}
UIButton button = ((UIButton) component);
if (button.getIcon() instanceof LazyIcon) {
String iconId = ((LazyIcon) button.getIcon()).getId();
button.setIcon(new LazyIcon(iconId));
}
}
}

13
designer-realize/src/main/java/com/fr/design/headerfooter/HeaderFooterPane.java

@ -3,6 +3,8 @@
*/
package com.fr.design.headerfooter;
import com.fine.theme.icon.LazyIcon;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.base.BaseUtils;
import com.fr.base.PaperSize;
import com.fr.base.ScreenResolution;
@ -53,6 +55,7 @@ public abstract class HeaderFooterPane extends BasicPane {
reportHFYypeList.setCellRenderer(reportPageTypeRenderer);
reportHFYypeList
.addListSelectionListener(reportHFTypeSelectionListener);
reportHFYypeList.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
JScrollPane hfTypeListScrollPane = new JScrollPane(reportHFYypeList);
leftPane.add(hfTypeListScrollPane, BorderLayout.CENTER);
@ -74,7 +77,7 @@ public abstract class HeaderFooterPane extends BasicPane {
JPanel definePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
centerPane.add(definePane, BorderLayout.NORTH);
defineCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_HF_Whether_To_Define_The_Selected_Type"), true);
defineCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_HF_Whether_To_Define_The_Selected_Type"), true); //是否定义选中的类型
definePane.add(defineCheckBox);
defineCheckBox.addChangeListener(defineChangeListener);
@ -133,9 +136,11 @@ public abstract class HeaderFooterPane extends BasicPane {
GUICoreUtils.setEnabled(headerFooterEditPane, true);
reportHFHash.put(currentReportHFType,
headerFooterEditPane.update());
headerFooterEditPane.enableIconToolPanel();
} else {
GUICoreUtils.setEnabled(headerFooterEditPane, false);
reportHFHash.remove(new Integer(currentReportHFType));
headerFooterEditPane.disableIconToolPanel();
}
reportHFYypeList.repaint();
@ -198,9 +203,7 @@ public abstract class HeaderFooterPane extends BasicPane {
if (value != null && value instanceof Integer) {
int reportHFType = (Integer) value;
this
.setIcon(BaseUtils
.readIcon("/com/fr/base/images/oem/logo.png"));
this.setIcon(new LazyIcon("logo"));
if (reportHFType == ReportConstants.REPORTPAGE_DEFAULT) {
this.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_HF_Default_Page"));
} else if (reportHFType == ReportConstants.REPORTPAGE_FIRST) {
@ -216,7 +219,7 @@ public abstract class HeaderFooterPane extends BasicPane {
if (reportHFHash != null) {
Object obj = reportHFHash.get(new Integer(reportHFType));
if (obj == null) {
this.setEnabled(false);
this.setIcon(new LazyIcon("logo").disabled());
}
}
}

42
designer-realize/src/main/java/com/fr/design/headerfooter/ImagePane.java

@ -3,9 +3,13 @@
*/
package com.fr.design.headerfooter;
import com.fine.theme.light.ui.FineRoundBorder;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.frpane.ImgChooseWrapper;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.style.background.image.ImageFileChooser;
import com.fr.design.style.background.image.ImagePreviewPane;
@ -15,10 +19,16 @@ import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* Image Pane.
*/
@ -34,27 +44,17 @@ public class ImagePane extends BasicPane {
this.setLayout(FRGUIPaneFactory.createM_BorderLayout());
//preview pane.
JPanel previewPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.add(previewPane);
// previewPane.setLayout(FRGUIPaneFactory.createBorderLayout());
if (hasPreviewBorder) {
previewPane.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview")));
}
JPanel previewPane = new JPanel(new BorderLayout());
imagePreviewPane = new ImagePreviewPane();
previewPane.add(new JScrollPane(imagePreviewPane));
previewPane.setBorder(new FineRoundBorder());
previewPane.setPreferredSize(new Dimension(500, 400));
previewPane.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
//select image
JPanel rightPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.add(rightPane, BorderLayout.EAST);
// rightPane.setLayout(FRGUIPaneFactory.createBorderLayout());
if (hasPreviewBorder) {
rightPane.setBorder(BorderFactory.createEmptyBorder(8, 2, 0, 2));
} else {
rightPane.setBorder(BorderFactory.createEmptyBorder(4, 2, 0, 2));
}
UIButton selectImageButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Image_Select_Picture"));
rightPane.add(selectImageButton, BorderLayout.NORTH);
selectImageButton.addActionListener(selectPictureActionListener);
@ -62,6 +62,16 @@ public class ImagePane extends BasicPane {
//init image file chooser.
imageFileChooser = new ImageFileChooser();
imageFileChooser.setMultiSelectionEnabled(false);
this.add(column(
3,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"))),
row(
10,
cell(previewPane).weight(0.9),
cell(rightPane).weight(0.2)
)
).with(it -> it.setBorder(new ScaledEmptyBorder(10,10,10,10))).getComponent());
}
@Override

37
designer-realize/src/main/java/com/fr/design/mainframe/AuthorityToolBarPane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.common.inputevent.InputEventBaseOnOS;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.file.HistoryTemplateListPane;
@ -24,10 +25,10 @@ import com.fr.web.attr.ReportWebAttr;
import com.fr.workspace.WorkContext;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.MouseAdapter;
@ -35,6 +36,9 @@ import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* Author : daisy
* Date: 13-9-9
@ -129,11 +133,11 @@ public class AuthorityToolBarPane<T extends WebContent> extends BasicBeanPane<Re
};
public AuthorityToolBarPane() {
this.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 3));
this.setBorder(BorderFactory.createEmptyBorder(0, PRE_GAP, 0, 0));
this.setLayout(new BorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0, PRE_GAP, 10, 0));
title = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Toolbar_Choose_Role"));
title.setHorizontalAlignment(SwingConstants.CENTER);
this.add(title, 0);
title.setPreferredSize(new Dimension(120, 20));
choseComboBox = new UIComboBox(CHOOSEITEM) {
public Dimension getPreferredSize() {
Dimension dim = super.getPreferredSize();
@ -144,29 +148,18 @@ public class AuthorityToolBarPane<T extends WebContent> extends BasicBeanPane<Re
choseComboBox.addItemListener(itemListener);
//默认选择第一个
choseComboBox.setSelectedIndex(0);
this.add(createGapPanel(SMALL_GAP));
this.add(choseComboBox);
toolBarPane = new ToolBarPane();
toolBarPane.setBorder(null);
toolBarPane.removeDefaultMouseListener();
this.add(createGapPanel(GAP));
this.add(toolBarPane);
populateDefaultToolBarWidgets();
populateBean(getReportWebAttr());
toolBarPane.addAuthorityListener(mouseListener);
authorityEditToolBarPane = new AuthorityEditToolBarPane(toolBarPane.getToolBarButtons());
authorityEditToolBarPane.setAuthorityToolBarPane(this);
checkToolBarPaneEnable();
}
private JPanel createGapPanel(final int gap) {
return new JPanel() {
public Dimension getPreferredSize() {
Dimension dim = super.getPreferredSize();
dim.width = gap;
return dim;
}
};
this.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
toolBarPane.setOpaque(false);
this.add(row(10, cell(title), cell(choseComboBox), cell(toolBarPane)).getComponent());
}
@ -273,15 +266,13 @@ public class AuthorityToolBarPane<T extends WebContent> extends BasicBeanPane<Re
this.remove(title);
// 如果是空值就说明采用服务器配置了
if (reportWebAttr == null || this.getWebContent(reportWebAttr) == null) {
title = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Server_Toolbar_Choose_Role"));
title.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Server_Toolbar_Choose_Role"));
populateServerSettings();
this.add(title, 0);
return;
}
// 模板设置
T webContent = this.getWebContent(reportWebAttr);
title = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Template_Toolbar_Choose_Role"));
this.add(title, 0);
title.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Template_Toolbar_Choose_Role"));
populate(webContent.getToolBarManagers());
}

1
designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneAuthorityEditPane.java

@ -885,7 +885,6 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane {
newValuePane.add(valueEditor, "new");
newValuePane.add(new JPanel(), "old");
newValuePane.setPreferredSize(VALUEPANE_OLD_DIMENSION);
oldNewValueButton.setPreferredSize(VALUEPANE_NEW_DIMENSION);
return oldNewValueButton;
}
}

44
designer-realize/src/main/java/com/fr/design/report/NewReportBackgroundPane.java

@ -1,5 +1,9 @@
package com.fr.design.report;
import com.fine.swing.ui.layout.Layouts;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.theme.ReportTheme;
import com.fr.base.theme.TemplateTheme;
import com.fr.base.theme.settings.ThemedReportBodyStyle;
@ -113,9 +117,12 @@ public class NewReportBackgroundPane extends BasicPane {
double f = TableLayout.FILL;
JPanel uiLabelPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
uiLabelPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Report_Background_Fill")), BorderLayout.NORTH);
UILabel uiLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Background_Fill"));
uiLabel.setPreferredSize(new Dimension(24,24));
uiLabelPane.add(uiLabel, BorderLayout.NORTH);
uiLabelPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
backgroundPane = new ReportBackgroundSpecialPane();
backgroundPane.setBorder(new ScaledEmptyBorder(10, 0, 0, 0));
backgroundLabeledPane = TableLayoutHelper.createCommonTableLayoutPane(
new Component[][]{ new Component[] { uiLabelPane, backgroundPane } },
new double[] { p }, new double[] { SETTING_LABEL_WIDTH, f}, IntervalConstants.INTERVAL_L1
@ -137,12 +144,11 @@ public class NewReportBackgroundPane extends BasicPane {
}
});
JPanel contentContainer = new JPanel(new BorderLayout(IntervalConstants.INTERVAL_L6, 0));
contentContainer.setBorder(BorderFactory.createEmptyBorder());
contentContainer.setBorder(BorderFactory.createEmptyBorder());
JPanel contentContainer = Layouts.column(
10,
Layouts.row(10, Layouts.cell(createLeftPane()), Layouts.cell(createRightPane()))
).getComponent();
contentContainer.setPreferredSize(new Dimension(600, 540));
contentContainer.add(createLeftPane(), BorderLayout.CENTER);
contentContainer.add(createRightPane(), BorderLayout.EAST);
addAttributeChangeListener(new AttributeChangeListener() {
@Override
@ -161,25 +167,23 @@ public class NewReportBackgroundPane extends BasicPane {
}
private JPanel createLeftPane() {
JPanel container = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
container.setBorder(BorderFactory.createEmptyBorder());
JPanel titledPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
titledPane.setBorder(new CompoundBorder(
BorderUtils.createTitleBorder(Toolkit.i18nText("Fine-Design_Basic_Preview"), 12),
BorderFactory.createEmptyBorder(5, 5, 4, 5)
));
titledPane.setPreferredSize(new Dimension(377, 502));
container.add(titledPane, BorderLayout.WEST);
titledPane.add(previewPane, BorderLayout.WEST);
previewPane.setPreferredSize(new Dimension(367, 480));
return container;
JPanel panel = new JPanel();
panel.add(previewPane, BorderLayout.NORTH);
previewPane.setBorder(new FineRoundBorder());
JPanel titledPane = Layouts.column(
10,
Layouts.cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Preview"))),
Layouts.cell(previewPane)
).getComponent();
previewPane.setPreferredSize(FineUIScale.scale(new Dimension(367, 480)));
return titledPane;
}
private JPanel createRightPane() {
JPanel container = FRGUIPaneFactory.createBorderLayout_S_Pane();
container.setBorder(BorderFactory.createEmptyBorder());
container.setPreferredSize(new Dimension(273, 502));
container.setPreferredSize(new Dimension(263, 502));
container.add(themePane, BorderLayout.NORTH);
return container;
}

149
designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java

@ -1,5 +1,6 @@
package com.fr.design.report;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.GraphHelper;
import com.fr.design.border.UIRoundedBorder;
import com.fr.design.border.UITitledBorder;
@ -38,6 +39,12 @@ import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle;
public class ReportColumnsPane extends BasicPane{
public static final int ROW = 0;
public static final int COLUMN = 1;
@ -118,8 +125,20 @@ public class ReportColumnsPane extends BasicPane{
JPanel buttonGroupPane = new JPanel(new FlowLayout(FlowLayout.CENTER, 23,11));
buttonGroupPane.add(onOffButtonGroup);
north.add(buttonGroupPane, BorderLayout.EAST);
this.add(north, BorderLayout.NORTH);
this.add(createRowColumnPane(), BorderLayout.CENTER);
this.setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
JPanel northV2 = column(
20,
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportColumns_Columns"))),
flex(0.1),
cell(onOffButtonGroup),
flex(0.7)
),
cell(createRowColumnPane())
).getComponent();
this.add(northV2, BorderLayout.NORTH);
}
private ActionListener onOffListener = new ActionListener() {
@ -175,23 +194,28 @@ public class ReportColumnsPane extends BasicPane{
* 创建分栏页面
*/
private JPanel createRowColumnPane() {
JPanel divideRowPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
divideRowPane.setBorder(BorderFactory.createEmptyBorder(0,21,0,21));
JPanel center = FRGUIPaneFactory.createBorderLayout_S_Pane();
// 行分栏样式
JPanel north = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column_Style"));
north.setPreferredSize(new Dimension(549, 216));
north.add(createSamplePane());
north.add(createRowMaxOrSetPane());
center.add(createRowPane(), BorderLayout.NORTH);
JPanel xx = new JPanel(new FlowLayout(FlowLayout.RIGHT,0,0));
JPanel north = column(
10,
cell(createSamplePane()),
cell(createRowMaxOrSetPane())
).getComponent();
showBlankCheckBox = new UICheckBox(SHOW_BLANK[rowOrColumn]);
xx.add(showBlankCheckBox);
center.add(xx, BorderLayout.CENTER);
divideRowPane.add(north, BorderLayout.NORTH);
divideRowPane.add(center, BorderLayout.CENTER);
JPanel center = column(
10,
cell(createRowPane()),
row(
flex(),
cell(showBlankCheckBox)
)
).getComponent();
JPanel divideRowPane = column(
20,
cell(wrapComponentWithTitle(north, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column_Style"))),
cell(north),
cell(center)
).getComponent();
return divideRowPane;
}
@ -199,25 +223,22 @@ public class ReportColumnsPane extends BasicPane{
* 创建示例页面
*/
private JPanel createSamplePane() {
JPanel sampleLablePane = new JPanel(new GridLayout(1,2));
sampleLablePane.setPreferredSize(new Dimension(524, 130));
JPanel rPane = new JPanel();
UILabel rLabel = new UILabel(IOUtils.readIcon("/com/fr/design/images/reportcolumns/" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Row_Icon_File_Name")));
rLabel.setBorder(BorderFactory.createEmptyBorder(5,45,0,49));
rPane.add(rLabel);
rowButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportColumns_Columns_Horizontally"));
rowButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportColumns_Columns_Horizontally")); // 行芬兰
rowButton.addActionListener(rowChangeListener);
rPane.add(rowButton);
sampleLablePane.add(rPane);
JPanel cPane = new JPanel();
UILabel cLabel = new UILabel(IOUtils.readIcon("/com/fr/design/images/reportcolumns/" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Col_Icon_File_Name")));
cLabel.setBorder(BorderFactory.createEmptyBorder(5,49,0,49));
cPane.add(cLabel);
colButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportColumns_Columns_Vertically"));
colButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportColumns_Columns_Vertically")); //列芬兰
colButton.addActionListener(colChangeListener);
cPane.add(colButton);
sampleLablePane.add(cPane);
return sampleLablePane;
return row(
row(
3,
column(cell(rowButton)),
cell(new UILabel(IOUtils.readIcon("/com/fr/design/images/reportcolumns/" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Row_Icon_File_Name"))))
).weight(0.2),
row(
3,
column(cell(colButton)),
cell(new UILabel(IOUtils.readIcon("/com/fr/design/images/reportcolumns/" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Col_Icon_File_Name"))))
).weight(0.3)
).getComponent();
}
private ActionListener rowChangeListener = new ActionListener() {
@ -253,26 +274,33 @@ public class ReportColumnsPane extends BasicPane{
}
private JPanel createRowMaxOrSetPane() {
JPanel RowMaxOrSetPane = new JPanel();
RowMaxOrSetPane.setBorder(BorderFactory.createEmptyBorder(8, 5, 0, 0));
RowMaxOrSetPane.setLayout(new FlowLayout(FlowLayout.LEFT,25,2));
//marks:在多少行后开始分栏
maxRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportColumns_Columns_After"));
maxNumberSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, Integer.MAX_VALUE, 1));
GUICoreUtils.setColumnForSpinner(maxNumberSpinner, 6);
maxRadioButton.addActionListener(maxBtnListener);
maxUILabel = new UILabel(COLUMN_ROW_TEXTS[rowOrColumn] );
JPanel maxRowRadioPane = GUICoreUtils.createFlowPane(new JComponent[]{maxRadioButton, maxNumberSpinner, maxUILabel, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Report_Columns_Columns_Optional"))}, FlowLayout.CENTER);
RowMaxOrSetPane.add(maxRowRadioPane);
//marks:分成多少行
toXRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportColumns_Columns_To"));
toXRadioButton.addActionListener(toXBtnListener);
toXSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, Integer.MAX_VALUE, 1));
GUICoreUtils.setColumnForSpinner(toXSpinner, 6);
toUILabel = new UILabel(COLUMN_ROW_TEXTS[1 - rowOrColumn]);
JPanel setRowRadioPane = GUICoreUtils.createFlowPane(new JComponent[]{toXRadioButton, toXSpinner, toUILabel}, FlowLayout.CENTER);
RowMaxOrSetPane.add(setRowRadioPane);
return RowMaxOrSetPane;
return row(
row(
3,
cell(maxRadioButton),
cell(maxNumberSpinner),
cell(maxUILabel),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Report_Columns_Columns_Optional")))
).weight(0.2),
row(
3,
cell(toXRadioButton),
cell(toXSpinner),
cell(toUILabel)
).weight(0.3)
).getComponent();
}
private ActionListener toXBtnListener = new ActionListener() {
@ -305,26 +333,31 @@ public class ReportColumnsPane extends BasicPane{
* 创建行分栏界面
*/
private JPanel createRowPane() {
JPanel rowPane = new JPanel();
UITitledBorder explainBorder = UITitledBorder.createBorderWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column_Area"));
rowPane.setBorder(explainBorder);
rowPane.setLayout(new FlowLayout(FlowLayout.LEFT, 5,13));
rowPane.setPreferredSize(new Dimension(500,80));
rowPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column_Data") + ":"));
repeatColDataTextField = new UITextField();
repeatColDataTextField.setPreferredSize(new Dimension(107,24));
rowPane.add(repeatColDataTextField);
rowPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Format") + ": A2:D5 "));
copyLabel = new UILabel(REPORT_COLUMN_RAPEAT[rowOrColumn] + ":");
rowPane.add(copyLabel);
copyTitleTextField = new UITextField();
copyTitleTextField.setPreferredSize(new Dimension(107,24));
rowPane.add(copyTitleTextField);
rowPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Format") + ": 1,2-3,5,18"));
return rowPane;
JPanel colPane = column(
10,
row(
10,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column_Data") + ":")).weight(0.12),
cell(repeatColDataTextField).weight(0.33),
cell(new UILabel("<html><font color=gray>" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Format") + ": A2:D5 " + "</font></html>")).weight(0.15),
flex(0.4)
),
row(
10,
cell(copyLabel).weight(0.12),
cell(copyTitleTextField).weight(0.33),
cell(new UILabel("<html><font color=gray>" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Format") + ": 1,2-3,5,18" + "</font></html>")).weight(0.15),
flex(0.4)
)
).getComponent();
return column(
cell(wrapComponentWithTitle(colPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column_Area")))
).getComponent();
}
/**

2
designer-realize/src/main/java/com/fr/design/report/freeze/FreezeAndRepeatPane.java

@ -26,7 +26,7 @@ public abstract class FreezeAndRepeatPane extends BasicBeanPane<FT> {
protected boolean isEnalbed;
protected void initComponent() {
Dimension size = new Dimension(43, 21);
Dimension size = new Dimension(50, 21);
if (start instanceof UISpinner) {
start.setPreferredSize(size);
((UISpinner) start).addChangeListener(new ChangeListener() {

277
designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java

@ -4,6 +4,7 @@ import com.fr.base.FRContext;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.extra.WebViewDlgHelper;
import com.fr.design.gui.frpane.FineTabbedPane;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.ActionLabel;
@ -24,6 +25,13 @@ import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle;
/**
* Sets Report Page Attributes
*/
@ -33,7 +41,7 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
private static final int LABEL_HEIGHT = 45;
//tab
private UITabbedPane tabbedPane;
private FineTabbedPane tabbedPane;
// 重复标题行
private RepeatRowPane repeatTitleRowPane;
@ -82,15 +90,16 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
* 重复标题行
*/
private JPanel initRowStartPane() {
JPanel soverlapRowStartPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
useRepeatTitleRCheckBox = new UICheckBox();
soverlapRowStartPane.add(useRepeatTitleRCheckBox);
soverlapRowStartPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Title_Start_Row_Form")));
repeatTitleRowPane = new RepeatRowPane();
soverlapRowStartPane.add(repeatTitleRowPane);
soverlapRowStartPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Row")));
return soverlapRowStartPane;
return row(
2,
cell(useRepeatTitleRCheckBox),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Title_Start_Row_Form"))),
cell(repeatTitleRowPane),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Row")))
).getComponent();
}
/**
@ -98,16 +107,49 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
*/
private JPanel initColStartPane() {
// 重复打印标题的起始列
JPanel soverlapColStartPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
useRepeatTitleCCheckBox = new UICheckBox();
soverlapColStartPane.add(useRepeatTitleCCheckBox);
soverlapColStartPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Title_Start_Column_Form")));
// 重复打印标题的结束列
repeatTitleColPane = new RepeatColPane();
soverlapColStartPane.add(repeatTitleColPane);
soverlapColStartPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column")));
return soverlapColStartPane;
return row(
2,
cell(useRepeatTitleCCheckBox),
cell(new UILabel(Toolkit.i18nText("Fine-Design_Report_Title_Start_Column_Form"))),
cell(repeatTitleColPane),
cell(new UILabel(Toolkit.i18nText("Fine-Design_Report_Column")))
).getComponent();
}
private JPanel initPageRepeatPane() {
return row(
10,
column(
10,
cell(new UILabel(REPEAT_AND_FROZEN_HEAD)).weight(0.5),
flex(0.5)
),
column(
10,
cell(initRowStartPane()).weight(0.5),
cell(initColStartPane()).weight(0.5)
)
).getComponent();
}
private JPanel initPageRepeatFootPane() {
return row(
10,
column(
10,
cell(new UILabel(REPEAT_AND_FROZEN_FOOT)).weight(0.5),
flex(0.5)
),
column(
10,
cell(initFootRowStarPane()).weight(0.5),
cell(initFootColStartPane()).weight(0.5)
)
).getComponent();
}
/**
@ -115,15 +157,16 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
*/
private JPanel initFootRowStarPane() {
// 重复打印结尾的起始行
JPanel foverlapRowStartPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
useRepeatFinisRCheckBox = new UICheckBox();
foverlapRowStartPane.add(useRepeatFinisRCheckBox);
foverlapRowStartPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Finis_Start_Row_Form")));
repeatFinisRowPane = new RepeatRowPane();
foverlapRowStartPane.add(repeatFinisRowPane);
foverlapRowStartPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Row")));
return foverlapRowStartPane;
return row(
2,
cell(useRepeatFinisRCheckBox),
cell(new UILabel(Toolkit.i18nText("Fine-Design_Report_Finis_Start_Row_Form"))),
cell(repeatFinisRowPane),
cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Row")))
).getComponent();
}
/**
@ -131,15 +174,16 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
*/
private JPanel initFootColStartPane() {
// 重复打印结尾的起始列
JPanel foverlapColStartPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
useRepeatFinisCCheckBox = new UICheckBox();
foverlapColStartPane.add(useRepeatFinisCCheckBox);
foverlapColStartPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Finis_Start_Column_Form")));
repeatFinisColPane = new RepeatColPane();
foverlapColStartPane.add(repeatFinisColPane);
foverlapColStartPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column")));
return foverlapColStartPane;
return row(
2,
cell(useRepeatFinisCCheckBox),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Finis_Start_Column_Form"))),
cell(repeatFinisColPane),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column")))
).getComponent();
}
/**
@ -157,37 +201,64 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
*/
private JPanel initPageFrozenPane() {
// 分页冻结
JPanel pagecon = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1);
pagecon.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0));
JPanel pageRowGridPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
pageRowGridPane.add(this.usePageHeadFrozenRCheckBox = new UICheckBox());
usePageHeadFrozenRCheckBox = new UICheckBox();
// 显示行冻结信息的panel
freezePageRowPane = new FreezePagePane(true);
pageRowGridPane.add(freezePageRowPane);
pagecon.add(pageRowGridPane);
addPageFrozenCol(pagecon);
addBorder(pagecon, REPEAT_AND_FROZEN_HEAD);
return pagecon;
freezePageColPane = new FreezePagePane(false);
usePageHeadFrozenCCheckBox = new UICheckBox();
return row(
10,
column(
10,
cell(new UILabel(REPEAT_AND_FROZEN_HEAD)).weight(0.5),
flex(0.5)
),
column(
10,
row(
2,
cell(usePageHeadFrozenRCheckBox),
cell(freezePageRowPane)
).weight(0.5),
row(
2,
cell(usePageHeadFrozenCCheckBox),
cell(freezePageColPane)
).weight(0.5)
)
).getComponent();
}
private JPanel initPageFrozenFootPane() {
JPanel pageContentPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1);
pageContentPanel.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0));
// 行冻结
JPanel pageRowPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
pageRowPane.add(this.usePageFootFrozenRCheckBox = new UICheckBox());
usePageFootFrozenRCheckBox = new UICheckBox();
// 列冻结
JPanel pageColPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
pageColPane.add(this.usePageFootFrozenCCheckBox = new UICheckBox());
pageContentPanel.add(pageRowPane);
usePageFootFrozenCCheckBox = new UICheckBox();
freezeFootRowPane = new FreezePagePane(true, true);
pageRowPane.add(freezeFootRowPane);
pageContentPanel.add(pageColPane);
freezeFootColPane = new FreezePagePane(false, true);
pageColPane.add(freezeFootColPane);
addBorder(pageContentPanel, REPEAT_AND_FROZEN_FOOT);
return pageContentPanel;
return row(
10,
column(
10,
cell(new UILabel(REPEAT_AND_FROZEN_FOOT)).weight(0.5),
flex(0.5)
),
column(
10,
row(
2,
cell(usePageFootFrozenRCheckBox),
cell(freezeFootRowPane)
).weight(0.5),
row(
2,
cell(usePageFootFrozenCCheckBox),
cell(freezeFootColPane)
).weight(0.5)
)
).getComponent();
}
@ -207,49 +278,59 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
* 填报冻结Pane
*/
protected JPanel initWriteFrozenPane() {
JPanel writePanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
// 填报冻结
UILabel writeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Face_Write_Frozen") + ":");
JPanel writeLabelPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
writeLabelPanel.add(writeLabel);
writePanel.add(writeLabelPanel, BorderLayout.NORTH);
JPanel writecon = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1);
writecon.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0));
writePanel.add(writecon, BorderLayout.CENTER);
// 行冻结
JPanel writeRowPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
writeRowPane.add(this.useWriteFrozenRCheckBox = new UICheckBox());
// 列冻结
JPanel writeColPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
writeColPane.add(this.useWriteFrozenCCheckBox = new UICheckBox());
writecon.add(writeRowPane);
useWriteFrozenRCheckBox = new UICheckBox();
freezeWriteRowPane = new FreezeWriteRowPane();
writeRowPane.add(freezeWriteRowPane);
writecon.add(writeColPane);
// 列冻结
useWriteFrozenCCheckBox = new UICheckBox();
freezeWriteColPane = new FreezeWriteColPane();
writeColPane.add(freezeWriteColPane);
return writePanel;
return row(
10,
column(
10,
cell(new UILabel(Toolkit.i18nText("Fine-Design_Report_Face_Write_Frozen"))).weight(0.5),
flex(0.5)
),
column(
10,
row(
2,
cell(useWriteFrozenRCheckBox),
cell(freezeWriteRowPane)
).weight(0.5),
row(
2,
cell(useWriteFrozenCCheckBox),
cell(freezeWriteColPane)
).weight(0.5)
)
).getComponent();
}
public RepeatAndFreezeSettingPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel outrepeatPanel = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Repeat"));
JPanel cenrepeatPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
outrepeatPanel.add(cenrepeatPanel);
JPanel outfreezePanel = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Frozen"));
JPanel pagePanel = new JPanel(FRGUIPaneFactory.createBorderLayout());
JPanel repeatHeadPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1);
JPanel repeatFootPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1);
tabbedPane = new UITabbedPane();
//添加上方的边界线
addBorder(repeatHeadPanel, REPEAT_AND_FROZEN_HEAD);
addBorder(repeatFootPanel, REPEAT_AND_FROZEN_FOOT);
pagePanel.add(outrepeatPanel, BorderLayout.NORTH);
pagePanel.add(outfreezePanel, BorderLayout.CENTER);
this.setLayout(new BorderLayout());
JPanel outrepeatPanel = column(
10,
cell(initPageRepeatPane()),
cell(initPageRepeatFootPane())
).getComponent();
JPanel outfreezePanel = column(
10,
cell(initPageFrozenPane()),
cell(initPageFrozenFootPane())
).getComponent();
JPanel pagePanel = column(
10,
fix(10),
cell(wrapComponentWithTitle(outrepeatPanel, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Repeat"))),
cell(wrapComponentWithTitle(outfreezePanel, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Frozen"))),
cell(new UILabel("<html><font color=gray>"+ Toolkit.i18nText("Fine-Design_Report_Engine_Freeze_Tip") + "</font></html>"))
).getComponent();
// 重复打印部分
// 重复打印标题的起始行
@ -258,31 +339,22 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
UILabel warning = new UILabel("(" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_FreezeWarning") + ")");
warning.setForeground(Color.red);
labelPanel.add(warning);
cenrepeatPanel.add(repeatHeadPanel, BorderLayout.NORTH);
cenrepeatPanel.add(repeatFootPanel, BorderLayout.CENTER);
repeatHeadPanel.add(initRowStartPane());
addColStart(repeatHeadPanel);
repeatFootPanel.add(initFootRowStarPane());
addFootColStart(repeatFootPanel);
outfreezePanel.add(initPageFrozenPane(), BorderLayout.NORTH);
outfreezePanel.add(initPageFrozenFootPane(),BorderLayout.CENTER);
outfreezePanel.add(new UILabel("<html><font color=gray>&nbsp"+ Toolkit.i18nText("Fine-Design_Report_Engine_Freeze_Tip") + "</font></html>"),BorderLayout.SOUTH);
JPanel writePanel = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Frozen"));
JPanel writeOutrepeatPanel = initWriteFrozenPane();
JPanel writePanel = column(
10,
fix(10),
cell(wrapComponentWithTitle(writeOutrepeatPanel, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Frozen")))
).getComponent();
addWriteFrozen(writePanel, pagePanel);
if (tabbedPane.getTabSize() == 0) {
this.add(pagePanel);
}
initPageRwoListener();
initPageColListener();
initWriteListener();
}
private boolean shouldShowTip() {
return WorkContext.getCurrent().isLocal() && FRContext.isChineseEnv();
}
@ -320,9 +392,10 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
}
protected void addWriteFrozen(JPanel freezePanel, JPanel pagePanel) {
freezePanel.add(initWriteFrozenPane(), BorderLayout.CENTER);
tabbedPane.addTab(Toolkit.i18nText("Fine-Design_Basic_M_Page_Preview"), pagePanel);
tabbedPane.addTab(Toolkit.i18nText("Fine-Design_Basic_M_Write_Preview"), freezePanel);
FineTabbedPane.TabPaneBuilder tabbedPaneBuilder = new FineTabbedPane.TabPaneBuilder();
tabbedPaneBuilder.addTab(Toolkit.i18nText("Fine-Design_Basic_M_Page_Preview"), pagePanel); //分页预览
tabbedPaneBuilder.addTab(Toolkit.i18nText("Fine-Design_Basic_M_Write_Preview"), freezePanel);
tabbedPane = tabbedPaneBuilder.withHeadRatio(0.35f).build();
//去除对应的焦点虚线边框
tabbedPane.setFocusable(false);
this.add(tabbedPane);

Loading…
Cancel
Save