<commit_before>package backupbuddies.gui;

/*TODO:
    high priority:
        upload button
        download button
        ipname input
        password input
    
    low priority
        list of peers
        file list
        file status
*/

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

import backupbuddies.network.Network;

public class GuiMain extends JFrame {
  
	private static Network network;
	
    //////////////////////////////////////////////////////////////////////
    //FIXME: these methods need to be in the interface class
        //so we can call them on user input events
    public static void login(String ip, String pass) {
        System.out.printf("[+] connecting to '%s' with '%s'\n", ip, pass);
        network = new Network(pass);
        network.connect(ip);
    }
    public static void uploadFile(String fileName, String fileDir) {
        System.out.printf("[+] uploading '%s' from '%s'\n", 
                fileName, fileDir);
    }
    public static void downloadFile(String fileName, String fileDir) {
        System.out.printf("[+] downloading '%s' to '%s'\n", 
                fileName, fileDir);
    }
    public static String[] fetchUserList(){
    	String[] list = {"user1","user2","user3"};
    	System.out.printf("fetchingUsers->complete\n  users are:\n");
    	int i=0;
    	while(i<list.length){
    		System.out.printf("     %s\n", list[i]);
    		i++;
    	}
    	return list;
    }
    public static String[] fetchFileList(){
    	String[] list = {"file1","file2","file3"};
    	System.out.printf("fetchingFiles->complete\n  files are:\n");
    	int i=0;
    	while(i<list.length){
    		System.out.printf("     %s\n", list[i]);
    		i++;
    	}
    	return list;
    }

    //////////////////////////////////////////////////////////////////////

    static JFrame frame;
    static JTextField saveDir = new JTextField();

    public static void setSaveDir() {
        JFileChooser browser = new JFileChooser();
        browser.setDialogTitle("choose save location");
        browser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        browser.setAcceptAllFileFilterUsed(false);
        if (browser.showOpenDialog(frame) == JFileChooser.APPROVE_OPTION) {
            saveDir.setText(browser.getSelectedFile().toString());
            //DEBUG:
            System.out.printf("[*] save directory set to '%s'\n",
                    saveDir.getText());
        }
    }
<commit_msg>added user and file list<commit_after>package backupbuddies.gui;

/*TODO:
    high priority:
        upload button
        download button
        ipname input
        password input
    
    low priority
        list of peers
        file list
        file status
*/

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

import backupbuddies.network.Network;

public class GuiMain extends JFrame {
  
	private static Network network;
	
    //////////////////////////////////////////////////////////////////////
    //FIXME: these methods need to be in the interface class
        //so we can call them on user input events
    public static void login(String ip, String pass) {
        System.out.printf("[+] connecting to '%s' with '%s'\n", ip, pass);
        network = new Network(pass);
        network.connect(ip);
    }
    public static void uploadFile(String fileName, String fileDir) {
        System.out.printf("[+] uploading '%s' from '%s'\n", 
                fileName, fileDir);
    }
    public static void downloadFile(String fileName, String fileDir) {
        System.out.printf("[+] downloading '%s' to '%s'\n", 
                fileName, fileDir);
    }
    public static String[] fetchUserList(){
    	String[] list = {"user1","user2","user3","user4"};
    	System.out.printf("fetchingUsers->complete\n  users are:\n");
    	int i=0;
    	while(i<list.length){
    		System.out.printf("     %s\n", list[i]);
    		i++;
    	}
    	return list;
    }
    public static String[] fetchFileList(){
    	String[] list = {"file1","file2","file3","file4"};
    	System.out.printf("fetchingFiles->complete\n  files are:\n");
    	int i=0;
    	while(i<list.length){
    		System.out.printf("     %s\n", list[i]);
    		i++;
    	}
    	return list;
    }

    //////////////////////////////////////////////////////////////////////

    static JFrame frame;
    static JTextField saveDir = new JTextField();

    public static void setSaveDir() {
        JFileChooser browser = new JFileChooser();
        browser.setDialogTitle("choose save location");
        browser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        browser.setAcceptAllFileFilterUsed(false);
        if (browser.showOpenDialog(frame) == JFileChooser.APPROVE_OPTION) {
            saveDir.setText(browser.getSelectedFile().toString());
            //DEBUG:
            System.out.printf("[*] save directory set to '%s'\n",
                    saveDir.getText());
        }
    }

{'fraction_non_alphanumeric': 0.17729204614450517, 'fraction_numerical': 0.0036429872495446266, 'mean_word_length': 1.9717378232110643, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '901552', 'n_tokens_mistral': 1413, 'n_tokens_neox': 1390, 'n_words': 356}