use of com.sldeditor.ui.widgets.FieldPanel in project sldeditor by robward-scisys.
the class FieldConfigFilename method createUI.
/**
* Creates the ui.
*/
/*
* (non-Javadoc)
*
* @see com.sldeditor.ui.detail.config.FieldConfigBase#createUI()
*/
@Override
public void createUI() {
if (externalGraphicPanel == null) {
FieldPanel fieldPanel = createFieldPanel(0, "");
fieldPanel.setLayout(new BorderLayout());
externalGraphicPanel = new ExternalGraphicDetails(this);
fieldPanel.add(externalGraphicPanel, BorderLayout.CENTER);
Dimension panelSize = externalGraphicPanel.getPanelSize();
fieldPanel.setPreferredSize(panelSize);
}
}
use of com.sldeditor.ui.widgets.FieldPanel in project sldeditor by robward-scisys.
the class MultiOptionGroup method populateOptionGroup.
/**
* Populate option group.
*
* @param fieldConfigManager the field config manager
* @param optionBox the option box
* @param groupConfigList the group config list
*/
private void populateOptionGroup(GraphicPanelFieldManager fieldConfigManager, Box optionBox, List<GroupConfigInterface> groupConfigList) {
for (GroupConfigInterface groupConfigI : groupConfigList) {
groupConfigI.createTitle(optionBox, null);
if (groupConfigI instanceof GroupConfig) {
GroupConfig groupConfig = (GroupConfig) groupConfigI;
for (FieldConfigBase field : groupConfig.getFieldConfigList()) {
field.createUI();
field.revertToDefaultValue();
FieldPanel component = field.getPanel();
optionBox.add(component);
fieldConfigManager.addField(field);
optionFieldList.add(field);
if (field instanceof FieldConfigVendorOption) {
((FieldConfigVendorOption) field).addToOptionBox(optionBox);
}
}
populateOptionGroup(fieldConfigManager, optionBox, groupConfig.getSubGroupList());
} else if (groupConfigI instanceof MultiOptionGroup) {
MultiOptionGroup multiOptionGroupConfig = (MultiOptionGroup) groupConfigI;
fieldConfigManager.addMultiOptionGroup(multiOptionGroupConfig);
multiOptionGroupConfig.createUI(fieldConfigManager, optionBox, parent, this.panelId);
}
}
}
use of com.sldeditor.ui.widgets.FieldPanel in project sldeditor by robward-scisys.
the class FieldConfigRange method createUI.
/**
* Creates the ui.
*/
/*
* (non-Javadoc)
*
* @see com.sldeditor.ui.detail.config.FieldConfigBase#createUI()
*/
@Override
public void createUI() {
if (startRange.spinner == null) {
int xPos = getXPos();
FieldPanel fieldPanel = createFieldPanel(xPos, "");
createRow(fieldPanel, xPos, 0, startRange, Localisation.getField(FieldConfigBase.class, "FieldConfigRange.minValue"));
createRow(fieldPanel, xPos, BasePanel.WIDGET_HEIGHT, endRange, Localisation.getField(FieldConfigBase.class, "FieldConfigRange.maxValue"));
Dimension preferredSize = new Dimension((int) fieldPanel.getPreferredSize().getWidth(), endRange.spinner.getY() + endRange.spinner.getHeight());
fieldPanel.setPreferredSize(preferredSize);
revertToDefaultValue();
}
}
use of com.sldeditor.ui.widgets.FieldPanel in project sldeditor by robward-scisys.
the class FieldConfigSlider method createUI.
/**
* Creates the ui.
*/
/*
* (non-Javadoc)
*
* @see com.sldeditor.ui.detail.config.FieldConfigBase#createUI()
*/
@Override
public void createUI() {
if (slider == null) {
final UndoActionInterface parentObj = this;
int xPos = getXPos();
FieldPanel fieldPanel = createFieldPanel(xPos, getLabel());
slider = new JSlider();
slider.setBounds(xPos + BasePanel.WIDGET_X_START, 0, BasePanel.WIDGET_STANDARD_WIDTH, BasePanel.WIDGET_HEIGHT);
fieldPanel.add(slider);
slider.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
JSlider source = (JSlider) e.getSource();
Integer newValueObj = (int) source.getValue();
UndoManager.getInstance().addUndoEvent(new UndoEvent(parentObj, getFieldId(), oldValueObj, newValueObj));
oldValueObj = newValueObj;
valueUpdated();
}
});
if (!isValueOnly()) {
setAttributeSelectionPanel(fieldPanel.internalCreateAttrButton(Double.class, this, isRasterSymbol()));
}
}
}
use of com.sldeditor.ui.widgets.FieldPanel in project sldeditor by robward-scisys.
the class FieldConfigDate method createUI.
/**
* Creates the ui.
*/
/*
* (non-Javadoc)
*
* @see com.sldeditor.ui.detail.config.FieldConfigBase#createUI()
*/
@Override
public void createUI() {
if (datePicker == null) {
int xPos = getXPos();
FieldPanel fieldPanel = createFieldPanel(xPos, getLabel());
JDatePanelImpl datePanel = new JDatePanelImpl(dateModel);
datePicker = new JDatePickerImpl(datePanel);
datePicker.setBounds(xPos + BasePanel.WIDGET_X_START, 0, BasePanel.WIDGET_STANDARD_WIDTH, BasePanel.WIDGET_HEIGHT);
fieldPanel.add(datePicker);
dateModel.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
valueUpdated();
}
});
// Time picker
SpinnerDateModel model = new SpinnerDateModel();
Calendar calendar = Calendar.getInstance();
model.setValue(calendar.getTime());
timePicker = new JSpinner(model);
timePicker.setBounds(datePicker.getX() + datePicker.getWidth() + 10, 0, BasePanel.WIDGET_STANDARD_WIDTH, BasePanel.WIDGET_HEIGHT);
timePicker.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
valueUpdated();
}
});
fieldPanel.add(timePicker);
timeEditor = new JSpinner.DateEditor(timePicker, "HH:mm:ss");
timePicker.setEditor(timeEditor);
DateFormatter formatter = (DateFormatter) timeEditor.getTextField().getFormatter();
formatter.setAllowsInvalid(false);
formatter.setOverwriteMode(true);
if (!isValueOnly()) {
setAttributeSelectionPanel(fieldPanel.internalCreateAttrButton(Double.class, this, isRasterSymbol()));
}
}
}
Aggregations