Search in sources :

Example 1 with VendorOptionInterface

use of com.sldeditor.ui.detail.vendor.geoserver.VendorOptionInterface in project sldeditor by robward-scisys.

the class FieldConfigVendorOptionTest method testVendorOptionsUpdated.

/**
 * Test method for
 * {@link com.sldeditor.ui.detail.config.FieldConfigVendorOption#vendorOptionsUpdated(java.util.List)}.
 */
@Test
public void testVendorOptionsUpdated() {
    RasterSymbolizerDetails panel = new RasterSymbolizerDetails();
    VendorOptionRasterFactory vendorOptionRasterFactory = new VendorOptionRasterFactory(getClass(), panel);
    // CHECKSTYLE:OFF
    List<VendorOptionInterface> veList = vendorOptionRasterFactory.getVendorOptionList("com.sldeditor.ui.detail.vendor.geoserver.raster.VOGeoServerContrastEnhancementNormalizeOverall");
    for (VendorOptionInterface extension : veList) {
        extension.setParentPanel(panel);
    }
    FieldConfigVendorOption field = new FieldConfigVendorOption(new FieldConfigCommonData(Double.class, FieldIdEnum.NAME, "label", false), veList);
    field.vendorOptionsUpdated(null);
    field.createUI();
    List<VersionData> vendorOptionVersionsList = new ArrayList<VersionData>();
    vendorOptionVersionsList.add(VersionData.getLatestVersion(GeoServerVendorOption.class));
    field.vendorOptionsUpdated(vendorOptionVersionsList);
}
Also used : VendorOptionRasterFactory(com.sldeditor.ui.detail.vendor.geoserver.raster.VendorOptionRasterFactory) GeoServerVendorOption(com.sldeditor.common.vendoroption.GeoServerVendorOption) FieldConfigVendorOption(com.sldeditor.ui.detail.config.FieldConfigVendorOption) VersionData(com.sldeditor.common.vendoroption.VersionData) RasterSymbolizerDetails(com.sldeditor.ui.detail.RasterSymbolizerDetails) FieldConfigCommonData(com.sldeditor.ui.detail.config.FieldConfigCommonData) ArrayList(java.util.ArrayList) VendorOptionInterface(com.sldeditor.ui.detail.vendor.geoserver.VendorOptionInterface) Test(org.junit.Test)

Example 2 with VendorOptionInterface

use of com.sldeditor.ui.detail.vendor.geoserver.VendorOptionInterface in project sldeditor by robward-scisys.

the class FieldConfigVendorOptionTest method testSetVisible.

/**
 * Test method for
 * {@link com.sldeditor.ui.detail.config.FieldConfigVendorOption#setVisible(boolean)}.
 */
@Test
public void testSetVisible() {
    List<VendorOptionInterface> veList = null;
    boolean valueOnly = true;
    FieldConfigVendorOption field = new FieldConfigVendorOption(new FieldConfigCommonData(Double.class, FieldIdEnum.NAME, "label", valueOnly), veList);
    boolean expectedValue = true;
    field.setVisible(expectedValue);
    field.createUI();
    field.setVisible(expectedValue);
    expectedValue = false;
    field.setVisible(expectedValue);
}
Also used : FieldConfigVendorOption(com.sldeditor.ui.detail.config.FieldConfigVendorOption) FieldConfigCommonData(com.sldeditor.ui.detail.config.FieldConfigCommonData) VendorOptionInterface(com.sldeditor.ui.detail.vendor.geoserver.VendorOptionInterface) Test(org.junit.Test)

Example 3 with VendorOptionInterface

use of com.sldeditor.ui.detail.vendor.geoserver.VendorOptionInterface in project sldeditor by robward-scisys.

the class FieldConfigVendorOptionTest method testSetEnabled.

/**
 * Test method for
 * {@link com.sldeditor.ui.detail.config.FieldConfigVendorOption#internal_setEnabled(boolean)}.
 * Test method for {@link com.sldeditor.ui.detail.config.FieldConfigVendorOption#isEnabled()}.
 * Test method for {@link com.sldeditor.ui.detail.config.FieldConfigVendorOption#createUI()}.
 */
