Package org.geotools.swing.wizard

Examples of org.geotools.swing.wizard.ParamField


            Parameter<?> parameter = new Parameter(entry.getKey(), entry.getValue().getClass(),
                    Text.text("Result"), Text.text("Result of process"));
            JLabel label = new JLabel(entry.getKey());
            page.add(label);

            ParamField widget;
            if (Double.class.isAssignableFrom(parameter.type)) {
                widget = new JDoubleField(parameter);
            } else if (Geometry.class.isAssignableFrom(parameter.type)) {
                widget = new JGeometryField(parameter);
            } else {
                // We got nothing special, let's hope the converter api can deal
                widget = new JField(parameter);
            }
            JComponent field = widget.doLayout();
            widget.setValue(entry.getValue());
            page.add(field);

        }
    }
View Full Code Here


                txt +="*";
            }
            JLabel label = new JLabel(txt);
            page.add(label);

            ParamField field = ParamField.create(param);
            JComponent component = field.doLayout();
            page.add(component, "span, wrap");

            fields.put(param, field);

            if (param.description != null) {
View Full Code Here

    @Override
    public 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());
        }
    }
View Full Code Here

    @Override
    public 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());
        }
    }
View Full Code Here

    @Override
    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;
    }
View Full Code Here

                txt +="*";
            }
            JLabel label = new JLabel(txt);
            page.add(label);

            ParamField field = ParamField.create(param);
            JComponent component = field.doLayout();
            page.add(component, "span, wrap");

            fields.put(param, field);

            if (param.description != null) {
View Full Code Here

    @Override
    public void preDisplayPanel() {
        // populate panel from params map
        for (Entry<Param, ParamField> entry : fields.entrySet()) {
            Param param = entry.getKey();
            ParamField field = entry.getValue();
            Object value = null;
            try {
                value = param.lookUp(connectionParameters);
            } catch (IOException e) {
            }
            if( value == null && param.required ){
                value = param.sample;
            }
            field.setValue(value);
        }
        for (Entry<Param, ParamField> entry : fields.entrySet()) {
            ParamField field = entry.getValue();
            field.addListener(getJWizard().getController());
        }
    }
View Full Code Here

    @Override
    public void preClosePanel() {
        for (Entry<Param, ParamField> entry : fields.entrySet()) {
            Param param = entry.getKey();
            ParamField field = entry.getValue();

            Object value = field.getValue();
            connectionParameters.put(param.key, (Serializable) value);
            field.setValue(value);
        }
        for (Entry<Param, ParamField> entry : fields.entrySet()) {
            ParamField field = entry.getValue();
            field.removeListener(getJWizard().getController());
        }
    }
View Full Code Here

                        values.add(pw.getValue());
                    }
                }
                paramMap.put(key, values);
            } else { // only a single value/widget
                ParamField ParamField = pws.get(0);
                if (ParamField.getValue() != null) {
                    paramMap.put(key, ParamField.getValue());
                }
            }

        }
    }
View Full Code Here

            // one widget)
            List<ParamField> widgets = new ArrayList<ParamField>();

            // loop through and create the min number of widgets for this param
            for (int i = 0; i < min; i++) {
                ParamField newWidget = createNewField(parameter, true);
                widgets.add(newWidget);
            }
            // add the widget(s) to the fields map
            fields.put(parameter.key, widgets);
        }
View Full Code Here

TOP

Related Classes of org.geotools.swing.wizard.ParamField

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.