1 23 package info.monitorenter.gui.chart.events; 24 25 import info.monitorenter.gui.chart.Chart2D; 26 import info.monitorenter.gui.chart.layout.LayoutFactory.PropertyChangeCheckBoxMenuItem; 27 28 import java.awt.event.ActionEvent ; 29 import java.beans.PropertyChangeEvent ; 30 31 import javax.swing.JCheckBoxMenuItem ; 32 33 57 public class Chart2DActionSetPaintLabels extends AChart2DAction { 58 59 75 public Chart2DActionSetPaintLabels(final Chart2D chart, final String description) { 76 super(chart, description); 77 chart.addPropertyChangeListener(Chart2D.PROPERTY_PAINTLABELS, this); 78 } 79 80 83 public void actionPerformed(final ActionEvent e) { 84 JCheckBoxMenuItem item = (JCheckBoxMenuItem ) e.getSource(); 85 boolean state = item.getState(); 86 this.m_chart.setPaintLabels(state); 87 } 88 89 92 public void propertyChange(final PropertyChangeEvent evt) { 93 String property = evt.getPropertyName(); 94 if (property.equals(Chart2D.PROPERTY_PAINTLABELS)) { 95 this.firePropertyChange(PropertyChangeCheckBoxMenuItem.PROPERTY_SELECTED, evt.getOldValue(), 96 evt.getNewValue()); 97 } 98 } 99 } 100 | Popular Tags |