+package jp.ymir.taskReporter;
+import java.awt.Dimension
+import java.io._
+import sbinary._
+import sbinary.DefaultProtocol._
+import sbinary.Operations._
+import preferscala._
+
+object AWTProtocol extends DefaultProtocol {
+ implicit object DimensionFormat extends Format[Dimension] {
+ def reads(in: Input) = read[(Int, Int)](in) match {
+ case (width, height) =>
+ new Dimension(width, height)
+ }
+ def writes(out: Output, value: Dimension) =
+ write[(Int, Int)](out, (value.width, value.height))
+ }
+}
+
+object Preferences extends PackageGroup(PreferenceType.User) {
+ import AWTProtocol._
+
+ val lookAndFeel =
+ new Preference("ui/lookAndFeel", "javax.swing.plaf.metal.MetalLookAndFeel");
+
+ val mainFrameSize =
+ new Preference("ui/MainFrame/size", new Dimension(640, 480));
+
+ val lastChosenDir =
+ new Preference("ui/lastChosenDir", new File(System.getProperty("user.dir")))
+}