use of com.sldeditor.common.undo.UndoEvent in project sldeditor by robward-scisys.
the class FieldConfigDouble method createUI.
/**
* Creates the ui.
*/
/*
* (non-Javadoc)
*
* @see com.sldeditor.ui.detail.config.FieldConfigBase#createUI()
*/
@Override
public void createUI() {
if (spinner == null) {
final UndoActionInterface parentObj = this;
int xPos = getXPos();
FieldPanel fieldPanel = createFieldPanel(xPos, getLabel());
if (configurationSet) {
spinner = new DecimalSpinner(minValue, maxValue, stepSize, noOfDecimalPlaces);
} else {
spinner = new DecimalSpinner();
}
spinner.setBounds(xPos + BasePanel.WIDGET_X_START, 0, BasePanel.WIDGET_STANDARD_WIDTH, BasePanel.WIDGET_HEIGHT);
fieldPanel.add(spinner);
if (!isValueOnly()) {
setAttributeSelectionPanel(fieldPanel.internalCreateAttrButton(Double.class, this, isRasterSymbol()));
}
spinner.registerObserver(new SpinnerNotifyInterface() {
@Override
public void notify(double oldValue, double newValue) {
Double oldValueObj = Double.valueOf(oldValue);
Double newValueObj = Double.valueOf(newValue);
UndoManager.getInstance().addUndoEvent(new UndoEvent(parentObj, getFieldId(), oldValueObj, newValueObj));
valueUpdated();
}
});
}
}
use of com.sldeditor.common.undo.UndoEvent in project sldeditor by robward-scisys.
the class FieldConfigGeometryField method createUI.
/**
* Creates the ui.
*/
/*
* (non-Javadoc)
*
* @see com.sldeditor.ui.detail.config.FieldConfigBase#createUI()
*/
@Override
public void createUI() {
if (attributeComboBox == null) {
final UndoActionInterface parentObj = this;
int xPos = getXPos();
FieldPanel fieldPanel = createFieldPanel(xPos, getLabel());
attributeComboBox = new JComboBox<String>();
attributeComboBox.setBounds(xPos + BasePanel.WIDGET_X_START, 0, BasePanel.WIDGET_STANDARD_WIDTH, BasePanel.WIDGET_HEIGHT);
fieldPanel.add(attributeComboBox);
populateAttributeComboBox();
if (!isValueOnly()) {
setAttributeSelectionPanel(fieldPanel.internalCreateAttrButton(Geometry.class, this, true));
}
attributeComboBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (isAttributeComboBoxPopulated()) {
String newValueObj = (String) attributeComboBox.getSelectedItem();
UndoManager.getInstance().addUndoEvent(new UndoEvent(parentObj, "DataSourceAttribute", oldValueObj, newValueObj));
valueUpdated();
}
}
});
}
}
use of com.sldeditor.common.undo.UndoEvent in project sldeditor by robward-scisys.
the class FieldConfigFeatureTypeConstraint method populateField.
/**
* Populate field.
*
* @param valueList the value list
*/
@Override
public void populateField(List<FeatureTypeConstraint> valueList) {
if (filterModel != null) {
if (valueList != null) {
filterModel.populate(valueList);
UndoManager.getInstance().addUndoEvent(new UndoEvent(this, getFieldId(), oldValueObj, valueList));
oldValueObj = valueList;
valueUpdated();
}
}
}
use of com.sldeditor.common.undo.UndoEvent in project sldeditor by robward-scisys.
the class FieldConfigFeatureTypeConstraint method featureTypeConstraintUpdated.
/*
* (non-Javadoc)
*
* @see com.sldeditor.ui.detail.config.featuretypeconstraint.FeatureTypeConstraintModelUpdateInterface#featureTypeConstraintUpdated()
*/
@Override
public void featureTypeConstraintUpdated() {
List<FeatureTypeConstraint> ftc = filterModel.getFeatureTypeConstraint();
UndoManager.getInstance().addUndoEvent(new UndoEvent(this, getFieldId(), oldValueObj, ftc));
oldValueObj = ftc;
valueUpdated();
}
use of com.sldeditor.common.undo.UndoEvent in project sldeditor by robward-scisys.
the class WKTDetails method buttonPressed.
/**
* Button pressed.
*
* @param buttonExternal the button external
*/
@Override
public void buttonPressed(Component buttonExternal) {
WKTDialog dlg = new WKTDialog();
if (dlg.showDialog(fieldConfigVisitor.getText(FieldIdEnum.WKT))) {
String wktString = dlg.getWKTString();
fieldConfigVisitor.populateTextField(FieldIdEnum.WKT, wktString);
UndoManager.getInstance().addUndoEvent(new UndoEvent(this, FieldIdEnum.WKT, oldValueObj, wktString));
oldValueObj = wktString;
EventQueue.invokeLater(new Runnable() {
public void run() {
updateSymbol();
}
});
}
}
Aggregations