in src/main/java/org/apache/log4j/chainsaw/ApplicationPreferenceModelPanel.java [373:442]
private void setupListeners() {
m_globalConfiguration.addEventListener(ConfigurationEvent.SET_PROPERTY,
evt -> {
if( evt.getPropertyName().equals( "showSplash" ) ){
boolean value = (Boolean) evt.getPropertyValue();
showSplash.setSelected(value);
}
});
m_globalConfiguration.addEventListener(ConfigurationEvent.SET_PROPERTY,
evt -> {
if( evt.getPropertyName().equals( "responsiveness" ) ){
int value = (Integer) evt.getPropertyValue();
if (value >= 1000) {
int newValue = (value - 750) / 1000;
logger.debug(
"Adjusting old Responsiveness value from " + value + " to "
+ newValue);
value = newValue;
}
responsiveSlider.setValue(value);
}
});
m_globalConfiguration.addEventListener(ConfigurationEvent.SET_PROPERTY,
evt -> {
if( evt.getPropertyName().equals( "toolTipDisplayMillis" ) ){
toolTipDisplayMillis.setText(evt.getPropertyValue().toString());
}
});
m_globalConfiguration.addEventListener(ConfigurationEvent.SET_PROPERTY,
evt -> {
if( evt.getPropertyName().equals( "cyclicBufferSize" ) ){
cyclicBufferSize.setText(evt.getPropertyValue().toString());
}
});
m_globalConfiguration.addEventListener(ConfigurationEvent.SET_PROPERTY,
evt -> {
if( evt.getPropertyName().equals( "confirmExit" ) ){
boolean value = (Boolean) evt.getPropertyValue();
confirmExit.setSelected(value);
}
});
showSplash.addActionListener(e -> m_globalConfiguration.setProperty("showSplash", showSplash.isSelected()));
responsiveSlider.getModel().addChangeListener(
e -> {
if (responsiveSlider.getValueIsAdjusting()) {
/**
* We'll wait until it stops.
*/
} else {
int value = responsiveSlider.getValue();
if (value == 0) {
value = 1;
}
logger.debug("Adjust responsiveness to " + value);
m_globalConfiguration.setProperty("responsiveness", value);
}
});
confirmExit.addActionListener(
e -> m_globalConfiguration.setProperty( "confirmExit",
confirmExit.isSelected()));
}