Browse Source

REPORT-11612 全局水印=>视觉优化;修复禁用面板后仍然可点击的bug

research/10.0
plough 6 years ago
parent
commit
54983e915c
  1. 6
      designer-base/src/main/java/com/fr/design/dialog/AbstractTemplateServerSettingPane.java
  2. 5
      designer-base/src/main/java/com/fr/design/report/WatermarkPane.java
  3. 10
      designer-base/src/main/java/com/fr/design/report/WatermarkSettingPane.java
  4. 4
      designer-base/src/main/java/com/fr/design/style/color/ColorCell.java
  5. 3
      designer-base/src/main/java/com/fr/design/style/color/CustomChooserPanel.java
  6. 14
      designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java
  7. 27
      designer-base/src/main/java/com/fr/design/style/color/PickColorButtonFactory.java
  8. 2
      designer-base/src/main/java/com/fr/design/style/color/UsedColorPane.java

6
designer-base/src/main/java/com/fr/design/dialog/AbstractTemplateServerSettingPane.java

@ -26,6 +26,7 @@ public abstract class AbstractTemplateServerSettingPane extends BasicPane {
protected static final int SERVER_SET = 1; protected static final int SERVER_SET = 1;
protected UIComboBox chooseComboBox; protected UIComboBox chooseComboBox;
protected JPanel buttonPane;
private JPanel contentPane; private JPanel contentPane;
protected AbstractTemplateServerSettingPane() { protected AbstractTemplateServerSettingPane() {
@ -35,8 +36,9 @@ public abstract class AbstractTemplateServerSettingPane extends BasicPane {
private void initComponents() { private void initComponents() {
chooseComboBox = new UIComboBox(CHOOSEITEM); chooseComboBox = new UIComboBox(CHOOSEITEM);
chooseComboBox.addItemListener(itemListener); chooseComboBox.addItemListener(itemListener);
UILabel belowSetLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Blow_Set") + ":"); UILabel belowSetLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Blow_Set"));
JPanel buttonPane = GUICoreUtils.createFlowPane(new Component[] { belowSetLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 20));
buttonPane = GUICoreUtils.createFlowPane(new Component[] {
belowSetLabel, chooseComboBox}, FlowLayout.LEFT, 0, 0); belowSetLabel, chooseComboBox}, FlowLayout.LEFT, 0, 0);
buttonPane.setBorder(BorderFactory.createEmptyBorder(10, 20, 0, 0)); buttonPane.setBorder(BorderFactory.createEmptyBorder(10, 20, 0, 0));

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

@ -13,7 +13,6 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.style.color.NewColorSelectPane; import com.fr.design.style.color.NewColorSelectPane;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -47,7 +46,7 @@ public class WatermarkPane extends BasicPane {
} }
private void initComponents() { private void initComponents() {
this.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); this.setBorder(BorderFactory.createEmptyBorder(4, 4, -5, 4));
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
@ -66,7 +65,7 @@ public class WatermarkPane extends BasicPane {
// 设置 // 设置
JPanel rightPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel rightPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
contentPane.add(rightPane, BorderLayout.EAST); contentPane.add(rightPane, BorderLayout.EAST);
rightPane.add(initRightPane(), BorderLayout.CENTER); rightPane.add(initRightPane(), BorderLayout.NORTH);
} }
public void populate(WatermarkAttr watermark) { public void populate(WatermarkAttr watermark) {

10
designer-base/src/main/java/com/fr/design/report/WatermarkSettingPane.java

@ -4,6 +4,7 @@ import com.fr.base.iofile.attr.WatermarkAttr;
import com.fr.design.dialog.AbstractTemplateServerSettingPane; import com.fr.design.dialog.AbstractTemplateServerSettingPane;
import com.fr.report.core.ReportUtils; import com.fr.report.core.ReportUtils;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
/** /**
@ -12,6 +13,15 @@ import javax.swing.JPanel;
public class WatermarkSettingPane extends AbstractTemplateServerSettingPane { public class WatermarkSettingPane extends AbstractTemplateServerSettingPane {
private WatermarkPane watermarkPane; private WatermarkPane watermarkPane;
public WatermarkSettingPane() {
super();
initComponents();
}
private void initComponents() {
buttonPane.setBorder(BorderFactory.createEmptyBorder(10, 8, 0, 0));
}
@Override @Override
protected JPanel getContentPane() { protected JPanel getContentPane() {
if (watermarkPane == null) { if (watermarkPane == null) {

4
designer-base/src/main/java/com/fr/design/style/color/ColorCell.java

@ -89,6 +89,10 @@ public class ColorCell extends JComponent implements ColorSelectable {
* @param 鼠标事件 * @param 鼠标事件
*/ */
public void processMouseEvent(MouseEvent e) { public void processMouseEvent(MouseEvent e) {
if (!isEnabled()) {
return;
}
if (e == null || e.getID() == MouseEvent.MOUSE_RELEASED) { if (e == null || e.getID() == MouseEvent.MOUSE_RELEASED) {
colorSelectable.setColor(this.getColor()); colorSelectable.setColor(this.getColor());
colorSelectable.colorSetted(this); colorSelectable.colorSetted(this);

3
designer-base/src/main/java/com/fr/design/style/color/CustomChooserPanel.java

@ -9,6 +9,7 @@ import java.util.regex.Pattern;
import javax.swing.ButtonGroup; import javax.swing.ButtonGroup;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JButton;
import javax.swing.JColorChooser; import javax.swing.JColorChooser;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SpinnerNumberModel; import javax.swing.SpinnerNumberModel;
@ -706,7 +707,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
mainPanel.add(hexPanel, BorderLayout.SOUTH); mainPanel.add(hexPanel, BorderLayout.SOUTH);
JPanel rightPane = new JPanel(new BorderLayout()); JPanel rightPane = new JPanel(new BorderLayout());
SpecialUIButton pickColorButton = PickColorButtonFactory.getPickColorButton(this, PickColorButtonFactory.IconType.ICON18, true); JButton pickColorButton = PickColorButtonFactory.getPickColorButton(this, PickColorButtonFactory.IconType.ICON18, true);
JPanel blankArea = new JPanel(); JPanel blankArea = new JPanel();
blankArea.setPreferredSize(new Dimension(100, 175)); blankArea.setPreferredSize(new Dimension(100, 175));
rightPane.add(blankArea, BorderLayout.CENTER); rightPane.add(blankArea, BorderLayout.CENTER);

14
designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java

@ -31,8 +31,6 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
// color setting action. // color setting action.
private ArrayList<ChangeListener> colorChangeListenerList = new ArrayList<ChangeListener>(); private ArrayList<ChangeListener> colorChangeListenerList = new ArrayList<ChangeListener>();
// 颜色选择器
private ColorSelectDetailPane pane;
// 是否支持透明 // 是否支持透明
private boolean isSupportTransparent; private boolean isSupportTransparent;
@ -52,10 +50,10 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
/** /**
* Constructor. * Constructor.
*/ */
public NewColorSelectPane(boolean isSupportTransparent) { NewColorSelectPane(boolean isSupportTransparent) {
this.isSupportTransparent = isSupportTransparent; this.isSupportTransparent = isSupportTransparent;
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, 5)); this.setBorder(new UIRoundedBorder(UIConstants.TOOLBAR_BORDER_COLOR, 1, 5));
if (isSupportTransparent) { if (isSupportTransparent) {
UIButton transpanrentButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ChartF_Transparency")); UIButton transpanrentButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ChartF_Transparency"));
this.add(transpanrentButton, BorderLayout.NORTH); this.add(transpanrentButton, BorderLayout.NORTH);
@ -96,12 +94,13 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
// mod by anchore 16/11/16 // mod by anchore 16/11/16
UIButton customButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_More_Color")); UIButton customButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_More_Color"));
customButton.addMouseListener(new MouseAdapter() { customButton.addActionListener(new ActionListener() {
@Override @Override
public void mousePressed(MouseEvent e) { public void actionPerformed(ActionEvent e) {
customButtonPressed(); customButtonPressed();
} }
}); });
customButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); customButton.setCursor(new Cursor(Cursor.HAND_CURSOR));
JPanel centerPane1 = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel centerPane1 = FRGUIPaneFactory.createBorderLayout_S_Pane();
centerPane1.setBorder(BorderFactory.createEmptyBorder(2, 8, 0, 8)); centerPane1.setBorder(BorderFactory.createEmptyBorder(2, 8, 0, 8));
@ -183,7 +182,8 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
} }
protected void customButtonPressed() { protected void customButtonPressed() {
pane = new ColorSelectDetailPane(Color.WHITE); // 颜色选择器
ColorSelectDetailPane pane = new ColorSelectDetailPane(Color.WHITE);
ColorSelectDialog.showDialog(DesignerContext.getDesignerFrame(), pane, Color.WHITE, this); ColorSelectDialog.showDialog(DesignerContext.getDesignerFrame(), pane, Color.WHITE, this);
} }

27
designer-base/src/main/java/com/fr/design/style/color/PickColorButtonFactory.java

@ -2,27 +2,32 @@ package com.fr.design.style.color;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.gui.ibutton.SpecialUIButton; import com.fr.design.gui.ibutton.SpecialUIButton;
import com.fr.design.gui.ibutton.UIBasicButtonUI;
import javax.swing.*; import javax.swing.*;
import javax.swing.plaf.ButtonUI; import javax.swing.plaf.ButtonUI;
import javax.swing.plaf.basic.BasicButtonUI;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.*;
/** /**
* Created by plough on 2016/12/22. * Created by plough on 2016/12/22.
*/ */
public class PickColorButtonFactory { class PickColorButtonFactory {
private static int iconSize; private static int iconSize;
private static final int SIZE_16 = 16; private static final int SIZE_16 = 16;
private static final int SIZE_18 = 18; private static final int SIZE_18 = 18;
private static IconType iconType; private static IconType iconType;
private static Image iconImage; private static Image iconImage;
public static SpecialUIButton getPickColorButton(ColorSelectable colorSelectable, IconType iconType) { /**
return getPickColorButton(colorSelectable, iconType, false); * 生成取色按钮
} * @param colorSelectable 接收取到的颜色值的对象
* @param iconType IconType 枚举可选择 16px 18px 两个尺寸
public static SpecialUIButton getPickColorButton(final ColorSelectable colorSelectable, IconType iconType, final boolean setColorRealTime) { * @param setColorRealTime 是否在取色过程中实时更新颜色值
* @return SpecialUIButton 屏幕取色按钮
*/
static JButton getPickColorButton(final ColorSelectable colorSelectable, IconType iconType, final boolean setColorRealTime) {
SpecialUIButton pickColorButton = new SpecialUIButton(new WhiteButtonUI()); SpecialUIButton pickColorButton = new SpecialUIButton(new WhiteButtonUI());
PickColorButtonFactory.iconType = iconType; PickColorButtonFactory.iconType = iconType;
@ -37,9 +42,9 @@ public class PickColorButtonFactory {
pickColorButton.setPreferredSize(new Dimension(iconSize, iconSize)); pickColorButton.setPreferredSize(new Dimension(iconSize, iconSize));
pickColorButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); pickColorButton.setCursor(new Cursor(Cursor.HAND_CURSOR));
pickColorButton.addMouseListener(new MouseAdapter() { pickColorButton.addActionListener(new ActionListener() {
@Override @Override
public void mousePressed(MouseEvent e) { public void actionPerformed(ActionEvent e) {
new ColorPicker(colorSelectable, setColorRealTime); new ColorPicker(colorSelectable, setColorRealTime);
} }
}); });
@ -47,12 +52,14 @@ public class PickColorButtonFactory {
return pickColorButton; return pickColorButton;
} }
// 取色器按钮使用的图标 /**
* 取色按钮可使用的图标尺寸
*/
public enum IconType { public enum IconType {
ICON16, ICON18 ICON16, ICON18
} }
private static class WhiteButtonUI extends ButtonUI { private static class WhiteButtonUI extends UIBasicButtonUI {
@Override @Override
public void paint(Graphics g, JComponent c) { public void paint(Graphics g, JComponent c) {
super.paint(g, c); super.paint(g, c);

2
designer-base/src/main/java/com/fr/design/style/color/UsedColorPane.java

@ -72,7 +72,7 @@ public class UsedColorPane extends BasicPane {
int i = 0; int i = 0;
if (needPickColorButton) { if (needPickColorButton) {
// 取色按钮 // 取色按钮
SpecialUIButton pickColorButton = PickColorButtonFactory.getPickColorButton(selectable, PickColorButtonFactory.IconType.ICON16, setColorRealTime); JButton pickColorButton = PickColorButtonFactory.getPickColorButton(selectable, PickColorButtonFactory.IconType.ICON16, setColorRealTime);
panel.add(pickColorButton); panel.add(pickColorButton);
i++; i++;
this.reserveCells += 1; this.reserveCells += 1;

Loading…
Cancel
Save