本文整理了Java中org.netbeans.modules.visual.action.ZoomAction
类的一些代码示例,展示了ZoomAction
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoomAction
类的具体详情如下:
包路径:org.netbeans.modules.visual.action.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));
内容来源于网络,如有侵权,请联系作者删除!