use of com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF in project sldeditor by robward-scisys.
the class FieldConfigTTFTest method testSetValue.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF#setValue(com.sldeditor.ui.detail.GraphicPanelFieldManager, com.sldeditor.ui.detail.config.FieldConfigSymbolType, org.opengis.style.GraphicalSymbol)}.
*/
@Test
public void testSetValue() {
GraphicPanelFieldManager fieldConfigManager = null;
Class<?> panelId = PointFillDetails.class;
fieldConfigManager = new GraphicPanelFieldManager(panelId);
FieldIdEnum colourFieldId = FieldIdEnum.FILL_COLOUR;
FieldConfigColour colourField = new FieldConfigColour(new FieldConfigCommonData(panelId, colourFieldId, "", false));
colourField.createUI();
String expectedColourValue = "#012345";
colourField.setTestValue(null, expectedColourValue);
fieldConfigManager.add(colourFieldId, colourField);
ColourFieldConfig fillConfig = new ColourFieldConfig(GroupIdEnum.FILL, FieldIdEnum.FILL_COLOUR, FieldIdEnum.OVERALL_OPACITY, FieldIdEnum.STROKE_WIDTH);
ColourFieldConfig strokeConfig = new ColourFieldConfig(GroupIdEnum.STROKE, FieldIdEnum.STROKE_STROKE_COLOUR, FieldIdEnum.OVERALL_OPACITY, FieldIdEnum.STROKE_FILL_WIDTH);
boolean valueOnly = true;
FieldConfigTTF field = new FieldConfigTTF(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), fillConfig, strokeConfig, null);
field.setValue(null, null, null, null, null);
field.setValue(null, fieldConfigManager, null, null, null);
field.createUI();
StyleBuilder styleBuilder = new StyleBuilder();
Mark marker = styleBuilder.createMark("star", Color.green, Color.black, 2.0);
field.setValue(null, null, null, null, marker);
field.setValue(null, fieldConfigManager, null, null, marker);
}
use of com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF in project sldeditor by robward-scisys.
the class FieldConfigTTFTest method testAccept.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF#accept(org.opengis.style.GraphicalSymbol)}.
*/
@Test
public void testAccept() {
boolean valueOnly = true;
FieldConfigTTF field = new FieldConfigTTF(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), null, null, null);
assertFalse(field.accept(null));
StyleBuilder styleBuilder = new StyleBuilder();
ExternalGraphicImpl externalGraphic = (ExternalGraphicImpl) styleBuilder.createExternalGraphic("test.tmp", "png");
assertFalse(field.accept(externalGraphic));
Mark marker1 = styleBuilder.createMark("triangle");
assertFalse(field.accept(marker1));
Mark marker2 = styleBuilder.createMark("ttf://Arial");
assertTrue(field.accept(marker2));
}
use of com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF in project sldeditor by robward-scisys.
the class FieldConfigTTFTest method testGetBasePanel.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF#getBasePanel()}.
*/
@Test
public void testGetBasePanel() {
boolean valueOnly = true;
FieldConfigTTF field = new FieldConfigTTF(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), null, null, null);
assertNull(field.getBasePanel());
}
use of com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF in project sldeditor by robward-scisys.
the class FieldConfigTTFTest method testJustSelected.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF#justSelected()}.
*/
@Test
public void testJustSelected() {
boolean valueOnly = true;
FieldConfigTTF field = new FieldConfigTTF(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), null, null, null);
field.justSelected();
}
use of com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF in project sldeditor by robward-scisys.
the class FieldConfigTTFTest method testGetSymbolClass.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF#getSymbolClass()}.
*/
@Test
public void testGetSymbolClass() {
boolean valueOnly = true;
FieldConfigTTF field = new FieldConfigTTF(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), null, null, null);
assertEquals(ExternalGraphicImpl.class, field.getSymbolClass());
}
Aggregations