From: PHO Date: Mon, 20 Oct 2014 03:39:59 +0000 (+0900) Subject: wip X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=48fca3f185c25534d4e58e4f4e379d65bb1ab6ad;p=task-reporter.git wip --- diff --git a/src/main/scala/jp/ymir/taskReporter/core/Task.scala b/src/main/scala/jp/ymir/taskReporter/core/Task.scala index d6ed1d8..c87dc21 100644 --- a/src/main/scala/jp/ymir/taskReporter/core/Task.scala +++ b/src/main/scala/jp/ymir/taskReporter/core/Task.scala @@ -24,6 +24,8 @@ object Task { case object DoingFine extends Status { override def toString() = "順調"} case object Lagging extends Status { override def toString() = "遅延"} case object Completed extends Status { override def toString() = "完了"} + + def all: Seq[Status] = Seq(DoingFine, Lagging, Completed) } implicit val CalendarFromField = new FromField[Calendar] { diff --git a/src/main/scala/jp/ymir/taskReporter/ui/MainFrame.scala b/src/main/scala/jp/ymir/taskReporter/ui/MainFrame.scala index f8ecc2f..da35f39 100644 --- a/src/main/scala/jp/ymir/taskReporter/ui/MainFrame.scala +++ b/src/main/scala/jp/ymir/taskReporter/ui/MainFrame.scala @@ -128,6 +128,11 @@ class MainFrame(reportFile: Option[File]) extends Frame { } } }) +/* rightComponent = new BoxPanel(Orientation.Vertical) { + contents += new TaskEditor { + border = BorderFactory.createEmptyBorder(5, 5, 5, 5) + } + */ rightComponent = new TaskEditor { border = BorderFactory.createEmptyBorder(5, 5, 5, 5) } diff --git a/src/main/scala/jp/ymir/taskReporter/ui/TaskEditor.scala b/src/main/scala/jp/ymir/taskReporter/ui/TaskEditor.scala index 95a3a67..17b77dd 100644 --- a/src/main/scala/jp/ymir/taskReporter/ui/TaskEditor.scala +++ b/src/main/scala/jp/ymir/taskReporter/ui/TaskEditor.scala @@ -1,6 +1,7 @@ package jp.ymir.taskReporter.ui import com.toedter.calendar._ import java.awt.Insets +import jp.ymir.taskReporter.core._ import scala.swing._ class TaskEditor extends GridBagPanel { @@ -11,7 +12,7 @@ class TaskEditor extends GridBagPanel { add( new Label("報告日"), - new Constraints() { gridx = 0; gridy = 0 }) + new Constraints { gridx = 0; gridy = 0 }) add( Component.wrap(new JDateChooser() { setDateFormatString("yyyy-MM-dd") @@ -25,7 +26,7 @@ class TaskEditor extends GridBagPanel { add( new Label("チケットID"), - new Constraints() { gridx = 0; gridy = 1 }) + new Constraints { gridx = 0; gridy = 1 }) add( new TextField(6) { val isDigit = (c : Char) => c >= '0' && c <= '9' @@ -38,7 +39,7 @@ class TaskEditor extends GridBagPanel { add( new Label("作業名"), - new Constraints() { gridx = 0; gridy = 2 }) + new Constraints { gridx = 0; gridy = 2 }) add( new TextField() { peer.setMargin(commonInsets) @@ -47,4 +48,57 @@ class TaskEditor extends GridBagPanel { gridx = 1; gridy = 2; fill = Horizontal; weightx = 1.0 insets = commonInsets }) + + add( + new Label("作業完了予定年月日"), + new Constraints { gridx = 0; gridy = 3 }) + add( + Component.wrap(new JDateChooser() { + setDateFormatString("yyyy-MM-dd") + getJCalendar().setTodayButtonVisible(true) + getJCalendar().setWeekOfYearVisible(false) + }), + new Constraints() { + gridx = 1; gridy = 3; anchor = West + ipadx = 3; ipady = 3; insets = commonInsets + }) + + add( + new Label("タスク期限"), + new Constraints { gridx = 0; gridy = 4 }) + add( + Component.wrap(new JDateChooser() { + setDateFormatString("yyyy-MM-dd") + getJCalendar().setTodayButtonVisible(true) + getJCalendar().setNullDateButtonVisible(true) + getJCalendar().setWeekOfYearVisible(false) + }), + new Constraints() { + gridx = 1; gridy = 4; anchor = West + ipadx = 3; ipady = 3; insets = commonInsets + }) + + add( + new Label("状態"), + new Constraints { gridx = 0; gridy = 5 }) + add( + new ComboBox[Task.Status](Task.Status.all), + new Constraints { + gridx = 1; gridy = 5; anchor = West + ipadx = 3; ipady = 3; insets = commonInsets + }) + + add( + new Label("説明"), + new Constraints { gridx = 0; gridy = 6 }) + add( + new ScrollPane( + new TextArea() { + rows = 5 + peer.setMargin(commonInsets) + }), + new Constraints() { + gridx = 1; gridy = 6; fill = Horizontal; weightx = 1.0 + insets = commonInsets + }) }