当前位置: 首页>>代码示例>>Java>>正文


Java AlignCellsAction类代码示例

本文整理汇总了Java中com.mxgraph.examples.swing.editor.EditorActions.AlignCellsAction的典型用法代码示例。如果您正苦于以下问题:Java AlignCellsAction类的具体用法?Java AlignCellsAction怎么用?Java AlignCellsAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AlignCellsAction类属于com.mxgraph.examples.swing.editor.EditorActions包,在下文中一共展示了AlignCellsAction类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: populateShapeMenu

import com.mxgraph.examples.swing.editor.EditorActions.AlignCellsAction; //导入依赖的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()));

}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:64,代码来源:EditorMenuBar.java

示例2: populateShapeMenu

import com.mxgraph.examples.swing.editor.EditorActions.AlignCellsAction; //导入依赖的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()));

}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:73,代码来源:EditorMenuBar.java


注:本文中的com.mxgraph.examples.swing.editor.EditorActions.AlignCellsAction类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。