|
|
@ -58,8 +58,6 @@ public class ChartColorAdjustPane extends JPanel implements UIObserver { |
|
|
|
private ChangeListener changeListener; |
|
|
|
private ChangeListener changeListener; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ChartColorAdjustPane() { |
|
|
|
public ChartColorAdjustPane() { |
|
|
|
this(DEFAULT_COLORS); |
|
|
|
this(DEFAULT_COLORS); |
|
|
|
} |
|
|
|
} |
|
|
@ -70,10 +68,6 @@ public class ChartColorAdjustPane extends JPanel implements UIObserver { |
|
|
|
createContentPane(); |
|
|
|
createContentPane(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void updateColor() { |
|
|
|
|
|
|
|
updateColor(DEFAULT_COLORS); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void updateColor(Color[] colors) { |
|
|
|
public void updateColor(Color[] colors) { |
|
|
|
createColorButton(colors); |
|
|
|
createColorButton(colors); |
|
|
|
relayout(); |
|
|
|
relayout(); |
|
|
@ -124,8 +118,9 @@ public class ChartColorAdjustPane extends JPanel implements UIObserver { |
|
|
|
|
|
|
|
|
|
|
|
private void createColorButton(Color[] colors) { |
|
|
|
private void createColorButton(Color[] colors) { |
|
|
|
colorButtons.clear(); |
|
|
|
colorButtons.clear(); |
|
|
|
for (Color color : colors) { |
|
|
|
int size = Math.min(colors.length, MAX_BUTTON); |
|
|
|
colorButtons.add(createColorButton(color)); |
|
|
|
for (int i = 0; i < size; i++) { |
|
|
|
|
|
|
|
colorButtons.add(createColorButton(colors[i])); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -219,7 +214,9 @@ public class ChartColorAdjustPane extends JPanel implements UIObserver { |
|
|
|
hidePopupMenu(); |
|
|
|
hidePopupMenu(); |
|
|
|
Color color = ((ColorSelectPane) e.getSource()).getColor(); |
|
|
|
Color color = ((ColorSelectPane) e.getSource()).getColor(); |
|
|
|
fireDisplayComponent(ColorBackground.getInstance(color)); |
|
|
|
fireDisplayComponent(ColorBackground.getInstance(color)); |
|
|
|
colorButtons.add(createColorButton(color)); |
|
|
|
if(colorButtons.size() < MAX_BUTTON) { |
|
|
|
|
|
|
|
colorButtons.add(createColorButton(color)); |
|
|
|
|
|
|
|
} |
|
|
|
ChartColorAdjustPane.this.stateChanged(); |
|
|
|
ChartColorAdjustPane.this.stateChanged(); |
|
|
|
relayout(); |
|
|
|
relayout(); |
|
|
|
} |
|
|
|
} |
|
|
|