|
|
|
@ -7,6 +7,7 @@ import com.fr.design.event.UIObserverListener;
|
|
|
|
|
import com.fr.design.gui.icheckbox.UICheckBox; |
|
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
|
import com.fr.design.gui.ipoppane.PopupHider; |
|
|
|
|
import com.fr.design.i18n.DesignSizeI18nManager; |
|
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
|
import com.fr.design.style.color.ColorControlWindow; |
|
|
|
@ -32,6 +33,7 @@ public class HeaderSortRulePane extends JPanel {
|
|
|
|
|
UICheckBox desUICheckBox; |
|
|
|
|
UICheckBox nosortUICheckBox; |
|
|
|
|
Color defaultColor = new Color(33, 33, 34); |
|
|
|
|
public static final int ICON_LENGTH = 20; |
|
|
|
|
|
|
|
|
|
HeaderSortRulePane() { |
|
|
|
|
initComponents(); |
|
|
|
@ -57,8 +59,9 @@ public class HeaderSortRulePane extends JPanel {
|
|
|
|
|
new Component[]{desUICheckBox = new UICheckBox(SortRule.DES.getDescription()), desIconButton = new IconButton(SortRule.DES)}, |
|
|
|
|
new Component[]{nosortUICheckBox = new UICheckBox(SortRule.NO_SORT.getDescription()), nosortIconButton = new IconButton(SortRule.NO_SORT)}, |
|
|
|
|
}; |
|
|
|
|
double[] rowSize = {HeaderIconBuilder.ICON_LENGTH + 10, HeaderIconBuilder.ICON_LENGTH + 10, HeaderIconBuilder.ICON_LENGTH + 10}; |
|
|
|
|
double[] columnSize = {80, HeaderIconBuilder.ICON_LENGTH + 10}; |
|
|
|
|
double[] rowSize = {ICON_LENGTH + 10, ICON_LENGTH + 10, ICON_LENGTH + 10}; |
|
|
|
|
double[] columnSize = |
|
|
|
|
{DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.sort.rule.item").getWidth(), ICON_LENGTH + 10}; |
|
|
|
|
JPanel sortRuleItem = TableLayoutHelper.createCommonTableLayoutPane(components, rowSize, columnSize, 0); |
|
|
|
|
this.add(sortRuleItem, BorderLayout.CENTER); |
|
|
|
|
initUICheckBoxChange(ascUICheckBox, ascIconButton); |
|
|
|
@ -116,10 +119,10 @@ public class HeaderSortRulePane extends JPanel {
|
|
|
|
|
jLayeredPane = new JLayeredPane(); |
|
|
|
|
iconLabel = getIconLabel(); |
|
|
|
|
borderUiLabel = new UILabel(); |
|
|
|
|
borderUiLabel.setSize(HeaderIconBuilder.ICON_LENGTH, HeaderIconBuilder.ICON_LENGTH); |
|
|
|
|
borderUiLabel.setSize(ICON_LENGTH, ICON_LENGTH); |
|
|
|
|
borderUiLabel.setOpaque(true); |
|
|
|
|
borderUiLabel.setBackground(Color.WHITE); |
|
|
|
|
iconLabel.setSize(HeaderIconBuilder.ICON_LENGTH, HeaderIconBuilder.ICON_LENGTH); |
|
|
|
|
iconLabel.setSize(ICON_LENGTH, ICON_LENGTH); |
|
|
|
|
iconLabel.addMouseListener(new MouseAdapter() { |
|
|
|
|
@Override |
|
|
|
|
public void mouseClicked(MouseEvent e) { |
|
|
|
@ -128,7 +131,7 @@ public class HeaderSortRulePane extends JPanel {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
jLayeredPane.setPreferredSize(new Dimension(HeaderIconBuilder.ICON_LENGTH, HeaderIconBuilder.ICON_LENGTH)); |
|
|
|
|
jLayeredPane.setPreferredSize(new Dimension(ICON_LENGTH, ICON_LENGTH)); |
|
|
|
|
jLayeredPane.add(iconLabel, JLayeredPane.POPUP_LAYER); |
|
|
|
|
jLayeredPane.add(borderUiLabel, JLayeredPane.MODAL_LAYER); |
|
|
|
|
this.add(jLayeredPane); |
|
|
|
@ -142,7 +145,7 @@ public class HeaderSortRulePane extends JPanel {
|
|
|
|
|
|
|
|
|
|
Icon getIcon(FineColor fineColor) { |
|
|
|
|
BufferedImage bufferedImage = HeaderIconBuilder.getIcon(sortRule, fineColor); |
|
|
|
|
Icon icon = new ImageIcon(bufferedImage); |
|
|
|
|
Icon icon = new SVGIcon(bufferedImage); |
|
|
|
|
return icon; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|