<commit_before>/*
 * Copyright (C) 2001-2014, <NAME> / Illposed Software.
 * All rights reserved.
 *
 * This code is licensed under the BSD 3-Clause license.
 * See file LICENSE (or LICENSE.html) for more information.
 */

// this is the package we are in
package com.illposed.osc.ui;

import com.illposed.osc.OSCBundle;
import com.illposed.osc.OSCListener;
import com.illposed.osc.OSCMessage;
import com.illposed.osc.OSCPacket;
import com.illposed.osc.OSCPort;
import com.illposed.osc.OSCPortIn;
import com.illposed.osc.OSCPortOut;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.io.InputStream;
import java.net.InetAddress;
import java.net.SocketException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.imageio.ImageIO;
import javax.swing.BoxLayout;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JSlider;
import javax.swing.JTabbedPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
import javax.swing.border.LineBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;



/**
 * OscUI is a subClass of JPanel.
 *
 * @author <NAME>
 * @author JT
 */
public class OscUI extends JPanel {

	// declare some variables
	private JFrame parent;
	private JTextField addressWidget;
	private JLabel portWidget;
	private JTextField textBox;
	private JTextField textBox2;
	private JTextField textBox3;
	private JTextField textBox4 = new JTextField(String.valueOf(1000), 8);
	private JLabel delayLabel;
	private Color OSK_PINK = new Color(249, 200, 202);
	private Color OSK_YELLOW = new Color(254, 242, 242);
	public enum EFFECT {LUMA, BLUR, FRAME, REFRACT, KALEI, CUBISM, OSKWAVE, EMPTY  };
	public static Font font16 = new Font("Verdana", Font.BOLD, 16);
	public static Font font22 = new Font("Verdana", Font.BOLD, 22);
	public static Font font24 = new Font("Verdana", Font.BOLD, 24);
	public static Border lineBorder = new LineBorder(Color.BLACK, 2);
	public static Border emptyBorder = new EmptyBorder(5, 5, 5, 5);


	


	private JButton firstSynthButtonOn, secondSynthButtonOn, thirdSynthButtonOn, fourthSynthButtonOn;
	private JButton firstSynthButtonOff, secondSynthButtonOff, thirdSynthButtonOff,fourthSynthButtonOff;
	private JSlider slider, slider2, slider3;

	private OSCPortOut oscPortOut;
	private OSCPortIn oscPortIn; 
	
	// create a constructor
	// OscUI takes an argument of myParent which is a JFrame
	public OscUI(JFrame myParent) {
		super();
		parent = myParent;
		makeDisplay();
		try {
			oscPortOut = new OSCPortOut();
			oscPortIn = new OSCPortIn(OSCPort.defaultSCOSCPort());
			JOptionPane.showMessageDialog(null, "ISTEEEEENING.");

			oscPortIn.addListener("/livelevel", new OSCListener() {
				@Override
				public void acceptMessage(Date time, OSCMessage message) {
					System.out.println("RECEIVED:"+message.toString());
					JOptionPane.showMessageDialog(null, "RECEIVED:"+message.toString());
				}	
			});
			oscPortIn.startListening();
			
		} catch (Exception ex) {
			// this is just a demo program, so this is acceptable behavior
			ex.printStackTrace();
		}
	}

	// create a method for widget building
	private final void makeDisplay() {

		// setLayout to be a BoxLayout
		setLayout(new BorderLayout());
		setBackground(OSK_PINK);
		setOpaque(true);<commit_msg>Changed pd file<commit_after>/*
 * Copyright (C) 2001-2014, <NAME> / Illposed Software.
 * All rights reserved.
 *
 * This code is licensed under the BSD 3-Clause license.
 * See file LICENSE (or LICENSE.html) for more information.
 */

// this is the package we are in
package com.illposed.osc.ui;

import com.illposed.osc.OSCBundle;
import com.illposed.osc.OSCListener;
import com.illposed.osc.OSCMessage;
import com.illposed.osc.OSCPacket;
import com.illposed.osc.OSCPort;
import com.illposed.osc.OSCPortIn;
import com.illposed.osc.OSCPortOut;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.io.InputStream;
import java.net.InetAddress;
import java.net.SocketException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.imageio.ImageIO;
import javax.swing.BoxLayout;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JSlider;
import javax.swing.JTabbedPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
import javax.swing.border.LineBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;



/**
 * OscUI is a subClass of JPanel.
 *
 * @author <NAME>
 * @author JT
 */
public class OscUI extends JPanel {

	// declare some variables
	private JFrame parent;
	private JTextField addressWidget;
	private JLabel portWidget;
	private JTextField textBox;
	private JTextField textBox2;
	private JTextField textBox3;
	private JTextField textBox4 = new JTextField(String.valueOf(1000), 8);
	private JLabel delayLabel;
	private Color OSK_PINK = new Color(249, 200, 202);
	private Color OSK_YELLOW = new Color(254, 242, 242);
	public enum EFFECT {LUMA, BLUR, FRAME, REFRACT, KALEI, CUBISM, OSKWAVE, EMPTY  };
	public static Font font16 = new Font("Verdana", Font.BOLD, 16);
	public static Font font22 = new Font("Verdana", Font.BOLD, 22);
	public static Font font24 = new Font("Verdana", Font.BOLD, 24);
	public static Border lineBorder = new LineBorder(Color.BLACK, 2);
	public static Border emptyBorder = new EmptyBorder(5, 5, 5, 5);


	


	private JButton firstSynthButtonOn, secondSynthButtonOn, thirdSynthButtonOn, fourthSynthButtonOn;
	private JButton firstSynthButtonOff, secondSynthButtonOff, thirdSynthButtonOff,fourthSynthButtonOff;
	private JSlider slider, slider2, slider3;

	private OSCPortOut oscPortOut;
	private OSCPortIn oscPortIn; 
	
	// create a constructor
	// OscUI takes an argument of myParent which is a JFrame
	public OscUI(JFrame myParent) {
		super();
		parent = myParent;
		makeDisplay();
		try {
			oscPortOut = new OSCPortOut();
			oscPortIn = new OSCPortIn(OSCPort.defaultSCOSCPort());
			oscPortIn.addListener("/livelevel", new OSCListener() {
				@Override
				public void acceptMessage(Date time, OSCMessage message) {
					List<Object> args = message.getArguments();
					for(Object a : args){
						Float ar = (Float) a;
						System.out.println("RECEIVED: "+ ar);
					}
					JOptionPane.showMessageDialog(null, "RECEIVED:"+message.toString());
				}	
			});
			oscPortIn.startListening();
			
		} catch (Exception ex) {
			// this is just a demo program, so this is acceptable behavior
			ex.printStackTrace();
		}
	}

	// create a method for widget building
	private final void makeDisplay() {

		// setLayout to be a BoxLayout
		setLayout(new BorderLayout());
		setBackground(OSK_PINK);
		setOpaque(true);
{'fraction_non_alphanumeric': 0.10340790842872008, 'fraction_numerical': 0.01404786680541103, 'mean_word_length': 4.74234503360717, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '5392182', 'n_tokens_mistral': 2718, 'n_tokens_neox': 2471, 'n_words': 672}