|
|
|
@ -38,6 +38,7 @@ import static com.fine.swing.ui.layout.Layouts.column;
|
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.fix; |
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.flex; |
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.row; |
|
|
|
|
import static com.fine.theme.utils.FineUIScale.scale; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -124,17 +125,17 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
|
|
|
|
|
/** |
|
|
|
|
* The default width of the gradient image. |
|
|
|
|
*/ |
|
|
|
|
private static final int IMG_WIDTH = 180; |
|
|
|
|
private static final int IMG_WIDTH = scale(180); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* The default height of the gradient image. |
|
|
|
|
*/ |
|
|
|
|
private static final int IMG_HEIGHT = 180; |
|
|
|
|
private static final int IMG_HEIGHT = scale(180); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* The default width of the track gradient. |
|
|
|
|
*/ |
|
|
|
|
private static final int TRACK_WIDTH = 12; |
|
|
|
|
private static final int TRACK_WIDTH = scale(12); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* The UILabel for Red. |
|
|
|
@ -597,7 +598,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
|
|
|
|
|
*/ |
|
|
|
|
protected void buildChooser() { |
|
|
|
|
setLayout(new BorderLayout(10, 0)); |
|
|
|
|
setPreferredSize(new Dimension((int) this.getPreferredSize().getWidth(), FineUIScale.scale(180))); |
|
|
|
|
setPreferredSize(new Dimension((int) this.getPreferredSize().getWidth(), scale(180))); |
|
|
|
|
add(buildRightPanel(), BorderLayout.CENTER); |
|
|
|
|
JPanel container = new JPanel(); |
|
|
|
|
container.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 0)); |
|
|
|
@ -623,9 +624,9 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
|
|
|
|
|
container.add(gradientPanel); |
|
|
|
|
container.add(layeredPane); |
|
|
|
|
|
|
|
|
|
layeredPane.setPreferredSize(FineUIScale.scale(new Dimension(12, 180))); |
|
|
|
|
slider.setSize(FineUIScale.scale(new Dimension(12, 180))); |
|
|
|
|
trackPanel.setSize(FineUIScale.scale(new Dimension(12, 180))); |
|
|
|
|
layeredPane.setPreferredSize(scale(new Dimension(12, 180))); |
|
|
|
|
slider.setSize(scale(new Dimension(12, 180))); |
|
|
|
|
trackPanel.setSize(scale(new Dimension(12, 180))); |
|
|
|
|
|
|
|
|
|
add(container, BorderLayout.WEST); |
|
|
|
|
slider.addChangeListener(new SliderChangeListener()); |
|
|
|
@ -638,7 +639,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
|
|
|
|
|
private JPanel createGradientPanel() { |
|
|
|
|
return new JPanel() { |
|
|
|
|
public Dimension getPreferredSize() { |
|
|
|
|
return FineUIScale.scale(new Dimension(IMG_WIDTH, IMG_HEIGHT)); |
|
|
|
|
return scale(new Dimension(IMG_WIDTH, IMG_HEIGHT)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void paint(Graphics g) { |
|
|
|
@ -657,7 +658,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
|
|
|
|
|
private JPanel createTrackPanel() { |
|
|
|
|
return new JPanel() { |
|
|
|
|
public Dimension getPreferredSize() { |
|
|
|
|
return FineUIScale.scale(new Dimension(TRACK_WIDTH, IMG_HEIGHT)); |
|
|
|
|
return scale(new Dimension(TRACK_WIDTH, IMG_HEIGHT)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void paint(Graphics g) { |
|
|
|
|