• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Parameter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: contentsForLevel

import org.geotools.data.Parameter; //导入依赖的package包/类
List<Parameter<?>> contentsForLevel(final List<Parameter<?>> contents, String level) {
	final List<Parameter<?>> list = new ArrayList<Parameter<?>>();
	if (level == null) {
		level = "user";
	}
	if (contents != null) {
		for (final Parameter<?> param : contents) {

			String check = param.metadata == null ? "user" : (String) param.metadata.get(Parameter.LEVEL);
			if (check == null) {
				check = "user";
			}
			if (level.equals(check)) {
				// we are good this is the one we want
				list.add(param);
			}
		}
	}
	return list;
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:21,代码来源:JParameterListWizard.java


示例2: preDisplayPanel

import org.geotools.data.Parameter; //导入依赖的package包/类
private void preDisplayPanel() {
    // populate panel from params map
    for( Entry<Parameter< ? >, ParamField> entry : fields.entrySet() ) {
        Parameter< ? > param = entry.getKey();
        ParamField field = entry.getValue();
        Object value = null;
        Object object = connectionParameters.get(param.key);
        value = Converters.convert(object, param.type);
        if (value == null) {
            value = object;
        }
        if (value == null && param.required) {
            value = param.sample;
        }
        field.setValue(value);
    }
    // for (Entry<Parameter<?>, ParamField> entry : fields.entrySet()) {
    // ParamField field = entry.getValue();
    // field.addListener(getJWizard().getController());
    // }
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:22,代码来源:JParameterListPage.java


示例3: getLayersAndDisplay

import org.geotools.data.Parameter; //导入依赖的package包/类
/**
 * Prompts the user for a GeoTIFF file and a Shapefile and passes them to the displayLayers
 * method
 */
private void getLayersAndDisplay() throws Exception {
    List<Parameter<?>> list = new ArrayList<Parameter<?>>();
    list.add(new Parameter<File>("image", File.class, "Image",
            "GeoTiff or World+Image to display as basemap",
            new KVP( Parameter.EXT, "tif", Parameter.EXT, "jpg")));
    list.add(new Parameter<File>("shape", File.class, "Shapefile",
            "Shapefile contents to display", new KVP(Parameter.EXT, "shp")));

    JParameterListWizard wizard = new JParameterListWizard("Image Lab",
            "Fill in the following layers", list);
    int finish = wizard.showModalDialog();

    if (finish != JWizard.FINISH) {
        System.exit(0);
    }
    File imageFile = (File) wizard.getConnectionParameters().get("image");
    File shapeFile = (File) wizard.getConnectionParameters().get("shape");
    displayLayers(imageFile, shapeFile);
}
 
开发者ID:ianturton,项目名称:geotools-cookbook,代码行数:24,代码来源:ImageLab.java


示例4: doLayout

import org.geotools.data.Parameter; //导入依赖的package包/类
@Override
public Control doLayout() {
	if (parameter.metadata != null && parameter.metadata.get(Parameter.IS_PASSWORD) == Boolean.TRUE) {
		text = new Text(parent, SWT.SINGLE | SWT.LEAD | SWT.PASSWORD | SWT.BORDER);
		text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
	} else if (single) {
		text = new Text(parent, SWT.SINGLE | SWT.LEAD | SWT.BORDER);
		text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
	} else {
		text = new Text(parent, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL | SWT.BORDER);
		text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
	}
	text.addModifyListener(arg0 -> validate());
	return text;
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:16,代码来源:JField.java


示例5: fillInDefaults

import org.geotools.data.Parameter; //导入依赖的package包/类
/**
 * Method used to fill in any required "programming" level defaults such as
 * dbtype.
 * 
 * @param contents
 * @param connectionParams
 *            a {@code Map} of initial parameter values
 */
private void fillInDefaults(final List<Parameter<?>> contents, final Map<String, Object> connectionParams) {
	if (connectionParams == null)
		return;

	for (final Parameter<?> param : contents) {
		if (param.required && "program".equals(param.getLevel())) {
			if (!connectionParams.containsKey(param.key)) {
				connectionParams.put(param.key, param.sample);
			}
		}
	}
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:21,代码来源:JParameterListWizard.java


示例6: JParameterListPage

import org.geotools.data.Parameter; //导入依赖的package包/类
public JParameterListPage( String title, String description, List<Parameter< ? >> contents, Map<String, Object> params ) {
    super(ID);
    this.contents = contents;
    this.connectionParameters = params;

    setTitle(title);
    setDescription(description);
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:9,代码来源:JParameterListPage.java


示例7: createControl

import org.geotools.data.Parameter; //导入依赖的package包/类
public void createControl( Composite parent ) {
    Composite mainComposite = new Composite(parent, SWT.NONE);
    GridLayout gridLayout = new GridLayout(1, false);
    mainComposite.setLayout(gridLayout);

    for( Parameter< ? > param : contents ) {
        String txt = param.title.toString();
        if (param.required) {
            txt += "*";
        }

        Label label = new Label(mainComposite, SWT.NONE);
        label.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        label.setText(txt);

        ParamField field = ParamField.create(mainComposite, param);
        field.doLayout();

        fields.put(param, field);

        // if (param.description != null) {
        // JLabel info = new JLabel("<html>" + param.description.toString());
        // page.add(info, "skip, span, wrap");
        // }
    }

    setControl(mainComposite);
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:29,代码来源:JParameterListPage.java


示例8: preClosePanel

import org.geotools.data.Parameter; //导入依赖的package包/类
private void preClosePanel() {
    for( Entry<Parameter< ? >, ParamField> entry : fields.entrySet() ) {
        Parameter< ? > param = entry.getKey();
        ParamField field = entry.getValue();

        Object value = field.getValue();
        connectionParameters.put(param.key, value);
        // field.setValue(value);
    }
    // for (Entry<Parameter<?>, ParamField> entry : fields.entrySet()) {
    // ParamField field = entry.getValue();
    // field.removeListener(getJWizard().getController());
    // }
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:15,代码来源:JParameterListPage.java


示例9: isValid

import org.geotools.data.Parameter; //导入依赖的package包/类
public boolean isValid() {
    // populate panel
    for( Entry<Parameter< ? >, ParamField> entry : fields.entrySet() ) {
        Parameter< ? > param = entry.getKey();
        ParamField field = entry.getValue();

        if (!field.validate()) {
            return false; // not validate
        }
        if (param.required && field.getValue() == null) {
            return false; // a value is required here
        }
    }
    return true;
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:16,代码来源:JParameterListPage.java


示例10: getD

import org.geotools.data.Parameter; //导入依赖的package包/类
/**
 * Determine the number of dimensions based on the CRS metadata.
 * 
 * @return Number of dimensions expected based on metadata, default of 2
 */
int getD() {
	try {
		final CoordinateReferenceSystem crs = (CoordinateReferenceSystem) parameter.metadata.get(Parameter.CRS);
		if (crs == null) {
			return 2;
		} else {
			return crs.getCoordinateSystem().getDimension();
		}
	} catch (final Throwable t) {
		return 2;
	}
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:18,代码来源:JGeometryField.java


示例11: importStyleWizard

import org.geotools.data.Parameter; //导入依赖的package包/类
private File importStyleWizard(String prompt, String ext, String format) {
	List<Parameter<?>> list = new ArrayList<Parameter<?>>();
	list.add(new Parameter<File>("import", File.class, ext, format,
			new KVP(Parameter.EXT, "sld")));

	JParameterListWizard wizard = new JParameterListWizard("Import Style",
			prompt, list);
	int finish = wizard.showModalDialog();

	if (finish != JWizard.FINISH) {
		return null; // no file selected
	}
	File file = (File) wizard.getConnectionParameters().get("import");
	return file;
}
 
开发者ID:ianturton,项目名称:geotools-cookbook,代码行数:16,代码来源:StyleConverter.java


示例12: exampleParam

import org.geotools.data.Parameter; //导入依赖的package包/类
public static void exampleParam() throws Exception {
    // param start
    Name name = new NameImpl("tutorial","octagonalEnvelope");

    Map<String, Parameter<?>> paramInfo = Processors.getParameterInfo(name);
    // param end
}
 
开发者ID:ianturton,项目名称:geotools-cookbook,代码行数:8,代码来源:ProcessExample.java


示例13: getRenderingProcess

import org.geotools.data.Parameter; //导入依赖的package包/类
public static Expression getRenderingProcess() {
	if (SINGLETON_RENDER_PROCESS == null) {
		final ProcessFactory processFactory = new AnnotatedBeanProcessFactory(
				Text.text("Internal GeoWave Process Factory"),
				"internal",
				InternalDistributedRenderProcess.class);
		final Name processName = new NameImpl(
				"internal",
				"InternalDistributedRender");
		final RenderingProcess process = (RenderingProcess) processFactory.create(processName);
		final Map<String, Parameter<?>> parameters = processFactory.getParameterInfo(processName);
		final InternalProcessFactory factory = new InternalProcessFactory();
		// this is kinda a hack, but the only way to instantiate a process
		// is
		// for it to have a registered process factory, so temporarily
		// register
		// the process factory
		Processors.addProcessFactory(factory);

		SINGLETON_RENDER_PROCESS = new RenderingProcessFunction(
				processName,
				Collections.singletonList(new ParameterFunction(
						null,
						Collections.singletonList(new LiteralExpressionImpl(
								"data")))),
				parameters,
				process,
				null);
		Processors.removeProcessFactory(factory);
	}
	return SINGLETON_RENDER_PROCESS;
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:33,代码来源:DistributedRenderProcessUtils.java


示例14: getLockMgtOptions

import org.geotools.data.Parameter; //导入依赖的package包/类
private static Map<String, List<String>> getLockMgtOptions() {
	final List<String> options = new ArrayList<String>();
	final Iterator<LockingManagementFactory> it = getLockManagementFactoryList();
	while (it.hasNext()) {
		options.add(
				it.next().toString());
	}
	final Map<String, List<String>> map = new HashMap<String, List<String>>();
	map.put(
			Parameter.OPTIONS,
			options);
	return map;
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:14,代码来源:GeoWavePluginConfig.java


示例15: getIndexQueryStrategyOptions

import org.geotools.data.Parameter; //导入依赖的package包/类
private static Map<String, List<String>> getIndexQueryStrategyOptions() {
	final List<String> options = new ArrayList<String>();

	final Iterator<IndexQueryStrategySPI> it = getInxexQueryStrategyList();
	while (it.hasNext()) {
		options.add(
				it.next().toString());
	}
	final Map<String, List<String>> map = new HashMap<String, List<String>>();
	map.put(
			Parameter.OPTIONS,
			options);
	return map;
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:15,代码来源:GeoWavePluginConfig.java


示例16: getAuthSPIOptions

import org.geotools.data.Parameter; //导入依赖的package包/类
private static Map<String, List<String>> getAuthSPIOptions() {
	final List<String> options = new ArrayList<String>();
	final Iterator<AuthorizationFactorySPI> it = getAuthorizationFactoryList();
	while (it.hasNext()) {
		options.add(
				it.next().toString());
	}
	final Map<String, List<String>> map = new HashMap<String, List<String>>();
	map.put(
			Parameter.OPTIONS,
			options);
	return map;
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:14,代码来源:GeoWavePluginConfig.java


示例17: apply

import org.geotools.data.Parameter; //导入依赖的package包/类
@Override
public Param apply(
		final ConfigOption input ) {
	if (input.isPassword()) {
		return new Param(
				input.getName(),
				String.class,
				input.getDescription(),
				!input.isOptional(),
				"mypassword",
				Collections.singletonMap(
						Parameter.IS_PASSWORD,
						Boolean.TRUE));
	}
	if (input.getType().isPrimitive() && (input.getType() == boolean.class)) {
		return new Param(
				input.getName(),
				input.getType(),
				input.getDescription(),
				true,
				"true",
				Collections.singletonMap(
						Parameter.OPTIONS,
						BooleanOptions));
	}
	return new Param(
			input.getName(),
			input.getType(),
			input.getDescription(),
			!input.isOptional());
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:32,代码来源:GeoWavePluginConfig.java


示例18: JURLField

import org.geotools.data.Parameter; //导入依赖的package包/类
public JURLField( Composite parent, Parameter< ? > parameter ) {
    super(parent, parameter);
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:4,代码来源:JURLField.java


示例19: createControl

import org.geotools.data.Parameter; //导入依赖的package包/类
@Override
public void createControl(final Composite parent) {

	final Composite mainComposite = new Composite(parent, SWT.NONE);
	final GridLayout gridLayout = new GridLayout(2, false);
	mainComposite.setLayout(gridLayout);

	for (final Param param : format.getParametersInfo()) {
		if (level != null) {
			String check = param.metadata == null ? "user" : (String) param.metadata.get(Parameter.LEVEL);

			if (check == null) {
				check = "user";
			}
			if (level.equals(check)) {
				// we are good this is the one we want
			} else {
				continue; // skip since it is not the one we want
			}
		}
		String txt = param.title.toString();
		if (param.required) {
			txt += "*";
		}

		final Label label = new Label(mainComposite, SWT.NONE);
		label.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
		label.setText(txt);

		final ParamField field = ParamField.create(mainComposite, param);
		field.doLayout();

		fields.put(param, field);

		// if (param.description != null) {
		// JLabel info = new
		// JLabel(formatDescription(param.description.toString()));
		// page.add(info, "skip, span, wrap");
		// }
	}

	setControl(mainComposite);

}
 
开发者ID:gama-platform,项目名称:gama,代码行数:45,代码来源:JDataStorePage.java


示例20: JDoubleField

import org.geotools.data.Parameter; //导入依赖的package包/类
public JDoubleField(final Composite parent, final Parameter<?> parameter) {
	super(parent, parameter);
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:4,代码来源:JDoubleField.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FLVWriter类代码示例发布时间:2022-05-22
下一篇:
Java InstantiateTransformer类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap