Package com.mxgraph.examples.swing.editor.EditorActions

Examples of com.mxgraph.examples.swing.editor.EditorActions.KeyValueAction


            mxConstants.ALIGN_LEFT)));

    submenu.addSeparator();

    submenu.add(editor.bind(mxResources.get("wordWrap"),
        new KeyValueAction(mxConstants.STYLE_WHITE_SPACE, "wrap")));
    submenu.add(editor.bind(mxResources.get("noWordWrap"),
        new KeyValueAction(mxConstants.STYLE_WHITE_SPACE, null)));

    submenu.addSeparator();

    submenu.add(editor.bind(mxResources.get("hide"), new ToggleAction(
        mxConstants.STYLE_NOLABEL)));

    menu.addSeparator();

    submenu = (JMenu) menu.add(new JMenu(mxResources.get("line")));

    submenu.add(editor.bind(mxResources.get("linecolor"), new ColorAction(
        "Linecolor", mxConstants.STYLE_STROKECOLOR),
        "/com/mxgraph/examples/swing/images/linecolor.gif"));

    submenu.addSeparator();

    submenu.add(editor.bind(mxResources.get("orthogonal"), new ToggleAction(
        mxConstants.STYLE_ORTHOGONAL)));
    submenu.add(editor.bind(mxResources.get("dashed"), new ToggleAction(
        mxConstants.STYLE_DASHED)));

    submenu.addSeparator();
   
    submenu.add(editor.bind(mxResources.get("linewidth"),
        new PromptValueAction(mxConstants.STYLE_STROKEWIDTH,
            "Linewidth")));

    submenu = (JMenu) menu.add(new JMenu(mxResources.get("connector")));

    submenu.add(editor.bind(mxResources.get("straight"),
        new SetStyleAction("straight"),
        "/com/mxgraph/examples/swing/images/straight.gif"));

    submenu.add(editor.bind(mxResources.get("horizontal"),
        new SetStyleAction(""),
        "/com/mxgraph/examples/swing/images/connect.gif"));
    submenu.add(editor.bind(mxResources.get("vertical"),
        new SetStyleAction("vertical"),
        "/com/mxgraph/examples/swing/images/vertical.gif"));

    submenu.addSeparator();

    submenu.add(editor.bind(mxResources.get("entityRelation"),
        new SetStyleAction("edgeStyle=mxEdgeStyle.EntityRelation"),
        "/com/mxgraph/examples/swing/images/entity.gif"));
    submenu.add(editor.bind(mxResources.get("arrow"), new SetStyleAction(
        "arrow"), "/com/mxgraph/examples/swing/images/arrow.gif"));

    submenu.addSeparator();

    submenu.add(editor.bind(mxResources.get("plain"), new ToggleAction(
        mxConstants.STYLE_NOEDGESTYLE)));

    menu.addSeparator();

    submenu = (JMenu) menu.add(new JMenu(mxResources.get("linestart")));

    submenu.add(editor.bind(mxResources.get("open"), new KeyValueAction(
        mxConstants.STYLE_STARTARROW, mxConstants.ARROW_OPEN),
        "/com/mxgraph/examples/swing/images/open_start.gif"));
    submenu.add(editor.bind(mxResources.get("classic"), new KeyValueAction(
        mxConstants.STYLE_STARTARROW, mxConstants.ARROW_CLASSIC),
        "/com/mxgraph/examples/swing/images/classic_start.gif"));
    submenu.add(editor.bind(mxResources.get("block"), new KeyValueAction(
        mxConstants.STYLE_STARTARROW, mxConstants.ARROW_BLOCK),
        "/com/mxgraph/examples/swing/images/block_start.gif"));

    submenu.addSeparator();

    submenu.add(editor.bind(mxResources.get("diamond"), new KeyValueAction(
        mxConstants.STYLE_STARTARROW, mxConstants.ARROW_DIAMOND),
        "/com/mxgraph/examples/swing/images/diamond_start.gif"));
    submenu.add(editor.bind(mxResources.get("oval"), new KeyValueAction(
        mxConstants.STYLE_STARTARROW, mxConstants.ARROW_OVAL),
        "/com/mxgraph/examples/swing/images/oval_start.gif"));

    submenu.addSeparator();

    submenu.add(editor.bind(mxResources.get("none"), new KeyValueAction(
        mxConstants.STYLE_STARTARROW, mxConstants.NONE)));
    submenu.add(editor.bind(mxResources.get("size"), new PromptValueAction(
        mxConstants.STYLE_STARTSIZE, "Linestart Size")));

    submenu = (JMenu) menu.add(new JMenu(mxResources.get("lineend")));

    submenu.add(editor.bind(mxResources.get("open"), new KeyValueAction(
        mxConstants.STYLE_ENDARROW, mxConstants.ARROW_OPEN),
        "/com/mxgraph/examples/swing/images/open_end.gif"));
    submenu.add(editor.bind(mxResources.get("classic"), new KeyValueAction(
        mxConstants.STYLE_ENDARROW, mxConstants.ARROW_CLASSIC),
        "/com/mxgraph/examples/swing/images/classic_end.gif"));
    submenu.add(editor.bind(mxResources.get("block"), new KeyValueAction(
        mxConstants.STYLE_ENDARROW, mxConstants.ARROW_BLOCK),
        "/com/mxgraph/examples/swing/images/block_end.gif"));

    submenu.addSeparator();

    submenu.add(editor.bind(mxResources.get("diamond"), new KeyValueAction(
        mxConstants.STYLE_ENDARROW, mxConstants.ARROW_DIAMOND),
        "/com/mxgraph/examples/swing/images/diamond_end.gif"));
    submenu.add(editor.bind(mxResources.get("oval"), new KeyValueAction(
        mxConstants.STYLE_ENDARROW, mxConstants.ARROW_OVAL),
        "/com/mxgraph/examples/swing/images/oval_end.gif"));

    submenu.addSeparator();

    submenu.add(editor.bind(mxResources.get("none"), new KeyValueAction(
        mxConstants.STYLE_ENDARROW, mxConstants.NONE)));
    submenu.add(editor.bind(mxResources.get("size"), new PromptValueAction(
        mxConstants.STYLE_ENDSIZE, "Lineend Size")));

    menu.addSeparator();

    submenu = (JMenu) menu.add(new JMenu(mxResources.get("alignment")));

    submenu.add(editor.bind(mxResources.get("left"), new KeyValueAction(
        mxConstants.STYLE_ALIGN, mxConstants.ALIGN_LEFT),
        "/com/mxgraph/examples/swing/images/left.gif"));
    submenu.add(editor.bind(mxResources.get("center"), new KeyValueAction(
        mxConstants.STYLE_ALIGN, mxConstants.ALIGN_CENTER),
        "/com/mxgraph/examples/swing/images/center.gif"));
    submenu.add(editor.bind(mxResources.get("right"), new KeyValueAction(
        mxConstants.STYLE_ALIGN, mxConstants.ALIGN_RIGHT),
        "/com/mxgraph/examples/swing/images/right.gif"));

    submenu.addSeparator();

    submenu.add(editor.bind(mxResources.get("top"), new KeyValueAction(
        mxConstants.STYLE_VERTICAL_ALIGN, mxConstants.ALIGN_TOP),
        "/com/mxgraph/examples/swing/images/top.gif"));
    submenu.add(editor.bind(mxResources.get("middle"), new KeyValueAction(
        mxConstants.STYLE_VERTICAL_ALIGN, mxConstants.ALIGN_MIDDLE),
        "/com/mxgraph/examples/swing/images/middle.gif"));
    submenu.add(editor.bind(mxResources.get("bottom"), new KeyValueAction(
        mxConstants.STYLE_VERTICAL_ALIGN, mxConstants.ALIGN_BOTTOM),
        "/com/mxgraph/examples/swing/images/bottom.gif"));

    submenu = (JMenu) menu.add(new JMenu(mxResources.get("spacing")));

    submenu.add(editor.bind(mxResources.get("top"), new PromptValueAction(
        mxConstants.STYLE_SPACING_TOP, "Top Spacing")));
    submenu.add(editor.bind(mxResources.get("right"),
        new PromptValueAction(mxConstants.STYLE_SPACING_RIGHT,
            "Right Spacing")));
    submenu.add(editor.bind(mxResources.get("bottom"),
        new PromptValueAction(mxConstants.STYLE_SPACING_BOTTOM,
            "Bottom Spacing")));
    submenu.add(editor.bind(mxResources.get("left"), new PromptValueAction(
        mxConstants.STYLE_SPACING_LEFT, "Left Spacing")));

    submenu.addSeparator();

    submenu.add(editor.bind(mxResources.get("global"),
        new PromptValueAction(mxConstants.STYLE_SPACING, "Spacing")));

    submenu.addSeparator();

    submenu.add(editor.bind(mxResources.get("sourceSpacing"),
        new PromptValueAction(
            mxConstants.STYLE_SOURCE_PERIMETER_SPACING, mxResources
                .get("sourceSpacing"))));
    submenu.add(editor.bind(mxResources.get("targetSpacing"),
        new PromptValueAction(
            mxConstants.STYLE_TARGET_PERIMETER_SPACING, mxResources
                .get("targetSpacing"))));

    submenu.addSeparator();

    submenu.add(editor.bind(mxResources.get("perimeter"),
        new PromptValueAction(mxConstants.STYLE_PERIMETER_SPACING,
            "Perimeter Spacing")));

    submenu = (JMenu) menu.add(new JMenu(mxResources.get("direction")));

    submenu.add(editor.bind(mxResources.get("north"), new KeyValueAction(
        mxConstants.STYLE_DIRECTION, mxConstants.DIRECTION_NORTH)));
    submenu.add(editor.bind(mxResources.get("east"), new KeyValueAction(
        mxConstants.STYLE_DIRECTION, mxConstants.DIRECTION_EAST)));
    submenu.add(editor.bind(mxResources.get("south"), new KeyValueAction(
        mxConstants.STYLE_DIRECTION, mxConstants.DIRECTION_SOUTH)));
    submenu.add(editor.bind(mxResources.get("west"), new KeyValueAction(
        mxConstants.STYLE_DIRECTION, mxConstants.DIRECTION_WEST)));

    submenu.addSeparator();

    submenu.add(editor.bind(mxResources.get("rotation"),
View Full Code Here


    add(editor.bind("Italic", new FontStyleAction(false),
        "/com/mxgraph/examples/swing/images/italic.gif"));

    addSeparator();

    add(editor.bind("Left", new KeyValueAction(mxConstants.STYLE_ALIGN,
        mxConstants.ALIGN_LEFT),
        "/com/mxgraph/examples/swing/images/left.gif"));
    add(editor.bind("Center", new KeyValueAction(mxConstants.STYLE_ALIGN,
        mxConstants.ALIGN_CENTER),
        "/com/mxgraph/examples/swing/images/center.gif"));
    add(editor.bind("Right", new KeyValueAction(mxConstants.STYLE_ALIGN,
        mxConstants.ALIGN_RIGHT),
        "/com/mxgraph/examples/swing/images/right.gif"));

    addSeparator();
View Full Code Here

        new SetLabelPositionAction(mxConstants.ALIGN_CENTER, mxConstants.ALIGN_CENTER)));
    subsubmenu.add(editor.bind(mxResources.get("right"), new SetLabelPositionAction(mxConstants.ALIGN_RIGHT, mxConstants.ALIGN_LEFT)));

    submenu.addSeparator();

    submenu.add(editor.bind(mxResources.get("wordWrap"), new KeyValueAction(mxConstants.STYLE_WHITE_SPACE, "wrap")));
    submenu.add(editor.bind(mxResources.get("noWordWrap"), new KeyValueAction(mxConstants.STYLE_WHITE_SPACE, null)));

    submenu.addSeparator();

    submenu.add(editor.bind(mxResources.get("hide"), new ToggleAction(mxConstants.STYLE_NOLABEL)));

    menu.addSeparator();

    submenu = (JMenu) menu.add(new JMenu(mxResources.get("line")));

    submenu.add(editor.bind(mxResources.get("linecolor"), new ColorAction("Linecolor", mxConstants.STYLE_STROKECOLOR),
        "/com/mxgraph/examples/swing/images/linecolor.gif"));

    submenu.addSeparator();

    submenu.add(editor.bind(mxResources.get("orthogonal"), new ToggleAction(mxConstants.STYLE_ORTHOGONAL)));
    submenu.add(editor.bind(mxResources.get("dashed"), new ToggleAction(mxConstants.STYLE_DASHED)));

    submenu.addSeparator();

    submenu.add(editor.bind(mxResources.get("linewidth"), new PromptValueAction(mxConstants.STYLE_STROKEWIDTH, "Linewidth")));

    submenu = (JMenu) menu.add(new JMenu(mxResources.get("connector")));

    submenu.add(editor.bind(mxResources.get("straight"), new SetStyleAction("straight"),
        "/com/mxgraph/examples/swing/images/straight.gif"));

    submenu.add(editor.bind(mxResources.get("horizontal"), new SetStyleAction(""), "/com/mxgraph/examples/swing/images/connect.gif"));
    submenu.add(editor.bind(mxResources.get("vertical"), new SetStyleAction("vertical"),
        "/com/mxgraph/examples/swing/images/vertical.gif"));

    submenu.addSeparator();

    submenu.add(editor.bind(mxResources.get("entityRelation"), new SetStyleAction("edgeStyle=mxEdgeStyle.EntityRelation"),
        "/com/mxgraph/examples/swing/images/entity.gif"));
    submenu.add(editor.bind(mxResources.get("arrow"), new SetStyleAction("arrow"), "/com/mxgraph/examples/swing/images/arrow.gif"));

    submenu.addSeparator();

    submenu.add(editor.bind(mxResources.get("plain"), new ToggleAction(mxConstants.STYLE_NOEDGESTYLE)));

    menu.addSeparator();

    submenu = (JMenu) menu.add(new JMenu(mxResources.get("linestart")));

    submenu.add(editor.bind(mxResources.get("open"), new KeyValueAction(mxConstants.STYLE_STARTARROW, mxConstants.ARROW_OPEN),
        "/com/mxgraph/examples/swing/images/open_start.gif"));
    submenu.add(editor.bind(mxResources.get("classic"), new KeyValueAction(mxConstants.STYLE_STARTARROW, mxConstants.ARROW_CLASSIC),
        "/com/mxgraph/examples/swing/images/classic_start.gif"));
    submenu.add(editor.bind(mxResources.get("block"), new KeyValueAction(mxConstants.STYLE_STARTARROW, mxConstants.ARROW_BLOCK),
        "/com/mxgraph/examples/swing/images/block_start.gif"));

    submenu.addSeparator();

    submenu.add(editor.bind(mxResources.get("diamond"), new KeyValueAction(mxConstants.STYLE_STARTARROW, mxConstants.ARROW_DIAMOND),
        "/com/mxgraph/examples/swing/images/diamond_start.gif"));
    submenu.add(editor.bind(mxResources.get("oval"), new KeyValueAction(mxConstants.STYLE_STARTARROW, mxConstants.ARROW_OVAL),
        "/com/mxgraph/examples/swing/images/oval_start.gif"));

    submenu.addSeparator();

    submenu.add(editor.bind(mxResources.get("none"), new KeyValueAction(mxConstants.STYLE_STARTARROW, mxConstants.NONE)));
    submenu.add(editor.bind(mxResources.get("size"), new PromptValueAction(mxConstants.STYLE_STARTSIZE, "Linestart Size")));

    submenu = (JMenu) menu.add(new JMenu(mxResources.get("lineend")));

    submenu.add(editor.bind(mxResources.get("open"), new KeyValueAction(mxConstants.STYLE_ENDARROW, mxConstants.ARROW_OPEN),
        "/com/mxgraph/examples/swing/images/open_end.gif"));
    submenu.add(editor.bind(mxResources.get("classic"), new KeyValueAction(mxConstants.STYLE_ENDARROW, mxConstants.ARROW_CLASSIC),
        "/com/mxgraph/examples/swing/images/classic_end.gif"));
    submenu.add(editor.bind(mxResources.get("block"), new KeyValueAction(mxConstants.STYLE_ENDARROW, mxConstants.ARROW_BLOCK),
        "/com/mxgraph/examples/swing/images/block_end.gif"));

    submenu.addSeparator();

    submenu.add(editor.bind(mxResources.get("diamond"), new KeyValueAction(mxConstants.STYLE_ENDARROW, mxConstants.ARROW_DIAMOND),
        "/com/mxgraph/examples/swing/images/diamond_end.gif"));
    submenu.add(editor.bind(mxResources.get("oval"), new KeyValueAction(mxConstants.STYLE_ENDARROW, mxConstants.ARROW_OVAL),
        "/com/mxgraph/examples/swing/images/oval_end.gif"));

    submenu.addSeparator();

    submenu.add(editor.bind(mxResources.get("none"), new KeyValueAction(mxConstants.STYLE_ENDARROW, mxConstants.NONE)));
    submenu.add(editor.bind(mxResources.get("size"), new PromptValueAction(mxConstants.STYLE_ENDSIZE, "Lineend Size")));

    menu.addSeparator();

    submenu = (JMenu) menu.add(new JMenu(mxResources.get("alignment")));

    submenu.add(editor.bind(mxResources.get("left"), new KeyValueAction(mxConstants.STYLE_ALIGN, mxConstants.ALIGN_LEFT),
        "/com/mxgraph/examples/swing/images/left.gif"));
    submenu.add(editor.bind(mxResources.get("center"), new KeyValueAction(mxConstants.STYLE_ALIGN, mxConstants.ALIGN_CENTER),
        "/com/mxgraph/examples/swing/images/center.gif"));
    submenu.add(editor.bind(mxResources.get("right"), new KeyValueAction(mxConstants.STYLE_ALIGN, mxConstants.ALIGN_RIGHT),
        "/com/mxgraph/examples/swing/images/right.gif"));

    submenu.addSeparator();

    submenu.add(editor.bind(mxResources.get("top"), new KeyValueAction(mxConstants.STYLE_VERTICAL_ALIGN, mxConstants.ALIGN_TOP),
        "/com/mxgraph/examples/swing/images/top.gif"));
    submenu.add(editor.bind(mxResources.get("middle"), new KeyValueAction(mxConstants.STYLE_VERTICAL_ALIGN, mxConstants.ALIGN_MIDDLE),
        "/com/mxgraph/examples/swing/images/middle.gif"));
    submenu.add(editor.bind(mxResources.get("bottom"), new KeyValueAction(mxConstants.STYLE_VERTICAL_ALIGN, mxConstants.ALIGN_BOTTOM),
        "/com/mxgraph/examples/swing/images/bottom.gif"));

    submenu = (JMenu) menu.add(new JMenu(mxResources.get("spacing")));

    submenu.add(editor.bind(mxResources.get("top"), new PromptValueAction(mxConstants.STYLE_SPACING_TOP, "Top Spacing")));
    submenu.add(editor.bind(mxResources.get("right"), new PromptValueAction(mxConstants.STYLE_SPACING_RIGHT, "Right Spacing")));
    submenu.add(editor.bind(mxResources.get("bottom"), new PromptValueAction(mxConstants.STYLE_SPACING_BOTTOM, "Bottom Spacing")));
    submenu.add(editor.bind(mxResources.get("left"), new PromptValueAction(mxConstants.STYLE_SPACING_LEFT, "Left Spacing")));

    submenu.addSeparator();

    submenu.add(editor.bind(mxResources.get("global"), new PromptValueAction(mxConstants.STYLE_SPACING, "Spacing")));

    submenu.addSeparator();

    submenu.add(editor.bind(mxResources.get("sourceSpacing"), new PromptValueAction(mxConstants.STYLE_SOURCE_PERIMETER_SPACING,
        mxResources.get("sourceSpacing"))));
    submenu.add(editor.bind(mxResources.get("targetSpacing"), new PromptValueAction(mxConstants.STYLE_TARGET_PERIMETER_SPACING,
        mxResources.get("targetSpacing"))));

    submenu.addSeparator();

    submenu.add(editor.bind(mxResources.get("perimeter"), new PromptValueAction(mxConstants.STYLE_PERIMETER_SPACING,
        "Perimeter Spacing")));

    submenu = (JMenu) menu.add(new JMenu(mxResources.get("direction")));

    submenu.add(editor.bind(mxResources.get("north"), new KeyValueAction(mxConstants.STYLE_DIRECTION, mxConstants.DIRECTION_NORTH)));
    submenu.add(editor.bind(mxResources.get("east"), new KeyValueAction(mxConstants.STYLE_DIRECTION, mxConstants.DIRECTION_EAST)));
    submenu.add(editor.bind(mxResources.get("south"), new KeyValueAction(mxConstants.STYLE_DIRECTION, mxConstants.DIRECTION_SOUTH)));
    submenu.add(editor.bind(mxResources.get("west"), new KeyValueAction(mxConstants.STYLE_DIRECTION, mxConstants.DIRECTION_WEST)));

    submenu.addSeparator();

    submenu.add(editor.bind(mxResources.get("rotation"), new PromptValueAction(mxConstants.STYLE_ROTATION, "Rotation (0-360)")));
View Full Code Here

TOP

Related Classes of com.mxgraph.examples.swing.editor.EditorActions.KeyValueAction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.