Browse Source

back 2

master
hzzz 7 years ago
parent
commit
5b17a17e85
  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. 12
      designer/src/com/fr/design/mainframe/ElementCasePane.java
  4. 5
      designer/src/com/fr/design/mainframe/FormatBrushAction.java
  5. 4
      designer_base/src/com/fr/design/actions/edit/CopyAction.java
  6. 4
      designer_base/src/com/fr/design/actions/edit/CutAction.java
  7. 4
      designer_base/src/com/fr/design/actions/edit/PasteAction.java
  8. 5
      designer_base/src/com/fr/design/gui/autocomplete/AutoCompletion.java
  9. 8
      designer_base/src/com/fr/design/gui/frpane/UIAdvancedTextPane.java
  10. 3
      designer_base/src/com/fr/design/gui/icombobox/ExtendedComboBox.java
  11. 5
      designer_base/src/com/fr/design/gui/icombobox/UIComboBoxUI.java
  12. 4
      designer_base/src/com/fr/design/gui/itabpane/UITabsHeaderIconPane.java
  13. 20
      designer_base/src/com/fr/design/gui/itextarea/UITextArea.java
  14. 20
      designer_base/src/com/fr/design/gui/itextfield/UITextField.java
  15. 27
      designer_base/src/com/fr/design/mainframe/loghandler/DesignerLogHandler.java
  16. 20
      designer_base/src/com/fr/design/menu/KeySetUtils.java
  17. 4
      designer_form/src/com/fr/design/designer/beans/actions/CopyAction.java
  18. 4
      designer_form/src/com/fr/design/designer/beans/actions/CutAction.java
  19. 4
      designer_form/src/com/fr/design/designer/beans/actions/PasteAction.java
  20. 4
      designer_form/src/com/fr/design/mainframe/actions/NewFormAction.java
  21. 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.design.mainframe.JPolyWorkBook;
