@@ -0,0 +1,1838 @@
+package com.rafkind.paintown;%0A%0Aimport java.util.HashMap;%0Aimport java.io.*;%0A%0A/* saves arbitrary data to a file so it can be loaded in between program instances */%0Apublic class Config%7B%0A    private HashMap%3CString, Serializable%3E config = new HashMap%3CString, Serializable%3E();%0A    private static Object lock = new Object();%0A    private static Config instance = null;%0A    private static final String savedFile = %22editor-config.obj%22;%0A%0A    private Config()%7B%0A        config = loadData();%0A    %7D%0A%0A    private void saveData()%7B%0A        try%7B%0A            ObjectOutputStream output = new ObjectOutputStream(new FileOutputStream(savedFile));%0A            output.writeObject(config);%0A            output.close();%0A        %7D catch (IOException fail)%7B%0A            System.err.println(fail);%0A        %7D%0A    %7D%0A%0A    private HashMap%3CString, Serializable%3E loadData()%7B%0A        try%7B%0A            ObjectInputStream input = new ObjectInputStream(new FileInputStream(savedFile));%0A            Object in = input.readObject();%0A            input.close();%0A            if (in instanceof HashMap)%7B%0A                return (HashMap%3CString, Serializable%3E) in;%0A            %7D%0A            return new HashMap%3CString, Serializable%3E();%0A        %7D catch (ClassNotFoundException fail)%7B%0A            return new HashMap%3CString, Serializable%3E();%0A        %7D catch (IOException fail)%7B%0A            System.err.println(fail);%0A            return new HashMap%3CString, Serializable%3E();%0A        %7D%0A    %7D%0A%0A    public static Config getConfig()%7B%0A        synchronized (lock)%7B%0A            if (instance == null)%7B%0A                instance = new Config();%0A            %7D%0A%0A            return instance;%0A        %7D%0A    %7D%0A%0A    public synchronized Serializable get(String name)%7B%0A        return config.get(name);%0A    %7D%0A%0A    public synchronized void set(String name, Serializable what)%7B%0A        config.put(name, what);%0A    %7D%0A%7D%0A

add class to serialize config data