Browse Source

REPORT-1096 取色板=》将取色框改为模态对话框;修改鼠标事件响应方法

master
plough 8 years ago
parent
commit
874d88ca75
  1. 6
      designer/src/com/fr/design/actions/report/ReportBackgroundAction.java
  2. 3
      designer_base/src/com/fr/design/style/color/ColorPicker.java
  3. 2
      designer_base/src/com/fr/design/style/color/ColorSelectDialog.java
  4. 10
      designer_base/src/com/fr/design/style/color/PickColorButtonFactory.java

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

@ -37,16 +37,14 @@ 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()));
BasicDialog bDialog = bPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { 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;
} }
} }

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

@ -49,7 +49,10 @@ public class ColorPicker extends JDialog implements ActionListener
updateSize(colorPickerSize); updateSize(colorPickerSize);
this.colorSelectable = colorSelectable; this.colorSelectable = colorSelectable;
this.setColorRealTime = setColorRealTime; this.setColorRealTime = setColorRealTime;
start();
this.setModal(true);
this.setAlwaysOnTop(true); this.setAlwaysOnTop(true);
updateLocation();
this.setVisible(true); this.setVisible(true);
this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
} }

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

@ -137,7 +137,7 @@ public class ColorSelectDialog extends MiddleChartDialog{
public static void showDialog(Frame owner,ColorSelectDetailPane pane,Color initialColor,ColorSelectable selectePane){ public static void showDialog(Frame owner,ColorSelectDetailPane pane,Color initialColor,ColorSelectable selectePane){
ColorTracker okListener = new ColorTracker(pane); ColorTracker okListener = new ColorTracker(pane);
ColorSelectDialog dialog = new ColorSelectDialog(owner,pane,initialColor,okListener,selectePane); ColorSelectDialog dialog = new ColorSelectDialog(owner,pane,initialColor,okListener,selectePane);
// dialog.setModal(true); dialog.setModal(true);
dialog.show(); dialog.show();
} }

10
designer_base/src/com/fr/design/style/color/PickColorButtonFactory.java

@ -4,8 +4,7 @@ import com.fr.base.BaseUtils;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.*;
import java.awt.event.ActionListener;
/** /**
* Created by plough on 2016/12/22. * Created by plough on 2016/12/22.
@ -28,11 +27,10 @@ public class PickColorButtonFactory {
} }
pickColorButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); pickColorButton.setCursor(new Cursor(Cursor.HAND_CURSOR));
pickColorButton.addActionListener(new ActionListener() { pickColorButton.addMouseListener(new MouseAdapter() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void mousePressed(MouseEvent e) {
ColorPicker colorPicker = new ColorPicker(colorSelectable, setColorRealTime); new ColorPicker(colorSelectable, setColorRealTime);
colorPicker.start();
} }
}); });

Loading…
Cancel
Save