1 23 package info.monitorenter.gui.chart.events; 24 25 import info.monitorenter.gui.chart.IAxis; 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 52 public class AxisActionSetGrid extends AAxisAction { 53 54 57 public void propertyChange(final PropertyChangeEvent evt) { 58 String property = evt.getPropertyName(); 59 if (property.equals(IAxis.PROPERTY_PAINTGRID)) { 60 this.firePropertyChange(PropertyChangeCheckBoxMenuItem.PROPERTY_SELECTED, evt.getOldValue(), 61 evt.getNewValue()); 62 } 63 } 64 65 81 public AxisActionSetGrid(final IAxis axis, final String description) { 82 super(axis, description); 83 axis.addPropertyChangeListener(IAxis.PROPERTY_PAINTGRID, this); 84 } 85 86 89 public void actionPerformed(final ActionEvent e) { 90 JCheckBoxMenuItem item = (JCheckBoxMenuItem ) e.getSource(); 91 boolean state = item.getState(); 92 this.m_axis.setPaintGrid(state); 93 } 94 } 95 | Popular Tags |