z.i18n({
    _locales: ["en", "zh"],
    GV_EDITOR_VALUE_LABEL_POSITION_CENTER: ["Center111", "中间111"],
    GV_EDITOR_VALUE_LABEL_POSITION_TOP: ["Top", "上"],
    GV_EDITOR_VALUE_LABEL_POSITION_BOTTOM: ["Bottom", "下"],
    GV_EDITOR_VALUE_LABEL_POSITION_LEFT: ["Left", "左"],
    GV_EDITOR_VALUE_LABEL_POSITION_RIGHT: ["Right", "右"],

    GV_EDITOR_VALUE_ARROW_SHAPE_ARROW: ["Arrow", "箭头"],
    GV_EDITOR_VALUE_ARROW_SHAPE_STEALTH_ARROW: ["Stealth Arrow", "燕尾形箭头"],
    GV_EDITOR_VALUE_ARROW_SHAPE_OPEN_ARROW: ["Open Arrow", "开放形箭头"],

    GV_EDITOR_VALUE_LINK_TYPE_RA: ["Right Angle", "折线"],
    GV_EDITOR_VALUE_LINK_TYPE_RA_HV: ["HV", "横-竖"],
    GV_EDITOR_VALUE_LINK_TYPE_RA_VH: ["VH", "竖-横"],
    GV_EDITOR_VALUE_LINK_TYPE_RA_TOP: ["Top", "上"],
    GV_EDITOR_VALUE_LINK_TYPE_RA_BOTTOM: ["Bottom", "下"],
    GV_EDITOR_VALUE_LINK_TYPE_RA_LEFT: ["Left", "左"],
    GV_EDITOR_VALUE_LINK_TYPE_RA_RIGHT: ["Right", "右"],
    GV_EDITOR_VALUE_LINK_TYPE_RA_HVH: ["HVH", "横-竖-横"],
    GV_EDITOR_VALUE_LINK_TYPE_RA_VHV: ["VHV", "竖-横-竖"],

    GV_EDITOR_VALUE_LINK_TYPE_CURVE: ["Curve", "曲线"],
    GV_EDITOR_VALUE_LINK_TYPE_QUADRATIC: ["Quadratic", "二次曲线"],
    GV_EDITOR_VALUE_LINK_TYPE_CUBIC: ["Cubic", "三次曲线"],

    GV_EDITOR_VALUE_SHAPE_RECT: ["Rect", "矩形"],
    GV_EDITOR_VALUE_SHAPE_CIRCLE: ["Circle", "圆形"],
    GV_EDITOR_VALUE_SHAPE_ELLIPSE: ["Ellipse", "椭圆"],
    GV_EDITOR_VALUE_SHAPE_ROUNDRECT: ["RoundRect", "圆角矩形"],
    GV_EDITOR_VALUE_SHAPE_TRIANGLE: ["Triangle", "三角形"],
    GV_EDITOR_VALUE_SHAPE_RIGHT_TRIANGLE: ["Right Triangle", "直角三角形"],
    GV_EDITOR_VALUE_SHAPE_DIAMOND: ["Diamond", "菱形"],
    GV_EDITOR_VALUE_SHAPE_PENTAGON: ["Pentagon", "五边形"],
    GV_EDITOR_VALUE_SHAPE_HEXAGON: ["Hexagon", "六边形"],
    GV_EDITOR_VALUE_SHAPE_STAR: ["Star", "星形"],
    GV_EDITOR_VALUE_SHAPE_PARALLELOGRAM: ["Parallelogram", "平行四边形"],
    GV_EDITOR_VALUE_SHAPE_CLOUD: ["Cloud", "云"],
    GV_EDITOR_VALUE_SHAPE_COVEXHULL: ["CovexHull", "凸多边形"],

    GV_EDITOR_VALUE_SELECT_STYLE_BORDER: ["Border", "边框"],
    GV_EDITOR_VALUE_SELECT_STYLE_SHADOW: ["Shadow", "阴影"],

    GV_EDITOR_VALUE_LINE_CAP_BUTT: ["Butt", "无线帽"],
    GV_EDITOR_VALUE_LINE_CAP_ROUND: ["Round", "圆形线帽"],
    GV_EDITOR_VALUE_LINE_CAP_SQUARE: ["Square", "正方形线帽"],

    GV_EDITOR_VALUE_LINE_JOIN_MITER: ["Miter", "尖角"],
    GV_EDITOR_VALUE_LINE_JOIN_ROUND: ["Round", "尖角"],
    GV_EDITOR_VALUE_LINE_JOIN_BEVEL: ["Bevel", "斜角"],

    GV_EDITOR_PROP_LABEL: ["Label", "文本标签"],
    GV_EDITOR_PROP_LABEL_VISIBLE: ["Label Visible", "显示标签"],
    GV_EDITOR_PROP_LABEL_COLOR: ["Label Color", "颜色"],
    GV_EDITOR_PROP_LABEL_FONT: ["Label Font", "字体"],
    GV_EDITOR_PROP_LABEL_POSITION: ["Label Position(Node)", "位置(节点)"],
    GV_EDITOR_PROP_LABEL_OFFSET_X: ["Label Offset X", "横向偏移"],
    GV_EDITOR_PROP_LABEL_OFFSET_Y: ["Label Offset Y", "竖向偏移"],
    GV_EDITOR_PROP_LABEL_ROTATION: ["Label Rotation(Link)", "旋转(Link)"],
    GV_EDITOR_PROP_LABEL_BOX: ["Label Box", "标签填充"],
    GV_EDITOR_PROP_LABEL_BOX_FILL: ["Box Fill", "标签填充"],
    GV_EDITOR_PROP_LABEL_BOX_STROKE: ["Box Stroke", "标签边框颜色"],
    GV_EDITOR_PROP_LABEL_BOX_STROKE_LINE_WIDTH: ["Box Stroke Line Width", "标签边框线宽"],
    GV_EDITOR_PROP_LABEL_BOX_STROKE_LINE_DASH: ["Box Stroke Line Dash", "标签边框虚线"],

    GV_EDITOR_PROP_INFO: ["Info", "信息提示"],
    GV_EDITOR_PROP_INFO_VISIBLE: ["Info Visible", "显示信息"],
    GV_EDITOR_PROP_INFO_FILL: ["Info Color", "颜色"],
    GV_EDITOR_PROP_INFO_FONT: ["Info Font", "字体"],
    GV_EDITOR_PROP_INFO_OFFSET_X: ["Info Offset X", "横向偏移"],
    GV_EDITOR_PROP_INFO_OFFSET_Y: ["Info Offset Y", "竖向偏移"],
    GV_EDITOR_PROP_INFO_BOX: ["Info Box", "信息填充"],
    GV_EDITOR_PROP_INFO_BOX_FILL: ["Box Fill", "信息填充"],
    GV_EDITOR_PROP_INFO_BOX_STROKE: ["Box Stroke", "信息边框颜色"],
    GV_EDITOR_PROP_INFO_BOX_STROKE_LINE_WIDTH: ["Box Stroke Line Width", "信息边框线宽"],
    GV_EDITOR_PROP_INFO_BOX_STROKE_LINE_DASH: ["Box Stroke Line Dash", "信息边框虚线"],


    GV_EDITOR_PROP_NODE: ["Node", "节点"],
    GV_EDITOR_PROP_NODE_X: ["X", "X坐标"],
    GV_EDITOR_PROP_NODE_Y: ["Y", "Y坐标"],
    GV_EDITOR_PROP_NODE_WIDTH: ["Width", "宽"],
    GV_EDITOR_PROP_NODE_HEIGHT: ["Height", "高"],
    GV_EDITOR_PROP_NODE_SHAPE: ["Shape", "形状"],
    GV_EDITOR_PROP_NODE_ALPHA: ["Alpha", "透明度"],
    GV_EDITOR_PROP_NODE_ROTATION: ["Rotation", "旋转"],
    GV_EDITOR_PROP_NODE_IMAGE: ["Image", "图标"],

    GV_EDITOR_PROP_NODE_RENDER: ["Render Style", "渲染样式"],
    GV_EDITOR_PROP_NODE_FILL: ["Fill", "填充颜色"],
    GV_EDITOR_PROP_NODE_STROKE: ["Stroke", "边框颜色"],
    GV_EDITOR_PROP_NODE_STROKE_LINE_WIDTH: ["Stroke Line Width", "边框线宽"],
    GV_EDITOR_PROP_NODE_STROKE_LINE_DASH: ["Stroke Line Dash", "边框虚线"],


    GV_EDITOR_PROP_NODE_ARROW: ["Arrow Style(Path Node)", "箭头样式(路径节点)"],
    GV_EDITOR_PROP_NODE_END_ARROW_SHAPE: ["End Arrow Shape", "结束箭头形状"],
    GV_EDITOR_PROP_NODE_END_ARROW_SIZE: ["End Arrow Size", "结束箭头大小"],
    GV_EDITOR_PROP_NODE_END_ARROW_OFFSET: ["End Arrow Offset", "结束箭头偏移"],
    GV_EDITOR_PROP_NODE_BEGIN_ARROW_SHAPE: ["Begin Arrow Shape", "开始箭头形状"],
    GV_EDITOR_PROP_NODE_BEGIN_ARROW_SIZE: ["Begin Arrow Size", "开始箭头大小"],
    GV_EDITOR_PROP_NODE_BEGIN_ARROW_OFFSET: ["Begin Arrow Offset", "开始箭头偏移"],

    GV_EDITOR_PROP_NODE_OUTLINE: ["Outline Style", "外边框样式"],
    GV_EDITOR_PROP_NODE_OUTLINE_STROKE: ["Outline Stroke", "外边框色"],
    GV_EDITOR_PROP_NODE_OUTLINE_STROKE_LINE_WIDTH: ["Outline Stroke Line Width", "外边框线宽"],
    GV_EDITOR_PROP_NODE_OUTLINE_STROKE_LINE_DASH: ["Outline Stroke Line Dash", "外边框虚线"],
    GV_EDITOR_PROP_NODE_BY_TYPE: ["By Type Style", "特殊类型样式"],
    GV_EDITOR_PROP_NODE_ROUNDRECT_RADIUS: ["RoundRect Radius", "圆角矩形半径"],


    GV_EDITOR_PROP_LINK: ["Link", "链路"],
    GV_EDITOR_PROP_LINK_TYPE: ["Type", "类型"],
    GV_EDITOR_PROP_LINK_STROKE: ["Stroke", "颜色"],
    GV_EDITOR_PROP_LINK_STROKE_LINE_WIDTH: ["Stroke Line Width", "线宽"],
    GV_EDITOR_PROP_LINK_STROKE_LINE_DASH: ["Stroke Line Dash", "虚线"],
    GV_EDITOR_PROP_LINK_ALPHA: ["Alpha", "透明度"],
    GV_EDITOR_PROP_LINK_FROM_OFFSET: ["From Offset", "起始偏移"],
    GV_EDITOR_PROP_LINK_TO_OFFSET: ["To Offset", "结束偏移"],
    GV_EDITOR_PROP_LINK_CORNER_RADIUS: ["Corner Radius", "拐角半径"],
    GV_EDITOR_PROP_LINK_CURVATURE: ["Curvature", "曲线弯曲度"],
    GV_EDITOR_PROP_LINK_ARROW: ["Arrow", "箭头"],
    GV_EDITOR_PROP_LINK_TO_ARROW_SHAPE: ["To Arrow Shape", "目的箭头形状"],
    GV_EDITOR_PROP_LINK_TO_ARROW_SIZE: ["To Arrow Size", "目的箭头大小"],
    GV_EDITOR_PROP_LINK_TO_ARROW_OFFSET: ["To Arrow Offset", "目的箭头偏移"],
    GV_EDITOR_PROP_LINK_FROM_ARROW_SHAPE: ["From Arrow Shape", "源箭头形状"],
    GV_EDITOR_PROP_LINK_FROM_ARROW_SIZE: ["From Arrow Size", "源箭头大小"],
    GV_EDITOR_PROP_LINK_FROM_ARROW_OFFSET: ["From Arrow Offset", "源箭头偏移"],


    GV_EDITOR_PROP_GROUP: ["Group", "分组"],
    GV_EDITOR_PROP_GROUP_EXPANDED: ["Group(Expanded)", "分组(展开状态)"],
    GV_EDITOR_PROP_GROUP_COLLAPSED: ["Group(Collapsed)", "分组(关闭状态)"],
    GV_EDITOR_PROP_GROUP_EXPAND_SHAPE: ["Expand Shape", "展开形状"],
    GV_EDITOR_PROP_GROUP_EXPAND_PADDING: ["Expand Padding", "展开边距"],
    GV_EDITOR_PROP_GROUP_EXPAND_FILL: ["Expand Fill", "展开填充色"],
    GV_EDITOR_PROP_GROUP_EXPAND_STROKE: ["Expand Stroke", "展开边框色"],
    GV_EDITOR_PROP_GROUP_EXPAND_STROKE_LINE_WIDTH: ["Expand Stroke Line Width", "展开边框线宽"],
    GV_EDITOR_PROP_GROUP_EXPAND_STROKE_LINE_DASH: ["Expand Stroke Line Dash", "展开边框虚线"],

    GV_EDITOR_PROP_VIEW: ["Global", "全局属性"],
    GV_EDITOR_PROP_VIEW_GRID_LINE: ["Grid Line", "网格线"],
    GV_EDITOR_PROP_VIEW_GRID_LINE_VISIBLE: ["Grid Line Visible", "显示网格线"],
    GV_EDITOR_PROP_VIEW_GRID_LINE_SPACE: ["Grid Line Space", "网格线间距"],

    GV_EDITOR_PROP_VIEW_LINE_STYLE: ["Line Style", "线段样式"],
    GV_EDITOR_PROP_VIEW_LINE_CAP: ["Line Cap", "末端线帽样式"],
    GV_EDITOR_PROP_VIEW_LINE_JOIN: ["Line Join", "线交点样式"],

    GV_EDITOR_PROP_VIEW_SELECT_STYLE: ["Select Style", "选中样式"],
    GV_EDITOR_PROP_VIEW_SELECT_BORDER_PADDING: ["Select Border Padding", "选中边框边距"],
    GV_EDITOR_PROP_VIEW_SELECT_BORDER_STROKE: ["Select Border Stroke", "选中边框色"],
    GV_EDITOR_PROP_VIEW_SELECT_BORDER_STROKE_LINE_WIDTH: ["Select Border Line Width", "选中边框线宽"],
    GV_EDITOR_PROP_VIEW_SELECT_BORDER_STROKE_LINE_DASH: ["Select Border Line Dash", "选中边框虚线"],
    GV_EDITOR_PROP_VIEW_SELECT_SHADOW_BLUR: ["Select Shadow Blur", "选中阴影模糊"],
    GV_EDITOR_PROP_VIEW_SELECT_SHADOW_COLOR: ["Select Shadow Color", "选中阴影颜色"],
    GV_EDITOR_PROP_VIEW_SELECT_SHADOW_OFFSET_X: ["Select Shadow Offset X", "选中阴影横向偏移"],
    GV_EDITOR_PROP_VIEW_SELECT_SHADOW_OFFSET_Y: ["Select Shadow Offset Y", "选中阴影竖向偏移"],

    GV_EDITOR_PROP_VIEW_OTHER_STYLE: ["Other Style", "其他"],
    GV_EDITOR_PROP_VIEW_LINK_GAP: ["Link Gap", "链路间距"],
    GV_EDITOR_PROP_VIEW_HIT_PADDING: ["Hit Padding", "选中范围"]
})
var EditorProps = {
    LABEL: "label",
    getSheetProperties: function (type, data) {
        var props = [];
        switch (type) {
            case "group":
                EditorProps._appendProps(type, data, props, EditorProps.LABEL_PROPERTIES, z.i18n("GV_EDITOR_PROP_LABEL"))
                EditorProps._appendProps(type, data, props, EditorProps.INFO_PROPERTIES, z.i18n("GV_EDITOR_PROP_INFO"))
                EditorProps._appendProps(type, data, props, EditorProps.GROUP_PROPERTIES, z.i18n("GV_EDITOR_PROP_GROUP_EXPANDED"))
                EditorProps._appendProps(type, data, props, EditorProps.NODE_PROPERTIES, z.i18n("GV_EDITOR_PROP_GROUP_COLLAPSED"))
                break;
            case "node":
                EditorProps._appendProps(type, data, props, EditorProps.LABEL_PROPERTIES, z.i18n("GV_EDITOR_PROP_LABEL"))
                EditorProps._appendProps(type, data, props, EditorProps.INFO_PROPERTIES, z.i18n("GV_EDITOR_PROP_INFO"))
                EditorProps._appendProps(type, data, props, EditorProps.NODE_PROPERTIES, z.i18n("GV_EDITOR_PROP_NODE"))
                break;
            case "link":
                EditorProps._appendProps(type, data, props, EditorProps.LABEL_PROPERTIES, z.i18n("GV_EDITOR_PROP_LABEL"))
                EditorProps._appendProps(type, data, props, EditorProps.INFO_PROPERTIES, z.i18n("GV_EDITOR_PROP_INFO"))
                EditorProps._appendProps(type, data, props, EditorProps.LINK_PROPERTIES, z.i18n("GV_EDITOR_PROP_LINK"))
                break;
            case "view":
                EditorProps._appendProps(type, data, props, EditorProps.GVIEW_PROPERTIES, z.i18n("GV_EDITOR_PROP_VIEW"), true)
                EditorProps._appendProps(type, data, props, EditorProps.LABEL_PROPERTIES, z.i18n("GV_EDITOR_PROP_LABEL"), true)
                EditorProps._appendProps(type, data, props, EditorProps.INFO_PROPERTIES, z.i18n("GV_EDITOR_PROP_INFO"), true)
                EditorProps._appendProps(type, data, props, EditorProps.NODE_PROPERTIES, z.i18n("GV_EDITOR_PROP_NODE"), "node")
                EditorProps._appendProps(type, data, props, EditorProps.LINK_PROPERTIES, z.i18n("GV_EDITOR_PROP_LINK"), "link")
                EditorProps._appendProps(type, data, props, EditorProps.GROUP_PROPERTIES, z.i18n("GV_EDITOR_PROP_GROUP_EXPANDED"), "group")
                break;
        }
        return props;
    },

    _appendProps: function (type, data, all_props, group_props, group_label, prefix) {
        if (group_props.length > 0) {
            var results = [];
            z.util.eachArray(group_props, function (item) {
                EditorProps._appendPropItem(type, data, results, item, prefix);
            });
            var item = {
                children: results,
                label: group_label
            }
            all_props.push(item)
        }
    },
    _appendPropItem: function (type, data, prop_arr, item, prefix) {
        if (item.isVisible) {
            if (item.isVisible(type, data) === false) {
                return;
            }
        }
        var property = item.property;

        var children = item.children;
        if (prefix && property) {
            if (prefix === true) {
                property = item.view_property || property;
            } else {
                property = item.view_property || (prefix + "_" + property);
            }
        }
        var _children = [];
        if (children) {
            children.forEach(function (childItem) {
                EditorProps._appendPropItem(type, data, _children, childItem, prefix);
            });
        }
        var funcMap = z.util.filterObject(item, function (key, value) {
            return z.type.isFunction(value);
        })
        delete funcMap.isVisible;
        item = JSON.parse(JSON.stringify(item));
        item = z.util.mergeObject(item, funcMap);
        if (_children.length > 0) {
            item.children = _children;
        }
        if (property) {
            item.property = property;
        }
        prop_arr.push(item);
        return item;
    },
    _getOptions: function (arr, withNullOpt) {
        arr = z.util.mergeArray([], arr);
        if (withNullOpt === true) {
            arr.unshift({label: "", value: ""});
        }
        return arr;
    },
    _getBaseShapeOptions: function (withNullOpt) {
        return EditorProps._getOptions(EditorProps.SHAPE_TYPES, withNullOpt);
    },
    _appendJSONProp: function (options) {
        return z.util.mergeObject(options, {
            getValue: function (value) {
                if (value) {
                    return JSON.parse(value);
                }
            },
            setValue: function (propertyRowData, value, valueField) {
                if (value) {
                    value = JSON.stringify(value);
                }
                propertyRowData.set(valueField, value);
            }
        });
    },
    _getArrowShapeOptions: function (withNullOpt) {
        // return z.util.mergeArray(EditorProps._getBaseShapeOptions(withNullOpt), EditorProps.ARROW_TYPES)
        return z.util.mergeArray(EditorProps._getOptions(EditorProps.ARROW_TYPES, withNullOpt), EditorProps.SHAPE_TYPES)
    },
    _appendDashProp: function (item, dash_items) {
        z.util.mergeObject(item, {
            type: "select",
            options: EditorProps._getOptions(dash_items || ["[6,1]", "[6,2]", "[6,3]"], true)
        })
        EditorProps._appendJSONProp(item);
        return item;
    }
};
z.util.mergeObject(EditorProps, {
    LABEL_POSITIONS: [
        {label: z.i18n("GV_EDITOR_VALUE_LABEL_POSITION_CENTER"), value: "center"},
        {label: z.i18n("GV_EDITOR_VALUE_LABEL_POSITION_TOP"), value: "top"},
        {label: z.i18n("GV_EDITOR_VALUE_LABEL_POSITION_BOTTOM"), value: "bottom"},
        {label: z.i18n("GV_EDITOR_VALUE_LABEL_POSITION_LEFT"), value: "left"},
        {label: z.i18n("GV_EDITOR_VALUE_LABEL_POSITION_RIGHT"), value: "right"}
    ],
    ARROW_TYPES: [
        {label: z.i18n("GV_EDITOR_VALUE_ARROW_SHAPE_ARROW"), value: "arrow"},
        {label: z.i18n("GV_EDITOR_VALUE_ARROW_SHAPE_STEALTH_ARROW"), value: "stealth_arrow"},
        {label: z.i18n("GV_EDITOR_VALUE_ARROW_SHAPE_OPEN_ARROW"), value: "open_arrow"}
    ],
    LINK_TYPES: [
        {
            label: z.i18n("GV_EDITOR_VALUE_LINK_TYPE_RA"), children: [
                {label: z.i18n("GV_EDITOR_VALUE_LINK_TYPE_RA_HV"), value: "ra_hv"},
                {label: z.i18n("GV_EDITOR_VALUE_LINK_TYPE_RA_VH"), value: "ra_vh"},
                {label: z.i18n("GV_EDITOR_VALUE_LINK_TYPE_RA_TOP"), value: "ra_top"},
                {label: z.i18n("GV_EDITOR_VALUE_LINK_TYPE_RA_BOTTOM"), value: "ra_bottom"},
                {label: z.i18n("GV_EDITOR_VALUE_LINK_TYPE_RA_LEFT"), value: "ra_left"},
                {label: z.i18n("GV_EDITOR_VALUE_LINK_TYPE_RA_RIGHT"), value: "ra_right"},
                {label: z.i18n("GV_EDITOR_VALUE_LINK_TYPE_RA_HVH"), value: "ra_hvh"},
                {label: z.i18n("GV_EDITOR_VALUE_LINK_TYPE_RA_VHV"), value: "ra_vhv"}]
        },
        {
            label: z.i18n("GV_EDITOR_VALUE_LINK_TYPE_CURVE"), children: [
                {label: z.i18n("GV_EDITOR_VALUE_LINK_TYPE_QUADRATIC"), value: "quadratic"},
                {label: z.i18n("GV_EDITOR_VALUE_LINK_TYPE_CUBIC"), value: "cubic"}]
        }
    ],

    SHAPE_TYPES: [
        {label: z.i18n("GV_EDITOR_VALUE_SHAPE_RECT"), value: "rect"},
        {label: z.i18n("GV_EDITOR_VALUE_SHAPE_CIRCLE"), value: "circle"},
        {label: z.i18n("GV_EDITOR_VALUE_SHAPE_ELLIPSE"), value: "ellipse"},
        {label: z.i18n("GV_EDITOR_VALUE_SHAPE_ROUNDRECT"), value: "roundrect"},
        {label: z.i18n("GV_EDITOR_VALUE_SHAPE_TRIANGLE"), value: "triangle"},
        {label: z.i18n("GV_EDITOR_VALUE_SHAPE_RIGHT_TRIANGLE"), value: "right_triangle"},
        {label: z.i18n("GV_EDITOR_VALUE_SHAPE_DIAMOND"), value: "diamond"},
        {label: z.i18n("GV_EDITOR_VALUE_SHAPE_PENTAGON"), value: "pentagon"},
        {label: z.i18n("GV_EDITOR_VALUE_SHAPE_HEXAGON"), value: "hexagon"},
        {label: z.i18n("GV_EDITOR_VALUE_SHAPE_STAR"), value: "star"},
        {label: z.i18n("GV_EDITOR_VALUE_SHAPE_PARALLELOGRAM"), value: "parallelogram"},
        {label: z.i18n("GV_EDITOR_VALUE_SHAPE_CLOUD"), value: "cloud"}
    ],
    SELECT_STYLES: [
        {label: z.i18n("GV_EDITOR_VALUE_SELECT_STYLE_BORDER"), value: "border"},
        {label: z.i18n("GV_EDITOR_VALUE_SELECT_STYLE_SHADOW"), value: "shadow"}
    ],
    LINE_CAPS: [
        {label: z.i18n("GV_EDITOR_VALUE_LINE_CAP_BUTT"), value: "butt"},
        {label: z.i18n("GV_EDITOR_VALUE_LINE_CAP_ROUND"), value: "round"},
        {label: z.i18n("GV_EDITOR_VALUE_LINE_CAP_SQUARE"), value: "square"}
    ],
    LINE_JOINS: [
        {label: z.i18n("GV_EDITOR_VALUE_LINE_JOIN_MITER"), value: "miter"},
        {label: z.i18n("GV_EDITOR_VALUE_LINE_JOIN_ROUND"), value: "round"},
        {label: z.i18n("GV_EDITOR_VALUE_LINE_JOIN_BEVEL"), value: "bevel"}
    ],
    FONTS: [
        "16px arial, sans-serif",
        "italic 20px arial, serif",
        "italic small-caps bold 16px/2 cursive",
        "small-caps bold 24px/1 sans-serif",
        "caption"
    ],
    GROUP_SHAPE_TYPES: [
        {label: z.i18n("GV_EDITOR_VALUE_SHAPE_RECT"), value: "rect"},
        {label: z.i18n("GV_EDITOR_VALUE_SHAPE_ROUNDRECT"), value: "roundrect"},
        {label: z.i18n("GV_EDITOR_VALUE_SHAPE_CIRCLE"), value: "circle"},
        {label: z.i18n("GV_EDITOR_VALUE_SHAPE_ELLIPSE"), value: "ellipse"},
        {label: z.i18n("GV_EDITOR_VALUE_SHAPE_PARALLELOGRAM"), value: "parallelogram"},
        {label: z.i18n("GV_EDITOR_VALUE_SHAPE_COVEXHULL"), value: "covexhull"}],

    NODE_IMAGES: [
        {label: "Router", value: "../_icons/topology/cisco/router.svg"},
        {label: "Layer3 Switch", value: "../_icons/topology/cisco/layer3_switch.svg"},
        {label: "Layer2 Switch", value: "../_icons/topology/cisco/workgroup_switch.svg"}]
})
z.util.mergeObject(EditorProps, {
    LABEL_PROPERTIES: [
        {label: z.i18n("GV_EDITOR_PROP_LABEL_VISIBLE"), property: "label_visible", type: "check"},
        {label: z.i18n("GV_EDITOR_PROP_LABEL_COLOR"), property: "label_fill", type: "color", removable: true},
        {label: z.i18n("GV_EDITOR_PROP_LABEL_FONT"), property: "label_font", type: "select", options: EditorProps._getOptions(EditorProps.FONTS, true)},
        {
            label: z.i18n("GV_EDITOR_PROP_LABEL_POSITION"), property: "label_position", type: "select",
            options: EditorProps._getOptions(EditorProps.LABEL_POSITIONS, true),
            isVisible: function (type, data) {
                return z.type.isView(data) || z.type.isNode(data);
            }
        },
        {label: z.i18n("GV_EDITOR_PROP_LABEL_OFFSET_X"), property: "label_offset_x", type: "number", attributes: {min: 1, max: 20, step: 1}},
        {label: z.i18n("GV_EDITOR_PROP_LABEL_OFFSET_Y"), property: "label_offset_y", type: "number", attributes: {min: 1, max: 20, step: 1}},
        {
            label: z.i18n("GV_EDITOR_PROP_LABEL_ROTATION"), property: "label_rotation", type: "check", default_value: true,
            isVisible: function (type, data) {
                return z.type.isView(data) || z.type.isLink(data);
            }
        },
        {
            label: z.i18n("GV_EDITOR_PROP_LABEL_BOX"), children: [
                {label: z.i18n("GV_EDITOR_PROP_LABEL_BOX_FILL"), property: "label_box_fill", type: "color"},
                {label: z.i18n("GV_EDITOR_PROP_LABEL_BOX_STROKE"), property: "label_box_stroke", type: "color"},
                {label: z.i18n("GV_EDITOR_PROP_LABEL_BOX_STROKE_LINE_WIDTH"), property: "label_box_stroke_line_width", type: "number", attributes: {min: 0, max: 10, step: 1}},
                EditorProps._appendDashProp({label: z.i18n("GV_EDITOR_PROP_LABEL_BOX_STROKE_LINE_DASH"), property: "label_box_stroke_line_dash"})
            ]
        }
    ],
    INFO_PROPERTIES: [
        {label: z.i18n("GV_EDITOR_PROP_INFO_VISIBLE"), property: "info_visible", type: "check"},
        {label: z.i18n("GV_EDITOR_PROP_INFO_FILL"), property: "info_fill", type: "color"},
        {label: z.i18n("GV_EDITOR_PROP_INFO_FONT"), property: "info_font", type: "select", options: EditorProps._getOptions(EditorProps.FONTS, true)},
        {label: z.i18n("GV_EDITOR_PROP_INFO_OFFSET_X"), property: "info_offset_x", type: "number", attributes: {min: 1, max: 20, step: 1}},
        {label: z.i18n("GV_EDITOR_PROP_INFO_OFFSET_Y"), property: "info_offset_y", type: "number", attributes: {min: 1, max: 20, step: 1}},
        {
            label: z.i18n("GV_EDITOR_PROP_INFO_BOX"), children: [
                {label: z.i18n("GV_EDITOR_PROP_INFO_BOX_FILL"), property: "info_box_fill", type: "color"},
                {label: z.i18n("GV_EDITOR_PROP_INFO_BOX_STROKE"), property: "info_box_stroke", type: "color"},
                {label: z.i18n("GV_EDITOR_PROP_INFO_BOX_STROKE_LINE_WIDTH"), property: "info_box_stroke_line_width", type: "number", attributes: {min: 0, max: 10, step: 1}},
                EditorProps._appendDashProp({label: z.i18n("GV_EDITOR_PROP_INFO_BOX_STROKE_LINE_DASH"), property: "info_box_stroke_line_dash"})
            ]
        }
    ],
    NODE_PROPERTIES: [
        {
            label: z.i18n("GV_EDITOR_PROP_NODE_X"), property: "x", type: "number", attributes: {min: 1, step: 1}, value_type: "int",
            isVisible: function (type, data) {
                return z.type.isNode(data) && !z.type.isGroup(data);
            }
        },
        {
            label: z.i18n("GV_EDITOR_PROP_NODE_Y"), property: "y", type: "number", attributes: {min: 1, step: 1}, value_type: "int",
            isVisible: function (type, data) {
                return z.type.isNode(data) && !z.type.isGroup(data);
            }
        },
        {label: z.i18n("GV_EDITOR_PROP_NODE_WIDTH"), property: "width", type: "number", attributes: {min: 1, step: 1}},
        {label: z.i18n("GV_EDITOR_PROP_NODE_HEIGHT"), property: "height", type: "number", attributes: {min: 1, step: 1}},
        {
            label: z.i18n("GV_EDITOR_PROP_NODE_SHAPE"), property: "shape", type: "select",
            options: EditorProps._getBaseShapeOptions(true)
        },
        {label: z.i18n("GV_EDITOR_PROP_NODE_ALPHA"), property: "alpha", view_property: "data_alpha", type: "number", attributes: {min: 0, max: 1, step: 0.1}},
        {label: z.i18n("GV_EDITOR_PROP_NODE_ROTATION"), property: "rotation", view_property: "rotation", type: "number", attributes: {min: 0, max: 360, step: 1}},
        {
            label: z.i18n("GV_EDITOR_PROP_NODE_IMAGE"), property: "image", type: "select", is_gv: false,
            options: EditorProps._getOptions(EditorProps.NODE_IMAGES, true),
            isVisible: function (type, data) {
                return z.type.isNode(data);
            }
        },
        {
            label: z.i18n("GV_EDITOR_PROP_NODE_RENDER"), children: [
                {label: z.i18n("GV_EDITOR_PROP_NODE_FILL"), property: "fill", type: "color"},
                {label: z.i18n("GV_EDITOR_PROP_NODE_STROKE"), property: "stroke", type: "color"},
                {label: z.i18n("GV_EDITOR_PROP_NODE_STROKE_LINE_WIDTH"), property: "stroke_line_width", type: "number", attributes: {min: 0, max: 10, step: 1}},
                EditorProps._appendDashProp({label: z.i18n("GV_EDITOR_PROP_NODE_STROKE_LINE_DASH"), property: "stroke_line_dash"})
            ]
        },
        {
            label: z.i18n("GV_EDITOR_PROP_NODE_ARROW"),
            children: [
                {label: z.i18n("GV_EDITOR_PROP_NODE_END_ARROW_SHAPE"), property: "end_arrow_shape", type: "select", options: EditorProps._getArrowShapeOptions(true)},
                {label: z.i18n("GV_EDITOR_PROP_NODE_END_ARROW_SIZE"), property: "end_arrow_size", type: "select", options: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]},
                {label: z.i18n("GV_EDITOR_PROP_NODE_END_ARROW_OFFSET"), property: "end_arrow_offset", type: "number", attributes: {min: 0, max: 20, step: 0.1}},
                {label: z.i18n("GV_EDITOR_PROP_NODE_BEGIN_ARROW_SHAPE"), property: "begin_arrow_shape", type: "select", options: EditorProps._getArrowShapeOptions(true)},
                {label: z.i18n("GV_EDITOR_PROP_NODE_BEGIN_ARROW_SIZE"), property: "begin_arrow_size", type: "select", options: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]},
                {label: z.i18n("GV_EDITOR_PROP_NODE_BEGIN_ARROW_OFFSET"), property: "begin_arrow_offset", type: "number", attributes: {min: 0, max: 20, step: 0.1}}
            ]
        },
        {
            label: z.i18n("GV_EDITOR_PROP_NODE_OUTLINE"), children: [
                {label: z.i18n("GV_EDITOR_PROP_NODE_OUTLINE_STROKE"), property: "outline_stroke", type: "color"},
                {label: z.i18n("GV_EDITOR_PROP_NODE_OUTLINE_STROKE_LINE_WIDTH"), property: "outline_stroke_line_width", type: "number", attributes: {min: 0, max: 10, step: 1}},
                EditorProps._appendDashProp({label: z.i18n("GV_EDITOR_PROP_NODE_OUTLINE_STROKE_LINE_DASH"), property: "outline_stroke_line_dash"})
            ]
        },
        {
            label: z.i18n("GV_EDITOR_PROP_NODE_BY_TYPE"), children: [
                EditorProps._appendJSONProp({
                    label: z.i18n("GV_EDITOR_PROP_NODE_ROUNDRECT_RADIUS"), property: "roundrect_radius", view_property: "roundrect_radius",
                    type: "select", options: EditorProps._getOptions(["10", "[10]", "[10,20]", "[10,20,30]", "[10,20,30,40]"])
                })
            ]
        }
    ],
    LINK_PROPERTIES: [
        {
            label: z.i18n("GV_EDITOR_PROP_LINK_TYPE"), property: "type", type: "select",
            options: EditorProps._getOptions(EditorProps.LINK_TYPES, true)
        },
        {label: z.i18n("GV_EDITOR_PROP_LINK_STROKE"), property: "stroke", type: "color"},
        {label: z.i18n("GV_EDITOR_PROP_LINK_STROKE_LINE_WIDTH"), property: "stroke_line_width", type: "number", attributes: {min: 0, max: 10, step: 1}},
        EditorProps._appendDashProp({label: z.i18n("GV_EDITOR_PROP_LINK_STROKE_LINE_DASH"), property: "stroke_line_dash"}),
        {label: z.i18n("GV_EDITOR_PROP_LINK_ALPHA"), property: "alpha", view_property: "data_alpha", type: "number", attributes: {min: 0, max: 1, step: 0.1}},

        {label: z.i18n("GV_EDITOR_PROP_LINK_FROM_OFFSET"), property: "from_offset", type: "number", attributes: {min: 0, max: 20, step: 1}},
        {label: z.i18n("GV_EDITOR_PROP_LINK_TO_OFFSET"), property: "to_offset", type: "number", attributes: {min: 0, max: 20, step: 1}},
        {label: z.i18n("GV_EDITOR_PROP_LINK_CORNER_RADIUS"), property: "corner_radius", type: "number", attributes: {min: 0, max: 20, step: 1}},
        {label: z.i18n("GV_EDITOR_PROP_LINK_CURVATURE"), property: "curvature", type: "number", attributes: {min: 0, max: 1, step: 0.1}},
        {
            label: z.i18n("GV_EDITOR_PROP_LINK_ARROW"), children: [
                {label: z.i18n("GV_EDITOR_PROP_LINK_TO_ARROW_SHAPE"), property: "to_arrow_shape", type: "select", options: EditorProps._getArrowShapeOptions(true)},
                {label: z.i18n("GV_EDITOR_PROP_LINK_TO_ARROW_SIZE"), property: "to_arrow_size", type: "select", options: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]},
                {label: z.i18n("GV_EDITOR_PROP_LINK_TO_ARROW_OFFSET"), property: "to_arrow_offset", type: "number", attributes: {min: 0, max: 20, step: 0.1}},
                {label: z.i18n("GV_EDITOR_PROP_LINK_FROM_ARROW_SHAPE"), property: "from_arrow_shape", type: "select", options: EditorProps._getArrowShapeOptions(true)},
                {label: z.i18n("GV_EDITOR_PROP_LINK_FROM_ARROW_SIZE"), property: "from_arrow_size", type: "select", options: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]},
                {label: z.i18n("GV_EDITOR_PROP_LINK_FROM_ARROW_OFFSET"), property: "from_arrow_offset", type: "number", attributes: {min: 0, max: 20, step: 0.1}}
            ]
        }
    ],
    GROUP_PROPERTIES: [
        {
            label: z.i18n("GV_EDITOR_PROP_GROUP_EXPAND_SHAPE"), property: "expand_shape", type: "select",
            options: EditorProps._getOptions(EditorProps.GROUP_SHAPE_TYPES, true)
        },
        {label: z.i18n("GV_EDITOR_PROP_GROUP_EXPAND_PADDING"), property: "expand_padding", type: "number", attributes: {min: 1, max: 50, step: 1}},
        {label: z.i18n("GV_EDITOR_PROP_GROUP_EXPAND_FILL"), property: "expand_fill", type: "color"},
        {label: z.i18n("GV_EDITOR_PROP_GROUP_EXPAND_STROKE"), property: "expand_stroke", type: "color"},
        {label: z.i18n("GV_EDITOR_PROP_GROUP_EXPAND_STROKE_LINE_WIDTH"), property: "expand_stroke_line_width", type: "number", attributes: {min: 1, max: 10, step: 1}},
        EditorProps._appendDashProp({label: z.i18n("GV_EDITOR_PROP_GROUP_EXPAND_STROKE_LINE_DASH"), property: "expand_stroke_line_dash"})
    ],

    GVIEW_PROPERTIES: [
        {
            label: z.i18n("GV_EDITOR_PROP_VIEW_GRID_LINE"),
            children: [
                {label: z.i18n("GV_EDITOR_PROP_VIEW_GRID_LINE_VISIBLE"), property: "grid_line_visible", type: "check"},
                {label: z.i18n("GV_EDITOR_PROP_VIEW_GRID_LINE_SPACE"), property: "grid_line_space", type: "number", attributes: {min: 10, max: 100, step: 10}}
            ]
        },
        {
            label: z.i18n("GV_EDITOR_PROP_VIEW_LINE_STYLE"),
            children: [
                {label: z.i18n("GV_EDITOR_PROP_VIEW_LINE_CAP"), property: "line_cap", type: "select", options: EditorProps._getOptions(EditorProps.LINE_CAPS, true)},
                {label: z.i18n("GV_EDITOR_PROP_VIEW_LINE_JOIN"), property: "line_join", type: "select", options: EditorProps._getOptions(EditorProps.LINE_JOINS, true)}
            ]
        },
        {
            label: z.i18n("GV_EDITOR_PROP_VIEW_SELECT_STYLE"),
            children: [
                {label: z.i18n("GV_EDITOR_PROP_VIEW_SELECT_STYLE"), property: "select_style", type: "select", options: EditorProps._getOptions(EditorProps.SELECT_STYLES, true)},
                {label: z.i18n("GV_EDITOR_PROP_VIEW_SELECT_BORDER_PADDING"), property: "select_border_padding", type: "number", attributes: {min: 1, max: 20, step: 1}},
                {label: z.i18n("GV_EDITOR_PROP_VIEW_SELECT_BORDER_STROKE"), property: "select_border_stroke", type: "color"},
                {
                    label: z.i18n("GV_EDITOR_PROP_VIEW_SELECT_BORDER_STROKE_LINE_WIDTH"),
                    property: "select_border_stroke_line_width",
                    type: "number",
                    attributes: {min: 1, max: 10, step: 1}
                },
                EditorProps._appendDashProp({label: z.i18n("GV_EDITOR_PROP_VIEW_SELECT_BORDER_STROKE_LINE_DASH"), property: "select_border_stroke_line_dash"}),

                {label: z.i18n("GV_EDITOR_PROP_VIEW_SELECT_SHADOW_BLUR"), property: "select_shadow_blur", type: "number", attributes: {min: 1, max: 20, step: 1}},
                {label: z.i18n("GV_EDITOR_PROP_VIEW_SELECT_SHADOW_COLOR"), property: "select_shadow_color", type: "color"},
                {label: z.i18n("GV_EDITOR_PROP_VIEW_SELECT_SHADOW_OFFSET_X"), property: "select_shadow_offset_x", type: "number", attributes: {min: 1, max: 20, step: 1}},
                {label: z.i18n("GV_EDITOR_PROP_VIEW_SELECT_SHADOW_OFFSET_Y"), property: "select_shadow_offset_y", type: "number", attributes: {min: 1, max: 20, step: 1}}
            ]
        },
        {
            label: z.i18n("GV_EDITOR_PROP_VIEW_OTHER_STYLE"),
            children: [
                {label: z.i18n("GV_EDITOR_PROP_VIEW_LINK_GAP"), property: "link_gap", type: "number", attributes: {min: 10, max: 30, step: 1}},
                {label: z.i18n("GV_EDITOR_PROP_VIEW_HIT_PADDING"), property: "hit_padding", type: "number", attributes: {min: 0, max: 5, step: 1}}
            ]
        }
    ]
})