updateSkyRadioButtons(controller);
// Brightness label and slider bound to LIGHT_COLOR controller property
this.brightnessLabel = new JLabel(SwingTools.getLocalizedLabelText(preferences,
Home3DAttributesPanel.class, "brightnessLabel.text"));
this.brightnessSlider = new JSlider(0, 255);
JLabel darkLabel = new JLabel(preferences.getLocalizedString(
Home3DAttributesPanel.class, "darkLabel.text"));
JLabel brightLabel = new JLabel(preferences.getLocalizedString(
Home3DAttributesPanel.class, "brightLabel.text"));
Dictionary<Integer,JComponent> brightnessSliderLabelTable = new Hashtable<Integer,JComponent>();
brightnessSliderLabelTable.put(0, darkLabel);
brightnessSliderLabelTable.put(255, brightLabel);
this.brightnessSlider.setLabelTable(brightnessSliderLabelTable);
this.brightnessSlider.setPaintLabels(true);
this.brightnessSlider.setPaintTicks(true);
this.brightnessSlider.setMajorTickSpacing(16);
this.brightnessSlider.setValue(controller.getLightColor() & 0xFF);
this.brightnessSlider.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent ev) {
int brightness = brightnessSlider.getValue();
controller.setLightColor((brightness << 16) + (brightness << 8) + brightness);
}
});
controller.addPropertyChangeListener(Home3DAttributesController.Property.LIGHT_COLOR,
new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent ev) {
brightnessSlider.setValue(controller.getLightColor() & 0xFF);
}
});
// Walls transparency label and slider bound to WALLS_ALPHA controller property
this.wallsTransparencyLabel = new JLabel(SwingTools.getLocalizedLabelText(preferences,
Home3DAttributesPanel.class, "wallsTransparencyLabel.text"));
this.wallsTransparencySlider = new JSlider(0, 255);
JLabel opaqueLabel = new JLabel(preferences.getLocalizedString(
Home3DAttributesPanel.class, "opaqueLabel.text"));
JLabel invisibleLabel = new JLabel(preferences.getLocalizedString(
Home3DAttributesPanel.class, "invisibleLabel.text"));
Dictionary<Integer,JComponent> wallsTransparencySliderLabelTable = new Hashtable<Integer,JComponent>();