|
|
@ -112,12 +112,10 @@ public class ColorPicker extends JDialog implements ActionListener |
|
|
|
validate(); // 更新所有子控件
|
|
|
|
validate(); // 更新所有子控件
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void pickComplete(Boolean setColor) { |
|
|
|
public void pickComplete(Color color) { |
|
|
|
timer.stop(); |
|
|
|
timer.stop(); |
|
|
|
if (setColor) { |
|
|
|
if (color != null) { |
|
|
|
colorSelectable.setColor(colorToSet); |
|
|
|
colorSelectable.setColor(color); |
|
|
|
} else if (setColorRealTime) { |
|
|
|
|
|
|
|
colorSelectable.setColor(initColor); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
this.dispose(); |
|
|
|
this.dispose(); |
|
|
|
} |
|
|
|
} |
|
|
@ -134,9 +132,9 @@ public class ColorPicker extends JDialog implements ActionListener |
|
|
|
public void mousePressed(MouseEvent e) |
|
|
|
public void mousePressed(MouseEvent e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (e.getButton() == e.BUTTON1) { // 左键确定
|
|
|
|
if (e.getButton() == e.BUTTON1) { // 左键确定
|
|
|
|
pickComplete(true); |
|
|
|
pickComplete(colorToSet); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
pickComplete(false); |
|
|
|
pickComplete(setColorRealTime ? initColor : null); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|