|
|
@ -39,6 +39,8 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { |
|
|
|
private static final long serialVersionUID = -8634152305687249392L; |
|
|
|
private static final long serialVersionUID = -8634152305687249392L; |
|
|
|
private static final float BRIGHTNESS_VALUE = 0.15F; |
|
|
|
private static final float BRIGHTNESS_VALUE = 0.15F; |
|
|
|
private static final float PURITY_VALUE = 0.1F; |
|
|
|
private static final float PURITY_VALUE = 0.1F; |
|
|
|
|
|
|
|
private static final int WIDTH = 197; |
|
|
|
|
|
|
|
private static final int HEIGHT = 250; |
|
|
|
|
|
|
|
|
|
|
|
private FineColor color = null; // color
|
|
|
|
private FineColor color = null; // color
|
|
|
|
// color setting action.
|
|
|
|
// color setting action.
|
|
|
@ -49,9 +51,6 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { |
|
|
|
|
|
|
|
|
|
|
|
private boolean isSupportThemeColor; |
|
|
|
private boolean isSupportThemeColor; |
|
|
|
|
|
|
|
|
|
|
|
public final static int TRANSPARENT_WINDOW_HEIGHT = 165; |
|
|
|
|
|
|
|
public final static int WINDOW_HEIGHT = 150; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 最近使用颜色
|
|
|
|
// 最近使用颜色
|
|
|
|
private final NewUsedColorPane usedColorPane; |
|
|
|
private final NewUsedColorPane usedColorPane; |
|
|
|
private final JPanel menuColorPane; |
|
|
|
private final JPanel menuColorPane; |
|
|
@ -84,10 +83,12 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { |
|
|
|
this.add(centerPane, BorderLayout.CENTER); |
|
|
|
this.add(centerPane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
|
|
menuColorPane = getMenuColorPane(); |
|
|
|
menuColorPane = getMenuColorPane(); |
|
|
|
centerPane.add(menuColorPane); |
|
|
|
|
|
|
|
if(isSupportThemeColor){ |
|
|
|
if(isSupportThemeColor){ |
|
|
|
initThemeColorPane(); |
|
|
|
JPanel themePane = initThemeColorPane(); |
|
|
|
|
|
|
|
centerPane.add(themePane); |
|
|
|
}else { |
|
|
|
}else { |
|
|
|
|
|
|
|
centerPane.add(menuColorPane); |
|
|
|
initMenuColorPane(); |
|
|
|
initMenuColorPane(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -138,8 +139,14 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { |
|
|
|
return jPanel; |
|
|
|
return jPanel; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void initThemeColorPane(){ |
|
|
|
private JPanel initThemeColorPane(){ |
|
|
|
menuColorPane.removeAll(); |
|
|
|
menuColorPane.removeAll(); |
|
|
|
|
|
|
|
JPanel themeColorPane = new JPanel(new BorderLayout(0, 5)); |
|
|
|
|
|
|
|
themeColorPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
|
|
|
|
|
|
themeColorPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Theme_Color")), BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
themeColorPane.add(menuColorPane, BorderLayout.SOUTH); |
|
|
|
|
|
|
|
|
|
|
|
menuColorPane.setLayout(new BorderLayout(0, 10)); |
|
|
|
menuColorPane.setLayout(new BorderLayout(0, 10)); |
|
|
|
JPanel northPane = new JPanel(new GridLayout(1, 8, 3, 0)); |
|
|
|
JPanel northPane = new JPanel(new GridLayout(1, 8, 3, 0)); |
|
|
|
JPanel centerPane = new JPanel(new GridLayout(1, 8, 3, 0)); |
|
|
|
JPanel centerPane = new JPanel(new GridLayout(1, 8, 3, 0)); |
|
|
@ -147,10 +154,6 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { |
|
|
|
menuColorPane.add(centerPane, BorderLayout.CENTER); |
|
|
|
menuColorPane.add(centerPane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
|
|
Color[] colorArray = new Color[] { |
|
|
|
Color[] colorArray = new Color[] { |
|
|
|
// 2列灰度色
|
|
|
|
|
|
|
|
Color.decode("#B3B3B3"), |
|
|
|
|
|
|
|
Color.decode("#808080"), |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 8列主题色
|
|
|
|
// 8列主题色
|
|
|
|
Color.decode("#FFFFFF"), |
|
|
|
Color.decode("#FFFFFF"), |
|
|
|
Color.decode("#CCCCCC"), |
|
|
|
Color.decode("#CCCCCC"), |
|
|
@ -160,13 +163,17 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { |
|
|
|
Color.decode("#CCCCCC"), |
|
|
|
Color.decode("#CCCCCC"), |
|
|
|
Color.decode("#FFFFFF"), |
|
|
|
Color.decode("#FFFFFF"), |
|
|
|
Color.decode("#CCCCCC"), |
|
|
|
Color.decode("#CCCCCC"), |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 2列灰度色
|
|
|
|
|
|
|
|
Color.decode("#808080"), |
|
|
|
|
|
|
|
Color.decode("#B3B3B3"), |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
if (themeColorCellGrid == null) { |
|
|
|
if (themeColorCellGrid == null) { |
|
|
|
themeColorCellGrid = new ColorCell[colorArray.length][5]; |
|
|
|
themeColorCellGrid = new ColorCell[colorArray.length][5]; |
|
|
|
for (int i = 0; i < colorArray.length; i++) { |
|
|
|
for (int i = 0; i < colorArray.length; i++) { |
|
|
|
ColorCell[] colorCellColumn = new ColorCell[5]; |
|
|
|
ColorCell[] colorCellColumn = new ColorCell[5]; |
|
|
|
boolean isDefaultColor = (i == 0 || i == 1); |
|
|
|
boolean isDefaultColor = (i == colorArray.length - 1 || i == colorArray.length - 2); |
|
|
|
Color color = colorArray[i]; |
|
|
|
Color color = colorArray[i]; |
|
|
|
colorCellColumn[0] = createFineColorCell(color, isDefaultColor, i, 2); |
|
|
|
colorCellColumn[0] = createFineColorCell(color, isDefaultColor, i, 2); |
|
|
|
colorCellColumn[2] = createFineColorCell(color = saturationDown(color, isDefaultColor, true), isDefaultColor, i, 1); |
|
|
|
colorCellColumn[2] = createFineColorCell(color = saturationDown(color, isDefaultColor, true), isDefaultColor, i, 1); |
|
|
@ -191,6 +198,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
refreshThemeMenuColorPane(); |
|
|
|
refreshThemeMenuColorPane(); |
|
|
|
|
|
|
|
return themeColorPane; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void refreshThemeMenuColorPane() { |
|
|
|
private void refreshThemeMenuColorPane() { |
|
|
@ -210,14 +218,14 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for (int i = 2; i < themeColorCellGrid.length; i++) { |
|
|
|
for (int i = 0; i < themeColorCellGrid.length - 2; i++) { |
|
|
|
Color color = standardColors.get(i - 2); |
|
|
|
Color color = standardColors.get(i); |
|
|
|
|
|
|
|
|
|
|
|
themeColorCellGrid[i][0].setColor(color); |
|
|
|
themeColorCellGrid[i][0].setColor(color); |
|
|
|
themeColorCellGrid[i][2].setColor(color = saturationDown(color, false, true)); |
|
|
|
themeColorCellGrid[i][2].setColor(color = saturationDown(color, false, true)); |
|
|
|
themeColorCellGrid[i][1].setColor(saturationDown(color, false, true)); |
|
|
|
themeColorCellGrid[i][1].setColor(saturationDown(color, false, true)); |
|
|
|
|
|
|
|
|
|
|
|
color = standardColors.get(i - 2); |
|
|
|
color = standardColors.get(i); |
|
|
|
themeColorCellGrid[i][3].setColor(color = saturationDown(color, false, false)); |
|
|
|
themeColorCellGrid[i][3].setColor(color = saturationDown(color, false, false)); |
|
|
|
themeColorCellGrid[i][4].setColor(saturationDown(color, false, false)); |
|
|
|
themeColorCellGrid[i][4].setColor(saturationDown(color, false, false)); |
|
|
|
} |
|
|
|
} |
|
|
@ -225,7 +233,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private FineColorCell createFineColorCell(Color color, boolean isDefaultColor, int x, int y) { |
|
|
|
private FineColorCell createFineColorCell(Color color, boolean isDefaultColor, int x, int y) { |
|
|
|
return isDefaultColor ? new FineColorCell(color, this) : new FineColorCell(color, this, x - 2, y); |
|
|
|
return isDefaultColor ? new FineColorCell(color, this) : new FineColorCell(color, this, x, y); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -375,10 +383,14 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Dimension getPreferredSize() { |
|
|
|
public Dimension getPreferredSize() { |
|
|
|
|
|
|
|
int height = HEIGHT; |
|
|
|
if (isSupportTransparent) { |
|
|
|
if (isSupportTransparent) { |
|
|
|
return new Dimension(197, 265); |
|
|
|
height += 15; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (isSupportThemeColor) { |
|
|
|
|
|
|
|
height += 25; |
|
|
|
} |
|
|
|
} |
|
|
|
return new Dimension(197, 250); |
|
|
|
return new Dimension(WIDTH, height); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|