use of com.sldeditor.ui.detail.config.FieldConfigBase in project sldeditor by robward-scisys.
the class FieldConfigWKT method populateColour.
/**
* Populate colour.
*
* @param fieldConfigManager the field config manager
* @param fieldConfig the field config
* @param expColour the exp colour
* @param expOpacity the exp opacity
*/
private void populateColour(GraphicPanelFieldManager fieldConfigManager, ColourFieldConfig fieldConfig, Expression expColour, Expression expOpacity) {
FieldConfigBase field = fieldConfigManager.get(fieldConfig.getColour());
if (field != null) {
field.populate(expColour);
}
field = fieldConfigManager.get(fieldConfig.getOpacity());
if (field != null) {
field.populate(expOpacity);
}
}
use of com.sldeditor.ui.detail.config.FieldConfigBase in project sldeditor by robward-scisys.
the class FieldConfigMarker method setSolidFill.
/**
* Sets the solid fill.
*
* @param fieldConfigManager the field config manager
* @param expFillColour the new solid fill
* @param expFillColourOpacity the expression fill colour opacity
*/
public void setSolidFill(GraphicPanelFieldManager fieldConfigManager, Expression expFillColour, Expression expFillColourOpacity) {
if (fieldConfigManager != null) {
FieldConfigBase field = fieldConfigManager.get(fillFieldConfig.getColour());
if (field != null) {
field.populate(expFillColour);
}
Class<?> panelId = getCommonData().getPanelId();
GroupConfigInterface fillGroup = fieldConfigManager.getGroup(panelId, GroupIdEnum.FILL);
if (fillGroup != null) {
fillGroup.enable(expFillColour != null);
}
// Opacity
field = fieldConfigManager.get(fillFieldConfig.getOpacity());
if (field != null) {
field.populate(expFillColourOpacity);
}
}
}
use of com.sldeditor.ui.detail.config.FieldConfigBase in project sldeditor by robward-scisys.
the class FieldConfigMarker method getFill.
/**
* Gets the fill.
*
* @param graphicFill the graphic fill
* @param fieldConfigManager the field config manager
* @return the fill
*/
@Override
public Fill getFill(GraphicFill graphicFill, GraphicPanelFieldManager fieldConfigManager) {
if (fieldConfigManager == null) {
return null;
}
Expression fillColour = null;
FieldConfigBase field = fieldConfigManager.get(fillFieldConfig.getColour());
if (field != null) {
if ((field instanceof FieldConfigColour) && field.isEnabled()) {
fillColour = ((FieldConfigColour) field).getColourExpression();
}
}
Expression fillColourOpacity = null;
field = fieldConfigManager.get(fillFieldConfig.getOpacity());
if (field != null) {
fillColourOpacity = field.getExpression();
}
GraphicFill _graphicFill = null;
Expression _fillColour = fillColour;
Expression _fillColourOpacity = fillColourOpacity;
if (graphicFill != null) {
List<GraphicalSymbol> symbolList = graphicFill.graphicalSymbols();
if ((symbolList != null) && (!symbolList.isEmpty())) {
GraphicalSymbol symbol = symbolList.get(0);
Mark mark = (Mark) symbol;
if (mark.getWellKnownName() != null) {
_graphicFill = graphicFill;
_fillColour = null;
_fillColourOpacity = null;
}
}
}
Fill fill = getStyleFactory().fill(_graphicFill, _fillColour, _fillColourOpacity);
return fill;
}
use of com.sldeditor.ui.detail.config.FieldConfigBase in project sldeditor by robward-scisys.
the class SymbolTypeFactory method internal_populate.
/**
* Internal populate.
*
* @param basePanel the base panel
* @param multiOptionSelected the multi option selected
* @param updateSymbol the update symbol
* @param selectionField the selection field
* @param fieldConfigManager the field config manager
*/
private void internal_populate(BasePanel basePanel, MultiOptionSelectedInterface multiOptionSelected, UpdateSymbolInterface updateSymbol, FieldIdEnum selectionField, GraphicPanelFieldManager fieldConfigManager) {
List<ValueComboBoxDataGroup> combinedSymbolList = new ArrayList<ValueComboBoxDataGroup>();
/**
* Populate symbol type list. Given a panel details class iterate over all the field panels
* asking them to populate the symbol type list.
*/
for (FieldState panel : symbolTypeFieldList) {
panel.populateSymbolList(basePanel.getClass(), combinedSymbolList);
}
FieldConfigBase field = fieldConfigManager.get(selectionField);
this.symbolTypeField = (FieldConfigSymbolType) field;
symbolTypeField.populate(multiOptionSelected, combinedSymbolList);
for (FieldState panel : symbolTypeFieldList) {
panel.setUpdateSymbolListener(updateSymbol);
classMap.put(panel.getClass(), panel);
this.symbolTypeField.addField(panel);
basePanel.updateFieldConfig(panel.getBasePanel());
// Transfer all the fields in the child panels into this panel
Map<FieldIdEnum, FieldConfigBase> map = panel.getFieldList(fieldConfigManager);
if (map != null) {
for (FieldIdEnum panelField : map.keySet()) {
fieldConfigManager.add(panelField, map.get(panelField));
}
}
}
}
use of com.sldeditor.ui.detail.config.FieldConfigBase in project sldeditor by robward-scisys.
the class ExternalGraphicDetails method createUI.
/**
* Creates the ui.
*/
private void createUI() {
readConfigFileNoScrollPane(null, getClass(), this, PANEL_CONFIG);
registerForTextFieldButton(FieldIdEnum.EXTERNAL_GRAPHIC, this);
for (FieldConfigBase fieldConfig : this.getFieldConfigList()) {
CurrentFieldState fieldState = fieldConfig.getFieldState();
fieldState.setFieldEnabled(true);
fieldConfig.setFieldState(fieldState);
}
}
Aggregations