<commit_before>package kg.apc.jmeter.vizualizers;

import java.awt.Color;
import java.awt.event.InputEvent;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.ToolTipManager;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import kg.apc.jmeter.JMeterPluginsUtils;
import kg.apc.jmeter.charting.GraphPanelChart;

/**
 *
 * @author <NAME>
 */
public class JSettingsPanel extends javax.swing.JPanel implements GraphRendererInterface
{
    public final static int TIMELINE_OPTION = 1;
    public final static int GRADIENT_OPTION = 1 << 1;
    public final static int CURRENTX_OPTION = 1 << 2;
    public final static int FINAL_ZEROING_OPTION = 1 << 3;
    public final static int LIMIT_POINT_OPTION = 1 << 4;
    public final static int BAR_CHART_X_LIMIT_OPTION = 1 << 5;
    public final static int HIDE_NON_REP_VALUES_OPTION = 1 << 6;
    public final static int AGGREGATE_OPTION = 1 << 7;
    public final static int RELATIVE_TIME_OPTION = 1 << 8;
    public final static int MAXY_OPTION = 1 << 9;

    private SettingsInterface parent = null;
    private int originalTooltipDisplayTime = 0;

    /** Creates new form JSettingsPanel */
    public JSettingsPanel(SettingsInterface parent, int options)
    {
        boolean showTimelineOption = (options & TIMELINE_OPTION) != 0;
        boolean showGradientOption = (options & GRADIENT_OPTION) != 0;
        boolean showCurrentXOption = (options & CURRENTX_OPTION) != 0;
        boolean showFinalZeroingLinesOption = (options & FINAL_ZEROING_OPTION) != 0;
        boolean showLimitPointOption = (options & LIMIT_POINT_OPTION) != 0;
        boolean showBarChartXAxisLimit = (options & BAR_CHART_X_LIMIT_OPTION) != 0;
        boolean showHideNonRepValues = (options & HIDE_NON_REP_VALUES_OPTION) != 0;
        boolean showAggregateOption = (options & AGGREGATE_OPTION) != 0;
        boolean showRelativeTimeOption = (options & RELATIVE_TIME_OPTION) != 0;
        boolean showMaxYOption = (options & MAXY_OPTION) != 0;

        initComponents();
        this.parent = parent;
        postInitComponents(showTimelineOption, showGradientOption, showCurrentXOption, showFinalZeroingLinesOption, showLimitPointOption, showBarChartXAxisLimit, showHideNonRepValues, showAggregateOption, showRelativeTimeOption, showMaxYOption);
        registerJTextfieldForRefresh(jTextFieldMaxY);
    }

    private void postInitComponents(boolean showTimelineOption,
            boolean showGradientOption,
            boolean showCurrentXOption,
            boolean showFinalZeroingLinesOption,
            boolean showLimitPointOption,
            boolean showBarChartXAxisLimit,
            boolean showHideNonRepValues,
            boolean showAggregateOption,
            boolean showRelativeTimeOption,
            boolean showMaxYOption)
    {
        boolean showGraphOptionPanel = showTimelineOption || showAggregateOption;
        jPanelTimeLineContainer.setVisible(showGraphOptionPanel || showRelativeTimeOption || showAggregateOption);

        jLabelTimeline1.setVisible(showTimelineOption);
        jLabelTimeline2.setVisible(showTimelineOption);<commit_msg>Correct handling of 0 option<commit_after>package kg.apc.jmeter.vizualizers;

import java.awt.Color;
import java.awt.event.InputEvent;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.ToolTipManager;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import kg.apc.jmeter.JMeterPluginsUtils;
import kg.apc.jmeter.charting.GraphPanelChart;

/**
 *
 * @author <NAME>
 */
public class JSettingsPanel extends javax.swing.JPanel implements GraphRendererInterface
{
    public final static int TIMELINE_OPTION = 1;
    public final static int GRADIENT_OPTION = 1 << 1;
    public final static int CURRENTX_OPTION = 1 << 2;
    public final static int FINAL_ZEROING_OPTION = 1 << 3;
    public final static int LIMIT_POINT_OPTION = 1 << 4;
    public final static int BAR_CHART_X_LIMIT_OPTION = 1 << 5;
    public final static int HIDE_NON_REP_VALUES_OPTION = 1 << 6;
    public final static int AGGREGATE_OPTION = 1 << 7;
    public final static int RELATIVE_TIME_OPTION = 1 << 8;
    public final static int MAXY_OPTION = 1 << 9;

    private SettingsInterface parent = null;
    private int originalTooltipDisplayTime = 0;

    /** Creates new form JSettingsPanel */
    public JSettingsPanel(SettingsInterface parent, int options)
    {
        boolean showTimelineOption = (options & TIMELINE_OPTION) != 0;
        boolean showGradientOption = (options & GRADIENT_OPTION) != 0;
        boolean showCurrentXOption = (options & CURRENTX_OPTION) != 0;
        boolean showFinalZeroingLinesOption = (options & FINAL_ZEROING_OPTION) != 0;
        boolean showLimitPointOption = (options & LIMIT_POINT_OPTION) != 0;
        boolean showBarChartXAxisLimit = (options & BAR_CHART_X_LIMIT_OPTION) != 0;
        boolean showHideNonRepValues = (options & HIDE_NON_REP_VALUES_OPTION) != 0;
        boolean showAggregateOption = (options & AGGREGATE_OPTION) != 0;
        boolean showRelativeTimeOption = (options & RELATIVE_TIME_OPTION) != 0;
        boolean showMaxYOption = (options & MAXY_OPTION) != 0;

        initComponents();
        this.parent = parent;
        postInitComponents(
                showTimelineOption,
                showGradientOption,
                showCurrentXOption,
                showFinalZeroingLinesOption,
                showLimitPointOption,
                showBarChartXAxisLimit,
                showHideNonRepValues,
                showAggregateOption,
                showRelativeTimeOption,
                showMaxYOption);
        registerJTextfieldForRefresh(jTextFieldMaxY);
    }

    private void postInitComponents(
            boolean showTimelineOption,
            boolean showGradientOption,
            boolean showCurrentXOption,
            boolean showFinalZeroingLinesOption,
            boolean showLimitPointOption,
            boolean showBarChartXAxisLimit,
            boolean showHideNonRepValues,
            boolean showAggregateOption,
            boolean showRelativeTimeOption,
            boolean showMaxYOption)
    {
        jPanelTimeLineContainer.setVisible(
                showTimelineOption ||
                showAggregateOption ||
                showRelativeTimeOption);
        jPanelRenderingOptionsContainer.setVisible(
                showGradientOption ||
                showCurrentXOption ||
                showFinalZeroingLinesOption ||
                showLimitPointOption ||
                showBarChartXAxisLimit ||
                showHideNonRepValues ||
                showMaxYOption);

        jLabelTimeline1.setVisible(showTimelineOption);
        jLabelTimeline2.setVisible(showTimelineOption);
{'fraction_non_alphanumeric': 0.0688235294117647, 'fraction_numerical': 0.009558823529411765, 'mean_word_length': 3.1444241316270567, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5444666', 'n_tokens_mistral': 1918, 'n_tokens_neox': 1858, 'n_words': 430}