use of com.sldeditor.ui.iface.ColourNotifyInterface in project sldeditor by robward-scisys.
the class ColourButton method notifyListeners.
/**
* Notify listeners.
*/
public void notifyListeners() {
String colourString = getColourString();
double opacity = getColourOpacity();
for (ColourNotifyInterface observer : observers) {
observer.notify(colourString, opacity);
}
}
use of com.sldeditor.ui.iface.ColourNotifyInterface in project sldeditor by robward-scisys.
the class FieldConfigColour method createUI.
/**
* Creates the ui.
*/
/*
* (non-Javadoc)
*
* @see com.sldeditor.ui.detail.config.FieldConfigBase#createUI()
*/
@Override
public void createUI() {
if (colourButton == null) {
final UndoActionInterface parentObj = this;
int xPos = getXPos();
FieldPanel fieldPanel = createFieldPanel(xPos, getLabel());
colourButton = new ColourButton();
colourButton.setBounds(xPos + BasePanel.WIDGET_X_START, 0, BasePanel.WIDGET_STANDARD_WIDTH, BasePanel.WIDGET_HEIGHT);
fieldPanel.add(colourButton);
if (!isValueOnly()) {
setAttributeSelectionPanel(fieldPanel.internalCreateAttrButton(String.class, this, isRasterSymbol()));
}
colourButton.registerObserver(new ColourNotifyInterface() {
@Override
public void notify(String colourString, double opacity) {
Color newValueObj = colourButton.getColour();
UndoManager.getInstance().addUndoEvent(new UndoEvent(parentObj, getFieldId(), oldValueObj, newValueObj));
oldValueObj = newValueObj;
valueUpdated();
}
});
}
}
Aggregations