diff --git a/designer/src/com/fr/design/mainframe/ReportComponentComposite.java b/designer/src/com/fr/design/mainframe/ReportComponentComposite.java index 7a4f24ea68..09b03c1837 100644 --- a/designer/src/com/fr/design/mainframe/ReportComponentComposite.java +++ b/designer/src/com/fr/design/mainframe/ReportComponentComposite.java @@ -2,6 +2,7 @@ package com.fr.design.mainframe; import com.fr.base.FRContext; import com.fr.base.ScreenResolution; +import com.fr.common.inputevent.InputEventBaseOnOS; import com.fr.design.designer.EditingState; import com.fr.design.event.TargetModifiedListener; import com.fr.design.file.HistoryTemplateListPane; @@ -11,6 +12,7 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.general.Inter; import com.fr.grid.Grid; import com.fr.main.impl.WorkBook; +import com.fr.poly.PolyDesigner; import com.fr.report.report.TemplateReport; import javax.swing.*; @@ -45,9 +47,6 @@ public class ReportComponentComposite extends JComponent { private JSliderPane jSliderContainer; - private boolean isCtrl = false; - - /** * Constructor with workbook.. */ @@ -66,29 +65,10 @@ public class ReportComponentComposite extends JComponent { jSliderContainer.getSelfAdaptButton().addItemListener(selfAdaptButtonItemListener); } - KeyListener showValSpinnerKeyListener = new KeyListener() { - @Override - public void keyTyped(KeyEvent e) { - - } - - @Override - public void keyPressed(KeyEvent e) { - if (e.isControlDown()) { - isCtrl = true; - } - } - - @Override - public void keyReleased(KeyEvent e) { - isCtrl = false; - } - }; - MouseWheelListener showValSpinnerMouseWheelListener = new MouseWheelListener() { @Override public void mouseWheelMoved(MouseWheelEvent e) { - if (isCtrl) { + if (InputEventBaseOnOS.isControlDown(e)) { int dir = e.getWheelRotation(); int old_resolution = (int) jSliderContainer.getShowVal().getValue(); jSliderContainer.getShowVal().setValue(old_resolution - (dir * MIN)); @@ -149,12 +129,12 @@ public class ReportComponentComposite extends JComponent { } if (centerCardPane.editingComponet.elementCasePane == null) { + centerCardPane.getPolyDezi().polyArea.addMouseWheelListener(showValSpinnerMouseWheelListener); return; } Grid grid = centerCardPane.editingComponet.elementCasePane.getGrid(); this.centerCardPane.editingComponet.elementCasePane.getGrid().addMouseWheelListener(showValSpinnerMouseWheelListener); - this.centerCardPane.editingComponet.elementCasePane.getGrid().addKeyListener(showValSpinnerKeyListener); if (!grid.hasFocus() && grid.isRequestFocusEnabled()) { grid.requestFocus(); diff --git a/designer/src/com/fr/design/mainframe/ReportFloatPane.java b/designer/src/com/fr/design/mainframe/ReportFloatPane.java index b7fead91aa..3a2756a130 100644 --- a/designer/src/com/fr/design/mainframe/ReportFloatPane.java +++ b/designer/src/com/fr/design/mainframe/ReportFloatPane.java @@ -49,7 +49,7 @@ public class ReportFloatPane extends JPanel { JPanel toolBarPane = new JPanel(new BorderLayout()); toolBarPane.add(topToolBar, BorderLayout.CENTER); - toolBarPane.setBorder(BorderFactory.createLineBorder(UIConstants.POP_DIALOG_BORDER)); + toolBarPane.setBorder(BorderFactory.createLineBorder(UIConstants.TITLED_BORDER_COLOR)); toolBarPane.setPreferredSize(new Dimension(155,20)); UILabel emptyLabel = new UILabel(); emptyLabel.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0)); @@ -62,7 +62,7 @@ public class ReportFloatPane extends JPanel { new Component[]{new UILabel(), new UILabel(Inter.getLocText("FR-Designer_Add_FloatElement")), emptyLabel, toolBarPane}, }; JPanel leftTopPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - leftTopPane.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 15)); + leftTopPane.setBorder(BorderFactory.createEmptyBorder(12, 5, 0, 15)); this.add(leftTopPane, BorderLayout.NORTH); } diff --git a/designer/src/com/fr/design/mainframe/form/FormReportComponentComposite.java b/designer/src/com/fr/design/mainframe/form/FormReportComponentComposite.java index f091cbe8aa..a79f64af4e 100644 --- a/designer/src/com/fr/design/mainframe/form/FormReportComponentComposite.java +++ b/designer/src/com/fr/design/mainframe/form/FormReportComponentComposite.java @@ -2,6 +2,7 @@ package com.fr.design.mainframe.form; import com.fr.base.DynamicUnitList; import com.fr.base.ScreenResolution; +import com.fr.common.inputevent.InputEventBaseOnOS; import com.fr.design.cell.bar.DynamicScrollBar; import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedListener; @@ -40,7 +41,6 @@ public class FormReportComponentComposite extends JComponent implements TargetMo private FormTabPane sheetNameTab; private JPanel hbarContainer; private JSliderPane jSliderContainer; - private boolean isCtrl = false; public FormReportComponentComposite(BaseJForm jform, FormElementCaseDesigner elementCaseDesign, FormElementCaseContainerProvider ecContainer) { this.jForm = jform; @@ -52,33 +52,13 @@ public class FormReportComponentComposite extends JComponent implements TargetMo jSliderContainer.getShowVal().addChangeListener(showValSpinnerChangeListener); jSliderContainer.getSelfAdaptButton().addItemListener(selfAdaptButtonItemListener); this.elementCaseDesigner.elementCasePane.getGrid().addMouseWheelListener(showValSpinnerMouseWheelListener); - this.elementCaseDesigner.elementCasePane.getGrid().addKeyListener(showValSpinnerKeyListener); elementCaseDesigner.addTargetModifiedListener(this); } - KeyListener showValSpinnerKeyListener = new KeyListener() { - @Override - public void keyTyped(KeyEvent e) { - - } - - @Override - public void keyPressed(KeyEvent e) { - if (e.isControlDown()) { - isCtrl = true; - } - } - - @Override - public void keyReleased(KeyEvent e) { - isCtrl = false; - } - }; - MouseWheelListener showValSpinnerMouseWheelListener = new MouseWheelListener() { @Override public void mouseWheelMoved(MouseWheelEvent e) { - if (isCtrl) { + if (InputEventBaseOnOS.isControlDown(e)) { int dir = e.getWheelRotation(); int old_resolution = (int) jSliderContainer.getShowVal().getValue(); jSliderContainer.getShowVal().setValue(old_resolution - (dir * MIN)); diff --git a/designer/src/com/fr/grid/GridMouseAdapter.java b/designer/src/com/fr/grid/GridMouseAdapter.java index 147155e43d..fc88714adc 100644 --- a/designer/src/com/fr/grid/GridMouseAdapter.java +++ b/designer/src/com/fr/grid/GridMouseAdapter.java @@ -807,9 +807,11 @@ public class GridMouseAdapter implements MouseListener, MouseWheelListener, Mous * @param e */ public void mouseWheelMoved(MouseWheelEvent e) { - ElementCasePane reportPane = grid.getElementCasePane(); - if (reportPane.isHorizontalScrollBarVisible()) { - reportPane.getVerticalScrollBar().setValue(reportPane.getVerticalScrollBar().getValue() + e.getWheelRotation() * 3); + if (!InputEventBaseOnOS.isControlDown(e)) { + ElementCasePane reportPane = grid.getElementCasePane(); + if (reportPane.isHorizontalScrollBarVisible()) { + reportPane.getVerticalScrollBar().setValue(reportPane.getVerticalScrollBar().getValue() + e.getWheelRotation() * 3); + } } } diff --git a/designer/src/com/fr/poly/PolyDesigner.java b/designer/src/com/fr/poly/PolyDesigner.java index aa416fc86f..0c700a7bf5 100644 --- a/designer/src/com/fr/poly/PolyDesigner.java +++ b/designer/src/com/fr/poly/PolyDesigner.java @@ -7,6 +7,7 @@ import com.fr.base.BaseUtils; import com.fr.base.FRContext; import com.fr.base.GraphHelper; import com.fr.base.ScreenResolution; +import com.fr.common.inputevent.InputEventBaseOnOS; import com.fr.design.DesignState; import com.fr.design.DesignerEnvManager; import com.fr.design.actions.edit.CopyAction; @@ -51,10 +52,7 @@ import com.fr.stable.unit.UnitRectangle; import javax.swing.*; import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; -import java.awt.event.MouseEvent; +import java.awt.event.*; import java.util.ArrayList; import java.util.List; @@ -98,7 +96,6 @@ public class PolyDesigner extends ReportComponent i this.chooseTable.populateBean(new DataBaseItems(dbName, dbDict.getSchema(), dbDict.getTableName())); if (this.database == null) { + this.keyColumnPane.updateUpButton(); + this.valueDictPane.updateUpButton(); return; } @@ -187,6 +189,9 @@ public class DatabaseDictPane extends FurtherBasicBeanPane i } dbDict.setKeyColumnIndex(keyColumnIndex); dbDict.setKeyColumnName(keyColumnName); + }else { + this.keyColumnPane.updateUpButton(); + this.valueDictPane.updateUpButton(); } Object value = this.valueDictPane.update(); if (value instanceof Integer) { diff --git a/designer_form/src/com/fr/design/mainframe/FormArea.java b/designer_form/src/com/fr/design/mainframe/FormArea.java index 12188f2da0..e35657c23b 100644 --- a/designer_form/src/com/fr/design/mainframe/FormArea.java +++ b/designer_form/src/com/fr/design/mainframe/FormArea.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe; import com.fr.base.ScreenResolution; +import com.fr.common.inputevent.InputEventBaseOnOS; import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XLayoutContainer; @@ -50,7 +51,6 @@ public class FormArea extends JComponent implements ScrollRulerComponent { private double START_VALUE = DEFAULT_SLIDER; private int resolution = ScreenResolution.getScreenResolution(); private double screenValue; - private boolean isCtrl = false; public FormScrollBar getHorScrollBar() { return horScrollBar; @@ -86,35 +86,14 @@ public class FormArea extends JComponent implements ScrollRulerComponent { } this.setFocusTraversalKeysEnabled(false); this.designer.addMouseWheelListener(showValSpinnerMouseWheelListener); - this.designer.addKeyListener(showValSpinnerKeyListener); this.setOpaque(true); this.setBackground(Color.WHITE); } - - KeyListener showValSpinnerKeyListener = new KeyListener() { - @Override - public void keyTyped(KeyEvent e) { - - } - - @Override - public void keyPressed(KeyEvent e) { - if (e.isControlDown()) { - isCtrl = true; - } - } - - @Override - public void keyReleased(KeyEvent e) { - isCtrl = false; - } - }; - MouseWheelListener showValSpinnerMouseWheelListener = new MouseWheelListener() { @Override public void mouseWheelMoved(MouseWheelEvent e) { - if (isCtrl) { + if (InputEventBaseOnOS.isControlDown(e)) { int dir = e.getWheelRotation(); int old_resolution = (int) slidePane.getShowVal().getValue(); slidePane.getShowVal().setValue(old_resolution - (dir * SHOWVALMIN));