/*
 * @(#)ViewToggleSubpixAAAction.java  1.0  2010-01-29
 * 
 * Copyright (c) 2010 Werner Randelshofer, Immensee, Switzerland.
 * All rights reserved.
 *
 * You may not use, copy or modify this file, except in compliance with the
 * license agreement you entered into with Werner Randelshofer.
 * For details see accompanying license terms.
 */

package ch.randelshofer.pdf.action;

import ch.randelshofer.pdf.*;
import java.awt.event.ActionEvent;

/**
 * ViewToggleSubpixAAAction.
 *
 * @author Werner Randelshofer
 * @version 1.0 2010-01-29 Created.
 */
public class ViewToggleSubpixAAAction extends AbstractJPDFFilePanelAction {
    public static String ID = "view.toggleSubpixAA";

    public ViewToggleSubpixAAAction(JPDFFilePanel pdfPanel) {
        super(pdfPanel, ID);
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        pdfPanel.setSubpixAAEnabled(!pdfPanel.isSubpixAAEnabled());
    }

    @Override
    protected void updateAction() {
        setEnabled(pdfPanel.getPDF() != null);
    }
}
