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


Java Style类代码示例

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


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

示例1: getDefaultStyle

import com.nextgis.maplib.display.Style; //导入依赖的package包/类
public Style getDefaultStyle()
        throws Exception
{
    switch (mGeometryType) {

        case GTPoint:
        case GTMultiPoint:
            return new SimpleMarkerStyle(
                    Color.RED, Color.BLACK, 6, SimpleMarkerStyle.MarkerStyleCircle);

        case GTLineString:
        case GTMultiLineString:
            return new SimpleLineStyle(Color.GREEN, Color.BLUE, SimpleLineStyle.LineStyleSolid);

        case GTPolygon:
        case GTMultiPolygon:
            return new SimplePolygonStyle(Color.MAGENTA, Color.MAGENTA);

        default:
            throw new Exception("Unknown geometry type: " + mGeometryType);
    }

}
 
开发者ID:nextgis,项目名称:android_maplib,代码行数:24,代码来源:VectorLayer.java

示例2: createNewLayer

import com.nextgis.maplib.display.Style; //导入依赖的package包/类
private boolean createNewLayer() {
    MainApplication app = (MainApplication) getApplication();
    int geomType = getResources().getIntArray(R.array.geom_types)[mSpLayerType.getSelectedItemPosition()];
    List<Field> fields = mFieldAdapter.getFields();
    if (fields.size() == 0)
        fields.add(new Field(GeoConstants.FTString, "description", getString(R.string.default_field_name)));

    VectorLayer layer = app.createEmptyVectorLayer(mEtLayerName.getText().toString().trim(), null, geomType, fields);

    SimpleFeatureRenderer sfr = (SimpleFeatureRenderer) layer.getRenderer();
    if (null != sfr) {
        Style style = sfr.getStyle();
        if (null != style) {
            Random rnd = new Random(System.currentTimeMillis());
            style.setColor(Color.rgb(rnd.nextInt(255), rnd.nextInt(255), rnd.nextInt(255)));
        }
    }

    MapBase map = app.getMap();
    map.addLayer(layer);
    return map.save();
}
 
开发者ID:nextgis,项目名称:android_gisapp,代码行数:23,代码来源:CreateVectorLayerActivity.java

示例3: showStyleDialog

import com.nextgis.maplib.display.Style; //导入依赖的package包/类
private void showStyleDialog(final String value) {
    try {
        final Style style = value == null ? mStyle : mRulesList.contains(mSelectedValue) ? mStyleRule.getStyle(mSelectedValue) : mStyle.clone();

        FragmentManager fm = getActivity().getSupportFragmentManager();
        final StyleFragment styleFragment = new StyleFragment();
        styleFragment.setLayer(mLayer);
        styleFragment.setStyle(style);
        styleFragment.setTitle(R.string.style);
        styleFragment.setPositiveText(android.R.string.ok);
        styleFragment.setOnPositiveClickedListener(new StyledDialogFragment.OnPositiveClickedListener() {
            @Override
            public void onPositiveClicked() {
                if (value != null) {
                    if (!mRulesList.contains(mSelectedValue)) {
                        mRulesList.add(mSelectedValue);
                        mRulesAdapter.notifyDataSetChanged();
                        setListViewHeightBasedOnChildren();
                    }

                    mStyleRule.setStyle(mSelectedValue, style);
                }

                styleFragment.dismiss();
            }
        });
        styleFragment.setNegativeText(android.R.string.cancel);
        styleFragment.setOnNegativeClickedListener(new StyledDialogFragment.OnNegativeClickedListener() {
            @Override
            public void onNegativeClicked() {
                styleFragment.dismiss();
            }
        });
        styleFragment.show(fm, STYLE_DIALOG_FRAGMENT);
    } catch (CloneNotSupportedException e) {
        e.printStackTrace();
    }
}
 
开发者ID:nextgis,项目名称:android_maplibui,代码行数:39,代码来源:RuleFeatureRendererUI.java

示例4: setStyle

import com.nextgis.maplib.display.Style; //导入依赖的package包/类
public void setStyle(Style style) {
    mStyle = style;
}
 
开发者ID:nextgis,项目名称:android_maplibui,代码行数:4,代码来源:StyleFragment.java

示例5: setStyleParams

import com.nextgis.maplib.display.Style; //导入依赖的package包/类
/**
 * Set style parameters
 * @param style New style
 * @param featureId The feature identifier to set style
 */
void setStyleParams(
        Style style,
        long featureId);
 
开发者ID:nextgis,项目名称:android_maplib,代码行数:9,代码来源:IStyleRule.java


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