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 UIComboBox chooseComboBox;
protected JPanel buttonPane;
private JPanel contentPane;
protected AbstractTemplateServerSettingPane() {
@ -35,8 +36,9 @@ public abstract class AbstractTemplateServerSettingPane extends BasicPane {
private void initComponents() {
chooseComboBox = new UIComboBox(CHOOSEITEM);
chooseComboBox.addItemListener(itemListener);
UILabel belowSetLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Blow_Set") + ":");
JPanel buttonPane = GUICoreUtils.createFlowPane(new Component[] {
UILabel belowSetLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Blow_Set"));
belowSetLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 20));
buttonPane = GUICoreUtils.createFlowPane(new Component[] {
belowSetLabel, chooseComboBox}, FlowLayout.LEFT, 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.utils.gui.GUICoreUtils;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JPanel;
@ -47,7 +46,7 @@ public class WatermarkPane extends BasicPane {
}
private void initComponents() {
this.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
this.setBorder(BorderFactory.createEmptyBorder(4, 4, -5, 4));
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
@ -66,7 +65,7 @@ public class WatermarkPane extends BasicPane {
// 设置
JPanel rightPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
contentPane.add(rightPane, BorderLayout.EAST);
rightPane.add(initRightPane(), BorderLayout.CENTER);
rightPane.add(initRightPane(), BorderLayout.NORTH);
}
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.report.core.ReportUtils;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
/**
@ -12,6 +13,15 @@ import javax.swing.JPanel;
public class WatermarkSettingPane extends AbstractTemplateServerSettingPane {
private WatermarkPane watermarkPane;
public WatermarkSettingPane() {
super();
initComponents();
}
private void initComponents() {
buttonPane.setBorder(BorderFactory.createEmptyBorder(10, 8, 0, 0));
}
@Override
protected JPanel getContentPane() {
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 鼠标事件
*/
public void processMouseEvent(MouseEvent e) {
if (!isEnabled()) {
return;
}
if (e == null || e.getID() == MouseEvent.MOUSE_RELEASED) {
colorSelectable.setColor(this.getColor());
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.Icon;
import javax.swing.JButton;
import javax.swing.JColorChooser;
import javax.swing.JPanel;
import javax.swing.SpinnerNumberModel;
@ -706,7 +707,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
mainPanel.add(hexPanel, BorderLayout.SOUTH);
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();
blankArea.setPreferredSize(new Dimension(100, 175));
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.
private ArrayList<ChangeListener> colorChangeListenerList = new ArrayList<ChangeListener>();
// 颜色选择器
private ColorSelectDetailPane pane;
// 是否支持透明
private boolean isSupportTransparent;
@ -52,10 +50,10 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
/**
* Constructor.
*/
public NewColorSelectPane(boolean isSupportTransparent) {
NewColorSelectPane(boolean isSupportTransparent) {
this.isSupportTransparent = isSupportTransparent;
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) {
UIButton transpanrentButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ChartF_Transparency"));
this.add(transpanrentButton, BorderLayout.NORTH);
@ -96,12 +94,13 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
// mod by anchore 16/11/16
UIButton customButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_More_Color"));
customButton.addMouseListener(new MouseAdapter() {
customButton.addActionListener(new ActionListener() {
@Override
public void mousePressed(MouseEvent e) {
public void actionPerformed(ActionEvent e) {
customButtonPressed();
}
});
customButton.setCursor(new Cursor(Cursor.HAND_CURSOR));
JPanel centerPane1 = FRGUIPaneFactory.createBorderLayout_S_Pane();
centerPane1.setBorder(BorderFactory.createEmptyBorder(2, 8, 0, 8));
@ -183,7 +182,8 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
}
protected void customButtonPressed() {
pane = new ColorSelectDetailPane(Color.WHITE);
// 颜色选择器
ColorSelectDetailPane pane = new ColorSelectDetailPane(Color.WHITE);
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.design.gui.ibutton.SpecialUIButton;
import com.fr.design.gui.ibutton.UIBasicButtonUI;
import javax.swing.*;
import javax.swing.plaf.ButtonUI;
import javax.swing.plaf.basic.BasicButtonUI;
import java.awt.*;
import java.awt.event.*;
/**
* Created by plough on 2016/12/22.
*/
public class PickColorButtonFactory {
class PickColorButtonFactory {
private static int iconSize;
private static final int SIZE_16 = 16;
private static final int SIZE_18 = 18;
private static IconType iconType;
private static Image iconImage;
public static SpecialUIButton getPickColorButton(ColorSelectable colorSelectable, IconType iconType) {
return getPickColorButton(colorSelectable, iconType, false);
}
public static SpecialUIButton getPickColorButton(final ColorSelectable colorSelectable, IconType iconType, final boolean setColorRealTime) {
/**
* 生成取色按钮
* @param colorSelectable 接收取到的颜色值的对象
* @param iconType IconType 枚举可选择 16px 18px 两个尺寸
* @param setColorRealTime 是否在取色过程中实时更新颜色值
* @return SpecialUIButton 屏幕取色按钮
*/
static JButton getPickColorButton(final ColorSelectable colorSelectable, IconType iconType, final boolean setColorRealTime) {
SpecialUIButton pickColorButton = new SpecialUIButton(new WhiteButtonUI());
PickColorButtonFactory.iconType = iconType;
@ -37,9 +42,9 @@ public class PickColorButtonFactory {
pickColorButton.setPreferredSize(new Dimension(iconSize, iconSize));
pickColorButton.setCursor(new Cursor(Cursor.HAND_CURSOR));
pickColorButton.addMouseListener(new MouseAdapter() {
pickColorButton.addActionListener(new ActionListener() {
@Override
public void mousePressed(MouseEvent e) {
public void actionPerformed(ActionEvent e) {
new ColorPicker(colorSelectable, setColorRealTime);
}
});
@ -47,12 +52,14 @@ public class PickColorButtonFactory {
return pickColorButton;
}
// 取色器按钮使用的图标
/**
* 取色按钮可使用的图标尺寸
*/
public enum IconType {
ICON16, ICON18
}
private static class WhiteButtonUI extends ButtonUI {
private static class WhiteButtonUI extends UIBasicButtonUI {
@Override
public void paint(Graphics g, JComponent 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;
if (needPickColorButton) {
// 取色按钮
SpecialUIButton pickColorButton = PickColorButtonFactory.getPickColorButton(selectable, PickColorButtonFactory.IconType.ICON16, setColorRealTime);
JButton pickColorButton = PickColorButtonFactory.getPickColorButton(selectable, PickColorButtonFactory.IconType.ICON16, setColorRealTime);
panel.add(pickColorButton);
i++;
this.reserveCells += 1;

Loading…
Cancel
Save