本文整理汇总了Java中org.geotools.data.Parameter类的典型用法代码示例。如果您正苦于以下问题:Java Parameter类的具体用法?Java Parameter怎么用?Java Parameter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Parameter类属于org.geotools.data包,在下文中一共展示了Parameter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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());
// }
}
示例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);
}
示例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;
}
示例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);
}
}
}
}
示例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);
}
示例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);
}
示例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());
// }
}
示例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;
}
示例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;
}
}
示例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;
}
示例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
}
示例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;
}
示例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;
}
示例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;
}