Iterative development on GUI
@ -0,0 +1,11 @@
|
|||||||
|
package com.jdbernard.timestamper
|
||||||
|
|
||||||
|
gracefulExitAction = action (
|
||||||
|
name: 'Graceful Exit',
|
||||||
|
closure: controller.&exitGracefully
|
||||||
|
)
|
||||||
|
|
||||||
|
toolsMenuAction = action (
|
||||||
|
name: 'Show Tools Menu',
|
||||||
|
closure: controller.&showToolsMenu
|
||||||
|
)
|
@ -11,6 +11,7 @@ application {
|
|||||||
mvcGroups {
|
mvcGroups {
|
||||||
// MVC Group for "com.jdbernard.timestamper.TimeStamperMain"
|
// MVC Group for "com.jdbernard.timestamper.TimeStamperMain"
|
||||||
'TimeStamperMain' {
|
'TimeStamperMain' {
|
||||||
|
actions = 'com.jdbernard.timestamper.TimeStamperMainActions'
|
||||||
model = 'com.jdbernard.timestamper.TimeStamperMainModel'
|
model = 'com.jdbernard.timestamper.TimeStamperMainModel'
|
||||||
controller = 'com.jdbernard.timestamper.TimeStamperMainController'
|
controller = 'com.jdbernard.timestamper.TimeStamperMainController'
|
||||||
view = 'com.jdbernard.timestamper.TimeStamperMainView'
|
view = 'com.jdbernard.timestamper.TimeStamperMainView'
|
||||||
|
@ -9,8 +9,11 @@ class TimeStamperMainController {
|
|||||||
// this method is called after model and view are injected
|
// this method is called after model and view are injected
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
def exitGracefully = { evt = null ->
|
||||||
def action = { evt = null ->
|
app.shutdown()
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
def showToolsMenu = { evt = null ->
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
BIN
griffon-app/resources/12-em-cross.png
Normal file
After Width: | Height: | Size: 357 B |
BIN
griffon-app/resources/16-em-cross-hover.png
Normal file
After Width: | Height: | Size: 506 B |
BIN
griffon-app/resources/16-em-cross.png
Normal file
After Width: | Height: | Size: 469 B |
BIN
griffon-app/resources/16-em-pencil.png
Normal file
After Width: | Height: | Size: 257 B |
BIN
griffon-app/resources/16-file-archive.png
Normal file
After Width: | Height: | Size: 293 B |
BIN
griffon-app/resources/16-square-green-add.png
Normal file
After Width: | Height: | Size: 345 B |
BIN
griffon-app/resources/16-square-red-delete.png
Normal file
After Width: | Height: | Size: 321 B |
BIN
griffon-app/resources/16-tool-a-hover.png
Normal file
After Width: | Height: | Size: 393 B |
BIN
griffon-app/resources/16-tool-a.png
Normal file
After Width: | Height: | Size: 275 B |
BIN
griffon-app/resources/24-em-cross.png
Normal file
After Width: | Height: | Size: 626 B |
BIN
griffon-app/resources/24-message-info.png
Normal file
After Width: | Height: | Size: 746 B |
BIN
griffon-app/resources/document-open-16x16.png
Normal file
After Width: | Height: | Size: 537 B |
BIN
griffon-app/resources/document-save-16x16.png
Normal file
After Width: | Height: | Size: 911 B |
BIN
griffon-app/resources/document-save-as-16x16.png
Normal file
After Width: | Height: | Size: 866 B |
BIN
griffon-app/resources/media-playback-reverse.png
Normal file
After Width: | Height: | Size: 636 B |
BIN
griffon-app/resources/media-playback-start.png
Normal file
After Width: | Height: | Size: 660 B |
BIN
griffon-app/resources/media-seek-backward.png
Normal file
After Width: | Height: | Size: 764 B |
BIN
griffon-app/resources/media-seek-forward.png
Normal file
After Width: | Height: | Size: 782 B |
BIN
griffon-app/resources/media-skip-backward.png
Normal file
After Width: | Height: | Size: 770 B |
BIN
griffon-app/resources/media-skip-forward.png
Normal file
After Width: | Height: | Size: 771 B |
@ -1,7 +1,9 @@
|
|||||||
package com.jdbernard.timestamper
|
package com.jdbernard.timestamper
|
||||||
|
|
||||||
import java.awt.Color
|
import java.awt.Color
|
||||||
import java.awt.GridBagConstraints
|
import java.awt.Font
|
||||||
|
import javax.swing.BoxLayout
|
||||||
|
import net.miginfocom.swing.MigLayout
|
||||||
|
|
||||||
application(title:'TimeStamper',
|
application(title:'TimeStamper',
|
||||||
//size:[320,480],
|
//size:[320,480],
|
||||||
@ -14,27 +16,45 @@ application(title:'TimeStamper',
|
|||||||
imageIcon('/appointment-new-16x16.png').image]
|
imageIcon('/appointment-new-16x16.png').image]
|
||||||
) {
|
) {
|
||||||
panel(
|
panel(
|
||||||
border:lineBorder(color:Color.BLACK, thickness:2, parent:true)
|
border:lineBorder(color:Color.BLACK, thickness:1, parent:true),
|
||||||
|
layout: new MigLayout('insets 0 5 0 0, fill','', '[]0[]0[]')
|
||||||
) {
|
) {
|
||||||
vbox() {
|
def mainFont = new Font(Font.SANS_SERIF, Font.BOLD, 12)
|
||||||
hbox() {
|
def timeFont = new Font(Font.SANS_SERIF, Font.BOLD, 14)
|
||||||
label("Current task started at ")
|
label("Current task started at ", font: mainFont)
|
||||||
label("00:00:00")
|
label("00:00:00", constraints: 'align leading',
|
||||||
hglue()
|
font: timeFont, foreground: [0, 102, 102])
|
||||||
button("Menu")
|
|
||||||
button("Exit")
|
|
||||||
}
|
|
||||||
panel () {
|
|
||||||
gridBagLayout()
|
|
||||||
|
|
||||||
textField("Task name", constraints:gbc(gridx:0, gridy:0,
|
panel( constraints: 'alignx trailing, aligny top, wrap') {
|
||||||
gridwidth:2, fill:GridBagConstraints.HORIZONTAL))
|
boxLayout(axis: BoxLayout.X_AXIS)
|
||||||
button("Notes", constraints:gbc(gridx:2, gridy:0,
|
button(toolsMenuAction,
|
||||||
fill:GridBagConstraints.NONE))
|
icon: imageIcon('/16-tool-a.png'),
|
||||||
button("Timeline", constraints:gbc(gridx:3, gridy:0,
|
rolloverIcon: imageIcon('/16-tool-a-hover.png'),
|
||||||
fill:GridBagConstraints.NONE))
|
border: emptyBorder(0),
|
||||||
label("12:34:56", constraints:gbc(gridx:0, gridy:1))
|
contentAreaFilled: false,
|
||||||
}
|
hideActionText: true)
|
||||||
|
button(gracefulExitAction,
|
||||||
|
icon: imageIcon('/16-em-cross.png'),
|
||||||
|
rolloverIcon: imageIcon('/16-em-cross-hover.png'),
|
||||||
|
border: emptyBorder(0),
|
||||||
|
contentAreaFilled: false,
|
||||||
|
hideActionText: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
textField("Task name", constraints: "growx, span 2, w 250::")
|
||||||
|
|
||||||
|
panel(constraints: 'alignx leading, aligny top, gapright 5px, wrap') {
|
||||||
|
boxLayout(axis: BoxLayout.X_AXIS)
|
||||||
|
toggleButton(icon: imageIcon('/16-em-pencil.png'),
|
||||||
|
border: emptyBorder(4))
|
||||||
|
toggleButton(icon: imageIcon('/16-file-archive.png'),
|
||||||
|
border: emptyBorder(4))
|
||||||
|
}
|
||||||
|
|
||||||
|
label("2hr 18min 56sec", constraints: 'alignx leading', font: timeFont,
|
||||||
|
foreground: [0, 153, 0])
|
||||||
|
|
||||||
|
label("00:00:00", constraints: 'align trailing', font: timeFont,
|
||||||
|
foreground: [204, 0, 0])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|