javax.swing.SwingUtilities#replaceUIActionMap ( )源码实例Demo

下面列出了javax.swing.SwingUtilities#replaceUIActionMap ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: diirt   文件: CompareResultImages.java
/**
 * Creates new form CompareResultImages
 */
public CompareResultImages() {
    initComponents();
    toReviewList.setModel(new DefaultListModel());
    fillList();
    setSize(800, 600);
    setExtendedState(getExtendedState() | MAXIMIZED_BOTH);
    actualImage.setStretch(false);
    referenceImage.setStretch(false);
    acceptAction.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke("control D"));

    InputMap keyMap = new ComponentInputMap(acceptButton);
    keyMap.put(KeyStroke.getKeyStroke("control D"), "accept");

    ActionMap actionMap = new ActionMapUIResource();
    actionMap.put("accept", acceptAction);

    SwingUtilities.replaceUIActionMap(acceptButton, actionMap);
    SwingUtilities.replaceUIInputMap(acceptButton, JComponent.WHEN_IN_FOCUSED_WINDOW, keyMap);
}
 
源代码2 项目: blog-codes   文件: mxKeyboardHandler.java
/**
 * Invoked as part from the boilerplate install block.
 */
protected void installKeyboardActions(mxGraphComponent graphComponent)
{
	InputMap inputMap = getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
	SwingUtilities.replaceUIInputMap(graphComponent,
			JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, inputMap);

	inputMap = getInputMap(JComponent.WHEN_FOCUSED);
	SwingUtilities.replaceUIInputMap(graphComponent,
			JComponent.WHEN_FOCUSED, inputMap);
	SwingUtilities.replaceUIActionMap(graphComponent, createActionMap());
}
 
protected void installKeyboardActions() {
  InputMap inputMap = (InputMap)UIManager.get("TaskPaneGroup.focusInputMap");
  if (inputMap != null) {
    SwingUtilities.replaceUIInputMap(
      group,
      JComponent.WHEN_FOCUSED,
      inputMap);
  }

  ActionMap map = getActionMap();
  if (map != null) {
    SwingUtilities.replaceUIActionMap(group, map);
  }
}
 
源代码4 项目: rapidminer-studio   文件: FileChooserUI.java
@Override
protected void installListeners(JFileChooser fc) {
	super.installListeners(fc);

	ActionMap actionMap = getActions();
	SwingUtilities.replaceUIActionMap(fc, actionMap);
}
 
源代码5 项目: lizzie   文件: BasicLizziePaneUI.java
protected void uninstallKeyboardActions() {
  SwingUtilities.replaceUIActionMap(lizziePane, null);
  SwingUtilities.replaceUIInputMap(
      lizziePane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null);
}
 
源代码6 项目: orbit-image-analysis   文件: BasicTipOfTheDayUI.java
protected void installKeyboardActions() {
  ActionMap map = getActionMap();
  if (map != null) {
    SwingUtilities.replaceUIActionMap(tipPane, map);
  }
}
 
源代码7 项目: iBioSim   文件: CloseTabPaneUI.java
@Override
protected void installKeyboardActions() {
	InputMap km = getMyInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);

	SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, km);
	km = getMyInputMap(JComponent.WHEN_FOCUSED);
	SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, km);

	ActionMap am = createMyActionMap();

	SwingUtilities.replaceUIActionMap(tabPane, am);

	tabScroller.scrollForwardButton.setAction(am.get("scrollTabsForwardAction"));
	tabScroller.scrollBackwardButton.setAction(am.get("scrollTabsBackwardAction"));

}
 
源代码8 项目: iBioSim   文件: CloseTabPaneUI.java
@Override
protected void uninstallKeyboardActions() {
	SwingUtilities.replaceUIActionMap(tabPane, null);
	SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null);
	SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, null);
}
 
源代码9 项目: tn5250j   文件: BasicTerminalUI.java
protected void uninstallKeyboardActions()
{
  SwingUtilities.replaceUIInputMap(terminal, JComponent.WHEN_FOCUSED, null);
  SwingUtilities.replaceUIActionMap(terminal, null);
}