Browse Source

Merge pull request #907 in BA/design from ~HZZZ/design:reset-before-2773 to dev

* commit '5b17a17e85a5fdc382644ee7663bd1863cb379e0':
  back 2
  back 1
master
superman 8 years ago
parent
commit
dcf9a44b08
  1. 4
      designer/src/com/fr/design/actions/file/newReport/NewPolyReportAction.java
  2. 5
      designer/src/com/fr/design/actions/file/newReport/NewWorkBookAction.java
  3. 3
      designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java
  4. 12
      designer/src/com/fr/design/mainframe/ElementCasePane.java
  5. 5
      designer/src/com/fr/design/mainframe/FormatBrushAction.java
  6. 5
      designer/src/com/fr/grid/GridKeyListener.java
  7. 5
      designer/src/com/fr/grid/GridMouseAdapter.java
  8. 21
      designer_base/src/com/fr/common/inputevent/InputEventBaseOnOS.java
  9. 4
      designer_base/src/com/fr/design/actions/edit/CopyAction.java
  10. 4
      designer_base/src/com/fr/design/actions/edit/CutAction.java
  11. 4
      designer_base/src/com/fr/design/actions/edit/PasteAction.java
  12. 5
      designer_base/src/com/fr/design/gui/autocomplete/AutoCompletion.java
  13. 8
      designer_base/src/com/fr/design/gui/frpane/UIAdvancedTextPane.java
  14. 24
      designer_base/src/com/fr/design/gui/icombobox/ExtendedComboBox.java
  15. 33
      designer_base/src/com/fr/design/gui/icombobox/UIComboBoxUI.java
  16. 3
      designer_base/src/com/fr/design/gui/itable/TableSorter.java
  17. 4
      designer_base/src/com/fr/design/gui/itabpane/UITabsHeaderIconPane.java
  18. 20
      designer_base/src/com/fr/design/gui/itextarea/UITextArea.java
  19. 20
      designer_base/src/com/fr/design/gui/itextfield/UITextField.java
  20. 3
      designer_base/src/com/fr/design/gui/itree/refreshabletree/UserObjectRefreshJTree.java
  21. 27
      designer_base/src/com/fr/design/mainframe/loghandler/DesignerLogHandler.java
  22. 20
      designer_base/src/com/fr/design/menu/KeySetUtils.java
  23. 3
      designer_base/src/com/fr/design/roleAuthority/UIRoleTreeUI.java
  24. 4
      designer_form/src/com/fr/design/designer/beans/actions/CopyAction.java
  25. 4
      designer_form/src/com/fr/design/designer/beans/actions/CutAction.java
  26. 4
      designer_form/src/com/fr/design/designer/beans/actions/PasteAction.java
  27. 5
      designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java
  28. 4
      designer_form/src/com/fr/design/mainframe/actions/NewFormAction.java
  29. 4
      designer_form/src/com/fr/design/mainframe/widget/editors/DataTableConfigPane.java

4
designer/src/com/fr/design/actions/file/newReport/NewPolyReportAction.java

