Skip to content

Commit

Permalink
Flag to disable username.
Browse files Browse the repository at this point in the history
  • Loading branch information
sandofsky committed Feb 3, 2010
1 parent 1b53939 commit 2a71a89
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions data/sample.config
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,4 @@ IsInputSorted=true

# OpenGL is experimental. Use at your own risk.
UseOpenGL=false
ShowUserName=true
1 change: 1 addition & 0 deletions data/twitter.config
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,4 @@ IsInputSorted=true

# OpenGL is experimental. Use at your own risk.
UseOpenGL=false
ShowUserName=false
1 change: 1 addition & 0 deletions src/CodeSwarmConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public class CodeSwarmConfig {
/** Controls where the config files are for the Physical Engine */
public static final String PHYSICS_ENGINE_CONF_DIR = "PhysicsEngineConfigDir";
public static final String IS_INPUT_SORTED_KEY = "IsInputSorted";
public static final String SHOW_USER_NAME_KEY = "ShowUserName";
/** Default regex and rgb values used to match anything not caught in the config file */
public static String DEFAULT_COLOR_ASSIGN = "\"Misc\",\".*\",128,128,128,128,128,128";

Expand Down
7 changes: 5 additions & 2 deletions src/code_swarm.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public class code_swarm extends PApplet {
// Data storage
BlockingQueue<FileEvent> eventsQueue;
boolean isInputSorted = false;
boolean showUserName = false;
protected static Map<String, FileNode> nodes;
protected static Map<Pair<FileNode, PersonNode>, Edge> edges;
protected static Map<String, PersonNode> people;
Expand Down Expand Up @@ -230,6 +231,7 @@ public void setup() {
UPDATE_DELTA = (long) (86400000 / framesperday);

isInputSorted = cfg.getBooleanProperty(CodeSwarmConfig.IS_INPUT_SORTED_KEY);
showUserName = cfg.getBooleanProperty(CodeSwarmConfig.SHOW_USER_NAME_KEY);

avatarFetcher = getAvatarFetcher(cfg.getStringProperty("AvatarFetcher"));

Expand Down Expand Up @@ -1492,11 +1494,12 @@ public void draw() {
textFont(font);

fill(fontColor, life);
text(name, mPosition.x, mPosition.y+10);
if(showUserName)
text(name, mPosition.x, mPosition.y+10);
if (icon != null){
colorMode(RGB);
tint(255,255,255,max(0,life-80));
image(icon, mPosition.x-(avatarFetcher.size / 2), mPosition.y-(avatarFetcher.size - 5));
image(icon, mPosition.x-(avatarFetcher.size / 2), mPosition.y-(avatarFetcher.size - ( showUserName ? 5 : 15)));
}
}
}
Expand Down

0 comments on commit 2a71a89

Please sign in to comment.