|
|
@ -29,7 +29,6 @@ import java.awt.event.ItemListener; |
|
|
|
* Created by plough on 2018/5/15. |
|
|
|
* Created by plough on 2018/5/15. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class WatermarkPane extends BasicPane { |
|
|
|
public class WatermarkPane extends BasicPane { |
|
|
|
|
|
|
|
|
|
|
|
private static final int MAX_WIDTH = 160; |
|
|
|
private static final int MAX_WIDTH = 160; |
|
|
|
|
|
|
|
|
|
|
|
// 水印预览面板
|
|
|
|
// 水印预览面板
|
|
|
@ -83,6 +82,7 @@ public class WatermarkPane extends BasicPane { |
|
|
|
watermark.setText(formulaPane.getUITextField().getText()); |
|
|
|
watermark.setText(formulaPane.getUITextField().getText()); |
|
|
|
watermark.setFontSize((int)fontSizeComboBox.getSelectedItem()); |
|
|
|
watermark.setFontSize((int)fontSizeComboBox.getSelectedItem()); |
|
|
|
watermark.setColor(colorPane.getColor()); |
|
|
|
watermark.setColor(colorPane.getColor()); |
|
|
|
|
|
|
|
colorPane.updateUsedColor(); |
|
|
|
return watermark; |
|
|
|
return watermark; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -97,6 +97,7 @@ public class WatermarkPane extends BasicPane { |
|
|
|
protected UIScrollPane initRightPane(){ |
|
|
|
protected UIScrollPane initRightPane(){ |
|
|
|
formulaPane = new TinyFormulaPane(); |
|
|
|
formulaPane = new TinyFormulaPane(); |
|
|
|
fontSizeComboBox = new UIComboBox(FRFontPane.FONT_SIZES); |
|
|
|
fontSizeComboBox = new UIComboBox(FRFontPane.FONT_SIZES); |
|
|
|
|
|
|
|
fontSizeComboBox.setEditable(true); |
|
|
|
JPanel fontSizeTypePane = new JPanel(new BorderLayout(10,0)); |
|
|
|
JPanel fontSizeTypePane = new JPanel(new BorderLayout(10,0)); |
|
|
|
fontSizeTypePane.add(fontSizeComboBox, BorderLayout.CENTER); |
|
|
|
fontSizeTypePane.add(fontSizeComboBox, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
|
@ -156,7 +157,8 @@ public class WatermarkPane extends BasicPane { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void populateColor(Color color) { |
|
|
|
private void populateColor(Color color) { |
|
|
|
colorPane.setColor(color); |
|
|
|
// 颜色面板的色值只有 rgb,去掉 alpha 通道
|
|
|
|
|
|
|
|
colorPane.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue())); |
|
|
|
colorPane.addChangeListener(new ChangeListener() { |
|
|
|
colorPane.addChangeListener(new ChangeListener() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void stateChanged(ChangeEvent e) { |
|
|
|
public void stateChanged(ChangeEvent e) { |
|
|
|