當前位置: 首頁>>代碼示例>>Java>>正文


Java StyleLayer類代碼示例

本文整理匯總了Java中org.geotools.map.StyleLayer的典型用法代碼示例。如果您正苦於以下問題:Java StyleLayer類的具體用法?Java StyleLayer怎麽用?Java StyleLayer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


StyleLayer類屬於org.geotools.map包,在下文中一共展示了StyleLayer類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: init

import org.geotools.map.StyleLayer; //導入依賴的package包/類
@Override
public void init(final IEditorSite site, final IEditorInput input) throws PartInitException {
	setSite(site);
	final FileEditorInput fi = (FileEditorInput) input;
	file = fi.getFile();
	final IPath path = fi.getPath();
	final File f = path.makeAbsolute().toFile();
	try {
		pathStr = f.getAbsolutePath();
		final ShapefileDataStore store = new ShapefileDataStore(f.toURI().toURL());
		content = new MapContent();
		featureSource = store.getFeatureSource();
		style = Utils.createStyle(f, featureSource);
		layer = new FeatureLayer(featureSource, style);
		mode = determineMode(featureSource.getSchema(), "Polygon");
		final List<FeatureTypeStyle> ftsList = style.featureTypeStyles();
		if (ftsList.size() > 0) {
			fts = ftsList.get(0);
		} else {
			fts = null;
		}
		if (fts != null) {
			this.setFillColor(PreferencesHelper.SHAPEFILE_VIEWER_FILL.getValue(), mode, fts);
			this.setStrokeColor(PreferencesHelper.SHAPEFILE_VIEWER_LINE_COLOR.getValue(), mode, fts);
			((StyleLayer) layer).setStyle(style);
		}
		content.addLayer(layer);
	} catch (final IOException e) {
		System.out.println("Unable to view file " + path);
	}
	this.setPartName(path.lastSegment());
	setInput(input);
}
 
開發者ID:gama-platform,項目名稱:gama,代碼行數:34,代碼來源:ShapeFileViewer.java

示例2: setColor

import org.geotools.map.StyleLayer; //導入依賴的package包/類
/**
 * Method setColor()
 * 
 * @see ummisco.gama.ui.views.toolbar.IToolbarDecoratedView.Colorizable#setColor(int,
 *      ummisco.gama.ui.resources.GamaColors.GamaUIColor)
 */
@Override
public void setColor(final int index, final GamaUIColor gc) {
	final RGB rgb = gc.getRGB();
	final Color c = new Color(rgb.red, rgb.green, rgb.blue);
	if (index == 0) {
		setStrokeColor(c, mode, fts);
	} else {
		setFillColor(c, mode, fts);
	}
	((StyleLayer) layer).setStyle(style);
}
 
開發者ID:gama-platform,項目名稱:gama,代碼行數:18,代碼來源:ShapeFileViewer.java

示例3: doSetStyle

import org.geotools.map.StyleLayer; //導入依賴的package包/類
/**
 * Show a style dialog to create a new Style for the layer
 *
 * @param layer
 *            the layer to be styled
 * @throws IOException
 */
private void doSetStyle(final Layer layer) throws IOException {
	if (layer instanceof StyleLayer) {
		final StyleLayer styleLayer = (StyleLayer) layer;
		final Style style = SimpleStyleConfigurator.showDialog(this.getTable().getShell(), layer);
		if (style != null) {
			styleLayer.setStyle(style);
		}
	}
}
 
開發者ID:gama-platform,項目名稱:gama,代碼行數:17,代碼來源:MaplayerTableViewer.java

示例4: setLayer

import org.geotools.map.StyleLayer; //導入依賴的package包/類
public void setLayer(StyleLayer layer) {
this.layer = layer;

   }
 
開發者ID:ianturton,項目名稱:ShapefileViewer,代碼行數:5,代碼來源:JLegendPanel.java


注:本文中的org.geotools.map.StyleLayer類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。