本文整理汇总了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;未经允许,请勿转载。 |
请发表评论