@ -11,15 +11,13 @@ import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JPolyWorkBook;
import com.fr.general.Inter;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
public class NewPolyReportAction extends UpdateAction {
public NewPolyReportAction() {
this.setName(Inter.getLocText("M-New_Multi_Report"));
this.setMnemonic('F');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/formExport.png"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_M, DEFAULT_MODIFIER));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_M, KeyEvent.CTRL_MASK));
}
/**

5
designer/src/com/fr/design/actions/file/newReport/NewWorkBookAction.java

@ -12,8 +12,6 @@ import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
public class NewWorkBookAction extends UpdateAction {
public NewWorkBookAction() {
@ -30,6 +28,7 @@ public class NewWorkBookAction extends UpdateAction {
/**
* 动作
*
* @param e 事件
*/
public void actionPerformed(ActionEvent e) {
@ -49,7 +48,7 @@ public class NewWorkBookAction extends UpdateAction {
@Override
public KeyStroke getKeyStroke() {
return KeyStroke.getKeyStroke(KeyEvent.VK_N, DEFAULT_MODIFIER);
return KeyStroke.getKeyStroke(KeyEvent.VK_N, InputEvent.CTRL_MASK);
}
};

3
designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java

@ -3,7 +3,6 @@ package com.fr.design.mainframe;
import com.fr.base.ConfigManager;
import com.fr.base.ConfigManagerProvider;
import com.fr.base.FRContext;
import com.fr.common.inputevent.InputEventBaseOnOS;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.icombobox.UIComboBox;
@ -68,7 +67,7 @@ public class AuthorityToolBarPane<T extends WebContent> extends BasicBeanPane<Re
buttonlists.get(i).setSelected(true);
}
}
} else if (!InputEventBaseOnOS.isControlDown(e)) {
} else if (!e.isControlDown()) {
//实现单选
removeSelection();
if (selectedIndex != -1) {

12
designer/src/com/fr/design/mainframe/ElementCasePane.java

@ -127,8 +127,6 @@ import com.fr.stable.ColumnRow;
import com.fr.stable.Constants;
import com.fr.stable.unit.FU;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
/**
* This class used to edit Report.
*/
@ -282,7 +280,7 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
}
}
});
formatBrush.registerKeyboardAction(keyListener, KeyStroke.getKeyStroke(KeyEvent.VK_B, DEFAULT_MODIFIER), JComponent.WHEN_IN_FOCUSED_WINDOW);
formatBrush.registerKeyboardAction(keyListener, KeyStroke.getKeyStroke(KeyEvent.VK_B, InputEvent.CTRL_MASK), JComponent.WHEN_IN_FOCUSED_WINDOW);
formatBrush.registerKeyboardAction(escKey, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_IN_FOCUSED_WINDOW);
}
@ -857,7 +855,7 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
// clearReportPage old values.
inputMapAncestor.clear();
actionMap.clear();
inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER), "cut");
inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_X, InputEvent.CTRL_MASK), "cut");
actionMap.put("cut", new AbstractAction() {
public void actionPerformed(ActionEvent evt) {
if (cut()) {
@ -865,13 +863,13 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
}
}
});
inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER), "copy");
inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK), "copy");
actionMap.put("copy", new AbstractAction() {
public void actionPerformed(ActionEvent evt) {
copy();
}
});
inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER), "paste");
inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.CTRL_MASK), "paste");
actionMap.put("paste", new AbstractAction() {
public void actionPerformed(ActionEvent evt) {
if (paste()) {
@ -889,7 +887,7 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
}
}
});
inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, DEFAULT_MODIFIER), "delete_all");
inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, InputEvent.CTRL_MASK), "delete_all");
actionMap.put("delete_all", new AbstractAction() {
public void actionPerformed(ActionEvent evt) {
if (clearAll()) {

5
designer/src/com/fr/design/mainframe/FormatBrushAction.java

@ -12,10 +12,9 @@ import com.fr.report.elementcase.TemplateElementCase;
import javax.swing.*;
import java.awt.*;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
/**
* Author : daisy
* Date: 13-8-7
@ -32,7 +31,7 @@ public class FormatBrushAction extends ElementCaseAction {
this.setName(Inter.getLocText("M_Edit-FormatBrush"));
this.setMnemonic('B');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/formatBrush.png"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_B, DEFAULT_MODIFIER));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_B, InputEvent.CTRL_MASK));
}
public boolean executeActionReturnUndoRecordNeeded() {

5
designer/src/com/fr/grid/GridKeyListener.java

@ -1,6 +1,5 @@
package com.fr.grid;
import com.fr.common.inputevent.InputEventBaseOnOS;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.FloatSelection;
@ -67,7 +66,7 @@ public class GridKeyListener implements KeyListener {
}
// Richie:Ctrl + A全选单元格
case KeyEvent.VK_A:
if (InputEventBaseOnOS.isControlDown(evt)) {
if (evt.isControlDown()) {
reportPane.setSelection(new CellSelection(0, 0, report.getColumnCount(), report.getRowCount()));
}
isNeedRepaint = true;
@ -161,7 +160,7 @@ public class GridKeyListener implements KeyListener {
return;
}
KeyEvent newEvt = KeyEventWork.processKeyEvent(evt);
if (newEvt == null || InputEventBaseOnOS.isControlDown(evt)) {// uneditable.
if (newEvt == null || evt.isControlDown()) {// uneditable.
return;
}
char ch = evt.getKeyChar();

5
designer/src/com/fr/grid/GridMouseAdapter.java

@ -3,7 +3,6 @@ package com.fr.grid;
import com.fr.base.BaseUtils;
import com.fr.base.DynamicUnitList;
import com.fr.base.ScreenResolution;
import com.fr.common.inputevent.InputEventBaseOnOS;
import com.fr.design.constants.UIConstants;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ElementCasePane;
@ -165,7 +164,7 @@ public class GridMouseAdapter implements MouseListener, MouseWheelListener, Mous
ElementCasePane reportPane = grid.getElementCasePane();
TemplateElementCase report = reportPane.getEditingElementCase();
boolean isShiftDown = evt.isShiftDown();
boolean isControlDown = InputEventBaseOnOS.isControlDown(evt);
boolean isControlDown = evt.isControlDown();
int clickCount = evt.getClickCount();
// peter:需要判断是否在可移动CellSelection的区域
grid.setDragType(isMoveCellSelection(this.oldEvtX, this.oldEvtY));
@ -337,7 +336,7 @@ public class GridMouseAdapter implements MouseListener, MouseWheelListener, Mous
return;
}
boolean isControlDown = InputEventBaseOnOS.isControlDown(evt);
boolean isControlDown = evt.isControlDown();
long systemCurrentTime = System.currentTimeMillis();
if (systemCurrentTime - lastMouseMoveTime <= DRAG_REFRESH_TIME) {// alex:Drag

21
designer_base/src/com/fr/common/inputevent/InputEventBaseOnOS.java

@ -1,21 +0,0 @@
package com.fr.common.inputevent;
import com.fr.stable.OperatingSystem;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
/**
* Created by hzzz on 2017/5/26.
*/
public class InputEventBaseOnOS {
private static final boolean IS_MACOS = OperatingSystem.isMacOS();
public static boolean isControlDown(MouseEvent e) {
return IS_MACOS ? e.isMetaDown() : e.isControlDown();
}
public static boolean isControlDown(KeyEvent e) {
return IS_MACOS ? e.isMetaDown() : e.isControlDown();
}
}

4
designer_base/src/com/fr/design/actions/edit/CopyAction.java

@ -11,8 +11,6 @@ import com.fr.general.Inter;
import javax.swing.*;
import java.awt.event.KeyEvent;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
/**
* Copy.
*/
@ -23,7 +21,7 @@ public class CopyAction extends TemplateComponentAction {
this.setName(Inter.getLocText("M_Edit-Copy"));
this.setMnemonic('C');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/copy.png"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.CTRL_MASK));
}
@Override

4
designer_base/src/com/fr/design/actions/edit/CutAction.java

@ -12,8 +12,6 @@ import com.fr.design.actions.TemplateComponentAction;
import com.fr.design.designer.TargetComponent;
import com.fr.general.Inter;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
/**
* Cut.
*/
@ -27,7 +25,7 @@ public class CutAction extends TemplateComponentAction {
this.setName(Inter.getLocText("M_Edit-Cut"));
this.setMnemonic('T');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/cut.png"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.CTRL_MASK));
}
@Override

4
designer_base/src/com/fr/design/actions/edit/PasteAction.java

@ -12,8 +12,6 @@ import com.fr.design.actions.TemplateComponentAction;
import com.fr.design.designer.TargetComponent;
import com.fr.general.Inter;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
/**
* Paste.
*/
@ -27,7 +25,7 @@ public class PasteAction extends TemplateComponentAction {
this.setName(Inter.getLocText("M_Edit-Paste"));
this.setMnemonic('P');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/paste.png"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, KeyEvent.CTRL_MASK));
}
@Override

5
designer_base/src/com/fr/design/gui/autocomplete/AutoCompletion.java

@ -20,9 +20,6 @@ import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.List;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
/**
* Adds auto-completion to a text component. Provides a popup window with a
* list of auto-complete choices on a given keystroke, such as Crtrl+Space.<p>
@ -310,7 +307,7 @@ public class AutoCompletion {
*/
public static KeyStroke getDefaultTriggerKey() {
// Default to CTRL, even on Mac, since Ctrl+Space activates Spotlight
return KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, DEFAULT_MODIFIER);
return KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, InputEvent.CTRL_MASK);
}

8
designer_base/src/com/fr/design/gui/frpane/UIAdvancedTextPane.java

@ -20,8 +20,6 @@ import com.fr.design.actions.UpdateAction;
import com.fr.design.menu.KeySetUtils;
import com.fr.general.Inter;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
/**
* p:这是一个增强的JTextPane,支持很多Action
*/
@ -145,7 +143,7 @@ public class UIAdvancedTextPane extends UITextPane {
setName(Inter.getLocText("M_Edit-Cut"));
setMnemonic('T');
setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/cut.png"));
setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER));
setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.CTRL_MASK));
}
public void actionPerformed(ActionEvent evt) {
@ -164,7 +162,7 @@ public class UIAdvancedTextPane extends UITextPane {
this.setName(Inter.getLocText("M_Edit-Copy"));
this.setMnemonic('C');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/copy.png"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.CTRL_MASK));
}
public void actionPerformed(ActionEvent evt) {
@ -183,7 +181,7 @@ public class UIAdvancedTextPane extends UITextPane {
this.setName(Inter.getLocText("M_Edit-Paste"));
this.setMnemonic('P');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/paste.png"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, KeyEvent.CTRL_MASK));
}
public void actionPerformed(ActionEvent evt) {

24
designer_base/src/com/fr/design/gui/icombobox/ExtendedComboBox.java

@ -1,23 +1,13 @@
package com.fr.design.gui.icombobox;
import com.fr.common.inputevent.InputEventBaseOnOS;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.InputEvent;
import java.awt.event.MouseEvent;
import java.util.Vector;
import javax.swing.ComboBoxModel;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JList;
import javax.swing.ListCellRenderer;
import javax.swing.*;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicComboPopup;
import javax.swing.plaf.basic.ComboPopup;
import java.awt.*;
import java.awt.event.InputEvent;
import java.awt.event.MouseEvent;
import java.util.Vector;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
@ -78,12 +68,12 @@ public class ExtendedComboBox extends UIComboBox {
protected JList createList() {
return new JList(comboBox.getModel()) {
public void processMouseEvent(MouseEvent e) {
if (InputEventBaseOnOS.isControlDown(e)) {
if (e.isControlDown()) {
// Fix for 4234053. Filter out the Control
// Key from the list.
// ie., don't allow CTRL key deselection.
e = new MouseEvent((Component) e.getSource(), e.getID(), e.getWhen(), e.getModifiers()
^ DEFAULT_MODIFIER, e.getX(), e.getY(), e.getClickCount(), e.isPopupTrigger());
^ InputEvent.CTRL_MASK, e.getX(), e.getY(), e.getClickCount(), e.isPopupTrigger());
}
super.processMouseEvent(e);
}

33
designer_base/src/com/fr/design/gui/icombobox/UIComboBoxUI.java

@ -1,31 +1,20 @@
package com.fr.design.gui.icombobox;
import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.event.InputEvent;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.*;
import javax.swing.plaf.basic.BasicComboBoxUI;
import javax.swing.plaf.basic.BasicComboPopup;
import javax.swing.plaf.basic.ComboPopup;
import com.fr.common.inputevent.InputEventBaseOnOS;
import com.fr.design.constants.UIConstants;
import sun.swing.DefaultLookup;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.stable.Constants;
import com.fr.stable.StringUtils;
import sun.swing.DefaultLookup;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
import javax.swing.*;
import javax.swing.plaf.basic.BasicComboBoxUI;
import javax.swing.plaf.basic.BasicComboPopup;
import javax.swing.plaf.basic.ComboPopup;
import java.awt.*;
import java.awt.event.InputEvent;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
/**
* @author zhou F
@ -210,8 +199,8 @@ public class UIComboBoxUI extends BasicComboBoxUI implements MouseListener {
@Override
public void processMouseEvent(MouseEvent e) {
if (InputEventBaseOnOS.isControlDown(e)) {
e = new MouseEvent((Component) e.getSource(), e.getID(), e.getWhen(), e.getModifiers() ^ DEFAULT_MODIFIER, e.getX(), e.getY(), e.getClickCount(),
if (e.isControlDown()) {
e = new MouseEvent((Component) e.getSource(), e.getID(), e.getWhen(), e.getModifiers() ^ InputEvent.CTRL_MASK, e.getX(), e.getY(), e.getClickCount(),
e.isPopupTrigger());
}
super.processMouseEvent(e);

3
designer_base/src/com/fr/design/gui/itable/TableSorter.java

@ -16,7 +16,6 @@ import java.util.Map;
import javax.swing.Icon;
import com.fr.common.inputevent.InputEventBaseOnOS;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.JTable;
import javax.swing.event.TableModelEvent;
@ -394,7 +393,7 @@ public class TableSorter extends AbstractTableModel {
int column = columnModel.getColumn(viewColumn).getModelIndex();
if (column != -1) {
int status = getSortingStatus(column);
if (!InputEventBaseOnOS.isControlDown(e)) {
if (!e.isControlDown()) {
cancelSorting();
}
// Cycle the sorting states through {NOT_SORTED, ASCENDING, DESCENDING} or

4
designer_base/src/com/fr/design/gui/itabpane/UITabsHeaderIconPane.java

@ -17,8 +17,6 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
/**
* 本来想弄个延迟加载的发现在单元格属性表那边没有意义就算了.这个面板是纯粹的没有与模板的任何交互操作(比如说populate() update())
*
@ -113,7 +111,7 @@ public class UITabsHeaderIconPane extends JPanel implements UITabComponent {
inputMapAncestor.clear();
actionMap.clear();
inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, DEFAULT_MODIFIER), "switch");
inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, KeyEvent.CTRL_MASK), "switch");
actionMap.put("switch", new AbstractAction() {
/**

20
designer_base/src/com/fr/design/gui/itextarea/UITextArea.java

@ -7,33 +7,13 @@ import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.text.DefaultEditorKit;
import java.awt.*;
import java.awt.event.KeyEvent;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
public class UITextArea extends JTextArea implements UIObserver {
private UIObserverListener uiObserverListener;
public UITextArea(int i, int j) {
super(i, j);
InputMap inputMap = this.getInputMap();
while (inputMap.getParent() != null) {
inputMap = inputMap.getParent();
}
if (inputMap.get(KeyStroke.getKeyStroke(KeyEvent.VK_A, DEFAULT_MODIFIER)) == null) {
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_A, DEFAULT_MODIFIER), DefaultEditorKit.selectAllAction);
}
if (inputMap.get(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER)) == null) {
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER), DefaultEditorKit.copyAction);
}
if (inputMap.get(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER)) == null) {
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER), DefaultEditorKit.pasteAction);
}
if (inputMap.get(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER)) == null) {
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER), DefaultEditorKit.cutAction);
}
initComponents();
}

20
designer_base/src/com/fr/design/gui/itextfield/UITextField.java

@ -10,12 +10,8 @@ import com.fr.stable.Constants;
import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.text.DefaultEditorKit;
import javax.swing.text.Document;
import java.awt.*;
import java.awt.event.KeyEvent;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
/**
* @author Jerry
@ -31,22 +27,6 @@ public class UITextField extends JTextField implements UIObserver, GlobalNameObs
public UITextField() {
super();
InputMap inputMap = this.getInputMap();
while (inputMap.getParent() != null) {
inputMap = inputMap.getParent();
}
if (inputMap.get(KeyStroke.getKeyStroke(KeyEvent.VK_A, DEFAULT_MODIFIER)) == null) {
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_A, DEFAULT_MODIFIER), DefaultEditorKit.selectAllAction);
}
if (inputMap.get(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER)) == null) {
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER), DefaultEditorKit.copyAction);
}
if (inputMap.get(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER)) == null) {
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER), DefaultEditorKit.pasteAction);
}
if (inputMap.get(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER)) == null) {
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER), DefaultEditorKit.cutAction);
}
initListener();
}

3
designer_base/src/com/fr/design/gui/itree/refreshabletree/UserObjectRefreshJTree.java

@ -1,6 +1,5 @@
package com.fr.design.gui.itree.refreshabletree;
import com.fr.common.inputevent.InputEventBaseOnOS;
import com.fr.general.NameObject;
import com.fr.design.gui.itree.refreshabletree.loader.ChildrenLoaderFactory;
import com.fr.general.ComparatorUtils;
@ -148,7 +147,7 @@ public abstract class UserObjectRefreshJTree<T extends UserObjectOP<?>> extends
}
}
// marks:鼠标在上次选中的paths上,则将上次的paths设为的树的路径,否则将鼠标所在的节点设为选中的节点
if (!(e.isShiftDown() || InputEventBaseOnOS.isControlDown(e))) {
if (!(e.isShiftDown() || e.isControlDown())) {
if (isFind) {
setSelectionPaths(oldPaths);
} else {

27
designer_base/src/com/fr/design/mainframe/loghandler/DesignerLogHandler.java

@ -21,8 +21,6 @@ import java.util.Date;
import java.util.logging.Handler;
import java.util.logging.LogRecord;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
public class DesignerLogHandler {
protected static final int INFO_INT = FRLogLevel.INFO.intValue();
protected static final int ERRO_INT = FRLogLevel.ERROR.intValue();
@ -131,7 +129,7 @@ public class DesignerLogHandler {
private UIMenuItem clear;
private LogHandlerArea() {
jTextArea = initLogJTextArea();
jTextArea = new JTextPane();
this.setLayout(FRGUIPaneFactory.createBorderLayout());
UIScrollPane js = new UIScrollPane(jTextArea);
this.add(js, BorderLayout.CENTER);
@ -156,9 +154,9 @@ public class DesignerLogHandler {
clear.setIcon(BaseUtils.readIcon("/com/fr/design/images/log/clear.png"));
popup.add(clear);
selectAll.setAccelerator(KeyStroke.getKeyStroke('A', DEFAULT_MODIFIER));
copy.setAccelerator(KeyStroke.getKeyStroke('C', DEFAULT_MODIFIER));
clear.setAccelerator(KeyStroke.getKeyStroke('L', DEFAULT_MODIFIER));
selectAll.setAccelerator(KeyStroke.getKeyStroke('A', InputEvent.CTRL_MASK));
copy.setAccelerator(KeyStroke.getKeyStroke('C', InputEvent.CTRL_MASK));
clear.setAccelerator(KeyStroke.getKeyStroke('L', InputEvent.CTRL_MASK));
jTextArea.addMouseListener(new MouseAdapter() {
// check for right click
@ -186,23 +184,6 @@ public class DesignerLogHandler {
});
}
private JTextPane initLogJTextArea() {
final JTextPane resultPane = new JTextPane();
InputMap inputMap = resultPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER), DefaultEditorKit.copyAction);
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_A, DEFAULT_MODIFIER), DefaultEditorKit.selectAllAction);
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_L, DEFAULT_MODIFIER), "clear");
ActionMap actionMap = resultPane.getActionMap();
actionMap.put("clear", new AbstractAction() {
public void actionPerformed(ActionEvent evt) {
resultPane.setText("");
caption.clearMessage();
DesignerLogImpl.getInstance().clear();
}
});
return resultPane;
}
public void printStackTrace(LogRecordTimeProvider logRecordTime) {
LogRecord logRecord = logRecordTime.getLogRecord();
Date date = logRecordTime.getDate();

20
designer_base/src/com/fr/design/menu/KeySetUtils.java

@ -12,8 +12,6 @@ import javax.swing.*;
import java.awt.event.KeyEvent;
import java.util.Locale;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
/**
* Created by IntelliJ IDEA.
* Author : daisy
@ -38,7 +36,7 @@ public class KeySetUtils {
@Override
public KeyStroke getKeyStroke() {
return KeyStroke.getKeyStroke(KeyEvent.VK_O, DEFAULT_MODIFIER);
return KeyStroke.getKeyStroke(KeyEvent.VK_O, KeyEvent.CTRL_MASK);
}
};
@ -73,7 +71,7 @@ public class KeySetUtils {
@Override
public KeyStroke getKeyStroke() {
return KeyStroke.getKeyStroke(KeyEvent.VK_W, DEFAULT_MODIFIER);
return KeyStroke.getKeyStroke(KeyEvent.VK_W, KeyEvent.CTRL_MASK);
}
};
@ -90,7 +88,7 @@ public class KeySetUtils {
@Override
public KeyStroke getKeyStroke() {
return KeyStroke.getKeyStroke(KeyEvent.VK_S, DEFAULT_MODIFIER);
return KeyStroke.getKeyStroke(KeyEvent.VK_S, KeyEvent.CTRL_MASK);
}
};
@ -124,7 +122,7 @@ public class KeySetUtils {
@Override
public KeyStroke getKeyStroke() {
return KeyStroke.getKeyStroke(KeyEvent.VK_Z, DEFAULT_MODIFIER);
return KeyStroke.getKeyStroke(KeyEvent.VK_Z, KeyEvent.CTRL_MASK);
}
};
@ -141,7 +139,7 @@ public class KeySetUtils {
@Override
public KeyStroke getKeyStroke() {
return KeyStroke.getKeyStroke(KeyEvent.VK_Y, DEFAULT_MODIFIER);
return KeyStroke.getKeyStroke(KeyEvent.VK_Y, KeyEvent.CTRL_MASK);
}
};
@ -158,7 +156,7 @@ public class KeySetUtils {
@Override
public KeyStroke getKeyStroke() {
return KeyStroke.getKeyStroke(KeyEvent.VK_E, DEFAULT_MODIFIER);
return KeyStroke.getKeyStroke(KeyEvent.VK_E, KeyEvent.CTRL_MASK);
}
};
@ -355,7 +353,7 @@ public class KeySetUtils {
@Override
public KeyStroke getKeyStroke() {
return KeyStroke.getKeyStroke(KeyEvent.VK_M, DEFAULT_MODIFIER);
return KeyStroke.getKeyStroke(KeyEvent.VK_M, KeyEvent.CTRL_MASK);
}
};
@ -372,7 +370,7 @@ public class KeySetUtils {
@Override
public KeyStroke getKeyStroke() {
return KeyStroke.getKeyStroke(KeyEvent.VK_E, DEFAULT_MODIFIER);
return KeyStroke.getKeyStroke(KeyEvent.VK_E, KeyEvent.CTRL_MASK);
}
};
@ -389,7 +387,7 @@ public class KeySetUtils {
@Override
public KeyStroke getKeyStroke() {
return KeyStroke.getKeyStroke(KeyEvent.VK_E, DEFAULT_MODIFIER);
return KeyStroke.getKeyStroke(KeyEvent.VK_E, KeyEvent.CTRL_MASK);
}
};

3
designer_base/src/com/fr/design/roleAuthority/UIRoleTreeUI.java

@ -1,6 +1,5 @@
package com.fr.design.roleAuthority;
import com.fr.common.inputevent.InputEventBaseOnOS;
import com.fr.design.gui.itree.UITreeUI;
import javax.swing.tree.TreePath;
@ -16,7 +15,7 @@ import java.awt.event.MouseEvent;
public class UIRoleTreeUI extends UITreeUI {
protected void selectPathForEvent(TreePath path, MouseEvent event) { /* Adjust from the anchor point. */
if (InputEventBaseOnOS.isControlDown(event) && tree.isPathSelected(path)) {
if (event.isControlDown() && tree.isPathSelected(path)) {
tree.removeSelectionPath(path);
} else if (event.isShiftDown()) {
tree.setAnchorSelectionPath(null);

4
designer_form/src/com/fr/design/designer/beans/actions/CopyAction.java

@ -8,8 +8,6 @@ import javax.swing.*;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
public class CopyAction extends FormEditAction {
public CopyAction(FormDesigner t) {
@ -17,7 +15,7 @@ public class CopyAction extends FormEditAction {
this.setName(Inter.getLocText("M_Edit-Copy"));
this.setMnemonic('C');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/copy.png"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK));
}
@Override

4
designer_form/src/com/fr/design/designer/beans/actions/CutAction.java

@ -9,8 +9,6 @@ import com.fr.base.BaseUtils;
import com.fr.general.Inter;
import com.fr.design.mainframe.FormDesigner;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
public class CutAction extends FormEditAction {
public CutAction(FormDesigner t) {
@ -18,7 +16,7 @@ public class CutAction extends FormEditAction {
this.setName(Inter.getLocText("M_Edit-Cut"));
this.setMnemonic('T');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/cut.png"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, InputEvent.CTRL_MASK));
}
@Override

4
designer_form/src/com/fr/design/designer/beans/actions/PasteAction.java

@ -9,8 +9,6 @@ import com.fr.base.BaseUtils;
import com.fr.general.Inter;
import com.fr.design.mainframe.FormDesigner;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
public class PasteAction extends FormEditAction {
public PasteAction(FormDesigner t) {
@ -18,7 +16,7 @@ public class PasteAction extends FormEditAction {
this.setName(Inter.getLocText("M_Edit-Paste"));
this.setMnemonic('P');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/paste.png"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.CTRL_MASK));
}
@Override

5
designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java

@ -1,6 +1,5 @@
package com.fr.design.designer.beans.models;
import com.fr.common.inputevent.InputEventBaseOnOS;
import com.fr.design.designer.beans.AdapterBus;
import com.fr.design.designer.beans.LayoutAdapter;
import com.fr.design.designer.beans.events.DesignerEvent;
@ -62,7 +61,7 @@ public class SelectionModel {
* @param e 鼠标事件
*/
public void selectACreatorAtMouseEvent(MouseEvent e) {
if (!InputEventBaseOnOS.isControlDown(e) && !e.isShiftDown()) {
if (!e.isControlDown() && !e.isShiftDown()) {
// 如果Ctrl或者Shift键盘没有按下,则清除已经选择的组件
selection.reset();
}
@ -373,7 +372,7 @@ public class SelectionModel {
public Direction getDirectionAt(MouseEvent e) {
Direction dir;
if (InputEventBaseOnOS.isControlDown(e) || e.isShiftDown()) {
if (e.isControlDown() || e.isShiftDown()) {
XCreator creator = designer.getComponentAt(e.getX(), e.getY(), selection.getSelectedCreators());
if (creator != designer.getRootComponent() && selection.addedable(creator)) {
return Location.add;

4
designer_form/src/com/fr/design/mainframe/actions/NewFormAction.java

@ -14,8 +14,6 @@ import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
public class NewFormAction extends UpdateAction {
public NewFormAction() {
@ -50,7 +48,7 @@ public class NewFormAction extends UpdateAction {
@Override
public KeyStroke getKeyStroke() {
return KeyStroke.getKeyStroke(KeyEvent.VK_F, DEFAULT_MODIFIER);
return KeyStroke.getKeyStroke(KeyEvent.VK_F, InputEvent.CTRL_MASK);
}
};
}

4
designer_form/src/com/fr/design/mainframe/widget/editors/DataTableConfigPane.java

@ -21,8 +21,6 @@ import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
public class DataTableConfigPane extends JComponent implements PropertyChangeListener {
private DataEditingTable table;
@ -187,7 +185,7 @@ public class DataTableConfigPane extends JComponent implements PropertyChangeLis
this.setName(Inter.getLocText("M_Edit-Cut"));
this.setMnemonic('T');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/cut.png"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.CTRL_MASK));
}
@Override

Loading…
Cancel
Save