本文整理汇总了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);
}
}
示例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();
}
示例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();
}
}
示例4: setStyle
import com.nextgis.maplib.display.Style; //导入依赖的package包/类
public void setStyle(Style style) {
mStyle = style;
}
示例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);