Search in sources :

Example 1 with PercentSlider

use of com.revolsys.swing.field.PercentSlider in project com.revolsys.open by revolsys.

the class GriddedElevationModelStylePanel method newField.

@Override
protected Field newField(final String fieldName, final Class<?> fieldClass, final Object value) {
    if ("opacity".equals(fieldName)) {
        final PercentSlider opacityField = new PercentSlider("opacity", (float) value);
        Property.addListener(opacityField, this);
        opacityField.setMaximumSize(new Dimension(100, 25));
        return opacityField;
    } else if ("gradient".equals(fieldName)) {
        final ColorGradientField field = new ColorGradientField((ColorGradientGriddedElevationModelRasterizer) this.rasterizer);
        Property.addListener(field, this);
        return field;
    } else {
        return super.newField(fieldName, fieldClass, value);
    }
}
Also used : PercentSlider(com.revolsys.swing.field.PercentSlider) ColorGradientGriddedElevationModelRasterizer(com.revolsys.elevation.gridded.rasterizer.ColorGradientGriddedElevationModelRasterizer) Dimension(java.awt.Dimension)

Aggregations

ColorGradientGriddedElevationModelRasterizer (com.revolsys.elevation.gridded.rasterizer.ColorGradientGriddedElevationModelRasterizer)1 PercentSlider (com.revolsys.swing.field.PercentSlider)1 Dimension (java.awt.Dimension)1