public static void populateShapeMenu(JMenu menu,BasicGraphEditor editor){
  menu.add(editor.bind(mxResources.get("home"),mxGraphActions.getHomeAction(),"/com/gkd/jgraphx_example/images/house.gif"));
  menu.addSeparator();
  menu.add(editor.bind(mxResources.get("exitGroup"),mxGraphActions.getExitGroupAction(),"/com/gkd/jgraphx_example/images/up.gif"));
  menu.add(editor.bind(mxResources.get("enterGroup"),mxGraphActions.getEnterGroupAction(),"/com/gkd/jgraphx_example/images/down.gif"));
  menu.addSeparator();
  menu.add(editor.bind(mxResources.get("group"),mxGraphActions.getGroupAction(),"/com/gkd/jgraphx_example/images/group.gif"));
  menu.add(editor.bind(mxResources.get("ungroup"),mxGraphActions.getUngroupAction(),"/com/gkd/jgraphx_example/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/gkd/jgraphx_example/images/collapse.gif"));
  menu.add(editor.bind(mxResources.get("expand"),mxGraphActions.getExpandAction(),"/com/gkd/jgraphx_example/images/expand.gif"));
  menu.addSeparator();
  menu.add(editor.bind(mxResources.get("toBack"),mxGraphActions.getToBackAction(),"/com/gkd/jgraphx_example/images/toback.gif"));
  menu.add(editor.bind(mxResources.get("toFront"),mxGraphActions.getToFrontAction(),"/com/gkd/jgraphx_example/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/gkd/jgraphx_example/images/alignleft.gif"));
  submenu.add(editor.bind(mxResources.get("center"),new AlignCellsAction(mxConstants.ALIGN_CENTER),"/com/gkd/jgraphx_example/images/aligncenter.gif"));
  submenu.add(editor.bind(mxResources.get("right"),new AlignCellsAction(mxConstants.ALIGN_RIGHT),"/com/gkd/jgraphx_example/images/alignright.gif"));
  submenu.addSeparator();
  submenu.add(editor.bind(mxResources.get("top"),new AlignCellsAction(mxConstants.ALIGN_TOP),"/com/gkd/jgraphx_example/images/aligntop.gif"));
  submenu.add(editor.bind(mxResources.get("middle"),new AlignCellsAction(mxConstants.ALIGN_MIDDLE),"/com/gkd/jgraphx_example/images/alignmiddle.gif"));
  submenu.add(editor.bind(mxResources.get("bottom"),new AlignCellsAction(mxConstants.ALIGN_BOTTOM),"/com/gkd/jgraphx_example/images/alignbottom.gif"));
  menu.addSeparator();
  menu.add(editor.bind(mxResources.get("autosize"),new AutosizeAction()));
}

public static void populateShapeMenu ( JMenu menu , BasicGraphEditor editor ) { menu . add ( editor . bind ( mxResources . get ( "home" ) , mxGraphActions . getHomeAction ( ) , "/com/gkd/jgraphx_example/images/house.gif" ) ) ; menu . addSeparator ( ) ; menu . add ( editor . bind ( mxResources . get ( "exitGroup" ) , mxGraphActions . getExitGroupAction ( ) , "/com/gkd/jgraphx_example/images/up.gif" ) ) ; menu . add ( editor . bind ( mxResources . get ( "enterGroup" ) , mxGraphActions . getEnterGroupAction ( ) , "/com/gkd/jgraphx_example/images/down.gif" ) ) ; menu . addSeparator ( ) ; menu . add ( editor . bind ( mxResources . get ( "group" ) , mxGraphActions . getGroupAction ( ) , "/com/gkd/jgraphx_example/images/group.gif" ) ) ; menu . add ( editor . bind ( mxResources . get ( "ungroup" ) , mxGraphActions . getUngroupAction ( ) , "/com/gkd/jgraphx_example/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/gkd/jgraphx_example/images/collapse.gif" ) ) ; menu . add ( editor . bind ( mxResources . get ( "expand" ) , mxGraphActions . getExpandAction ( ) , "/com/gkd/jgraphx_example/images/expand.gif" ) ) ; menu . addSeparator ( ) ; menu . add ( editor . bind ( mxResources . get ( "toBack" ) , mxGraphActions . getToBackAction ( ) , "/com/gkd/jgraphx_example/images/toback.gif" ) ) ; menu . add ( editor . bind ( mxResources . get ( "toFront" ) , mxGraphActions . getToFrontAction ( ) , "/com/gkd/jgraphx_example/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/gkd/jgraphx_example/images/alignleft.gif" ) ) ; submenu . add ( editor . bind ( mxResources . get ( "center" ) , new AlignCellsAction ( mxConstants . ALIGN_CENTER ) , "/com/gkd/jgraphx_example/images/aligncenter.gif" ) ) ; submenu . add ( editor . bind ( mxResources . get ( "right" ) , new AlignCellsAction ( mxConstants . ALIGN_RIGHT ) , "/com/gkd/jgraphx_example/images/alignright.gif" ) ) ; submenu . addSeparator ( ) ; submenu . add ( editor . bind ( mxResources . get ( "top" ) , new AlignCellsAction ( mxConstants . ALIGN_TOP ) , "/com/gkd/jgraphx_example/images/aligntop.gif" ) ) ; submenu . add ( editor . bind ( mxResources . get ( "middle" ) , new AlignCellsAction ( mxConstants . ALIGN_MIDDLE ) , "/com/gkd/jgraphx_example/images/alignmiddle.gif" ) ) ; submenu . add ( editor . bind ( mxResources . get ( "bottom" ) , new AlignCellsAction ( mxConstants . ALIGN_BOTTOM ) , "/com/gkd/jgraphx_example/images/alignbottom.gif" ) ) ; menu . addSeparator ( ) ; menu . add ( editor . bind ( mxResources . get ( "autosize" ) , new AutosizeAction ( ) ) ) ; }
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 .
