Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove whitespace [Gun.io WhitespaceBot]

  • Loading branch information...
commit 34dcee285b184c6417b51b03c8a4f4ba6aa6c17d 1 parent cc1daa4
Gun.io Whitespace Robot authored
View
4 bin/README
@@ -10,13 +10,13 @@ convert_logs.py supports more formats than we have documented here. For more in
cd path/to/svn/project
svn log -v > my_svn.log
python convert_logs.py -s path/to/svn/project/my_svn.log -o svn_log.xml
-
+
# git #
cd path/to/git/project
git-log --name-status --pretty=format:'%n------------------------------------------------------------------------%nr%h | %ae | %ai (%aD) | x lines%nChanged paths:' > my_git_project.log
python convert_logs.py -g path/to/git/project/my_git_project -o git_log.xml
-
+
# Startteam #
View
24 bin/code_swarm
@@ -24,7 +24,7 @@ import md5
from random import random
from threading import Thread
from shutil import copy
-
+
def parse_args():
from optparse import OptionParser
@@ -55,15 +55,15 @@ def parse_args():
def main():
"""
Visualizes the project in the current working directory.
-
+
Doing this automagically involves three steps:
1) Discovering what kind of repository is used in the current working
directory.
-
+
2) Converting the log formats from each kind of repository to the event
xml format that code_swarm expects.
-
- 3) Invoking code_swarm
+
+ 3) Invoking code_swarm
"""
options = parse_args()[0]
@@ -127,7 +127,7 @@ def invoke_code_swarm(code_swarm_jar, proj_cfg, options):
path_64 = os.path.join(path, "linux-x86_64")
path = os.pathsep.join([path_64, path])
return "-Djava.library.path=" + os.pathsep.join([path, old_path])
-
+
classpath = os.pathsep.join([code_swarm_jar, get_jars(), "."])
ea = "-da"
if options.debug: ea = "-ea"
@@ -175,15 +175,15 @@ def autogenerate_files(options):
if options.reload or not os.path.exists(os.path.join(dir, "log.xml")):
generate_log(dir)
-
+
proj_cfg = os.path.join(dir, "project.config")
if not os.path.exists(proj_cfg):
print >>sys.stderr, "Creating default config file at " + proj_cfg
cp_tpl = os.path.join(root_path(), "bin", "config.template")
copy(cp_tpl, proj_cfg)
-
+
return proj_cfg
-
+
def do_cmds(*cmds):
for cmd in cmds:
@@ -222,7 +222,7 @@ def do_hg(dir):
def do_darcs(dir):
tmp = os.path.join(dir, "darcs.xml")
xml = os.path.join(dir, "log.xml")
-
+
return do_cmds("darcs changes -s --xml-output > '%s'" % tmp
,"convert_logs.py -d '%s' -o '%s'" % (tmp, xml)
,"rm -f '%s'" % tmp)
@@ -240,7 +240,7 @@ def do_freebase(domain):
cfgf.write("InputFile=%s\n" % xml)
cfgf.close()
return cfg
-
-
+
+
if __name__ == "__main__":
main()
View
4 bin/config.template
@@ -6,7 +6,7 @@ InputFile=log.xml
# Color assignment rules
# Keep in order, do not skip numbers. Numbers start
# at 1.
-#
+#
# Pattern: "Label", "regex", R,G,B, R,G,B
# Label is optional. If it is omitted, the regex
# will be used.
@@ -37,6 +37,6 @@ IsInputSorted=true
# To use local avatars, uncomment this line:
#AvatarFetcher=LocalAvatar
-# then place png files named after the usernames of committers in
+# then place png files named after the usernames of committers in
# the data/local_avatars directory
# data/local_avatars/default.png is used by default
View
2  data/sample.config
@@ -35,7 +35,7 @@ Background=0,0,0
# Color assignment rules
# Keep in order, do not skip numbers. Numbers start
# at 1.
-#
+#
# Pattern: "Label", "regex", R,G,B, R,G,B
# Label is optional. If it is omitted, the regex
# will be used.
View
2  data/twitter.config
@@ -36,7 +36,7 @@ Background=0,0,0
# Color assignment rules
# Keep in order, do not skip numbers. Numbers start
# at 1.
-#
+#
# Pattern: "Label", "regex", R,G,B, R,G,B
# Label is optional. If it is omitted, the regex
# will be used.
View
6 defaults/code_swarm.config
@@ -64,7 +64,7 @@ Font=SansSerif
FontSize=10
FontColor=255,255,255
-# Font for people's names immediately after they've made an edit
+# Font for people's names immediately after they've made an edit
BoldFont=SansSerif
BoldFontSize=14
@@ -103,7 +103,7 @@ IsInputSorted=false
# Particle sprite file
ParticleSpriteFile=src/particle.png
-# OpenGL has problems on some platforms. We're closer to having it work
+# OpenGL has problems on some platforms. We're closer to having it work
# automatically out of the box, but not close enough to enable it by default
UseOpenGL=false
@@ -114,7 +114,7 @@ AvatarFetcher=GravatarFetcher
#AvatarFetcher=NoAvatar
-# looks for avatar images (with the same name as the user name) in
+# looks for avatar images (with the same name as the user name) in
# the LocalAvatarDirectory
#AvatarFetcher=LocalAvatar
View
18 src/AvatarFetcher.java
@@ -11,35 +11,35 @@
public class AvatarFetcher {
protected CodeSwarmConfig cfg;
- public int size;
+ public int size;
public AvatarFetcher(CodeSwarmConfig cfg) {
this.cfg = cfg;
size = cfg.getPositiveIntProperty("AvatarSize");
}
-
+
public String fetchUserImage(String username) {
throw new RuntimeException("Override fetchUserImage in your Avatar Fetcher");
}
-
+
protected static String getFilename(String key){
return "image_cache/" + key;
}
-
+
protected static boolean imageCached(String key) {
return new File(getFilename(key)).exists();
}
-
+
protected static String getImage(String key, URL url) {
String filename = getFilename(key);
if (!imageCached(key)){
- boolean successful = fetchImage(filename, url);
+ boolean successful = fetchImage(filename, url);
if (!successful)
return null;
}
-
+
return filename;
}
-
+
protected static boolean fetchImage(String filename, URL url) {
try {
new File("image_cache").mkdirs();
@@ -72,7 +72,7 @@ protected static boolean fetchImage(String filename, URL url) {
return false;
}
}
-
+
//these two methods taken from http://en.gravatar.com/site/implement/java
private static String hex(byte[] array) {
StringBuffer sb = new StringBuffer();
View
32 src/CodeSwarmConfig.java
@@ -108,8 +108,8 @@
public static final String DRAW_CIRCULAR_AVATARS = "CircularAvatars";
private List<Properties> propStack;
-
-
+
+
// Cache variables
private Color _background = null;
@@ -118,7 +118,7 @@ public CodeSwarmConfig(String configFileName) throws IOException {
initPropStack();
addPropertiesLayer(configFileName);
}
-
+
public CodeSwarmConfig(Iterable<String> configFileNames) throws IOException {
initPropStack();
for (String filename: configFileNames)
@@ -134,12 +134,12 @@ public void addPropertiesLayer(String filename) throws IOException {
props.load(new FileInputStream(filename));
addPropertiesLayer(props);
}
-
+
protected void initPropStack() {
propStack = new LinkedList<Properties>();
propStack.add(createDefaults());
}
-
+
private Properties createDefaults() {
Properties def = new Properties();
def.setProperty( COLOR_ASSIGN_KEY + "1" , DEFAULT_COLOR_ASSIGN );
@@ -148,7 +148,7 @@ private Properties createDefaults() {
/**
- *
+ *
* @param key
* @return Returns the first key found in the stack of config files.
*/
@@ -163,7 +163,7 @@ public Color getColorProperty(String key) {
return stringToColor( getStringProperty(key) );
}
-
+
/**
* Specify the path to the Xml-input file containing the repository
* entries.<br />
@@ -176,13 +176,13 @@ public void setInputFile(String filePath){
propStack.get(0).setProperty(INPUT_FILE_KEY, filePath);
}
-
+
public boolean getBooleanProperty(String key) {
return Boolean.valueOf(getStringProperty(key));
}
-
+
/**
- *
+ *
* @param key
* @return value of property if found, 0 if not found.
*/
@@ -191,7 +191,7 @@ public int getIntProperty( String key ) {
}
/**
- *
+ *
* @param key
* @param defValue
* @return value of property if found.
@@ -204,7 +204,7 @@ public int getPositiveIntProperty(String key) {
}
/**
- *
+ *
* @param key
* @param defValue
* @return defValue if not found or found value isn't negative, Value of property if found.
@@ -219,7 +219,7 @@ public int getNegativeIntProperty( String key) {
/**
- *
+ *
* @param key
* @return value of property if found, 0 if not found.
*/
@@ -228,7 +228,7 @@ public long getLongProperty( String key ) {
}
/**
- *
+ *
* @param key
* @return value of property if found, 0 if not found.
*/
@@ -237,7 +237,7 @@ public float getFloatProperty( String key ) {
}
/**
- *
+ *
* @param index
* @return String containing the regex and rgb values used to colorcode nodes, null if not found
*/
@@ -246,7 +246,7 @@ public String getColorAssignProperty( Integer index ) {
}
/**
- *
+ *
* @param str
* @return Color object constructed from values in str
*/
View
14 src/FreebaseAvatarFetcher.java
@@ -15,7 +15,7 @@ public FreebaseAvatarFetcher(CodeSwarmConfig cfg) {
}
static private Pattern imageIDPattern = Pattern.compile("\"image:id\"\\s*:\\s*\"(.*?)\"");
-
+
private static String readURLToString(URL url) {
try {
URLConnection con = url.openConnection();
@@ -25,7 +25,7 @@ private static String readURLToString(URL url) {
if (length == -1){
//read until exhausted
while(true){
- String line = reader.readLine();
+ String line = reader.readLine();
if (line == null) break;
sb.append(line);
}
@@ -41,7 +41,7 @@ private static String readURLToString(URL url) {
return null;
}
}
-
+
private static String getUserImageID(String username) {
try {
new File("image_cache").mkdirs();
@@ -58,7 +58,7 @@ private static String getUserImageID(String username) {
}
return null;
}
-
+
public String fetchUserImage(String username) {
String key = md5Hex("metaweb:" + username);
if (imageCached(key))
@@ -66,9 +66,9 @@ public String fetchUserImage(String username) {
try {
String imageID = getUserImageID(username);
if (imageID == null) return null;
- return getImage(key, new URL("http://www.freebase.com/api/trans/image_thumb/"
- + imageID
- + "?maxheight=" + size
+ return getImage(key, new URL("http://www.freebase.com/api/trans/image_thumb/"
+ + imageID
+ + "?maxheight=" + size
+ "&maxwidth=" + size
+ "&mode=fillcrop"));
} catch (MalformedURLException e) {
View
2  src/GravatarFetcher.java
@@ -18,7 +18,7 @@ public String fetchUserImage(String username) {
return null;
}
}
-
+
private Pattern emailPattern = Pattern.compile("<(.*?@.*?\\..*?)>");
private String getEmail(String username) {
Matcher emailMatcher = emailPattern.matcher(username);
View
10 src/LocalAvatar.java
@@ -4,18 +4,18 @@
public String dir = "";
public String empty_pic = null;
- public LocalAvatar(CodeSwarmConfig cfg) {
+ public LocalAvatar(CodeSwarmConfig cfg) {
super(cfg);
- dir = cfg.getStringProperty("LocalAvatarDirectory");
- empty_pic = cfg.getStringProperty("LocalAvatarDefaultPic");
+ dir = cfg.getStringProperty("LocalAvatarDirectory");
+ empty_pic = cfg.getStringProperty("LocalAvatarDefaultPic");
}
public String fetchUserImage(String username) {
- String filename = dir+username+".png";
+ String filename = dir+username+".png";
File f = new File(filename);
if(f.exists()) return filename;
return dir+empty_pic;
}
-
+
}
View
20 src/MainView.java
@@ -31,24 +31,24 @@
* This is the main entry point for the application.<br />
* This version is a fast implementation of a user-interface.<br />
* Further versions should be improved and include stuff like i18n.<br />
- * The usage of Swing-Application-Framework and Beans-Binding could help in the
+ * The usage of Swing-Application-Framework and Beans-Binding could help in the
* future.<br />
- *
+ *
* NOTE: This dialog was made using Netbeans. Modifications should be done with
* Netbeans (at least 6.0) to reflect them to the corresponding netbeans-form.
* @author tpraxl
*/
public class MainView extends javax.swing.JFrame {
- // This class couples SVNHistory too tightly.
- // TODO The concrete History-Implementation should be created by a Factory
+ // This class couples SVNHistory too tightly.
+ // TODO The concrete History-Implementation should be created by a Factory
// depending on the URL and/or other settings.
-
+
/**
- *
+ *
*/
private static final long serialVersionUID = 1L;
/**
- * initializes the Dialog and sets the dialog-values according to the
+ * initializes the Dialog and sets the dialog-values according to the
* user's preferences (the last values entered).
* @param args java arguments passed to the main method. The first parameter
* will be passed to {@link code_swarm}. It specifies the config-file.
@@ -149,8 +149,8 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
/**
* gets called when the user presses the "Go"-Button.<br />
- * It manages fetching the repository entries and serving it to
- * {@link code_swarm}. It starts code_swarm after fetching the repository
+ * It manages fetching the repository entries and serving it to
+ * {@link code_swarm}. It starts code_swarm after fetching the repository
* entries.
* @param evt The ActionEvent from Swing
*/
@@ -192,7 +192,7 @@ private void clearCacheActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FI
}//GEN-LAST:event_clearCacheActionPerformed
/**
- * This is the main entry-point. It sets the native Look&Feel, creates and
+ * This is the main entry-point. It sets the native Look&Feel, creates and
* shows the MainView.
* @param args the command line arguments. The first parameter
* will be passed to {@link code_swarm}. It specifies the config-file.
View
32 src/PhysicsEngine.java
@@ -25,7 +25,7 @@
*
* @note Need to be derived to define force calculation algorithms between Nodes
* @note Need to use the constructor to apply some configuration options
- *
+ *
* @note For portability, no Processing library should be use there, only standard Java packages
*/
public abstract class PhysicsEngine
@@ -36,20 +36,20 @@
* @param p Properties file
*/
public abstract void setup (CodeSwarmConfig p);
-
+
/**
* Method that allows Physics Engine to initialize the Frame
- *
+ *
*/
public void initializeFrame() {}
-
+
/**
* Method that allows Physics Engine to finalize the Frame
- *
+ *
*/
public void finalizeFrame() {}
-
+
public void onRelax(code_swarm.PersonNode p){}
public void onRelax(code_swarm.FileNode f){}
@@ -72,26 +72,26 @@ private void updateNode(code_swarm.Node node) {
node.decay();
}
-
+
/**
- *
+ *
* @return Vector2f vector holding the starting location for a Person Node
*/
public Vector2f startLocation(code_swarm.PersonNode node){
return randomLocation();
}
-
-
+
+
/**
- *
+ *
* @return Vector2f vector holding the starting location for a File Node
*/
public Vector2f startLocation(code_swarm.FileNode node){
return randomLocation();
}
-
+
/**
- *
+ *
* @return Vector2f vector holding the starting velocity for a File Node
*/
public Vector2f startVelocity(code_swarm.PersonNode node) {
@@ -103,19 +103,19 @@ public Vector2f startVelocity(code_swarm.FileNode node) {
vec.scale((1 / vec.length()) * (float)Math.random() * 15 / node.mass);
return vec;
}
-
+
public Vector2f randomLocation() {
Vector2f vec = new Vector2f(code_swarm.width*(float)Math.random(), code_swarm.height*(float)Math.random());
return vec;
}
-
+
protected float constrain(float value, float min, float max) {
if (value < min) {
return min;
} else if (value > max) {
return max;
}
-
+
return value;
}
}
View
20 src/PhysicsEngineOrderly.java
@@ -22,7 +22,7 @@
/**
* @brief A modification of the Legacy engine to prevent people from piling up in the center
- *
+ *
* @see PhysicsEngine Physics Engine Interface
*/
public class PhysicsEngineOrderly extends PhysicsEngine
@@ -30,7 +30,7 @@
private CodeSwarmConfig cfg;
private float MIN_DISTANCE_SQR;
-
+
/**
* Method for initializing parameters.
* @param p The CodeSwarmConfig for this code_swarm instance
@@ -40,13 +40,13 @@ public void setup (CodeSwarmConfig p)
cfg = p;
MIN_DISTANCE_SQR = 40000;
}
-
-
+
+
/**
* Method that allows Physics Engine to modify Speed / Position during the relax phase.
- *
+ *
* @param pNode the node to which the force apply
- *
+ *
* @Note Standard physics is "Position Variation = Speed x Duration" with a convention of "Duration=1" between to frames
*/
public void onRelax(code_swarm.PersonNode pNode) {
@@ -102,12 +102,12 @@ public void onRelax(code_swarm.PersonNode pNode) {
index = 0;
}
index++;
-
+
code_swarm.FileNode file = editedFiles.next();
//leave a hole for the null files
if (file == null) continue;
-
- final int place_around_ring = index * num_nodes_in_ring + salt;
+
+ final int place_around_ring = index * num_nodes_in_ring + salt;
int x = (int)(radius * Math.sin(place_around_ring));
int y = (int)(radius * Math.cos(place_around_ring));
@@ -120,7 +120,7 @@ public void onRelax(code_swarm.PersonNode pNode) {
}
/**
- *
+ *
* @return Vector2f vector holding the starting location for a Person Node
*/
public Vector2f pStartLocation(){
View
34 src/Vector.java
@@ -22,13 +22,13 @@
* A small object to manipulate multidimensional force vector (2D).
*
* Used by physical engine classes, ie. ForceCalculation, ForceApplication and PositionUpdate
- *
+ *
* @remark currently 2D, but one day, 3D would be great
*/
class Vector
{
- protected float x, y;
-
+ protected float x, y;
+
/**
* Default constructor, null vector.
*/
@@ -37,10 +37,10 @@
x = 0;
y = 0;
}
-
+
/**
* Constructor, init the vector and calculate its norm.
- *
+ *
* @param x x-axis component of the force
* @param y y-axis component of the force
*/
@@ -54,36 +54,36 @@ public void setX(float x)
{
this.x = x;
}
-
+
public void setY(float y)
{
this.y = y;
}
-
+
public void set(float x, float y)
{
this.x = x;
this.y = y;
}
-
+
public void set(Vector force)
{
this.x = force.getX();
this.y = force.getY();
}
-
+
public void add(float x, float y)
{
this.x += x;
this.y += y;
}
-
+
public void add(Vector force)
{
this.x += force.getX();
this.y += force.getY();
}
-
+
/**
* @return xx x-axis component of the force.
*/
@@ -99,7 +99,7 @@ public float getY()
{
return y;
}
-
+
/**
* @return calculated norm of the vector (ie. its length).
*/
@@ -107,19 +107,19 @@ public float getNorm()
{
return (float)Math.sqrt(x*x + y*y);
}
-
+
/**
* multiply each component by the multiplier, recalculates the resulting norm.
- *
+ *
* @param multiplier
- *
- * TODO: transform to/add a '*' operator redefinition
+ *
+ * TODO: transform to/add a '*' operator redefinition
*/
void multiply(float multiplier)
{
x *= multiplier;
y *= multiplier;
}
-
+
}
View
148 src/code_swarm.java
@@ -53,11 +53,11 @@
/**
- *
+ *
*
*/
public class code_swarm extends PApplet {
- /** @remark needed for any serializable class */
+ /** @remark needed for any serializable class */
public static final long serialVersionUID = 0;
// User-defined variables
@@ -80,11 +80,11 @@
// Liveness cache
static List<PersonNode> livingPeople = new ArrayList<PersonNode>();
static List<Edge> livingEdges = new ArrayList<Edge>();
- static List<FileNode> livingNodes = new ArrayList<FileNode>();
-
+ static List<FileNode> livingNodes = new ArrayList<FileNode>();
+
LinkedList<ColorBins> history;
boolean finishedLoading = false;
-
+
// Temporary variables
FileEvent currentEvent;
Date nextDate;
@@ -99,8 +99,8 @@
PImage avatarMask;
boolean paused = false;
-
- // Graphics state variables
+
+ // Graphics state variables
boolean showHistogram;
boolean showDate;
boolean showLegend;
@@ -115,11 +115,11 @@
boolean drawFilesSharp;
boolean drawFilesFuzzy;
boolean drawFilesJelly;
-
+
//used to ensure that input is sorted when we're told it is
long maximumDateSeenSoFar = 0;
-
-
+
+
// Color mapper
ColorAssigner colorAssigner;
int currentColor;
@@ -138,7 +138,7 @@
private float PERSON_MASS;
private int HIGHLIGHT_PCT;
-
+
// Physics engine configuration
String physicsEngineConfigDir;
String physicsEngineSelection;
@@ -158,7 +158,7 @@
//kinda a hack that these two are static
protected static CodeSwarmConfig cfg;
protected static String userConfigFilename = null;
-
+
private long lastDrawDuration = 0;
private String loadingMessage = "Reading input file";
protected static int width=0;
@@ -178,8 +178,8 @@
private int fontColor;
-
-
+
+
/**
* Initialization
*/
@@ -195,18 +195,18 @@ public void setup() {
} else {
size(width, height);
}
-
+
int maxBackgroundThreads = cfg.getPositiveIntProperty(CodeSwarmConfig.MAX_THREADS_KEY);
backgroundExecutor = new ThreadPoolExecutor(1, maxBackgroundThreads, Long.MAX_VALUE, TimeUnit.NANOSECONDS, new ArrayBlockingQueue<Runnable>(4 * maxBackgroundThreads), new ThreadPoolExecutor.CallerRunsPolicy());
-
+
showLegend = cfg.getBooleanProperty(CodeSwarmConfig.SHOW_LEGEND);
- showHistogram = cfg.getBooleanProperty(CodeSwarmConfig.SHOW_HISTORY);
+ showHistogram = cfg.getBooleanProperty(CodeSwarmConfig.SHOW_HISTORY);
showDate = cfg.getBooleanProperty(CodeSwarmConfig.SHOW_DATE);
showEdges = cfg.getBooleanProperty(CodeSwarmConfig.SHOW_EDGES);
showDebug = cfg.getBooleanProperty(CodeSwarmConfig.SHOW_DEBUG);
takeSnapshots = cfg.getBooleanProperty(CodeSwarmConfig.TAKE_SNAPSHOTS_KEY);
drawNamesSharp = cfg.getBooleanProperty(CodeSwarmConfig.DRAW_NAMES_SHARP);
- drawNamesHalos = cfg.getBooleanProperty(CodeSwarmConfig.DRAW_NAMES_HALOS);
+ drawNamesHalos = cfg.getBooleanProperty(CodeSwarmConfig.DRAW_NAMES_HALOS);
drawFilesSharp = cfg.getBooleanProperty(CodeSwarmConfig.DRAW_FILES_SHARP);
drawFilesFuzzy = cfg.getBooleanProperty(CodeSwarmConfig.DRAW_FILES_FUZZY);
drawFilesJelly = cfg.getBooleanProperty(CodeSwarmConfig.DRAW_FILES_JELLY);
@@ -214,14 +214,14 @@ public void setup() {
background = cfg.getColorProperty(CodeSwarmConfig.BACKGROUND_KEY).getRGB();
fontColor = cfg.getColorProperty(CodeSwarmConfig.FONT_COLOR_KEY).getRGB();
-
+
// Ensure we have sane values.
EDGE_LIFE_INIT = cfg.getPositiveIntProperty(CodeSwarmConfig.EDGE_LIFE_KEY);
FILE_LIFE_INIT = cfg.getPositiveIntProperty(CodeSwarmConfig.FILE_LIFE_KEY);
PERSON_LIFE_INIT = cfg.getPositiveIntProperty(CodeSwarmConfig.PERSON_LIFE_KEY);
-
-
-
+
+
+
/* enforce decrements < 0 */
EDGE_LIFE_DECREMENT = cfg.getNegativeIntProperty(CodeSwarmConfig.EDGE_DECREMENT_KEY);
FILE_LIFE_DECREMENT = cfg.getNegativeIntProperty(CodeSwarmConfig.FILE_DECREMENT_KEY);
@@ -237,7 +237,7 @@ public void setup() {
isInputSorted = cfg.getBooleanProperty(CodeSwarmConfig.IS_INPUT_SORTED_KEY);
showUserName = cfg.getBooleanProperty(CodeSwarmConfig.SHOW_USER_NAME_KEY);
-
+
avatarFetcher = getAvatarFetcher(cfg.getStringProperty("AvatarFetcher"));
/**
@@ -255,7 +255,7 @@ public void setup() {
String ConfigPath = physicsEngineConfigDir + System.getProperty("file.separator") + configFiles[i];
CodeSwarmConfig physicsConfig = null;
try {
-
+
physicsConfig = new CodeSwarmConfig(ConfigPath);
} catch (IOException e) {
e.printStackTrace();
@@ -291,8 +291,8 @@ public void setup() {
System.exit(1);
}
-
-
+
+
smooth();
frameRate(FRAME_RATE);
@@ -300,14 +300,14 @@ public void setup() {
nodes = new HashMap<String,FileNode>();
edges = new HashMap<Pair<FileNode, PersonNode>, Edge>();
people = new HashMap<String,PersonNode>();
- history = new LinkedList<ColorBins>();
+ history = new LinkedList<ColorBins>();
if (isInputSorted)
//If the input is sorted, we only need to store the next few events
eventsQueue = new ArrayBlockingQueue<FileEvent>(50000);
else
//Otherwise we need to store them all at once in a data structure that will sort them
eventsQueue = new PriorityBlockingQueue<FileEvent>();
-
+
// Init color map
initColors();
@@ -321,9 +321,9 @@ public void setup() {
SCREENSHOT_FILE = cfg.getStringProperty(CodeSwarmConfig.SNAPSHOT_LOCATION_KEY);
EDGE_LEN = cfg.getPositiveIntProperty(CodeSwarmConfig.EDGE_LENGTH_KEY);
-
+
maxFramesSaved = (int) Math.pow(10, SCREENSHOT_FILE.replaceAll("[^#]","").length());
-
+
// Create fonts
String fontName = cfg.getStringProperty(CodeSwarmConfig.FONT_KEY);
String boldFontName = cfg.getStringProperty(CodeSwarmConfig.FONT_KEY_BOLD);
@@ -404,7 +404,7 @@ public void draw() {
node.draw();
}
-
+
textFont(font);
// Show the physics engine name
@@ -443,7 +443,7 @@ else if (showLegend) {
}
// Stop animation when we run out of data
-
+
if (finishedLoading && eventsQueue.isEmpty()) {
// noLoop();
backgroundExecutor.shutdown();
@@ -589,7 +589,7 @@ public void drawDebugData() {
text("Queue: " + eventsQueue.size(), 0, 20);
text("Last render time: " + lastDrawDuration, 0, 30);
}
-
+
/**
* TODO This could be made to look a lot better.
*/
@@ -631,7 +631,7 @@ public void drawPopular() {
}
}
}
-
+
/**
* @param name
* @return physics engine instance
@@ -647,7 +647,7 @@ public PhysicsEngine getPhysicsEngine(String name) {
e.printStackTrace();
System.exit(1);
}
-
+
return pe;
}
@@ -657,21 +657,21 @@ public PhysicsEngine getPhysicsEngine(String name) {
public static List<PersonNode> getLivingPeople() {
return Collections.unmodifiableList (livingPeople);
}
-
+
/**
* @return list of edges whose life is > 0
*/
public static List<Edge> getLivingEdges() {
return Collections.unmodifiableList (livingEdges);
}
-
+
/**
* @return list of file nodes whose life is > 0
*/
public static List<FileNode> getLivingNodes() {
return Collections.unmodifiableList (livingNodes);
}
-
+
private static <T extends Drawable> List<T> filterLiving(Collection<T> iter) {
ArrayList<T> livingThings = new ArrayList<T>(iter.size());
for (T thing : iter)
@@ -679,7 +679,7 @@ public PhysicsEngine getPhysicsEngine(String name) {
livingThings.add(thing);
return livingThings;
}
-
+
/**
* Take screenshot
*/
@@ -712,7 +712,7 @@ public void update() {
if (finishedLoading){
currentEvent = eventsQueue.poll();
if (currentEvent == null)
- return;
+ return;
}
else {
try {
@@ -723,7 +723,7 @@ public void update() {
continue;
}
}
-
+
FileNode n = findNode(currentEvent.path + currentEvent.filename);
if (n == null) {
n = new FileNode(currentEvent);
@@ -743,16 +743,16 @@ public void update() {
p.freshen();
}
p.addColor(n.nodeHue);
-
+
Edge ped = findEdge(n, p);
if (ped == null) {
ped = new Edge(n, p);
edges.put(new Pair<FileNode,PersonNode>(n,p), ped);
} else
ped.freshen();
-
+
n.setEditor(p);
-
+
/*
* if ( currentEvent.date.equals( prevDate ) ) { Edge e = findEdge( n, prevNode
* ); if ( e == null ) { e = new Edge( n, prevNode ); edges.add( e ); } else {
@@ -767,7 +767,7 @@ public void update() {
while(eventsQueue.isEmpty());
currentEvent = eventsQueue.peek();
}
-
+
}
prevDate = nextDate;
@@ -790,13 +790,13 @@ public void update() {
Have have to do it this way as the physics engine onRelax methods
loop on all living elements and filtering this for every element
- gets too painfull slow on logs with over 100.000 entries.
+ gets too painfull slow on logs with over 100.000 entries.
*/
livingPeople = filterLiving(people.values());
livingNodes = filterLiving(nodes.values());
livingEdges = filterLiving(edges.values());
-
+
// update velocity
for (Edge edge : getLivingEdges()) {
mPhysicsEngine.onRelax(edge);
@@ -831,7 +831,7 @@ public void update() {
// Finalize frame:
mPhysicsEngine.finalizeFrame();
-
+
safeToToggle = true;
if (wantToToggle == true) {
switchPhysicsEngine(toggleDirection);
@@ -873,14 +873,14 @@ public PersonNode findPerson(String name) {
public void loadRepEvents(String filename) {
if (userConfigFilename != null) {
String parentPath = new File(userConfigFilename).getParentFile().getAbsolutePath();
- File fileInConfigDir = new File(parentPath, filename);
+ File fileInConfigDir = new File(parentPath, filename);
if (fileInConfigDir.exists())
filename = fileInConfigDir.getAbsolutePath();
}
-
+
final String fullFilename = filename;
Runnable eventLoader = new XMLQueueLoader(fullFilename, eventsQueue, isInputSorted);
-
+
if (isInputSorted)
backgroundExecutor.execute(eventLoader);
else
@@ -1021,7 +1021,7 @@ public void pauseButton() {
private BlockingQueue<FileEvent> queue;
boolean isXMLSorted;
private Set<String> peopleSeen = new TreeSet<String>();
-
+
private XMLQueueLoader(String fullFilename, BlockingQueue<FileEvent> queue, boolean isXMLSorted) {
this.fullFilename = fullFilename;
this.queue = queue;
@@ -1044,7 +1044,7 @@ public void startElement(String uri, String localName, String name,
String eventFilename = atts.getValue("filename");
String eventDatestr = atts.getValue("date");
long eventDate = Long.parseLong(eventDatestr);
-
+
//It's difficult for the user to tell that they're missing events,
//so we should crash in this case
if (isXMLSorted){
@@ -1055,19 +1055,19 @@ public void startElement(String uri, String localName, String name,
else
maximumDateSeenSoFar = eventDate;
}
-
+
String eventAuthor = atts.getValue("author");
// int eventLinesAdded = atts.getValue( "linesadded" );
// int eventLinesRemoved = atts.getValue( "linesremoved" );
-
+
FileEvent evt = new FileEvent(eventDate, eventAuthor, "", eventFilename);
-
+
//We want to pre-fetch images to minimize lag as images are loaded
if (!peopleSeen.contains(eventAuthor)){
avatarFetcher.fetchUserImage(eventAuthor);
peopleSeen.add(eventAuthor);
}
-
+
try {
queue.put(evt);
} catch (InterruptedException e) {
@@ -1185,7 +1185,7 @@ public int compareTo(Object o) {
/**
* Base class for all drawable objects
- *
+ *
* Lists and implements features common to all drawable objects
* Edge and Node, FileNode and PersonNode
*/
@@ -1196,7 +1196,7 @@ public int compareTo(Object o) {
final public int LIFE_DECREMENT;
/**
* 1) constructor(s)
- *
+ *
* Init jobs common to all objects
*/
Drawable(int lifeInit, int lifeDecrement) {
@@ -1206,7 +1206,7 @@ public int compareTo(Object o) {
// init life relative vars
life = LIFE_INIT;
}
-
+
/**
* 4) shortening life.
*/
@@ -1228,14 +1228,14 @@ public void decay() {
* 6) reseting life as if new.
*/
public abstract void freshen();
-
+
/**
* @return true if life > 0
*/
public boolean isAlive() {
return life > 0;
}
-
+
}
/**
@@ -1246,7 +1246,7 @@ public boolean isAlive() {
protected PersonNode nodeTo;
protected float len;
-
+
/**
* 1) constructor.
* @param from FileNode
@@ -1310,7 +1310,7 @@ public void freshen() {
private int minBold;
protected int touches;
private PersonNode lastEditor = null;
-
+
/**
* @return file node as a string
*/
@@ -1352,11 +1352,11 @@ public void draw() {
}
// Draw motion blur
// float d = mPosition.distance(mLastPosition);
-
+
float nx = mPosition.x - mLastPosition.x;
float ny = mPosition.y - mLastPosition.y;
float d = (float) Math.sqrt(nx * nx + ny * ny);
-
+
stroke(nodeHue, min(255f * (d / 10f), 255f) / 10f);
strokeCap(ROUND);
strokeWeight(currentWidth / 4f);
@@ -1385,7 +1385,7 @@ public void freshen() {
maxTouches = touches;
}
}
-
+
public boolean isAlive() {
boolean alive = life > 0;
if (!alive && lastEditor != null) {
@@ -1394,10 +1394,10 @@ public boolean isAlive() {
lastEditor.editing.set(idx, null);
lastEditor = null;
}
-
+
return alive;
}
-
+
public void setEditor(PersonNode editor) {
if (editor == lastEditor)
return;
@@ -1493,7 +1493,7 @@ public void drawJelly() {
mass = PERSON_MASS; // bigger mass to person then to node, to stabilize them
touches = 1;
mPosition.set(mPhysicsEngine.startLocation(this));
- mLastPosition.set(new Vector2f(mPosition));
+ mLastPosition.set(new Vector2f(mPosition));
mLastPosition.add(mPhysicsEngine.startVelocity(this));
mFriction = 0.99f;
String iconFile = avatarFetcher.fetchUserImage(name);
@@ -1517,7 +1517,7 @@ public void draw() {
textFont(boldFont);
else
textFont(font);
-
+
fill(fontColor, life);
if(showUserName)
text(name, mPosition.x, mPosition.y+10);
@@ -1549,7 +1549,7 @@ static public void main(String args[]) {
try {
if (args.length > 0) {
userConfigFilename = args[0];
- List<String> configFileStack = Arrays.asList(new String[]{"defaults/code_swarm.config",
+ List<String> configFileStack = Arrays.asList(new String[]{"defaults/code_swarm.config",
"defaults/user.config",
args[0]});
start(new CodeSwarmConfig(configFileStack));
@@ -1565,8 +1565,8 @@ static public void main(String args[]) {
/**
* the alternative entry-point for code_swarm. It gets called from
* {@link MainView} after fetching the repository log.
- * @param config the modified config
- * (it's InputFile-property has been changed to reflect the
+ * @param config the modified config
+ * (it's InputFile-property has been changed to reflect the
* fetched repository-log)
*/
public static void start(CodeSwarmConfig config){
View
2  src/org/codeswarm/dependencies/sun/tools/javac/util/Pair.java
@@ -2,7 +2,7 @@
* So it turns out that there's not a decent implementation of Pair
* in Java's supported API. Fortunately it's open source,
* so here's a decent version for the benefit of platforms without
- * it.
+ * it.
*/
/*
View
40 src/org/codeswarm/repository/RepositoryHistoryVisitor.java
@@ -16,18 +16,18 @@
package org.codeswarm.repository;
/**
- * This interface provides hooks and methods for concrete
+ * This interface provides hooks and methods for concrete
* RepositoryHistoryVisitor-implementations.<br />
- * It is not tight to concrete repositories like CVS, SVN, etc. but can be
+ * It is not tight to concrete repositories like CVS, SVN, etc. but can be
* used as an API to visit arbitrary repositories.
* Derived classes may be of two types:<br />
* <dl>
* <dt>Repository-specific Behaviour</dt>
- * <dd>Derived classes that implement the behaviour to visit the
+ * <dd>Derived classes that implement the behaviour to visit the
* repository-entries of concrete repositories (like CVS, SVN).<br />
- * These classes should be abstract.
+ * These classes should be abstract.
* They should implement {@link #run(String, String, String)}.<br />
- * They should not implement the other methods, but simply call them in
+ * They should not implement the other methods, but simply call them in
* appropriate situations, as those methods are meant to be hooks.
* </dd>
* <dt>Context-specific Behaviour</dt>
@@ -36,27 +36,27 @@
* operations on the hooks being called.
* </dd>
* </dl>
- *
+ *
* NOTE: The interface is work in progress and should be improved.
* @author tpraxl
*/
public interface RepositoryHistoryVisitor <E, T, R > {
- // TODO remove userName and password from this implementation
- // and replace it with an AuthenticationManager to be able to use arbitrary
+ // TODO remove userName and password from this implementation
+ // and replace it with an AuthenticationManager to be able to use arbitrary
// authentication-mechanisms such as key-file based authentication.
-
+
// TODO think about redesign to decouple from SVNKit.
- // This interface was designed around SVNKit's behaviour. It's design
+ // This interface was designed around SVNKit's behaviour. It's design
// should be changed to be more abstract.
/**
* This method gets called when the visitor shall start its operation.
- * @param url complete repository url
+ * @param url complete repository url
* (with protocoll prefix, such as http://, svn://)
* @param name userName
* @param password userPassword
*/
public void run(String url, String name, String password);
-
+
// HOOKS
// EXCEPTION HOOKS:
/**
@@ -66,19 +66,19 @@
public abstract void handleStart(String url);
/**
* An Exception has occured while trying to create a Repository driver
- * for the specified protocol. No RepositoryDriver is available for the
+ * for the specified protocol. No RepositoryDriver is available for the
* protocol. This exception is typically not recoverable.
* @param exception The original Exception
* @param url The url whose protocol was analyzed.
- * @return false if you want to stop further processing, true if you want to
+ * @return false if you want to stop further processing, true if you want to
* proceed. Typically you will want to return false.
*/
public abstract boolean handleCreateRepositoryException(T exception, String url);
/**
- * An Exception has occured while trying to fetch the latest revision
- * number. This exception is caused by authentication or connection failures.
+ * An Exception has occured while trying to fetch the latest revision
+ * number. This exception is caused by authentication or connection failures.
* @param exception The original Exception
- * @return null if you want to stop further processing, a desired Revision if you want to
+ * @return null if you want to stop further processing, a desired Revision if you want to
* proceed. Typically you will want to return null.
*/
public abstract R handleFetchingLatestRepositoryRevisionException(T exception);
@@ -87,7 +87,7 @@
* This exception is caused by authentication or connection failures.
* @param exception The original Exception
* @param url The url to the repository that was asked for the log.
- * @return false if you want to stop further processing, true if you want to
+ * @return false if you want to stop further processing, true if you want to
* proceed. Typically you will want to return false.
*/
public abstract boolean handleCollectingLogInformationException(T exception, String url);
@@ -101,8 +101,8 @@
* The latest repository revision was fetched. Implement code to process the
* information.
* @param revision the latest repository revision
- * @return false if you want to stop further processing, true if you want to
- * proceed. Return false to stop processing for example when a cached
+ * @return false if you want to stop further processing, true if you want to
+ * proceed. Return false to stop processing for example when a cached
* version was found.
*/
public abstract boolean handleFetchingLatestRepositoryRevision(R revision);
View
54 src/org/codeswarm/repository/svn/AbstractSVNHistoryVisitor.java
@@ -35,7 +35,7 @@
/**
* Provides access to the repository log of svn-repositories. Using SVNKit.<br />
* It simply visits all entries of the log and calls the corresponding hooks.<br />
- *
+ *
* Derived classes must implement the hooks to perform corresponding operations.
* @see org.codeswarm.repository.RepositoryHistoryVisitor
* NOTE: The class is work in progress and should be improved.
@@ -45,7 +45,7 @@
/**
* Starts the repository-log-lookup from the first to the last revision.
* @see #run(String, Long, Long, String, String)
- * @param url the complete url to the repository
+ * @param url the complete url to the repository
* (including the protocol (http://, svn://,...))
* @param name username for authentication
* @param password users password for authentication
@@ -56,11 +56,11 @@ public void run(String url, String name, String password){
/**
* Starts the repository-log-lookup.
* @see #run(String, String, String)
- * @param url the complete url to the repository
+ * @param url the complete url to the repository
* (including the protocol (http://, svn://,...))
* @param pStartrevision the revision to start with
* @param pEndrevision the last revision to take into account.<br />
- * NOTE: Currently this parameter is not supported.
+ * NOTE: Currently this parameter is not supported.
* The log will always be fetched until the last revision.
* @param name username for authentication
* @param password users password for authentication
@@ -77,7 +77,7 @@ public void run(String url, Long pStartrevision, Long pEndrevision, String name,
setupLibrary();
SVNRepository repository = null;
-
+
try {
/*
* Creates an instance of SVNRepository to work with the repository.
@@ -93,20 +93,20 @@ public void run(String url, Long pStartrevision, Long pEndrevision, String name,
}
/*
- * User's authentication information (name/password) is provided via an
- * ISVNAuthenticationManager instance. SVNWCUtil creates a default
+ * User's authentication information (name/password) is provided via an
+ * ISVNAuthenticationManager instance. SVNWCUtil creates a default
* authentication manager given user's name and password.
- *
- * Default authentication manager first attempts to use provided user name
- * and password and then falls back to the credentials stored in the
- * default Subversion credentials storage that is located in Subversion
- * configuration area. If you'd like to use provided user name and password
- * only you may use BasicAuthenticationManager class instead of default
+ *
+ * Default authentication manager first attempts to use provided user name
+ * and password and then falls back to the credentials stored in the
+ * default Subversion credentials storage that is located in Subversion
+ * configuration area. If you'd like to use provided user name and password
+ * only you may use BasicAuthenticationManager class instead of default
* authentication manager:
- *
+ *
* authManager = new BasicAuthenticationsManager(userName, userPassword);
- *
- * You may also skip this point - anonymous access will be used.
+ *
+ * You may also skip this point - anonymous access will be used.
*/
ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(name, password);
repository.setAuthenticationManager(authManager);
@@ -135,31 +135,31 @@ public void run(String url, Long pStartrevision, Long pEndrevision, String name,
* defined by its start and end points [startRevision, endRevision].
* For each revision commit information is represented by
* SVNLogEntry.
- *
+ *
* the 1st parameter (targetPaths - an array of path strings) is set
* when restricting the [startRevision, endRevision] range to only
* those revisions when the paths in targetPaths were changed.
- *
+ *
* the 2nd parameter if non-null - is a user's Collection that will
* be filled up with found SVNLogEntry objects; it's just another
* way to reach the scope.
- *
+ *
* startRevision, endRevision - to define a range of revisions you are
* interested in; by default in this program - startRevision=0, endRevision=
* the latest (HEAD) revision of the repository.
- *
+ *
* the 5th parameter - a boolean flag changedPath - if true then for
* each revision a corresponding SVNLogEntry will contain a map of
* all paths which were changed in that revision.
- *
+ *
* the 6th parameter - a boolean flag strictNode - if false and a
* changed path is a copy (branch) of an existing one in the repository
- * then the history for its origin will be traversed; it means the
- * history of changes of the target URL (and all that there's in that
+ * then the history for its origin will be traversed; it means the
+ * history of changes of the target URL (and all that there's in that
* URL) will include the history of the origin path(s).
* Otherwise if strictNode is true then the origin path history won't be
* included.
- *
+ *
* The return value is a Collection filled up with SVNLogEntry Objects.
*/
logEntries = repository.log(new String[] {""}, null,
@@ -175,7 +175,7 @@ public void run(String url, Long pStartrevision, Long pEndrevision, String name,
}
/*
- * Initializes the library to work with a repository via
+ * Initializes the library to work with a repository via
* different protocols.
*/
private static void setupLibrary() {
@@ -187,12 +187,12 @@ private static void setupLibrary() {
* For using over svn:// and svn+xxx://
*/
SVNRepositoryFactoryImpl.setup();
-
+
/*
* For using over file:///
*/
FSRepositoryFactory.setup();
}
-
+
}
View
12 src/org/codeswarm/repository/svn/SVNHistory.java
@@ -77,7 +77,7 @@ public void handleStart(String url) {
* looks up the cache. Stops proceeding if a cached version for this
* repository was found.
* @param pRevision the latest repository revision.
- * @return false if a cached version was found, true if the history shall
+ * @return false if a cached version was found, true if the history shall
* be fetched from repository.
*/
public boolean handleFetchingLatestRepositoryRevision(Long pRevision) {
@@ -108,7 +108,7 @@ public void handleLogEntry(SVNLogEntry logEntry) {
Set<String> keySet = logEntry.getChangedPaths().keySet();
for(String key : keySet){
SVNLogEntryPath entryPath = (SVNLogEntryPath) logEntry.getChangedPaths().get(key);
- list.addEvent(new Event(entryPath.getPath(),logEntry.getDate().getTime(),logEntry.getAuthor()));
+ list.addEvent(new Event(entryPath.getPath(),logEntry.getDate().getTime(),logEntry.getAuthor()));
if(LOGGER.isLoggable(Level.FINE)){
LOGGER.log(Level.FINE, "fetched entry {0}\n date {1}\n rev. {2}\n--", new Object[]{entryPath.getPath(),logEntry.getDate(), logEntry.getRevision()});
}
@@ -127,11 +127,11 @@ public void handleLogEntry(SVNLogEntry logEntry) {
SVNLogEntryPath entryPath = (SVNLogEntryPath) logEntry.getChangedPaths().get(changedPath);
/*
* SVNLogEntryPath.getPath returns the changed path itself;
- *
+ *
* SVNLogEntryPath.getType returns a charecter describing
* how the path was changed ('A' - added, 'D' - deleted or
* 'M' - modified);
- *
+ *
* If the path was copied from another one (branched) then
* SVNLogEntryPath.getCopyPath &
* SVNLogEntryPath.getCopyRevision tells where it was copied
@@ -143,7 +143,7 @@ public void handleLogEntry(SVNLogEntry logEntry) {
copyPathInfo.append("(from ").append(entryPath.getCopyPath());
copyPathInfo.append(" rev ").append(entryPath.getCopyRevision()).append(")");
}
- LOGGER.log(Level.FINE,"entry: {0} {1} {2}",
+ LOGGER.log(Level.FINE,"entry: {0} {1} {2}",
new Object[]{entryPath.getType(),entryPath.getPath(),copyPathInfo.toString()});
}
}
@@ -154,7 +154,7 @@ public void handleLogEntry(SVNLogEntry logEntry) {
*/
public void finishLogEntries() {
try {
- CodeSwarmEventsSerializer serializer =
+ CodeSwarmEventsSerializer serializer =
new CodeSwarmEventsSerializer(list);
serializer.serialize(getFilePath());
} catch (ParserConfigurationException ex) {
View
4 src/org/codeswarm/repositoryevents/CodeSwarmEventsSerializer.java
@@ -44,7 +44,7 @@ public CodeSwarmEventsSerializer(EventList list){
}
/**
* actually serializes the list to the file denoted by pathToFile
- * @param pathToFile the path to the xml file to serialize to.
+ * @param pathToFile the path to the xml file to serialize to.
* It gets created if it doesn't exist.
* @throws javax.xml.parsers.ParserConfigurationException
* When the serialization failed
@@ -76,5 +76,5 @@ public void serialize(String pathToFile) throws ParserConfigurationException, Tr
t.transform(new DOMSource(d), result);
out.close();
}
-
+
}
Please sign in to comment.
Something went wrong with that request. Please try again.