<commit_before>//----------------------------------------------------------------------------//
//                                                                            //
//                        V i e w P a r a m e t e r s                         //
//                                                                            //
//  Copyright (C) <NAME> 2000-2007. All rights reserved.               //
//  This software is released under the GNU General Public License.           //
//  Contact author at <EMAIL> to report bugs & suggestions. //
//----------------------------------------------------------------------------//
//
package omr.glyph.ui;

import omr.constant.Constant;
import omr.constant.ConstantSet;

import omr.plugin.Plugin;
import omr.plugin.PluginType;

import omr.util.Implement;

import org.jdesktop.application.AbstractBean;
import org.jdesktop.application.Action;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.AbstractAction;
import javax.swing.JCheckBoxMenuItem;

/**
 * Class <code>ViewParameters</code> handles parameters for GlyphLagView
 *
 * @author <NAME>
 * @version $Id$
 */
public class ViewParameters
    extends AbstractBean
{
    //~ Static fields/initializers ---------------------------------------------

    /** Specific application parameters */
    private static final Constants constants = new Constants();

    //~ Methods ----------------------------------------------------------------

    //-------------//
    // getInstance //
    //-------------//
    public static ViewParameters getInstance ()
    {
        return Holder.INSTANCE;
    }

    //-------------------//
    // setCirclePainting //
    //-------------------//
    public void setCirclePainting (boolean value)
    {
        boolean oldValue = constants.circlePainting.getValue();
        constants.circlePainting.setValue(value);
        firePropertyChange("circlePainting", oldValue, value);
    }

    //------------------//
    // isCirclePainting //
    //------------------//
    public boolean isCirclePainting ()
    {
        return constants.circlePainting.getValue();
    }

    //-----------------//
    // setLinePainting //
    //-----------------//
    public void setLinePainting (boolean value)
    {
        boolean oldValue = constants.linePainting.getValue();
        constants.linePainting.setValue(value);
        firePropertyChange("linePainting", oldValue, value);
    }

    //----------------//
    // isLinePainting //
    //----------------//
    public boolean isLinePainting ()
    {
        return constants.linePainting.getValue();
    }

    //---------------//
    // toggleCircles //
    //---------------//
    /**
     * Action that toggles the display of approximating circles in selected
     * slur-shaped glyphs
     * @param e the event that triggered this action
     */
    @Action(selectedProperty = "circlePainting")
    public void toggleCircles (ActionEvent e)
    {
    }

    //-------------//
    // toggleLines //
    //-------------//
    /**
     * Action that toggles the display of mean line in selected sticks
     * @param e the event that triggered this action
     */
    @Action(selectedProperty = "linePainting")
    public void toggleLines (ActionEvent e)
    {
    }

    //~ Inner Classes ----------------------------------------------------------

    //------------------//
    // SlurCircleAction //
    //------------------//
    @Deprecated
    @Plugin(type = PluginType.GLYPH_VIEW, item = JCheckBoxMenuItem.class)
    public static class SlurCircleAction
        extends AbstractAction
    {
        //~ Constructors -------------------------------------------------------

        public SlurCircleAction ()
        {
            putValue("SwingSelectedKey", constants.circlePainting.getValue());
        }

        //~ Methods ------------------------------------------------------------

        @Implement(ActionListener.class)
        public void actionPerformed (ActionEvent e)
        {
            JCheckBoxMenuItem item = (JCheckBoxMenuItem) e.getSource();
            constants.circlePainting.setValue(item.isSelected());
        }
    }

    //-----------------//
    // StickLineAction //
    //-----------------//
    @Deprecated
    @Plugin(type = PluginType.GLYPH_VIEW, item = JCheckBoxMenuItem.class)
    public static class StickLineAction
        extends AbstractAction
    {
        //~ Constructors -------------------------------------------------------

        public StickLineAction ()
        {
            putValue("SwingSelectedKey", constants.linePainting.getValue());
        }

        //~ Methods ------------------------------------------------------------

        @Implement(ActionListener.class)
        public void actionPerformed (ActionEvent e)
        {
            JCheckBoxMenuItem item = (JCheckBoxMenuItem) e.getSource();
            constants.linePainting.setValue(item.isSelected());
        }
    }

    //-----------//
    // Constants //
    //-----------//
    private static final class Constants
        extends ConstantSet
    {
        //~ Instance fields ----------------------------------------------------

        /** Should the lines be painted */
        final Constant.Boolean linePainting = new Constant.Boolean(
            false,
            "Should the stick lines be painted");

        /** Should the circles be painted */
        final Constant.Boolean circlePainting = new Constant.Boolean(
            true,
            "Should the slur circles be painted");
    }

    //--------//<commit_msg>Removed dependendy on old plugin package<commit_after>//----------------------------------------------------------------------------//
//                                                                            //
//                        V i e w P a r a m e t e r s                         //
//                                                                            //
//  Copyright (C) <NAME> 2000-2007. All rights reserved.               //
//  This software is released under the GNU General Public License.           //
//  Contact author at <EMAIL> to report bugs & suggestions. //
//----------------------------------------------------------------------------//
//
package omr.glyph.ui;

import omr.constant.Constant;
import omr.constant.ConstantSet;

import org.jdesktop.application.AbstractBean;
import org.jdesktop.application.Action;

import java.awt.event.ActionEvent;

/**
 * Class <code>ViewParameters</code> handles parameters for GlyphLagView
 *
 * @author <NAME>
 * @version $Id$
 */
public class ViewParameters
    extends AbstractBean
{
    //~ Static fields/initializers ---------------------------------------------

    /** Specific application parameters */
    private static final Constants constants = new Constants();

    //~ Methods ----------------------------------------------------------------

    //-------------//
    // getInstance //
    //-------------//
    public static ViewParameters getInstance ()
    {
        return Holder.INSTANCE;
    }

    //-------------------//
    // setCirclePainting //
    //-------------------//
    public void setCirclePainting (boolean value)
    {
        boolean oldValue = constants.circlePainting.getValue();
        constants.circlePainting.setValue(value);
        firePropertyChange("circlePainting", oldValue, value);
    }

    //------------------//
    // isCirclePainting //
    //------------------//
    public boolean isCirclePainting ()
    {
        return constants.circlePainting.getValue();
    }

    //-----------------//
    // setLinePainting //
    //-----------------//
    public void setLinePainting (boolean value)
    {
        boolean oldValue = constants.linePainting.getValue();
        constants.linePainting.setValue(value);
        firePropertyChange("linePainting", oldValue, value);
    }

    //----------------//
    // isLinePainting //
    //----------------//
    public boolean isLinePainting ()
    {
        return constants.linePainting.getValue();
    }

    //---------------//
    // toggleCircles //
    //---------------//
    /**
     * Action that toggles the display of approximating circles in selected
     * slur-shaped glyphs
     * @param e the event that triggered this action
     */
    @Action(selectedProperty = "circlePainting")
    public void toggleCircles (ActionEvent e)
    {
    }

    //-------------//
    // toggleLines //
    //-------------//
    /**
     * Action that toggles the display of mean line in selected sticks
     * @param e the event that triggered this action
     */
    @Action(selectedProperty = "linePainting")
    public void toggleLines (ActionEvent e)
    {
    }

    //~ Inner Classes ----------------------------------------------------------

    //-----------//
    // Constants //
    //-----------//
    private static final class Constants
        extends ConstantSet
    {
        //~ Instance fields ----------------------------------------------------

        /** Should the lines be painted */
        final Constant.Boolean linePainting = new Constant.Boolean(
            false,
            "Should the stick lines be painted");

        /** Should the circles be painted */
        final Constant.Boolean circlePainting = new Constant.Boolean(
            true,
            "Should the slur circles be painted");
    }

    //--------//
{'fraction_non_alphanumeric': 0.253519635863237, 'fraction_numerical': 0.0016936593627606647, 'mean_word_length': 1.1250562303193883, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5313155', 'n_tokens_mistral': 2208, 'n_tokens_neox': 2109, 'n_words': 527}