Browse Source

REPORT-51919 - 主题切换

research/11.0
kerry 3 years ago
parent
commit
17f87679c7
  1. 9
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ui/ColorListPane.java
  2. 1
      designer-base/src/main/java/com/fr/design/style/color/NewColorSelectBox.java
  3. 9
      designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java

9
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ui/ColorListPane.java

@ -4,7 +4,7 @@ import com.fr.base.background.ColorBackground;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.style.AbstractSelectBox;
import com.fr.design.style.color.ColorSelectPane;
import com.fr.design.style.color.NewColorSelectPane;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
@ -130,7 +130,7 @@ public class ColorListPane extends JPanel implements UIObserver {
private static class ColorButton extends AbstractSelectBox<Color> {
private Color color;
private ColorSelectPane colorPane;
private NewColorSelectPane colorPane;
private ChangeListener changeListener;
public ColorButton(Color color) {
@ -145,7 +145,7 @@ public class ColorListPane extends JPanel implements UIObserver {
@Override
public JPanel initWindowPane(double preferredWidth) {
colorPane = new ColorSelectPane(false) {
colorPane = new NewColorSelectPane(false) {
@Override
public void setVisible(boolean b) {
super.setVisible(b);
@ -156,10 +156,11 @@ public class ColorListPane extends JPanel implements UIObserver {
return false;
}
};
colorPane.setColor(this.getSelectObject());
colorPane.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
hidePopupMenu();
color = ((ColorSelectPane) e.getSource()).getColor();
color = ((NewColorSelectPane) e.getSource()).getColor();
fireDisplayComponent(ColorBackground.getInstance(color));
ColorListPane.ColorButton.this.fireStateChanged();
}

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

@ -59,6 +59,7 @@ public class NewColorSelectBox extends AbstractSelectBox<Color> implements UIObs
public JPanel initWindowPane(double preferredWidth) {
// 下拉的时候重新生成面板,以刷新最近使用颜色
colorPane = new NewColorSelectPane(false);
colorPane.setColor(this.getSelectObject());
colorPane.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
hidePopupMenu();

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

@ -104,8 +104,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
row1Pane.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Used")), BorderLayout.CENTER);
centerPane.add(row1Pane);
// 最近使用
usedColorPane = new NewUsedColorPane(8, this, selectRealTime());
usedColorPane.setPreferredSize(new Dimension(168, 16));
usedColorPane = new NewUsedColorPane(9, this, selectRealTime());
row1Pane.add(usedColorPane.getPane(), BorderLayout.SOUTH);
// mod by anchore 16/11/16
@ -417,7 +416,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
private void initialComponents() {
int total = columns;
JPanel panel = new JPanel();
panel.setLayout(new GridLayout(1, columns + 2, 3, 3));
panel.setLayout(new GridLayout(1, columns + 1, 3, 3));
panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
//最近使用颜色
Color[] colors = DesignerEnvManager.getEnvManager().getColorConfigManager().getColors();
@ -430,10 +429,6 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
// 取色按钮
JButton pickColorButton = PickColorButtonFactory.getPickColorButton(selectable, PickColorButtonFactory.IconType.ICON16, setColorRealTime);
panel.add(pickColorButton);
ColorCell cc = new ColorCell(UsedColorPane.DEFAULT_COLOR, selectable);
cc.setVisible(false);
panel.add(cc);
this.pane = panel;
}

Loading…
Cancel
Save