Browse Source

Merge pull request #643 in DESIGN/design from ~PLOUGH/10-design:feature/10.0 to feature/10.0

* commit 'baeff898863849d052d41adbeece2abfb4a3cd75':
  DEC-5580 【10.0.2迭代验收】【全局水印】设计器字号可选范围与平台不统一
  DEC-5580 【10.0.2迭代验收】【全局水印】设计器字号可选范围与平台不统一
  DEC-5624 【10.0.2迭代验收】【全局水印】设计器中颜色配置不显示
research/10.0
plough 6 years ago
parent
commit
17a5bdda7d
  1. 7
      designer-base/src/main/java/com/fr/design/gui/style/FRFontPane.java
  2. 6
      designer-base/src/main/java/com/fr/design/report/WatermarkPane.java

7
designer-base/src/main/java/com/fr/design/gui/style/FRFontPane.java

@ -37,9 +37,12 @@ import java.util.Vector;
* Pane to edit Font. * Pane to edit Font.
*/ */
public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObserver { public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObserver {
public static final Integer[] FONT_SIZES = {
6, 8, 9, 10, 11, 12, 13, 14, 16,
18, 20, 22, 24, 26, 28, 30, 32, 34,
36, 38, 40, 48, 64, 72, 128
};
private static final int MAX_FONT_SIZE = 100; private static final int MAX_FONT_SIZE = 100;
public static Integer[] FONT_SIZES = {new Integer(6), new Integer(8), new Integer(9), new Integer(10), new Integer(11), new Integer(12), new Integer(14), new Integer(16),
new Integer(18), new Integer(20), new Integer(22), new Integer(24), new Integer(26), new Integer(28), new Integer(36), new Integer(48), new Integer(72)};
private static final Dimension BUTTON_SIZE = new Dimension(20, 18); private static final Dimension BUTTON_SIZE = new Dimension(20, 18);
private static final Dimension UNDER_LINE_SIZE = new Dimension(87, 20); private static final Dimension UNDER_LINE_SIZE = new Dimension(87, 20);
private static final Dimension HIDE_SIZE = new Dimension(0, 0); private static final Dimension HIDE_SIZE = new Dimension(0, 0);

6
designer-base/src/main/java/com/fr/design/report/WatermarkPane.java

@ -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) {

Loading…
Cancel
Save