use of com.sldeditor.common.undo.UndoEvent in project sldeditor by robward-scisys.
the class ExternalGraphicDetails method setValue.
/**
* Sets the value.
*
* @param filename the new value
*/
public void setValue(String filename) {
if (filename != null) {
externalURL = parseString(filename);
UndoManager.getInstance().addUndoEvent(new UndoEvent(this, FieldIdEnum.EXTERNAL_GRAPHIC, oldValueObj, externalURL));
oldValueObj = externalURL;
populateExpression(filename);
}
}
use of com.sldeditor.common.undo.UndoEvent in project sldeditor by robward-scisys.
the class ExternalGraphicDetails method updateSymbol.
/**
* Update symbol.
*/
private void updateSymbol() {
if (!Controller.getInstance().isPopulating()) {
Expression expression = fieldConfigVisitor.getExpression(FieldIdEnum.EXTERNAL_GRAPHIC);
if (!lastURLValue.equals(expression.toString())) {
externalURL = parseString(expression.toString());
lastURLValue = expression.toString();
UndoManager.getInstance().addUndoEvent(new UndoEvent(this, FieldIdEnum.EXTERNAL_GRAPHIC, oldValueObj, externalURL));
oldValueObj = externalURL;
}
if (parentObj != null) {
parentObj.externalGraphicValueUpdated();
}
}
}
use of com.sldeditor.common.undo.UndoEvent 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.common.undo.UndoEvent in project sldeditor by robward-scisys.
the class FieldConfigTimePeriod method populateField.
/**
* Populate field.
*
* @param value the value
*/
@Override
public void populateField(TimePeriod value) {
if (value != null) {
populateDuration(start, value.getStart());
populateDuration(end, value.getEnd());
UndoManager.getInstance().addUndoEvent(new UndoEvent(this, getFieldId(), oldValueObj, value));
oldValueObj = value;
valueUpdated();
}
}
use of com.sldeditor.common.undo.UndoEvent in project sldeditor by robward-scisys.
the class FieldConfigDate method populateField.
/**
* Populate field.
*
* @param value the value
*/
@Override
public void populateField(Date value) {
if ((dateModel != null) && (timePicker != null) && (value != null)) {
dateModel.setValue(value);
timePicker.setValue(value);
UndoManager.getInstance().addUndoEvent(new UndoEvent(this, getFieldId(), oldValueObj, value));
oldValueObj = value;
valueUpdated();
}
}
Aggregations