gpt4 book ai didi

org.netbeans.modules.visual.action.ZoomAction类的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 20:14:31 34 4
gpt4 key购买 nike

本文整理了Java中org.netbeans.modules.visual.action.ZoomAction类的一些代码示例,展示了ZoomAction类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoomAction类的具体详情如下:
包路径:org.netbeans.modules.visual.action.ZoomAction
类名称:ZoomAction

ZoomAction介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

import com.google.common.collect.ClassToInstanceMap;
import com.google.common.collect.ImmutableClassToInstanceMap;

import javax.swing.*;
import javax.swing.text.DefaultEditorKit;

public class ActionHandler {

  private static final ClassToInstanceMap<Action> actionMap =
      new ImmutableClassToInstanceMap.Builder<Action>().
          put(DefaultEditorKit.CutAction.class, new DefaultEditorKit.CutAction()).
          put(DefaultEditorKit.CopyAction.class, new DefaultEditorKit.CopyAction()).
          put(DefaultEditorKit.PasteAction.class, new DefaultEditorKit.PasteAction()).
          put(RefreshAction.class, new RefreshAction()).
          put(MinimizeAction.class, new MinimizeAction()).
          put(ZoomAction.class, new ZoomAction()).
          build();

  public static Action getActionFor(Class<? extends Action> actionClasss) {
    return actionMap.getInstance(actionClasss);
  }
}

代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual

/**
 * Creates a action that controls a zoom factor of a scene where the action is assigned.
 * @param zoomMultiplier the zoom multiplier of each zoom step
 * @param animated if true, then the zoom factor changed is animated
 * @return the zoom action
 */
public static WidgetAction createZoomAction (double zoomMultiplier, boolean animated) {
  return new ZoomAction (zoomMultiplier, animated);
}

代码示例来源:origin: in.jlibs/org-netbeans-api-visual

/**
 * Creates a action that controls a zoom factor of a scene where the action is assigned.
 * @param zoomMultiplier the zoom multiplier of each zoom step
 * @param animated if true, then the zoom factor changed is animated
 * @return the zoom action
 */
public static WidgetAction createZoomAction (double zoomMultiplier, boolean animated) {
  return new ZoomAction (zoomMultiplier, animated);
}

代码示例来源:origin: stackoverflow.com

InputMap im = getInputMap(WHEN_IN_FOCUSED_WINDOW);
ActionMap am = getActionMap();
im.put(KeyStroke.getKeyStroke(KeyEvent.VK_ADD, 0), "zoom-in");
im.put(KeyStroke.getKeyStroke(KeyEvent.VK_SUBTRACT, 0), "zoom-out");

am.put("zoom-in", new ZoomAction(this, "Zoom in", 0.1f));
am.put("zoom-out", new ZoomAction(this, "Zoom out", -0.1f));

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com