|
|
@ -1,10 +1,11 @@ |
|
|
|
package com.fr.design.widgettheme; |
|
|
|
package com.fr.design.widgettheme; |
|
|
|
|
|
|
|
|
|
|
|
import com.fine.swing.ui.layout.Column; |
|
|
|
import com.fine.swing.ui.layout.Column; |
|
|
|
|
|
|
|
import com.fine.theme.icon.LazyIcon; |
|
|
|
|
|
|
|
import com.fine.theme.utils.FineLayoutBuilder; |
|
|
|
import com.fr.base.background.ColorBackground; |
|
|
|
import com.fr.base.background.ColorBackground; |
|
|
|
import com.fr.base.theme.TemplateTheme; |
|
|
|
import com.fr.base.theme.TemplateTheme; |
|
|
|
import com.fr.design.beans.BasicBeanPane; |
|
|
|
import com.fr.design.beans.BasicBeanPane; |
|
|
|
import com.fr.design.designer.IntervalConstants; |
|
|
|
|
|
|
|
import com.fr.design.file.HistoryTemplateListCache; |
|
|
|
import com.fr.design.file.HistoryTemplateListCache; |
|
|
|
import com.fr.design.gui.frpane.FontSizeComboPane; |
|
|
|
import com.fr.design.gui.frpane.FontSizeComboPane; |
|
|
|
import com.fr.design.gui.frpane.UIPercentDragPane; |
|
|
|
import com.fr.design.gui.frpane.UIPercentDragPane; |
|
|
@ -18,15 +19,12 @@ import com.fr.design.gui.ispinner.UISpinner; |
|
|
|
import com.fr.design.gui.style.FRFontPane; |
|
|
|
import com.fr.design.gui.style.FRFontPane; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
|
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
|
|
|
|
import com.fr.design.mainframe.JTemplate; |
|
|
|
import com.fr.design.mainframe.JTemplate; |
|
|
|
import com.fr.design.style.color.NewColorSelectBox; |
|
|
|
import com.fr.design.style.color.NewColorSelectBox; |
|
|
|
import com.fr.design.utils.DesignUtils; |
|
|
|
import com.fr.design.utils.DesignUtils; |
|
|
|
import com.fr.design.widget.FRWidgetFactory; |
|
|
|
import com.fr.design.widget.FRWidgetFactory; |
|
|
|
import com.fr.form.ui.Widget; |
|
|
|
import com.fr.form.ui.Widget; |
|
|
|
import com.fr.general.FRFont; |
|
|
|
import com.fr.general.FRFont; |
|
|
|
import com.fr.general.IOUtils; |
|
|
|
|
|
|
|
import com.fr.util.ColorUtils; |
|
|
|
import com.fr.util.ColorUtils; |
|
|
|
import com.fr.widgettheme.theme.bean.ButtonBackground; |
|
|
|
import com.fr.widgettheme.theme.bean.ButtonBackground; |
|
|
|
import com.fr.widgettheme.theme.panel.ButtonStyleDefinedPane; |
|
|
|
import com.fr.widgettheme.theme.panel.ButtonStyleDefinedPane; |
|
|
@ -38,7 +36,6 @@ import com.fr.widgettheme.theme.widget.theme.WidgetThemeDisplayConstants; |
|
|
|
import com.fr.widgettheme.util.WidgetStyleComponentCombiner; |
|
|
|
import com.fr.widgettheme.util.WidgetStyleComponentCombiner; |
|
|
|
import com.fr.widgettheme.util.WidgetThemeDesignerUtils; |
|
|
|
import com.fr.widgettheme.util.WidgetThemeDesignerUtils; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
|
|
|
import javax.swing.JPanel; |
|
|
|
import javax.swing.JPanel; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
import java.awt.Color; |
|
|
|
import java.awt.Color; |
|
|
@ -130,8 +127,9 @@ public abstract class BaseStyleSettingPane<T extends Widget> extends BasicBeanPa |
|
|
|
|
|
|
|
|
|
|
|
protected void initPane() { |
|
|
|
protected void initPane() { |
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
this.add(createHeadPane(), BorderLayout.NORTH); |
|
|
|
this.add(column(10, |
|
|
|
this.add(createCustomPane(), BorderLayout.CENTER); |
|
|
|
cell(createHeadPane()), cell(createCustomPane()) |
|
|
|
|
|
|
|
).getComponent(), BorderLayout.CENTER); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -145,8 +143,8 @@ public abstract class BaseStyleSettingPane<T extends Widget> extends BasicBeanPa |
|
|
|
fontNameSelectBox = new UIComboBox(DesignUtils.getAvailableFontFamilyNames4Report()); |
|
|
|
fontNameSelectBox = new UIComboBox(DesignUtils.getAvailableFontFamilyNames4Report()); |
|
|
|
fontSizePane = new FontSizeComboPane(); |
|
|
|
fontSizePane = new FontSizeComboPane(); |
|
|
|
fontColorButton = new UIColorButton(); |
|
|
|
fontColorButton = new UIColorButton(); |
|
|
|
bold = new UIToggleButton(IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png")); |
|
|
|
bold = new UIToggleButton(new LazyIcon("bold")); |
|
|
|
italic = new UIToggleButton(IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png")); |
|
|
|
italic = new UIToggleButton(new LazyIcon("italic")); |
|
|
|
widgetBgColorSelectBox = new NewColorSelectBox(WidgetThemeDisplayConstants.THEME_WIDGET_COMPONENT_WIDTH, true); |
|
|
|
widgetBgColorSelectBox = new NewColorSelectBox(WidgetThemeDisplayConstants.THEME_WIDGET_COMPONENT_WIDTH, true); |
|
|
|
widgetBgAlphaDragPane = new UIPercentDragPane(); |
|
|
|
widgetBgAlphaDragPane = new UIPercentDragPane(); |
|
|
|
paneMap.put(StyleSetting.THEME_COLOR, colorSelectBox); |
|
|
|
paneMap.put(StyleSetting.THEME_COLOR, colorSelectBox); |
|
|
@ -180,34 +178,14 @@ public abstract class BaseStyleSettingPane<T extends Widget> extends BasicBeanPa |
|
|
|
switchCard(); |
|
|
|
switchCard(); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
JPanel headPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ |
|
|
|
|
|
|
|
new Component[]{headLabel, styleSettingHead}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); |
|
|
|
return FineLayoutBuilder.createHorizontalLayout(0, new double[] {1.2, 3}, headLabel, styleSettingHead); |
|
|
|
headPane.setBorder(BorderFactory.createEmptyBorder(0, 0, IntervalConstants.INTERVAL_L1, 0)); |
|
|
|
|
|
|
|
return headPane; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected JPanel createCustomPane() { |
|
|
|
protected JPanel createCustomPane() { |
|
|
|
int size = styleSettingList.size(); |
|
|
|
int size = styleSettingList.size(); |
|
|
|
|
|
|
|
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
customPane = FineLayoutBuilder.compatibleTableLayout(10, createComponents(size), new double[]{1.2, 3}); |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
|
|
|
int columnCount = 2; |
|
|
|
|
|
|
|
double[] rowSize = new double[size]; |
|
|
|
|
|
|
|
for (int i = 0; i < size; i++) { |
|
|
|
|
|
|
|
rowSize[i] = p; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
double[] columnSize = {p, f}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int[][] rowCount = new int[size][columnCount]; |
|
|
|
|
|
|
|
for (int i = 0; i < size; i++) { |
|
|
|
|
|
|
|
for (int j = 0; j < columnCount; j++) { |
|
|
|
|
|
|
|
rowCount[i][j] = 1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
customPane = TableLayoutHelper.createGapTableLayoutPane(createComponents(size), rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); |
|
|
|
|
|
|
|
customPane.setBorder(BorderFactory.createEmptyBorder(0, 0, IntervalConstants.INTERVAL_L1, 0)); |
|
|
|
|
|
|
|
return customPane; |
|
|
|
return customPane; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|