Browse Source

REPORT-1096 在“纸张背景”窗口中增加取色器按钮

master
plough 8 years ago
parent
commit
d998b8524c
  1. 7
      designer/src/com/fr/design/actions/report/ReportBackgroundAction.java
  2. 1
      designer_base/src/com/fr/design/style/color/ColorPicker.java
  3. 21
      designer_base/src/com/fr/design/style/color/ColorSelectPane.java
  4. 2
      designer_base/src/com/fr/design/style/color/NewColorSelectPane.java

7
designer/src/com/fr/design/actions/report/ReportBackgroundAction.java

@ -5,6 +5,7 @@ package com.fr.design.actions.report;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.actions.ReportComponentAction; import com.fr.design.actions.ReportComponentAction;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ReportComponent; import com.fr.design.mainframe.ReportComponent;
import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.KeySetUtils;
@ -36,14 +37,16 @@ public class ReportBackgroundAction extends ReportComponentAction<ReportComponen
} }
final ReportBackgroundPane bPane = new ReportBackgroundPane(); final ReportBackgroundPane bPane = new ReportBackgroundPane();
bPane.populate(ReportUtils.getReportSettings(reportPane.getTemplateReport())); bPane.populate(ReportUtils.getReportSettings(reportPane.getTemplateReport()));
bPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { BasicDialog bDialog = bPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
@Override @Override
public void doOk() { public void doOk() {
bPane.update(reportPane.getTemplateReport().getReportSettings()); bPane.update(reportPane.getTemplateReport().getReportSettings());
reportPane.fireTargetModified(); reportPane.fireTargetModified();
} }
}).setVisible(true); });
bDialog.setModal(false);
bDialog.setVisible(true);
return false; return false;
} }
} }

1
designer_base/src/com/fr/design/style/color/ColorPicker.java

@ -58,6 +58,7 @@ public class ColorPicker extends JDialog implements ActionListener
timer = new Timer(1000/FPS, this); timer = new Timer(1000/FPS, this);
timer.start(); timer.start();
hideCursor(); hideCursor();
System.out.println(KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusedWindow());
} }
/** /**

21
designer_base/src/com/fr/design/style/color/ColorSelectPane.java

@ -3,10 +3,7 @@
*/ */
package com.fr.design.style.color; package com.fr.design.style.color;
import java.awt.BorderLayout; import java.awt.*;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.GridLayout;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
@ -72,9 +69,21 @@ public class ColorSelectPane extends TransparentPane implements ColorSelectable
JPanel centerPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); JPanel centerPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
this.add(centerPane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER);
// 第一行,1个取色按钮 + 7个最近使用的颜色
JPanel row1Pane = new JPanel(FRGUIPaneFactory.createBorderLayout());
row1Pane.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 0));
row1Pane.setPreferredSize(new Dimension(135, 24)); // 宽度为 16 * 8 + 7
centerPane.add(row1Pane);
// 取色按钮
PickColorButton pickColorButton = new PickColorButton(this, PickColorButton.IconType.ICON16, true);
row1Pane.add(pickColorButton, BorderLayout.WEST);
// 最近使用 // 最近使用
UsedColorPane pane = new UsedColorPane(1, 8, ColorSelectConfigManager.getInstance().getColors(),this); UsedColorPane usedColorPane = new UsedColorPane(1, 7, ColorSelectConfigManager.getInstance().getColors(),this);
centerPane.add(pane.getPane()); usedColorPane.getPane().setBorder(BorderFactory.createEmptyBorder(0, 1, 0, 8));
row1Pane.add(usedColorPane.getPane());
JPanel menuColorPane1 = new JPanel(); JPanel menuColorPane1 = new JPanel();
centerPane.add(menuColorPane1); centerPane.add(menuColorPane1);

2
designer_base/src/com/fr/design/style/color/NewColorSelectPane.java

@ -87,7 +87,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
centerPane.add(row1Pane); centerPane.add(row1Pane);
// 取色按钮 // 取色按钮
PickColorButton pickColorButton = new PickColorButton(this, PickColorButton.IconType.ICON18); PickColorButton pickColorButton = new PickColorButton(this, PickColorButton.IconType.ICON16);
row1Pane.add(pickColorButton, BorderLayout.WEST); row1Pane.add(pickColorButton, BorderLayout.WEST);

Loading…
Cancel
Save