]> Dogcows Code - chaz/vimcoder/commitdiff
just some whitespace cleanup
authorCharles McGarvey <chazmcgarvey@brokenzipper.com>
Wed, 13 Jul 2011 18:20:47 +0000 (12:20 -0600)
committerCharles McGarvey <chazmcgarvey@brokenzipper.com>
Wed, 13 Jul 2011 18:20:47 +0000 (12:20 -0600)
src/com/dogcows/Editor.java
src/com/dogcows/Util.java
src/com/dogcows/VimCoder.java

index eca84208ad675a66706995396744d2d821845537..203d8ec2eb5ac4dc159205d765f0b628c5cb528c 100644 (file)
@@ -24,22 +24,22 @@ public class Editor
        /**
         * The problem ID number.
         */
-       private String  id;
+       private String id;
 
        /**
         * The name of the class.
         */
-       private String  name;
+       private String name;
 
        /**
         * The path of the current source file.
         */
-       private File    sourceFile;
+       private File sourceFile;
 
        /**
         * The path of the problem directory.
         */
-       private File    directory;
+       private File directory;
 
 
        /**
@@ -48,10 +48,10 @@ public class Editor
        private static final Map<String,String> languageExtension = new HashMap<String,String>();
        static
        {
-               languageExtension.put("Java",   "java");
-               languageExtension.put("C++",    "cc");
-               languageExtension.put("C#",             "cs");
-               languageExtension.put("VB",             "vb");
+               languageExtension.put("Java", "java");
+               languageExtension.put("C++", "cc");
+               languageExtension.put("C#", "cs");
+               languageExtension.put("VB", "vb");
                languageExtension.put("Python", "py");
        }
 
@@ -64,8 +64,7 @@ public class Editor
         * @throws Exception If the editor could not set itself up.
         */
        public Editor(ProblemComponentModel component,
-                                 Language language,
-                                 Renderer renderer) throws Exception
+                     Language language, Renderer renderer) throws Exception
        {
                this.id = String.valueOf(component.getProblem().getProblemID());
                this.name = component.getClassName();
@@ -85,22 +84,20 @@ public class Editor
                }
 
                String lang = language.getName();
-               String ext      = languageExtension.get(lang);
+               String ext = languageExtension.get(lang);
 
                // Set up the terms used for the template expansion.
                HashMap<String,String> terms = new HashMap<String,String>();
-               terms.put("RETURNTYPE",   component.getReturnType().getDescriptor(language));
-               terms.put("CLASSNAME",    name);
-               terms.put("METHODNAME",   component.getMethodName());
+               terms.put("RETURNTYPE", component.getReturnType().getDescriptor(language));
+               terms.put("CLASSNAME", name);
+               terms.put("METHODNAME", component.getMethodName());
                terms.put("METHODPARAMS", getMethodParams(component.getParamTypes(),
-                                                                                                 component.getParamNames(),
-                                                                                                 language));
-               terms.put("METHODPARAMNAMES",     Util.join(component.getParamNames(), ", "));
-               terms.put("METHODPARAMSTREAMIN",  Util.join(component.getParamNames(), " >> "));
+                                                         component.getParamNames(), language));
+               terms.put("METHODPARAMNAMES", Util.join(component.getParamNames(), ", "));
+               terms.put("METHODPARAMSTREAMIN", Util.join(component.getParamNames(), " >> "));
                terms.put("METHODPARAMSTREAMOUT", Util.join(component.getParamNames(), " << \", \" << "));
-               terms.put("METHODPARAMDECLARES",  getMethodParamDeclarations(component.getParamTypes(),
-                                                                                                                                        component.getParamNames(),
-                                                                                                                                        language));
+               terms.put("METHODPARAMDECLARES", getMethodParamDeclarations(component.getParamTypes(),
+                                                                           component.getParamNames(), language));
 
                // Write the problem statement as an HTML file in the problem directory.
                File problemFile = new File(directory, "Problem.html");