@Test
public void testSetEnabled() {
    // Value only, no attribute/expression dropdown
    List<VendorOptionInterface> veList = null;
    boolean valueOnly = true;
    FieldConfigVendorOption field = new FieldConfigVendorOption(new FieldConfigCommonData(Double.class, FieldIdEnum.NAME, "label", valueOnly), veList);
    // Text field will not have been created
    boolean expectedValue = true;
    field.internal_setEnabled(expectedValue);
    assertTrue(field.isEnabled());
    // Create text field
    field.createUI();
    assertEquals(expectedValue, field.isEnabled());
    expectedValue = false;
    field.internal_setEnabled(expectedValue);
    assertTrue(field.isEnabled());
    // Has attribute/expression dropdown
    valueOnly = false;
    FieldConfigVendorOption field2 = new FieldConfigVendorOption(new FieldConfigCommonData(Double.class, FieldIdEnum.NAME, "label", valueOnly), veList);
    // Text field will not have been created
    expectedValue = true;
    field2.internal_setEnabled(expectedValue);
    assertTrue(field2.isEnabled());
    // Create text field
    field2.createUI();
    assertEquals(expectedValue, field2.isEnabled());
    expectedValue = false;
    field2.internal_setEnabled(expectedValue);
    assertTrue(field2.isEnabled());
}
Also used : FieldConfigVendorOption(com.sldeditor.ui.detail.config.FieldConfigVendorOption) FieldConfigCommonData(com.sldeditor.ui.detail.config.FieldConfigCommonData) VendorOptionInterface(com.sldeditor.ui.detail.vendor.geoserver.VendorOptionInterface) Test(org.junit.Test)

Example 4 with VendorOptionInterface

use of com.sldeditor.ui.detail.vendor.geoserver.VendorOptionInterface in project sldeditor by robward-scisys.

the class FieldConfigVendorOptionTest method testGenerateExpression.

/**
 * Test method for
 * {@link com.sldeditor.ui.detail.config.FieldConfigVendorOption#generateExpression()}. Test
 * method for {@link com.sldeditor.ui.detail.config.FieldConfigVendorOption#getStringValue()}.
 * Test method for
 * {@link com.sldeditor.ui.detail.config.FieldConfigVendorOption#populateExpression(java.lang.Object)}.
 */
@Test
public void testGenerateExpression() {
    boolean valueOnly = true;
    List<VendorOptionInterface> veList = null;
    FieldConfigVendorOption field = new FieldConfigVendorOption(new FieldConfigCommonData(Double.class, FieldIdEnum.NAME, "label", valueOnly), veList);
    assertNull(field.getStringValue());
    field.populateExpression(null);
}
Also used : FieldConfigVendorOption(com.sldeditor.ui.detail.config.FieldConfigVendorOption) FieldConfigCommonData(com.sldeditor.ui.detail.config.FieldConfigCommonData) VendorOptionInterface(com.sldeditor.ui.detail.vendor.geoserver.VendorOptionInterface) Test(org.junit.Test)

Example 5 with VendorOptionInterface

use of com.sldeditor.ui.detail.vendor.geoserver.VendorOptionInterface in project sldeditor by robward-scisys.

the class RasterSymbolizerDetails method createVendorOptionPanel.

/**
 * Creates the vendor option panel.
 *
 * @return the detail panel
 */
private void createVendorOptionPanel() {
    vendorOptionRasterFactory = new VendorOptionRasterFactory(getClass(), this);
    List<VendorOptionInterface> voList = vendorOptionRasterFactory.getVendorOptionList();
    if (voList != null) {
        for (VendorOptionInterface vendorOption : voList) {
            vendorOption.setParentPanel(this);
        }
    }
}
Also used : VendorOptionRasterFactory(com.sldeditor.ui.detail.vendor.geoserver.raster.VendorOptionRasterFactory) VendorOptionInterface(com.sldeditor.ui.detail.vendor.geoserver.VendorOptionInterface)

Aggregations

VendorOptionInterface (com.sldeditor.ui.detail.vendor.geoserver.VendorOptionInterface)16 Test (org.junit.Test)6 FieldConfigCommonData (com.sldeditor.ui.detail.config.FieldConfigCommonData)5 FieldConfigVendorOption (com.sldeditor.ui.detail.config.FieldConfigVendorOption)5 PopulateDetailsInterface (com.sldeditor.ui.iface.PopulateDetailsInterface)4 VersionData (com.sldeditor.common.vendoroption.VersionData)2 VendorOptionFillFactory (com.sldeditor.ui.detail.vendor.geoserver.fill.VendorOptionFillFactory)2 VendorOptionRasterFactory (com.sldeditor.ui.detail.vendor.geoserver.raster.VendorOptionRasterFactory)2 ArrayList (java.util.ArrayList)2 GeoServerVendorOption (com.sldeditor.common.vendoroption.GeoServerVendorOption)1 VendorOptionInfo (com.sldeditor.common.vendoroption.info.VendorOptionInfo)1 VendorOptionInfoPanel (com.sldeditor.common.vendoroption.info.VendorOptionInfoPanel)1 BasePanel (com.sldeditor.ui.detail.BasePanel)1 RasterSymbolizerDetails (com.sldeditor.ui.detail.RasterSymbolizerDetails)1 VendorOptionFactoryInterface (com.sldeditor.ui.detail.vendor.VendorOptionFactoryInterface)1 VendorOptionFTSFactory (com.sldeditor.ui.detail.vendor.geoserver.featuretypestyle.VendorOptionFTSFactory)1 VendorOptionTextFactory (com.sldeditor.ui.detail.vendor.geoserver.text.VendorOptionTextFactory)1