Changeset 666 for trunk/src/org/expeditee/settings/UserSettings.java
- Timestamp:
- 01/08/14 12:29:24 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/settings/UserSettings.java
r664 r666 22 22 import org.expeditee.items.ItemUtils; 23 23 import org.expeditee.items.Text; 24 import org.expeditee.setting.BooleanSetting; 25 import org.expeditee.setting.FloatSetting; 24 26 import org.expeditee.setting.FrameSetting; 25 27 import org.expeditee.setting.FunctionSetting; 26 import org.expeditee.setting. GenericSetting;28 import org.expeditee.setting.IntegerSetting; 27 29 import org.expeditee.setting.ListSetting; 28 30 import org.expeditee.setting.Setting; 31 import org.expeditee.setting.StringSetting; 32 import org.expeditee.setting.TextSetting; 29 33 30 34 /** … … 41 45 */ 42 46 43 public static final GenericSetting<Float> ScaleFactor = new GenericSetting<Float>(Float.class,"Scale Factor for drawing (TODO: does this even do anything?)", 1F);44 45 public static final GenericSetting<Float> FormatSpacingMin = new GenericSetting<Float>(Float.class,"Minimum spacing ratio", null);46 47 public static final GenericSetting<Float> FormatSpacingMax = new GenericSetting<Float>(Float.class,"Maximum spacing ratio", null);48 49 public static final GenericSetting<Integer> Gravity = new GenericSetting<Integer>(Integer.class,"Distance the cursor has to be from a text item to select the text item", 3);50 51 public static final GenericSetting<Integer> LineStraightenThreshold = new GenericSetting<Integer>(Integer.class,"Threshold for straightening a line (TODO: does this even do anything?)", 15);52 53 public static final GenericSetting<Integer> NoOpThreshold = new GenericSetting<Integer>(Integer.class,"Distance the cursor may be dragged while clicking before the operation is cancelled", 60);54 55 public static final GenericSetting<Integer> TitlePosition = new GenericSetting<Integer>(Integer.class,"Position of title item in frame (TODO: find whether this is x-offset or y-offset)", 150);56 57 public static final GenericSetting<Integer> InitialWidth = new GenericSetting<Integer>(Integer.class,"Initial width of Expeditee window", 1024);58 59 public static final GenericSetting<Integer> InitialHeight = new GenericSetting<Integer>(Integer.class,"Initial height of Expeditee window", 768);60 61 public static final GenericSetting<String> ProfileName = new GenericSetting<String>(String.class,"Profile name", FrameIO.ConvertToValidFramesetName(System.getProperty("user.name")));62 63 public static final GenericSetting<String> UserName = new GenericSetting<String>(String.class,"User name", ProfileName.get());64 65 public static final GenericSetting<Boolean> AntiAlias = new GenericSetting<Boolean>(Boolean.class,"Whether anti-aliasing should be enabled", false);66 67 public static final GenericSetting<Boolean> LineHighlight = new GenericSetting<Boolean>(Boolean.class,"Whether lines should be highlighted", false);68 69 public static final GenericSetting<Boolean> Logging = new GenericSetting<Boolean>(Boolean.class,"Whether logging should be enabled", false);70 71 public static final GenericSetting<Boolean> LogStats = new GenericSetting<Boolean>(Boolean.class,"Whether stats should be logged", true);72 73 public static final GenericSetting<Boolean> Threading = new GenericSetting<Boolean>(Boolean.class,"Whether threading should be enabled", true);47 public static final FloatSetting ScaleFactor = new FloatSetting("Scale Factor for drawing (TODO: does this even do anything?)", 1F); 48 49 public static final FloatSetting FormatSpacingMin = new FloatSetting("Minimum spacing ratio", null); 50 51 public static final FloatSetting FormatSpacingMax = new FloatSetting("Maximum spacing ratio", null); 52 53 public static final IntegerSetting Gravity = new IntegerSetting("Distance the cursor has to be from a text item to select the text item", 3); 54 55 public static final IntegerSetting LineStraightenThreshold = new IntegerSetting("Threshold for straightening a line (TODO: does this even do anything?)", 15); 56 57 public static final IntegerSetting NoOpThreshold = new IntegerSetting("Distance the cursor may be dragged while clicking before the operation is cancelled", 60); 58 59 public static final IntegerSetting TitlePosition = new IntegerSetting("Position of title item in frame (TODO: find whether this is x-offset or y-offset)", 150); 60 61 public static final IntegerSetting InitialWidth = new IntegerSetting("Initial width of Expeditee window", 1024); 62 63 public static final IntegerSetting InitialHeight = new IntegerSetting("Initial height of Expeditee window", 768); 64 65 public static final StringSetting ProfileName = new StringSetting("Profile name", FrameIO.ConvertToValidFramesetName(System.getProperty("user.name"))); 66 67 public static final StringSetting UserName = new StringSetting("User name", ProfileName.get()); 68 69 public static final BooleanSetting AntiAlias = new BooleanSetting("Whether anti-aliasing should be enabled", false); 70 71 public static final BooleanSetting LineHighlight = new BooleanSetting("Whether lines should be highlighted", false); 72 73 public static final BooleanSetting Logging = new BooleanSetting("Whether logging should be enabled", false); 74 75 public static final BooleanSetting LogStats = new BooleanSetting("Whether stats should be logged", true); 76 77 public static final BooleanSetting Threading = new BooleanSetting("Whether threading should be enabled", true); 74 78 75 79 … … 77 81 * Frames 78 82 */ 79 public static final GenericSetting<String> DefaultFrame = new GenericSetting<String>(String.class,"The default frame", null) {83 public static final StringSetting DefaultFrame = new StringSetting("The default frame", null) { 80 84 @Override 81 85 public boolean setSetting(Text text) { … … 85 89 }; 86 90 87 public static final GenericSetting<String> StatisticsFrameset = new GenericSetting<String>(String.class,"The statistics frameset", null);88 89 public static final GenericSetting<String> MenuFrame = new GenericSetting<String>(String.class,"The menu frame", null);90 91 public static final GenericSetting<String> HomeFrame = new GenericSetting<String>(String.class,"The home frame", null) {91 public static final StringSetting StatisticsFrameset = new StringSetting("The statistics frameset", null); 92 93 public static final StringSetting MenuFrame = new StringSetting("The menu frame", null); 94 95 public static final StringSetting HomeFrame = new StringSetting("The home frame", null) { 92 96 @Override 93 97 public boolean setSetting(Text text) { … … 180 184 * Templates 181 185 */ 182 public static final GenericSetting<Text> TitleTemplate = new GenericSetting<Text>(Text.class, "Template for Title text item"); 183 184 public static final GenericSetting<Text> ItemTemplate = new GenericSetting<Text>(Text.class, "Template for normal text items", new Text("@ItemTemplate")) { 185 @Override 186 public boolean setSetting(Text text) { 187 _value = text.getTemplateForm(); 188 return true; 189 } 190 }; 191 192 public static final GenericSetting<Text> DotTemplate = new GenericSetting<Text>(Text.class, "Template for dot items", new Text("@DotTemplate")) { 193 @Override 194 public boolean setSetting(Text text) { 195 _value = text.getTemplateForm(); 196 return true; 197 } 198 }; 199 200 private static final Text annotationTemplate() { 201 Text t = new Text("@AnnotationTemplate"); 202 t.setColor(Color.gray); 203 return t; 204 } 205 public static final GenericSetting<Text> AnnotationTemplate = new GenericSetting<Text>(Text.class, "Template for annotation text items", annotationTemplate()) { 206 @Override 207 public boolean setSetting(Text text) { 208 _value = text.getTemplateForm(); 209 return true; 210 } 211 }; 212 213 private static final Text codeCommentTemplate() { 214 Text t = new Text("@CommentTemplate"); 215 t.setColor(Color.green.darker()); 216 return t; 217 } 218 public static final GenericSetting<Text> CodeCommentTemplate = new GenericSetting<Text>(Text.class, "Template for code comment text items", codeCommentTemplate()) { 219 @Override 220 public boolean setSetting(Text text) { 221 _value = text.getTemplateForm(); 222 return true; 223 } 224 }; 225 226 private static final Text statTemplate() { 227 Text t = new Text("@StatsTemplate"); 228 t.setColor(Color.BLACK); 229 t.setBackgroundColor(new Color(0.9F, 0.9F, 0.9F)); 230 t.setFamily(Text.MONOSPACED_FONT); 231 t.setSize(14); 232 return t; 233 } 234 public static final GenericSetting<Text> StatTemplate = new GenericSetting<Text>(Text.class, "Template for statistics (e.g. extracted attributes) text items", statTemplate()) { 235 @Override 236 public boolean setSetting(Text text) { 237 _value = text.getTemplateForm(); 238 return true; 239 } 240 }; 241 242 private static final Text tooltipTemplate() { 243 Text t = new Text("@StatsTemplate"); 244 t.setColor(Color.BLACK); 245 t.setBackgroundColor(new Color(0.7F, 0.7F, 0.9F)); 246 // t.setFamily(Text.MONOSPACED_FONT); 247 t.setSize(14); 248 return t; 249 } 250 public static final GenericSetting<Text> TooltipTemplate = new GenericSetting<Text>(Text.class, "Template for tooltips", tooltipTemplate()) { 251 @Override 252 public boolean setSetting(Text text) { 253 _value = text.getTemplateForm(); 254 return true; 186 public static final TextSetting TitleTemplate = new TextSetting("Template for Title text item") { 187 @Override 188 public Text generateText() { 189 return null; 190 } 191 }; 192 193 public static final TextSetting ItemTemplate = new TextSetting("Template for normal text items") { 194 @Override 195 public boolean setSetting(Text text) { 196 _value = text.getTemplateForm(); 197 return true; 198 } 199 200 @Override 201 public Text generateText() { 202 return new Text("@ItemTemplate"); 203 } 204 }; 205 206 public static final TextSetting DotTemplate = new TextSetting("Template for dot items") { 207 @Override 208 public boolean setSetting(Text text) { 209 _value = text.getTemplateForm(); 210 return true; 211 } 212 213 @Override 214 public Text generateText() { 215 return new Text("@DotTemplate"); 216 } 217 }; 218 219 public static final TextSetting AnnotationTemplate = new TextSetting("Template for annotation text items") { 220 @Override 221 public boolean setSetting(Text text) { 222 _value = text.getTemplateForm(); 223 return true; 224 } 225 @Override 226 public Text generateText() { 227 Text t = new Text("@AnnotationTemplate"); 228 t.setColor(Color.gray); 229 return t; 230 } 231 }; 232 233 public static final TextSetting CodeCommentTemplate = new TextSetting("Template for code comment text items") { 234 @Override 235 public boolean setSetting(Text text) { 236 _value = text.getTemplateForm(); 237 return true; 238 } 239 @Override 240 public Text generateText() { 241 Text t = new Text("@CommentTemplate"); 242 t.setColor(Color.green.darker()); 243 return t; 244 } 245 }; 246 247 public static final TextSetting StatTemplate = new TextSetting("Template for statistics (e.g. extracted attributes) text items") { 248 @Override 249 public boolean setSetting(Text text) { 250 _value = text.getTemplateForm(); 251 return true; 252 } 253 @Override 254 public Text generateText() { 255 Text t = new Text("@StatsTemplate"); 256 t.setColor(Color.BLACK); 257 t.setBackgroundColor(new Color(0.9F, 0.9F, 0.9F)); 258 t.setFamily(Text.MONOSPACED_FONT); 259 t.setSize(14); 260 return t; 261 } 262 }; 263 264 public static final TextSetting TooltipTemplate = new TextSetting("Template for tooltips") { 265 @Override 266 public boolean setSetting(Text text) { 267 _value = text.getTemplateForm(); 268 return true; 269 } 270 @Override 271 public Text generateText() { 272 Text t = new Text("@StatsTemplate"); 273 t.setColor(Color.BLACK); 274 t.setBackgroundColor(new Color(0.7F, 0.7F, 0.9F)); 275 // t.setFamily(Text.MONOSPACED_FONT); 276 t.setSize(14); 277 return t; 255 278 } 256 279 }; … … 382 405 UserSettings.FrameDirs.get().add(FrameIO.PROFILE_PATH); 383 406 UserSettings.FrameDirs.get().add(FrameIO.HELP_PATH); 407 UserSettings.FrameDirs.get().add(FrameIO.MESSAGES_PATH); 408 UserSettings.FrameDirs.setDefault(UserSettings.FrameDirs.get()); 384 409 UserSettings.ImageDirs.get().add(FrameIO.IMAGES_PATH); 385 UserSettings. FrameDirs.get().add(FrameIO.MESSAGES_PATH);410 UserSettings.ImageDirs.setDefault(UserSettings.ImageDirs.get()); 386 411 } 387 412
Note:
See TracChangeset
for help on using the changeset viewer.