Browse Source

Pull request #5494: REPORT-51919 - 主题切换

Merge in DESIGN/design from ~KERRY/design_10.0:feature/x to feature/x

* commit '17f87679c7a054b3206c7190dabe7512e4e9ebfd':
  REPORT-51919 - 主题切换
research/11.0
kerry 3 years ago
parent
commit
6084470308
  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.UIObserver;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
import com.fr.design.style.AbstractSelectBox; 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.JPanel;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
@ -130,7 +130,7 @@ public class ColorListPane extends JPanel implements UIObserver {
private static class ColorButton extends AbstractSelectBox<Color> { private static class ColorButton extends AbstractSelectBox<Color> {
private Color color; private Color color;
private ColorSelectPane colorPane; private NewColorSelectPane colorPane;
private ChangeListener changeListener; private ChangeListener changeListener;
public ColorButton(Color color) { public ColorButton(Color color) {
@ -145,7 +145,7 @@ public class ColorListPane extends JPanel implements UIObserver {
@Override @Override
public JPanel initWindowPane(double preferredWidth) { public JPanel initWindowPane(double preferredWidth) {
colorPane = new ColorSelectPane(false) { colorPane = new NewColorSelectPane(false) {
@Override @Override
public void setVisible(boolean b) { public void setVisible(boolean b) {
super.setVisible(b); super.setVisible(b);
@ -156,10 +156,11 @@ public class ColorListPane extends JPanel implements UIObserver {
return false; return false;
} }
}; };
colorPane.setColor(this.getSelectObject());
colorPane.addChangeListener(new ChangeListener() { colorPane.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
hidePopupMenu(); hidePopupMenu();
color = ((ColorSelectPane) e.getSource()).getColor(); color = ((NewColorSelectPane) e.getSource()).getColor();
fireDisplayComponent(ColorBackground.getInstance(color)); fireDisplayComponent(ColorBackground.getInstance(color));
ColorListPane.ColorButton.this.fireStateChanged(); 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) { public JPanel initWindowPane(double preferredWidth) {
// 下拉的时候重新生成面板,以刷新最近使用颜色 // 下拉的时候重新生成面板,以刷新最近使用颜色
colorPane = new NewColorSelectPane(false); colorPane = new NewColorSelectPane(false);
colorPane.setColor(this.getSelectObject());
colorPane.addChangeListener(new ChangeListener() { colorPane.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
hidePopupMenu(); 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); row1Pane.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Used")), BorderLayout.CENTER);
centerPane.add(row1Pane); centerPane.add(row1Pane);
// 最近使用 // 最近使用
usedColorPane = new NewUsedColorPane(8, this, selectRealTime()); usedColorPane = new NewUsedColorPane(9, this, selectRealTime());
usedColorPane.setPreferredSize(new Dimension(168, 16));
row1Pane.add(usedColorPane.getPane(), BorderLayout.SOUTH); row1Pane.add(usedColorPane.getPane(), BorderLayout.SOUTH);
// mod by anchore 16/11/16 // mod by anchore 16/11/16
@ -417,7 +416,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
private void initialComponents() { private void initialComponents() {
int total = columns; int total = columns;
JPanel panel = new JPanel(); 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)); panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
//最近使用颜色 //最近使用颜色
Color[] colors = DesignerEnvManager.getEnvManager().getColorConfigManager().getColors(); 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); JButton pickColorButton = PickColorButtonFactory.getPickColorButton(selectable, PickColorButtonFactory.IconType.ICON16, setColorRealTime);
panel.add(pickColorButton); panel.add(pickColorButton);
ColorCell cc = new ColorCell(UsedColorPane.DEFAULT_COLOR, selectable);
cc.setVisible(false);
panel.add(cc);
this.pane = panel; this.pane = panel;
} }

Loading…
Cancel
Save