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. 23
      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.design.actions.ReportComponentAction;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ReportComponent;
import com.fr.design.menu.KeySetUtils;
@ -36,14 +37,16 @@ public class ReportBackgroundAction extends ReportComponentAction<ReportComponen
}
final ReportBackgroundPane bPane = new ReportBackgroundPane();
bPane.populate(ReportUtils.getReportSettings(reportPane.getTemplateReport()));
bPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
BasicDialog bDialog = bPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
@Override
public void doOk() {
bPane.update(reportPane.getTemplateReport().getReportSettings());
reportPane.fireTargetModified();
}
}).setVisible(true);
});
bDialog.setModal(false);
bDialog.setVisible(true);
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.start();
hideCursor();
System.out.println(KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusedWindow());
}
/**

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

@ -3,10 +3,7 @@
*/
package com.fr.design.style.color;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.GridLayout;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
@ -71,10 +68,22 @@ public class ColorSelectPane extends TransparentPane implements ColorSelectable
// center
JPanel centerPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
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);
centerPane.add(pane.getPane());
UsedColorPane usedColorPane = new UsedColorPane(1, 7, ColorSelectConfigManager.getInstance().getColors(),this);
usedColorPane.getPane().setBorder(BorderFactory.createEmptyBorder(0, 1, 0, 8));
row1Pane.add(usedColorPane.getPane());
JPanel menuColorPane1 = new JPanel();
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);
// 取色按钮
PickColorButton pickColorButton = new PickColorButton(this, PickColorButton.IconType.ICON18);
PickColorButton pickColorButton = new PickColorButton(this, PickColorButton.IconType.ICON16);
row1Pane.add(pickColorButton, BorderLayout.WEST);

Loading…
Cancel
Save