Trying to add FEST-Swing tests.
This commit is contained in:
@ -1,33 +1,22 @@
|
||||
application {
|
||||
title='PitSwing'
|
||||
startupGroups = ['PIT']
|
||||
|
||||
// Should Griffon exit when no Griffon created frames are showing?
|
||||
autoShutdown = true
|
||||
|
||||
// If you want some non-standard application class, apply it here
|
||||
//frameClass = 'javax.swing.JFrame'
|
||||
title="PitSwing"
|
||||
startupGroups=["PIT"]
|
||||
autoShutdown=true
|
||||
}
|
||||
mvcGroups {
|
||||
// MVC Group for "com.jdbernard.pit.swing.NewIssueDialog"
|
||||
'NewIssueDialog' {
|
||||
model = 'com.jdbernard.pit.swing.NewIssueDialogModel'
|
||||
controller = 'com.jdbernard.pit.swing.NewIssueDialogController'
|
||||
view = 'com.jdbernard.pit.swing.NewIssueDialogView'
|
||||
}
|
||||
|
||||
// MVC Group for "com.jdbernard.pit.swing.ProjectPanel"
|
||||
'ProjectPanel' {
|
||||
model = 'com.jdbernard.pit.swing.ProjectPanelModel'
|
||||
view = 'com.jdbernard.pit.swing.ProjectPanelView'
|
||||
controller = 'com.jdbernard.pit.swing.ProjectPanelController'
|
||||
}
|
||||
|
||||
// MVC Group for "com.jdbernard.pit.swing.PIT"
|
||||
'PIT' {
|
||||
model = 'com.jdbernard.pit.swing.PITModel'
|
||||
view = 'com.jdbernard.pit.swing.PITView'
|
||||
controller = 'com.jdbernard.pit.swing.PITController'
|
||||
}
|
||||
|
||||
NewIssueDialog {
|
||||
model="com.jdbernard.pit.swing.NewIssueDialogModel"
|
||||
controller="com.jdbernard.pit.swing.NewIssueDialogController"
|
||||
view="com.jdbernard.pit.swing.NewIssueDialogView"
|
||||
}
|
||||
ProjectPanel {
|
||||
model="com.jdbernard.pit.swing.ProjectPanelModel"
|
||||
view="com.jdbernard.pit.swing.ProjectPanelView"
|
||||
controller="com.jdbernard.pit.swing.ProjectPanelController"
|
||||
}
|
||||
PIT {
|
||||
model="com.jdbernard.pit.swing.PITModel"
|
||||
view="com.jdbernard.pit.swing.PITView"
|
||||
controller="com.jdbernard.pit.swing.PITController"
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import com.jdbernard.pit.Issue
|
||||
import com.jdbernard.pit.Project
|
||||
import com.jdbernard.pit.Status
|
||||
import groovy.beans.Bindable
|
||||
import java.awt.Font
|
||||
|
||||
class PITModel {
|
||||
// filter for projects and issues
|
||||
@ -24,4 +25,6 @@ class PITModel {
|
||||
def projectPanelMVCs = [:]
|
||||
|
||||
def projectIdMap = [:]
|
||||
|
||||
@Bindable issueDetailFont = new Font(Font.MONOSPACED, Font.PLAIN, 10)
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ import javax.swing.DefaultComboBoxModel
|
||||
import javax.swing.DefaultListModel
|
||||
import javax.swing.JDialog
|
||||
import javax.swing.JFileChooser
|
||||
import javax.swing.JOptionPane
|
||||
import net.miginfocom.swing.MigLayout
|
||||
|
||||
import java.awt.Color
|
||||
@ -109,6 +110,21 @@ frame = application(title:'Personal Issue Tracker',
|
||||
}
|
||||
}
|
||||
|
||||
separator()
|
||||
|
||||
menuItem('Detail Text Size...',
|
||||
actionPerformed: {
|
||||
def newSize = JOptionPane.showInputDialog(frame,
|
||||
'New text size: ', 'Change Issue Detail Text Size...',
|
||||
JOptionPane.QUESTION_MESSAGE)
|
||||
if (!newSize.isInteger())
|
||||
JOptionPane.showMessageDialog(frame,
|
||||
"$newSize is not a valid size.",
|
||||
'Change Issue Detail Text Size...',
|
||||
JOptionPane.ERROR_MESSAGE)
|
||||
model.issueDetailFont = model.issueDetailFont.deriveFont(
|
||||
newSize.toInteger())
|
||||
})
|
||||
}
|
||||
|
||||
menu('Sort') {
|
||||
|
@ -217,6 +217,7 @@ panel = splitPane(orientation: JSplitPane.HORIZONTAL_SPLIT,
|
||||
|
||||
}
|
||||
|
||||
println model.mainMVC?.model?.issueDetailFont
|
||||
scrollPane(constraints: "bottom") {
|
||||
issueTextArea = textArea(
|
||||
wrapStyleWord: true,
|
||||
@ -224,7 +225,8 @@ panel = splitPane(orientation: JSplitPane.HORIZONTAL_SPLIT,
|
||||
sourceProperty: 'selected'),
|
||||
editable: bind( source: issueList, sourceEvent: 'valueChanged',
|
||||
sourceValue: { issueList.selectedValue != null }),
|
||||
font: new Font(Font.MONOSPACED, Font.PLAIN, 10),
|
||||
font: bind(source: model.mainMVC.model,
|
||||
property: 'issueDetailFont'),
|
||||
focusGained: {},
|
||||
focusLost: {
|
||||
if (!issueList?.selectedValue) return
|
||||
|
Reference in New Issue
Block a user