You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
2.8 KiB
67 lines
2.8 KiB
package com.fr.design.condition; |
|
|
|
import com.fine.theme.utils.FineUIScale; |
|
import com.formdev.flatlaf.util.ScaledEmptyBorder; |
|
import com.fr.design.gui.icombobox.UIComboBox; |
|
import com.fr.design.gui.ilable.UILabel; |
|
import com.fr.design.style.color.ColorSelectBox; |
|
|
|
import com.fr.report.cell.cellattr.highlight.ForegroundHighlightAction; |
|
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; |
|
import static com.fine.theme.utils.FineClientProperties.ADAPTIVE_COMBO_BOX; |
|
import static com.fine.theme.utils.FineClientProperties.COMBO_BOX_TYPE; |
|
|
|
/** |
|
* @author richie |
|
* @date 2015-03-26 |
|
* @since 8.0 |
|
*/ |
|
public class ForeGroundPane extends ConditionAttrSingleConditionPane<HighlightAction> { |
|
private UILabel foregroundLabel; |
|
private ColorSelectBox foregroundColorPane; |
|
private UIComboBox foreScopeComboBox; |
|
|
|
|
|
public ForeGroundPane(ConditionAttributesPane conditionAttributesPane) { |
|
super(conditionAttributesPane); |
|
foregroundLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Foreground") + ":"); |
|
this.foregroundColorPane = new ColorSelectBox(80); |
|
foregroundColorPane.setPreferredSize(new Dimension(FineUIScale.scale(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.foreScopeComboBox.putClientProperty(COMBO_BOX_TYPE, ADAPTIVE_COMBO_BOX); |
|
this.foregroundColorPane.setSelectObject(Color.black); |
|
|
|
this.add(row(10, cell(foregroundLabel).weight(0.2), row( |
|
10, |
|
cell(foregroundColorPane), |
|
cell(foreScopeComboBox)).weight(0.8) |
|
).with(it -> it.setBorder(new ScaledEmptyBorder(5, 5, 5, 0))).getComponent(), BorderLayout.CENTER); |
|
} |
|
|
|
@Override |
|
public String nameForPopupMenuItem() { |
|
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Foreground"); |
|
} |
|
|
|
@Override |
|
protected String title4PopupWindow() { |
|
return nameForPopupMenuItem(); |
|
} |
|
|
|
public void populate(HighlightAction ha) { |
|
this.foregroundColorPane.setSelectObject(((ForegroundHighlightAction)ha).getForegroundColor()); |
|
this.foreScopeComboBox.setSelectedIndex(((ForegroundHighlightAction)ha).getScope()); |
|
} |
|
|
|
public HighlightAction update() { |
|
return new ForegroundHighlightAction(this.foregroundColorPane.getSelectObject(), this.foreScopeComboBox.getSelectedIndex()); |
|
} |
|
}
|
|
|