@@ -122,8 +119,7 @@ public class Editor
                sourceFile = new File(directory, name + "." + ext);
                if (!sourceFile.canRead())
                {
-                       String text = Util.expandTemplate(readTemplate(lang + "Template"),
-                                                                                         terms);
+                       String text = Util.expandTemplate(readTemplate(lang + "Template"), terms);
                        FileWriter writer = new FileWriter(sourceFile);
                        writer.write(text);
                        writer.close();
@@ -133,8 +129,7 @@ public class Editor
                File driverFile = new File(directory, "driver." + ext);
                if (!driverFile.canRead())
                {
-                       String text = Util.expandTemplate(readTemplate(lang + "Driver"),
-                                                                                         terms);
+                       String text = Util.expandTemplate(readTemplate(lang + "Driver"), terms);
                        FileWriter writer = new FileWriter(driverFile);
                        writer.write(text);
                        writer.close();
@@ -166,8 +161,7 @@ public class Editor
                File makeFile = new File(directory, "Makefile");
                if (!makeFile.canRead())
                {
-                       String text = Util.expandTemplate(readTemplate(lang + "Makefile"),
-                                                                                         terms);
+                       String text = Util.expandTemplate(readTemplate(lang + "Makefile"), terms);
                        FileWriter writer = new FileWriter(makeFile);
                        writer.write(text);
                        writer.close();
@@ -209,8 +203,7 @@ public class Editor
         * @param argument A single argument for the remote command.
         * @throws Exception If the command could not be sent.
         */
-       private void sendVimCommand(String command,
-                                                               String argument) throws Exception
+       private void sendVimCommand(String command, String argument) throws Exception
        {
                String[] arguments = {argument};
                sendVimCommand(command, arguments);
@@ -224,8 +217,7 @@ public class Editor
         * @param argument Arguments for the remote command.
         * @throws Exception If the command could not be sent.
         */
-       private void sendVimCommand(String command,
-                                                               String[] arguments) throws Exception
+       private void sendVimCommand(String command, String[] arguments) throws Exception
        {
                String[] vimCommand = VimCoder.getVimCommand().split("\\s");
                String[] flags = {"--servername", "VimCoder" + id, command};
@@ -311,9 +303,7 @@ public class Editor
         * @param language The language used for representing the data types.
         * @return The list of parameters.
         */
-       private String getMethodParams(DataType[] types,
-                                                                  String[] names,
-                                                                  Language language)
+       private String getMethodParams(DataType[] types, String[] names, Language language)
        {
                String[] typeStrings = getStringTypes(types, language);
                return Util.join(Util.combine(typeStrings, names, " "), ", ");
@@ -329,9 +319,7 @@ public class Editor
         * @param language The language used for representing the data types.
         * @return The parameters as a block of declarations.
         */
-       private String getMethodParamDeclarations(DataType[] types,
-                                                                                         String[] names,
-                                                                                         Language language)
+       private String getMethodParamDeclarations(DataType[] types, String[] names, Language language)
        {
                final String end = ";" + System.getProperty("line.separator");
                String[] typeStrings = getStringTypes(types, language);
index 40303b6b7aac26dfa5854b9ce1dc7d032bf08eb1..3253ae223c5515457949c2012fb6c658be05d5c9 100644 (file)
@@ -120,7 +120,7 @@ public abstract class Util
                        try
                        {
                                byte[]  buffer = new byte[4096];
-                               int             numBytes = 0;
+                               int     numBytes = 0;
                                while (0 < (numBytes = stream.read(buffer)))
                                {
                                        text.append(new String(buffer, 0, numBytes));
index 650d982801764a0384e445d6bde4002936c94944..b47de71bcd17ee2afe2a539818ecc536cde2e946 100644 (file)
@@ -27,23 +27,23 @@ public class VimCoder
        /**
         * The name and version of this plugin.
         */
-       public final static String      version = "VimCoder 0.3.1";
+       public final static String version = "VimCoder 0.3.1";
 
        /**
         * The website of the plugin project.
         */
-       public final static String      website = "http://www.dogcows.com/vimcoder";
+       public final static String website = "http://www.dogcows.com/vimcoder";
 
 
        /**
         * The first part of the command used to invoke the Vim server.
         */
-       private static String           vimCommand = "gvim";
+       private static String vimCommand = "gvim";
 
        /**
         * The path to the main VimCoder directory.
         */
-       private static File                     rootDir;
+       private static File rootDir;
        static
        {
                if (System.getProperty("os.name").toLowerCase().equals("win"))
@@ -51,29 +51,29 @@ public class VimCoder
                        vimCommand = "C:\\WINDOWS\\gvim.bat";
                }
                rootDir = new File(System.getProperty("user.home") +
-                                                  System.getProperty("file.separator") + ".vimcoder");
+                                  System.getProperty("file.separator") + ".vimcoder");
        }
 
 
        /**
         * The panel given to the Arena applet when it is requested.
         */
-       private JPanel          panel;
+       private JPanel panel;
 
        /**
         * The text widget where log messages are appended.
         */
-       private JTextArea       logArea;
+       private JTextArea logArea;
 
        /**
         * The current editor object (or null if there is none).
         */
-       private Editor          editor;
+       private Editor editor;
 
        /**
         * The configuration panel.
         */
-       private JDialog         configDialog;
+       private JDialog configDialog;
 
 
        /**
@@ -186,8 +186,7 @@ public class VimCoder
                }
                catch (Exception exception)
                {
-                       logError("Failed to get source code: " +
-                                        exception.getLocalizedMessage());
+                       logError("Failed to get source code: " + exception.getLocalizedMessage());
                        throw exception;
                }
        }
@@ -206,7 +205,7 @@ public class VimCoder
                catch (Exception exception)
                {
                        logError("Failed to save the source given by the server: " +
-                                        exception.getLocalizedMessage());
+                                exception.getLocalizedMessage());
                        return;
                }
        }
@@ -220,8 +219,7 @@ public class VimCoder
         * statement.
         */
        public void setProblemComponent(ProblemComponentModel component,
-                                                                       Language language,
-                                                                       Renderer renderer)
+                                       Language language, Renderer renderer)
        {
                try
                {
@@ -230,7 +228,7 @@ public class VimCoder
                catch (Exception exception)
                {
                        logError("An error occured while loading the problem: " +
-                                        exception.getLocalizedMessage());
+                                exception.getLocalizedMessage());
                }
        }
 
This page took 0.031403 seconds and 4 git commands to generate.