import com.fr.general.Inter; import com.fr.general.Inter;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
public class NewPolyReportAction extends UpdateAction { public class NewPolyReportAction extends UpdateAction {
public NewPolyReportAction() { public NewPolyReportAction() {
this.setName(Inter.getLocText("M-New_Multi_Report")); this.setName(Inter.getLocText("M-New_Multi_Report"));
this.setMnemonic('F'); this.setMnemonic('F');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/formExport.png")); 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.InputEvent;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
public class NewWorkBookAction extends UpdateAction { public class NewWorkBookAction extends UpdateAction {
public NewWorkBookAction() { public NewWorkBookAction() {
@ -30,6 +28,7 @@ public class NewWorkBookAction extends UpdateAction {
/** /**
* 动作 * 动作
*
* @param e 事件 * @param e 事件
*/ */
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -49,7 +48,7 @@ public class NewWorkBookAction extends UpdateAction {
@Override @Override
public KeyStroke getKeyStroke() { public KeyStroke getKeyStroke() {
return KeyStroke.getKeyStroke(KeyEvent.VK_N, DEFAULT_MODIFIER); return KeyStroke.getKeyStroke(KeyEvent.VK_N, InputEvent.CTRL_MASK);
} }
}; };

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.Constants;
import com.fr.stable.unit.FU; import com.fr.stable.unit.FU;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
/** /**
* This class used to edit Report. * 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); 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. // clearReportPage old values.
inputMapAncestor.clear(); inputMapAncestor.clear();
actionMap.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() { actionMap.put("cut", new AbstractAction() {
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
if (cut()) { 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() { actionMap.put("copy", new AbstractAction() {
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
copy(); 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() { actionMap.put("paste", new AbstractAction() {
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
if (paste()) { 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() { actionMap.put("delete_all", new AbstractAction() {
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
if (clearAll()) { 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 javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
/** /**
* Author : daisy * Author : daisy
* Date: 13-8-7 * Date: 13-8-7
@ -32,7 +31,7 @@ public class FormatBrushAction extends ElementCaseAction {
this.setName(Inter.getLocText("M_Edit-FormatBrush")); this.setName(Inter.getLocText("M_Edit-FormatBrush"));
this.setMnemonic('B'); this.setMnemonic('B');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/formatBrush.png")); 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() { public boolean executeActionReturnUndoRecordNeeded() {

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

@ -11,8 +11,6 @@ import com.fr.general.Inter;
import javax.swing.*; import javax.swing.*;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
/** /**
* Copy. * Copy.
*/ */
@ -23,7 +21,7 @@ public class CopyAction extends TemplateComponentAction {
this.setName(Inter.getLocText("M_Edit-Copy")); this.setName(Inter.getLocText("M_Edit-Copy"));
this.setMnemonic('C'); this.setMnemonic('C');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/copy.png")); 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 @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.design.designer.TargetComponent;
import com.fr.general.Inter; import com.fr.general.Inter;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
/** /**
* Cut. * Cut.
*/ */
@ -27,7 +25,7 @@ public class CutAction extends TemplateComponentAction {
this.setName(Inter.getLocText("M_Edit-Cut")); this.setName(Inter.getLocText("M_Edit-Cut"));
this.setMnemonic('T'); this.setMnemonic('T');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/cut.png")); 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 @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.design.designer.TargetComponent;
import com.fr.general.Inter; import com.fr.general.Inter;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
/** /**
* Paste. * Paste.
*/ */
@ -27,7 +25,7 @@ public class PasteAction extends TemplateComponentAction {
this.setName(Inter.getLocText("M_Edit-Paste")); this.setName(Inter.getLocText("M_Edit-Paste"));
this.setMnemonic('P'); this.setMnemonic('P');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/paste.png")); 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 @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.beans.PropertyChangeListener;
import java.util.List; 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 * 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> * 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() { public static KeyStroke getDefaultTriggerKey() {
// Default to CTRL, even on Mac, since Ctrl+Space activates Spotlight // 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.design.menu.KeySetUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
/** /**
* p:这是一个增强的JTextPane,支持很多Action * p:这是一个增强的JTextPane,支持很多Action
*/ */
@ -145,7 +143,7 @@ public class UIAdvancedTextPane extends UITextPane {
setName(Inter.getLocText("M_Edit-Cut")); setName(Inter.getLocText("M_Edit-Cut"));
setMnemonic('T'); setMnemonic('T');
setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/cut.png")); 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) { public void actionPerformed(ActionEvent evt) {
@ -164,7 +162,7 @@ public class UIAdvancedTextPane extends UITextPane {
this.setName(Inter.getLocText("M_Edit-Copy")); this.setName(Inter.getLocText("M_Edit-Copy"));
this.setMnemonic('C'); this.setMnemonic('C');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/copy.png")); 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) { public void actionPerformed(ActionEvent evt) {
@ -183,7 +181,7 @@ public class UIAdvancedTextPane extends UITextPane {
this.setName(Inter.getLocText("M_Edit-Paste")); this.setName(Inter.getLocText("M_Edit-Paste"));
this.setMnemonic('P'); this.setMnemonic('P');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/paste.png")); 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) { public void actionPerformed(ActionEvent evt) {

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

@ -5,6 +5,7 @@ import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicComboPopup; import javax.swing.plaf.basic.BasicComboPopup;
import javax.swing.plaf.basic.ComboPopup; import javax.swing.plaf.basic.ComboPopup;
import java.awt.*; import java.awt.*;
import java.awt.event.InputEvent;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.util.Vector; import java.util.Vector;
@ -72,7 +73,7 @@ public class ExtendedComboBox extends UIComboBox {
// Key from the list. // Key from the list.
// ie., don't allow CTRL key deselection. // ie., don't allow CTRL key deselection.
e = new MouseEvent((Component) e.getSource(), e.getID(), e.getWhen(), e.getModifiers() 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); super.processMouseEvent(e);
} }

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

@ -12,11 +12,10 @@ import javax.swing.plaf.basic.BasicComboBoxUI;
import javax.swing.plaf.basic.BasicComboPopup; import javax.swing.plaf.basic.BasicComboPopup;
import javax.swing.plaf.basic.ComboPopup; import javax.swing.plaf.basic.ComboPopup;
import java.awt.*; import java.awt.*;
import java.awt.event.InputEvent;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.awt.event.MouseListener; import java.awt.event.MouseListener;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
/** /**
* @author zhou F * @author zhou F
* @since 2012-5-9下午4:33:07 * @since 2012-5-9下午4:33:07
@ -201,7 +200,7 @@ public class UIComboBoxUI extends BasicComboBoxUI implements MouseListener {
@Override @Override
public void processMouseEvent(MouseEvent e) { public void processMouseEvent(MouseEvent e) {
if (e.isControlDown()) { if (e.isControlDown()) {
e = new MouseEvent((Component) e.getSource(), e.getID(), e.getWhen(), e.getModifiers() ^ DEFAULT_MODIFIER, e.getX(), e.getY(), e.getClickCount(), e = new MouseEvent((Component) e.getSource(), e.getID(), e.getWhen(), e.getModifiers() ^ InputEvent.CTRL_MASK, e.getX(), e.getY(), e.getClickCount(),
e.isPopupTrigger()); e.isPopupTrigger());
} }
super.processMouseEvent(e); super.processMouseEvent(e);

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.Arrays;
import java.util.List; import java.util.List;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
/** /**
* 本来想弄个延迟加载的发现在单元格属性表那边没有意义就算了.这个面板是纯粹的没有与模板的任何交互操作(比如说populate() update()) * 本来想弄个延迟加载的发现在单元格属性表那边没有意义就算了.这个面板是纯粹的没有与模板的任何交互操作(比如说populate() update())
* *
@ -113,7 +111,7 @@ public class UITabsHeaderIconPane extends JPanel implements UITabComponent {
inputMapAncestor.clear(); inputMapAncestor.clear();
actionMap.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() { 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.*;
import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
import javax.swing.text.DefaultEditorKit;
import java.awt.*; 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 { public class UITextArea extends JTextArea implements UIObserver {
private UIObserverListener uiObserverListener; private UIObserverListener uiObserverListener;
public UITextArea(int i, int j) { public UITextArea(int i, int j) {
super(i, 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(); 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.*;
import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
import javax.swing.text.DefaultEditorKit;
import javax.swing.text.Document; import javax.swing.text.Document;
import java.awt.*; import java.awt.*;
import java.awt.event.KeyEvent;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
/** /**
* @author Jerry * @author Jerry
@ -31,22 +27,6 @@ public class UITextField extends JTextField implements UIObserver, GlobalNameObs
public UITextField() { public UITextField() {
super(); 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(); initListener();
} }

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.Handler;
import java.util.logging.LogRecord; import java.util.logging.LogRecord;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
public class DesignerLogHandler { public class DesignerLogHandler {
protected static final int INFO_INT = FRLogLevel.INFO.intValue(); protected static final int INFO_INT = FRLogLevel.INFO.intValue();
protected static final int ERRO_INT = FRLogLevel.ERROR.intValue(); protected static final int ERRO_INT = FRLogLevel.ERROR.intValue();
@ -131,7 +129,7 @@ public class DesignerLogHandler {
private UIMenuItem clear; private UIMenuItem clear;
private LogHandlerArea() { private LogHandlerArea() {
jTextArea = initLogJTextArea(); jTextArea = new JTextPane();
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
UIScrollPane js = new UIScrollPane(jTextArea); UIScrollPane js = new UIScrollPane(jTextArea);
this.add(js, BorderLayout.CENTER); this.add(js, BorderLayout.CENTER);
@ -156,9 +154,9 @@ public class DesignerLogHandler {
clear.setIcon(BaseUtils.readIcon("/com/fr/design/images/log/clear.png")); clear.setIcon(BaseUtils.readIcon("/com/fr/design/images/log/clear.png"));
popup.add(clear); popup.add(clear);
selectAll.setAccelerator(KeyStroke.getKeyStroke('A', DEFAULT_MODIFIER)); selectAll.setAccelerator(KeyStroke.getKeyStroke('A', InputEvent.CTRL_MASK));
copy.setAccelerator(KeyStroke.getKeyStroke('C', DEFAULT_MODIFIER)); copy.setAccelerator(KeyStroke.getKeyStroke('C', InputEvent.CTRL_MASK));
clear.setAccelerator(KeyStroke.getKeyStroke('L', DEFAULT_MODIFIER)); clear.setAccelerator(KeyStroke.getKeyStroke('L', InputEvent.CTRL_MASK));
jTextArea.addMouseListener(new MouseAdapter() { jTextArea.addMouseListener(new MouseAdapter() {
// check for right click // 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) { public void printStackTrace(LogRecordTimeProvider logRecordTime) {
LogRecord logRecord = logRecordTime.getLogRecord(); LogRecord logRecord = logRecordTime.getLogRecord();
Date date = logRecordTime.getDate(); 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.awt.event.KeyEvent;
import java.util.Locale; import java.util.Locale;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
/** /**
* Created by IntelliJ IDEA. * Created by IntelliJ IDEA.
* Author : daisy * Author : daisy
@ -38,7 +36,7 @@ public class KeySetUtils {
@Override @Override
public KeyStroke getKeyStroke() { 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 @Override
public KeyStroke getKeyStroke() { 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 @Override
public KeyStroke getKeyStroke() { 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 @Override
public KeyStroke getKeyStroke() { 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 @Override
public KeyStroke getKeyStroke() { 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 @Override
public KeyStroke getKeyStroke() { 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 @Override
public KeyStroke getKeyStroke() { 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 @Override
public KeyStroke getKeyStroke() { 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 @Override
public KeyStroke getKeyStroke() { public KeyStroke getKeyStroke() {
return KeyStroke.getKeyStroke(KeyEvent.VK_E, DEFAULT_MODIFIER); return KeyStroke.getKeyStroke(KeyEvent.VK_E, KeyEvent.CTRL_MASK);
} }
}; };

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.InputEvent;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
public class CopyAction extends FormEditAction { public class CopyAction extends FormEditAction {
public CopyAction(FormDesigner t) { public CopyAction(FormDesigner t) {
@ -17,7 +15,7 @@ public class CopyAction extends FormEditAction {
this.setName(Inter.getLocText("M_Edit-Copy")); this.setName(Inter.getLocText("M_Edit-Copy"));
this.setMnemonic('C'); this.setMnemonic('C');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/copy.png")); 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 @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.general.Inter;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
public class CutAction extends FormEditAction { public class CutAction extends FormEditAction {
public CutAction(FormDesigner t) { public CutAction(FormDesigner t) {
@ -18,7 +16,7 @@ public class CutAction extends FormEditAction {
this.setName(Inter.getLocText("M_Edit-Cut")); this.setName(Inter.getLocText("M_Edit-Cut"));
this.setMnemonic('T'); this.setMnemonic('T');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/cut.png")); 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 @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.general.Inter;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
public class PasteAction extends FormEditAction { public class PasteAction extends FormEditAction {
public PasteAction(FormDesigner t) { public PasteAction(FormDesigner t) {
@ -18,7 +16,7 @@ public class PasteAction extends FormEditAction {
this.setName(Inter.getLocText("M_Edit-Paste")); this.setName(Inter.getLocText("M_Edit-Paste"));
this.setMnemonic('P'); this.setMnemonic('P');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/paste.png")); 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 @Override

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.InputEvent;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
public class NewFormAction extends UpdateAction { public class NewFormAction extends UpdateAction {
public NewFormAction() { public NewFormAction() {
@ -50,7 +48,7 @@ public class NewFormAction extends UpdateAction {
@Override @Override
public KeyStroke getKeyStroke() { 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.awt.event.MouseEvent;
import java.util.ArrayList; import java.util.ArrayList;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
public class DataTableConfigPane extends JComponent implements PropertyChangeListener { public class DataTableConfigPane extends JComponent implements PropertyChangeListener {
private DataEditingTable table; private DataEditingTable table;
@ -187,7 +185,7 @@ public class DataTableConfigPane extends JComponent implements PropertyChangeLis
this.setName(Inter.getLocText("M_Edit-Cut")); this.setName(Inter.getLocText("M_Edit-Cut"));
this.setMnemonic('T'); this.setMnemonic('T');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/cut.png")); 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 @Override

Loading…
Cancel
Save