Search in sources :

Example 16 with LegendOptionData

use of com.sldeditor.ui.legend.option.LegendOptionData in project sldeditor by robward-scisys.

the class LegendOptionDataTest method testImageSize.

/**
 * Test method for {@link com.sldeditor.ui.legend.option.LegendOptionData#getImageSize()}.
 * Test method for {@link com.sldeditor.ui.legend.option.LegendOptionData#setImageSize(int)}.
 */
@Test
public void testImageSize() {
    LegendOptionData data = new LegendOptionData();
    int imageSize = 76;
    data.setImageSize(imageSize);
    assertEquals(imageSize, data.getImageSize());
}
Also used : LegendOptionData(com.sldeditor.ui.legend.option.LegendOptionData) Test(org.junit.Test)

Example 17 with LegendOptionData

use of com.sldeditor.ui.legend.option.LegendOptionData in project sldeditor by robward-scisys.

the class LegendOptionDataTest method testShowTitle.

/**
 * Test method for {@link com.sldeditor.ui.legend.option.LegendOptionData#isShowTitle()}.
 * Test method for {@link com.sldeditor.ui.legend.option.LegendOptionData#setShowTitle(boolean)}.
 */
@Test
public void testShowTitle() {
    LegendOptionData data = new LegendOptionData();
    data.setShowTitle(true);
    assertTrue(data.isShowTitle());
    data.setShowTitle(false);
    assertFalse(data.isShowTitle());
}
Also used : LegendOptionData(com.sldeditor.ui.legend.option.LegendOptionData) Test(org.junit.Test)

Example 18 with LegendOptionData

use of com.sldeditor.ui.legend.option.LegendOptionData in project sldeditor by robward-scisys.

the class LegendOptionDataTest method testBorder.

/**
 * Test method for {@link com.sldeditor.ui.legend.option.LegendOptionData#isBorder()}.
 * Test method for {@link com.sldeditor.ui.legend.option.LegendOptionData#setBorder(boolean)}.
 */
@Test
public void testBorder() {
    LegendOptionData data = new LegendOptionData();
    data.setBorder(true);
    assertTrue(data.isBorder());
    data.setBorder(false);
    assertFalse(data.isBorder());
}
Also used : LegendOptionData(com.sldeditor.ui.legend.option.LegendOptionData) Test(org.junit.Test)

Example 19 with LegendOptionData

use of com.sldeditor.ui.legend.option.LegendOptionData in project sldeditor by robward-scisys.

the class LegendOptionDataTest method testMaintainAspectRatio.

/**
 * Test method for {@link com.sldeditor.ui.legend.option.LegendOptionData#isMaintainAspectRatio()}.
 * Test method for {@link com.sldeditor.ui.legend.option.LegendOptionData#setMaintainAspectRatio(boolean)}.
 */
@Test
public void testMaintainAspectRatio() {
    LegendOptionData data = new LegendOptionData();
    int expectedWidth = 10;
    int expectedheight = 20;
    data.setMaintainAspectRatio(false);
    data.setImageWidth(expectedWidth);
    data.setImageHeight(expectedheight);
    assertFalse(data.isMaintainAspectRatio());
    assertEquals(expectedWidth, data.getImageWidth());
    assertEquals(expectedheight, data.getImageHeight());
    expectedWidth++;
    expectedheight++;
    data.setImageWidth(expectedWidth);
    data.setImageHeight(expectedheight);
    assertEquals(expectedWidth, data.getImageWidth());
    assertEquals(expectedheight, data.getImageHeight());
    data.setMaintainAspectRatio(true);
    assertTrue(data.isMaintainAspectRatio());
    data.setImageWidth(expectedWidth);
    assertEquals(expectedWidth, data.getImageWidth());
    assertEquals(expectedWidth, data.getImageHeight());
    data.setImageWidth(expectedheight);
    assertEquals(expectedheight, data.getImageWidth());
    assertEquals(expectedheight, data.getImageHeight());
}
Also used : LegendOptionData(com.sldeditor.ui.legend.option.LegendOptionData) Test(org.junit.Test)

Example 20 with LegendOptionData

use of com.sldeditor.ui.legend.option.LegendOptionData in project sldeditor by robward-scisys.

the class LegendOptionDataTest method testBandInformation.

/**
 * Test method for {@link com.sldeditor.ui.legend.option.LegendOptionData#isBandInformation()}.
 * Test method for {@link com.sldeditor.ui.legend.option.LegendOptionData#setBandInformation(boolean)}.
 */
@Test
public void testBandInformation() {
    LegendOptionData data = new LegendOptionData();
    data.setBandInformation(true);
    assertTrue(data.isBandInformation());
    data.setBandInformation(false);
    assertFalse(data.isBandInformation());
}
Also used : LegendOptionData(com.sldeditor.ui.legend.option.LegendOptionData) Test(org.junit.Test)

Aggregations

LegendOptionData (com.sldeditor.ui.legend.option.LegendOptionData)24 Test (org.junit.Test)21 Color (java.awt.Color)3 IOException (java.io.IOException)3 DocumentBuilder (javax.xml.parsers.DocumentBuilder)3 DocumentBuilderFactory (javax.xml.parsers.DocumentBuilderFactory)3 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)3 Document (org.w3c.dom.Document)3 DataSourcePropertiesInterface (com.sldeditor.common.DataSourcePropertiesInterface)2 SLDData (com.sldeditor.common.data.SLDData)2 VersionData (com.sldeditor.common.vendoroption.VersionData)2 SLDEditorFile (com.sldeditor.datasource.SLDEditorFile)2 EnvVar (com.sldeditor.filter.v2.envvar.EnvVar)2 Font (java.awt.Font)2 File (java.io.File)2 StyledLayerDescriptor (org.geotools.styling.StyledLayerDescriptor)2 Element (org.w3c.dom.Element)2 SLDDataInterface (com.sldeditor.common.SLDDataInterface)1 StyleWrapper (com.sldeditor.common.data.StyleWrapper)1 VendorOptionVersion (com.sldeditor.common.vendoroption.VendorOptionVersion)1