|
|
@ -39,8 +39,10 @@ import java.util.List; |
|
|
|
public class NewColorSelectPane extends BasicPane implements ColorSelectable { |
|
|
|
public class NewColorSelectPane extends BasicPane implements ColorSelectable { |
|
|
|
private static final long serialVersionUID = -8634152305687249392L; |
|
|
|
private static final long serialVersionUID = -8634152305687249392L; |
|
|
|
|
|
|
|
|
|
|
|
private static final int WIDTH = 197; |
|
|
|
private static final int WIDTH = 216; |
|
|
|
private static final int HEIGHT = 250; |
|
|
|
private static final int HEIGHT = 230; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final int DEFAULT_COLOR_HOR_INTERVAL = 4; |
|
|
|
//颜色衍生的数量
|
|
|
|
//颜色衍生的数量
|
|
|
|
private static final int DEFAULT_DERIVE_COUNT = 5; |
|
|
|
private static final int DEFAULT_DERIVE_COUNT = 5; |
|
|
|
|
|
|
|
|
|
|
@ -81,7 +83,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { |
|
|
|
initSelectButton(isSupportTransparent); |
|
|
|
initSelectButton(isSupportTransparent); |
|
|
|
// center
|
|
|
|
// center
|
|
|
|
JPanel centerPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); |
|
|
|
JPanel centerPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); |
|
|
|
centerPane.setBorder(BorderFactory.createEmptyBorder(10, 4, 0, 4)); |
|
|
|
centerPane.setBorder(BorderFactory.createEmptyBorder(10, 6, 0, 6)); |
|
|
|
this.add(centerPane, BorderLayout.CENTER); |
|
|
|
this.add(centerPane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
|
|
menuColorPane = getMenuColorPane(); |
|
|
|
menuColorPane = getMenuColorPane(); |
|
|
@ -126,14 +128,14 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { |
|
|
|
|
|
|
|
|
|
|
|
customButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); |
|
|
|
customButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); |
|
|
|
JPanel centerPane1 = new JPanel(new BorderLayout(0, 0)); |
|
|
|
JPanel centerPane1 = new JPanel(new BorderLayout(0, 0)); |
|
|
|
centerPane1.setBorder(BorderFactory.createEmptyBorder(9, 0, 11, 0)); |
|
|
|
centerPane1.setBorder(BorderFactory.createEmptyBorder(8, 0, 9, 0)); |
|
|
|
centerPane1.add(customButton, BorderLayout.CENTER); |
|
|
|
centerPane1.add(customButton, BorderLayout.CENTER); |
|
|
|
customButton.setPreferredSize(new Dimension(197, 20)); |
|
|
|
customButton.setPreferredSize(new Dimension(197, 20)); |
|
|
|
centerPane.add(centerPane1); |
|
|
|
centerPane.add(centerPane1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private JPanel createStandardColorPane() { |
|
|
|
private JPanel createStandardColorPane() { |
|
|
|
JPanel jPanel = new JPanel(new GridLayout(1, 10, 3, 0)); |
|
|
|
JPanel jPanel = new JPanel(new GridLayout(1, 10, DEFAULT_COLOR_HOR_INTERVAL, 0)); |
|
|
|
Color[] colorArray = ColorFactory.STANDARD_COLORS; |
|
|
|
Color[] colorArray = ColorFactory.STANDARD_COLORS; |
|
|
|
for (int i = 0; i < colorArray.length; i++) { |
|
|
|
for (int i = 0; i < colorArray.length; i++) { |
|
|
|
jPanel.add(new ColorCell(colorArray[i], this)); |
|
|
|
jPanel.add(new ColorCell(colorArray[i], this)); |
|
|
@ -150,8 +152,8 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { |
|
|
|
themeColorPane.add(menuColorPane, BorderLayout.SOUTH); |
|
|
|
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, DEFAULT_COLOR_HOR_INTERVAL, 0)); |
|
|
|
JPanel centerPane = new JPanel(new GridLayout(1, 8, 3, 0)); |
|
|
|
JPanel centerPane = new JPanel(new GridLayout(1, 8, DEFAULT_COLOR_HOR_INTERVAL, 0)); |
|
|
|
menuColorPane.add(northPane, BorderLayout.NORTH); |
|
|
|
menuColorPane.add(northPane, BorderLayout.NORTH); |
|
|
|
menuColorPane.add(centerPane, BorderLayout.CENTER); |
|
|
|
menuColorPane.add(centerPane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
|
@ -189,7 +191,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { |
|
|
|
northPane.add(themeColorCellGrid[i][0]); |
|
|
|
northPane.add(themeColorCellGrid[i][0]); |
|
|
|
} |
|
|
|
} |
|
|
|
for (int i = 0; i < colorArray.length; i++) { |
|
|
|
for (int i = 0; i < colorArray.length; i++) { |
|
|
|
JPanel columnPane = new JPanel(new GridLayout(DEFAULT_DERIVE_COUNT - 1, 1, 0, 3)); |
|
|
|
JPanel columnPane = new JPanel(new GridLayout(DEFAULT_DERIVE_COUNT - 1, 1, 0, 0)); |
|
|
|
for (int j = 1; j < DEFAULT_DERIVE_COUNT; j++) { |
|
|
|
for (int j = 1; j < DEFAULT_DERIVE_COUNT; j++) { |
|
|
|
columnPane.add(themeColorCellGrid[i][j]); |
|
|
|
columnPane.add(themeColorCellGrid[i][j]); |
|
|
|
} |
|
|
|
} |
|
|
@ -233,7 +235,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initMenuColorPane() { |
|
|
|
private void initMenuColorPane() { |
|
|
|
menuColorPane.setLayout(new GridLayout(5, 8, 3, 3)); |
|
|
|
menuColorPane.setLayout(new GridLayout(5, 8, DEFAULT_COLOR_HOR_INTERVAL, 0)); |
|
|
|
Color[] colorArray = this.getColorArray(); |
|
|
|
Color[] colorArray = this.getColorArray(); |
|
|
|
for (int i = 0; i < colorArray.length; i++) { |
|
|
|
for (int i = 0; i < colorArray.length; i++) { |
|
|
|
Color color = colorArray[i] == null ? UsedColorPane.DEFAULT_COLOR : colorArray[i]; |
|
|
|
Color color = colorArray[i] == null ? UsedColorPane.DEFAULT_COLOR : colorArray[i]; |
|
|
@ -409,7 +411,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 + 1, 3, 3)); |
|
|
|
panel.setLayout(new GridLayout(1, columns + 1, DEFAULT_COLOR_HOR_INTERVAL, 0)); |
|
|
|
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(); |
|
|
|