diff --git a/src/org/ntlab/actions/AutoTrackingAction.java b/src/org/ntlab/actions/AutoTrackingAction.java new file mode 100644 index 0000000..86c3f27 --- /dev/null +++ b/src/org/ntlab/actions/AutoTrackingAction.java @@ -0,0 +1,31 @@ +package org.ntlab.actions; + +import java.awt.event.ActionEvent; + +import javax.swing.JCheckBox; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; + +import org.ntlab.deltaViewer.MagnetRONViewer; + +public class AutoTrackingAction extends AbstractViewerAction implements ChangeListener { + + private static final long serialVersionUID = -4780429455781975464L; + + public AutoTrackingAction(MagnetRONViewer viewer) { + super("Auto Tracking", viewer); + } + + @Override + public void stateChanged(ChangeEvent e) { + if (e.getSource() instanceof JCheckBox) { + JCheckBox checkBox = (JCheckBox) e.getSource(); + super.viewer.setAutoTracking(checkBox.isSelected()); + } + } + + @Override + public void actionPerformed(ActionEvent e) { + // TODO Auto-generated method stub + } +} \ No newline at end of file