<commit_before>package com.rafkind.paintown.animator.events;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import org.swixml.SwingEngine;

import com.rafkind.paintown.animator.Animation;
import com.rafkind.paintown.animator.DrawArea;
import com.rafkind.paintown.Token;
import com.rafkind.paintown.animator.events.AnimationEvent;

public class UserDefinedEvent implements AnimationEvent {
    private String name;
    private String value;

    public UserDefinedEvent(){
    }
    
    public void loadToken(Token token){
		name = token.readString(0);
		value = token.readString(1);
    }
    
    public Token getToken(){
        Token temp = new Token("user");
		temp.addToken(new Token("user"));
		temp.addToken(new Token(name));
		temp.addToken(new Token(value));
		
		return temp;
    }
    
    public void interact(Animation animation){
    }
    
    public String getName(){
        return getToken().toString();
    }

    public JPanel getEditor(final Animation animation, final DrawArea area){

        SwingEngine engine = new SwingEngine( "animator/event-user.xml" );
		final JTextField namePanel = (JTextField) engine.find("name");
		final JTextField valuePanel = (JTextField) engine.find("value");

        namePanel.setText(name);
        valuePanel.setText(value);
        namePanel.addActionListener(new AbstractAction(){
            public void actionPerformed(ActionEvent e){
                name = namePanel.getText();
            }
        });

        valuePanel.addActionListener(new AbstractAction(){
            public void actionPerformed(ActionEvent e){
                value = valuePanel.getText();
            }
        });

        return (JPanel) engine.getRootComponent();

    }

    public void destroy(){
    }
}
<commit_msg>quote strings<commit_after>package com.rafkind.paintown.animator.events;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import org.swixml.SwingEngine;

import com.rafkind.paintown.animator.Animation;
import com.rafkind.paintown.animator.DrawArea;
import com.rafkind.paintown.Token;
import com.rafkind.paintown.animator.events.AnimationEvent;

public class UserDefinedEvent implements AnimationEvent {
    private String name;
    private String value;

    public UserDefinedEvent(){
        name = "";
        value = "";
    }
    
    public void loadToken(Token token){
		name = token.readString(0);
		value = token.readString(1);
    }

    private String maybeString(String value){
        if (value.indexOf(" ") != -1){
            return "\"" + value + "\"";
        }
        return value;
    }
    
    public Token getToken(){
        Token temp = new Token("user");
		temp.addToken(new Token("user"));
		temp.addToken(new Token(maybeString(name)));
		temp.addToken(new Token(maybeString(value)));
		
		return temp;
    }
    
    public void interact(Animation animation){
    }
    
    public String getName(){
        return getToken().toString();
    }

    public JPanel getEditor(final Animation animation, final DrawArea area){

        SwingEngine engine = new SwingEngine( "animator/event-user.xml" );
		final JTextField namePanel = (JTextField) engine.find("name");
		final JTextField valuePanel = (JTextField) engine.find("value");

        namePanel.setText(name);
        valuePanel.setText(value);
        namePanel.addActionListener(new AbstractAction(){
            public void actionPerformed(ActionEvent e){
                name = namePanel.getText();
            }
        });

        valuePanel.addActionListener(new AbstractAction(){
            public void actionPerformed(ActionEvent e){
                value = valuePanel.getText();
            }
        });

        return (JPanel) engine.getRootComponent();

    }

    public void destroy(){
    }
}

{'fraction_non_alphanumeric': 0.11425603739288497, 'fraction_numerical': 0.0012983640612827837, 'mean_word_length': 2.8214285714285716, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '1089480', 'n_tokens_mistral': 1112, 'n_tokens_neox': 1064, 'n_words': 238}