本文整理汇总了Java中com.mxgraph.examples.swing.editor.EditorActions.AutosizeAction类的典型用法代码示例。如果您正苦于以下问题:Java AutosizeAction类的具体用法?Java AutosizeAction怎么用?Java AutosizeAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AutosizeAction类属于com.mxgraph.examples.swing.editor.EditorActions包,在下文中一共展示了AutosizeAction类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: populateShapeMenu
import com.mxgraph.examples.swing.editor.EditorActions.AutosizeAction; //导入依赖的package包/类
/**
* Adds menu items to the given shape menu. This is factored out because
* the shape menu appears in the menubar and also in the popupmenu.
*/
public static void populateShapeMenu(JMenu menu, BasicGraphEditor editor)
{
menu.add(editor.bind(mxResources.get("home"), mxGraphActions.getHomeAction(), "/com/mxgraph/examples/swing/images/house.gif"));
menu.addSeparator();
menu.add(editor.bind(mxResources.get("exitGroup"), mxGraphActions.getExitGroupAction(), "/com/mxgraph/examples/swing/images/up.gif"));
menu.add(editor.bind(mxResources.get("enterGroup"), mxGraphActions.getEnterGroupAction(),
"/com/mxgraph/examples/swing/images/down.gif"));
menu.addSeparator();
menu.add(editor.bind(mxResources.get("group"), mxGraphActions.getGroupAction(), "/com/mxgraph/examples/swing/images/group.gif"));
menu.add(editor.bind(mxResources.get("ungroup"), mxGraphActions.getUngroupAction(),
"/com/mxgraph/examples/swing/images/ungroup.gif"));
menu.addSeparator();
menu.add(editor.bind(mxResources.get("removeFromGroup"), mxGraphActions.getRemoveFromParentAction()));
menu.add(editor.bind(mxResources.get("updateGroupBounds"), mxGraphActions.getUpdateGroupBoundsAction()));
menu.addSeparator();
menu.add(editor.bind(mxResources.get("collapse"), mxGraphActions.getCollapseAction(),
"/com/mxgraph/examples/swing/images/collapse.gif"));
menu.add(editor.bind(mxResources.get("expand"), mxGraphActions.getExpandAction(), "/com/mxgraph/examples/swing/images/expand.gif"));
menu.addSeparator();
menu.add(editor.bind(mxResources.get("toBack"), mxGraphActions.getToBackAction(), "/com/mxgraph/examples/swing/images/toback.gif"));
menu.add(editor.bind(mxResources.get("toFront"), mxGraphActions.getToFrontAction(),
"/com/mxgraph/examples/swing/images/tofront.gif"));
menu.addSeparator();
JMenu submenu = (JMenu) menu.add(new JMenu(mxResources.get("align")));
submenu.add(editor.bind(mxResources.get("left"), new AlignCellsAction(mxConstants.ALIGN_LEFT),
"/com/mxgraph/examples/swing/images/alignleft.gif"));
submenu.add(editor.bind(mxResources.get("center"), new AlignCellsAction(mxConstants.ALIGN_CENTER),
"/com/mxgraph/examples/swing/images/aligncenter.gif"));
submenu.add(editor.bind(mxResources.get("right"), new AlignCellsAction(mxConstants.ALIGN_RIGHT),
"/com/mxgraph/examples/swing/images/alignright.gif"));
submenu.addSeparator();
submenu.add(editor.bind(mxResources.get("top"), new AlignCellsAction(mxConstants.ALIGN_TOP),
"/com/mxgraph/examples/swing/images/aligntop.gif"));
submenu.add(editor.bind(mxResources.get("middle"), new AlignCellsAction(mxConstants.ALIGN_MIDDLE),
"/com/mxgraph/examples/swing/images/alignmiddle.gif"));
submenu.add(editor.bind(mxResources.get("bottom"), new AlignCellsAction(mxConstants.ALIGN_BOTTOM),
"/com/mxgraph/examples/swing/images/alignbottom.gif"));
menu.addSeparator();
menu.add(editor.bind(mxResources.get("autosize"), new AutosizeAction()));
}
示例2: populateShapeMenu
import com.mxgraph.examples.swing.editor.EditorActions.AutosizeAction; //导入依赖的package包/类
/**
* Adds menu items to the given shape menu. This is factored out because the shape menu appears in
* the menubar and also in the popupmenu.
*/
public static void populateShapeMenu(JMenu menu, BasicGraphEditor editor) {
menu.add(editor.bind(mxResources.get("home"), mxGraphActions.getHomeAction(),
"/com/mxgraph/examples/swing/images/house.gif"));
menu.addSeparator();
menu.add(editor.bind(mxResources.get("exitGroup"), mxGraphActions.getExitGroupAction(),
"/com/mxgraph/examples/swing/images/up.gif"));
menu.add(editor.bind(mxResources.get("enterGroup"), mxGraphActions.getEnterGroupAction(),
"/com/mxgraph/examples/swing/images/down.gif"));
menu.addSeparator();
menu.add(editor.bind(mxResources.get("group"), mxGraphActions.getGroupAction(),
"/com/mxgraph/examples/swing/images/group.gif"));
menu.add(editor.bind(mxResources.get("ungroup"), mxGraphActions.getUngroupAction(),
"/com/mxgraph/examples/swing/images/ungroup.gif"));
menu.addSeparator();
menu.add(editor.bind(mxResources.get("removeFromGroup"),
mxGraphActions.getRemoveFromParentAction()));
menu.add(editor.bind(mxResources.get("updateGroupBounds"),
mxGraphActions.getUpdateGroupBoundsAction()));
menu.addSeparator();
menu.add(editor.bind(mxResources.get("collapse"), mxGraphActions.getCollapseAction(),
"/com/mxgraph/examples/swing/images/collapse.gif"));
menu.add(editor.bind(mxResources.get("expand"), mxGraphActions.getExpandAction(),
"/com/mxgraph/examples/swing/images/expand.gif"));
menu.addSeparator();
menu.add(editor.bind(mxResources.get("toBack"), mxGraphActions.getToBackAction(),
"/com/mxgraph/examples/swing/images/toback.gif"));
menu.add(editor.bind(mxResources.get("toFront"), mxGraphActions.getToFrontAction(),
"/com/mxgraph/examples/swing/images/tofront.gif"));
menu.addSeparator();
JMenu submenu = (JMenu) menu.add(new JMenu(mxResources.get("align")));
submenu.add(editor.bind(mxResources.get("left"), new AlignCellsAction(mxConstants.ALIGN_LEFT),
"/com/mxgraph/examples/swing/images/alignleft.gif"));
submenu
.add(editor.bind(mxResources.get("center"), new AlignCellsAction(mxConstants.ALIGN_CENTER),
"/com/mxgraph/examples/swing/images/aligncenter.gif"));
submenu.add(editor.bind(mxResources.get("right"), new AlignCellsAction(mxConstants.ALIGN_RIGHT),
"/com/mxgraph/examples/swing/images/alignright.gif"));
submenu.addSeparator();
submenu.add(editor.bind(mxResources.get("top"), new AlignCellsAction(mxConstants.ALIGN_TOP),
"/com/mxgraph/examples/swing/images/aligntop.gif"));
submenu
.add(editor.bind(mxResources.get("middle"), new AlignCellsAction(mxConstants.ALIGN_MIDDLE),
"/com/mxgraph/examples/swing/images/alignmiddle.gif"));
submenu
.add(editor.bind(mxResources.get("bottom"), new AlignCellsAction(mxConstants.ALIGN_BOTTOM),
"/com/mxgraph/examples/swing/images/alignbottom.gif"));
menu.addSeparator();
menu.add(editor.bind(mxResources.get("autosize"), new AutosizeAction()));
}