diff --git a/.hgignore b/.hgignore index 012d7d9..d24d917 100644 --- a/.hgignore +++ b/.hgignore @@ -2,3 +2,4 @@ build/ \..*sw[op] dist/ staging/ +target/test-reports diff --git a/issues/pit-swing/0019fn5.rst b/issues/pit-swing/0019fn5.rst new file mode 100644 index 0000000..1d66926 --- /dev/null +++ b/issues/pit-swing/0019fn5.rst @@ -0,0 +1,24 @@ +Add the ability to change the Issue text size. +===== + +Description +----------- + +Type a description of the feature here. + +Implementation Notes +-------------------- + +Optionally, describe any specific implementation notes. + +Solution +-------- + +How was the feature realized? + +Resolution +---------- + +Date Created: YYYY-MM-DD +Date Resolved: YYYY-MM-DD +Delivery: #### diff --git a/issues/pit-swing/0020bn5.rst b/issues/pit-swing/0020bn5.rst new file mode 100644 index 0000000..3b0a445 --- /dev/null +++ b/issues/pit-swing/0020bn5.rst @@ -0,0 +1,4 @@ +The auto-generated pit-swing.groovy file needs to be renamed. +============================================================= + +Currently, when \ No newline at end of file diff --git a/issues/pit-swing/0020tn5.rst b/issues/pit-swing/0020tn5.rst new file mode 100644 index 0000000..7ca4ed5 --- /dev/null +++ b/issues/pit-swing/0020tn5.rst @@ -0,0 +1,19 @@ +The auto-generated pit-swing.groovy file needs to be renamed. +============================================================= + +Description +----------- + +Currently, when + +Solution +-------- + +TBD + +Resolution +---------- + +Date Created: 2010-03-19 +Date Resolved: YYYY-MM-DD +Delivery: 0020 \ No newline at end of file diff --git a/pit-swing/application.properties b/pit-swing/application.properties index 9bf1875..af9464f 100644 --- a/pit-swing/application.properties +++ b/pit-swing/application.properties @@ -1,5 +1,6 @@ #utf-8 -#Mon Mar 01 10:39:50 CST 2010 +#Wed Mar 10 12:10:54 CST 2010 app.version=2.1.0 +plugins.fest=0.3 app.griffon.version=0.2.1 app.name=pit-swing diff --git a/pit-swing/griffon-app/conf/Application.groovy b/pit-swing/griffon-app/conf/Application.groovy index 7c6e0a4..c5d0675 100644 --- a/pit-swing/griffon-app/conf/Application.groovy +++ b/pit-swing/griffon-app/conf/Application.groovy @@ -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" + } } diff --git a/pit-swing/griffon-app/models/com/jdbernard/pit/swing/PITModel.groovy b/pit-swing/griffon-app/models/com/jdbernard/pit/swing/PITModel.groovy index 52cb267..98f3e05 100644 --- a/pit-swing/griffon-app/models/com/jdbernard/pit/swing/PITModel.groovy +++ b/pit-swing/griffon-app/models/com/jdbernard/pit/swing/PITModel.groovy @@ -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) } diff --git a/pit-swing/griffon-app/views/com/jdbernard/pit/swing/PITView.groovy b/pit-swing/griffon-app/views/com/jdbernard/pit/swing/PITView.groovy index fefe423..d00bd5c 100644 --- a/pit-swing/griffon-app/views/com/jdbernard/pit/swing/PITView.groovy +++ b/pit-swing/griffon-app/views/com/jdbernard/pit/swing/PITView.groovy @@ -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') { diff --git a/pit-swing/griffon-app/views/com/jdbernard/pit/swing/ProjectPanelView.groovy b/pit-swing/griffon-app/views/com/jdbernard/pit/swing/ProjectPanelView.groovy index abaa8b1..87ed641 100644 --- a/pit-swing/griffon-app/views/com/jdbernard/pit/swing/ProjectPanelView.groovy +++ b/pit-swing/griffon-app/views/com/jdbernard/pit/swing/ProjectPanelView.groovy @@ -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 diff --git a/pit-swing/pit-swing.ipr b/pit-swing/pit-swing.ipr index 4d14d8d..5e35796 100644 --- a/pit-swing/pit-swing.ipr +++ b/pit-swing/pit-swing.ipr @@ -12,50 +12,50 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - + - - - - - - - - - - - - - - - + - - diff --git a/pit-swing/session.vim b/pit-swing/session.vim index c42f2ef..62af8ae 100644 --- a/pit-swing/session.vim +++ b/pit-swing/session.vim @@ -3,10 +3,13 @@ if &cp | set nocp | endif nmap v :call Screen_Vars() nmap  vip vmap  "ry :call Send_to_Screen(@r) +vnoremap  :Hexmode +nnoremap  :Hexmode let s:cpo_save=&cpo set cpo&vim nmap gx NetrwBrowseX nnoremap NetrwBrowseX :call netrw#NetrwBrowseX(expand(""),0) +inoremap  :Hexmode let &cpo=s:cpo_save unlet s:cpo_save set autoindent @@ -42,8 +45,11 @@ badd +3 src/com/jdbernard/pit/swing/IssueListCellRenderer.groovy badd +15 src/main/com/jdbernard/pit/swing/IssueListCellRenderer.groovy badd +1 griffon-app/lifecycle/Initialize.groovy badd +1 griffon-app/models/com/jdbernard/pit/swing/NewIssueDialogModel.groovy -badd +0 griffon-app/controllers/com/jdbernard/pit/swing/NewIssueDialogController.groovy -badd +0 griffon-app/views/com/jdbernard/pit/swing/NewIssueDialogView.groovy +badd +1 griffon-app/controllers/com/jdbernard/pit/swing/NewIssueDialogController.groovy +badd +1 griffon-app/views/com/jdbernard/pit/swing/NewIssueDialogView.groovy +badd +0 griffon-app/models/com/jdbernard/pit/swing/ProjectPanelModel.groovy +badd +0 griffon-app/views/com/jdbernard/pit/swing/ProjectPanelView.groovy +badd +0 griffon-app/controllers/com/jdbernard/pit/swing/ProjectPanelController.groovy args griffon-app/models/com/jdbernard/pit/swing/PITModel.groovy edit griffon-app/models/com/jdbernard/pit/swing/PITModel.groovy set splitbelow splitright @@ -59,9 +65,9 @@ set nosplitbelow set nosplitright wincmd t set winheight=1 winwidth=1 -exe '1resize ' . ((&lines * 21 + 40) / 81) +exe '1resize ' . ((&lines * 16 + 30) / 60) exe 'vert 1resize ' . ((&columns * 91 + 91) / 182) -exe '2resize ' . ((&lines * 56 + 40) / 81) +exe '2resize ' . ((&lines * 40 + 30) / 60) exe 'vert 2resize ' . ((&columns * 91 + 91) / 182) exe 'vert 3resize ' . ((&columns * 90 + 91) / 182) argglobal @@ -160,12 +166,12 @@ setlocal nowinfixwidth setlocal wrap setlocal wrapmargin=0 silent! normal! zE -let s:l = 1 - ((0 * winheight(0) + 10) / 21) +let s:l = 27 - ((15 * winheight(0) + 8) / 16) if s:l < 1 | let s:l = 1 | endif exe s:l normal! zt -1 -normal! 030l +27 +normal! 0 wincmd w argglobal edit griffon-app/views/com/jdbernard/pit/swing/PITView.groovy @@ -264,12 +270,12 @@ setlocal nowinfixwidth setlocal wrap setlocal wrapmargin=0 silent! normal! zE -let s:l = 40 - ((0 * winheight(0) + 28) / 56) +let s:l = 52 - ((0 * winheight(0) + 20) / 40) if s:l < 1 | let s:l = 1 | endif exe s:l normal! zt -40 -normal! 0 +52 +normal! 015l wincmd w argglobal edit griffon-app/controllers/com/jdbernard/pit/swing/PITController.groovy @@ -368,19 +374,19 @@ setlocal nowinfixwidth setlocal wrap setlocal wrapmargin=0 silent! normal! zE -let s:l = 11 - ((0 * winheight(0) + 39) / 78) +let s:l = 53 - ((42 * winheight(0) + 28) / 57) if s:l < 1 | let s:l = 1 | endif exe s:l normal! zt -11 +53 normal! 04l wincmd w -exe '1resize ' . ((&lines * 21 + 40) / 81) +exe '1resize ' . ((&lines * 16 + 30) / 60) exe 'vert 1resize ' . ((&columns * 91 + 91) / 182) -exe '2resize ' . ((&lines * 56 + 40) / 81) +exe '2resize ' . ((&lines * 40 + 30) / 60) exe 'vert 2resize ' . ((&columns * 91 + 91) / 182) exe 'vert 3resize ' . ((&columns * 90 + 91) / 182) -tabedit griffon-app/models/com/jdbernard/pit/swing/PITModel.groovy +tabedit griffon-app/models/com/jdbernard/pit/swing/ProjectPanelModel.groovy set splitbelow splitright wincmd _ | wincmd | vsplit @@ -394,9 +400,9 @@ set nosplitbelow set nosplitright wincmd t set winheight=1 winwidth=1 -exe '1resize ' . ((&lines * 29 + 40) / 81) +exe '1resize ' . ((&lines * 20 + 30) / 60) exe 'vert 1resize ' . ((&columns * 91 + 91) / 182) -exe '2resize ' . ((&lines * 48 + 40) / 81) +exe '2resize ' . ((&lines * 36 + 30) / 60) exe 'vert 2resize ' . ((&columns * 91 + 91) / 182) exe 'vert 3resize ' . ((&columns * 90 + 91) / 182) argglobal @@ -495,15 +501,15 @@ setlocal nowinfixwidth setlocal wrap setlocal wrapmargin=0 silent! normal! zE -let s:l = 1 - ((0 * winheight(0) + 14) / 29) +let s:l = 25 - ((19 * winheight(0) + 10) / 20) if s:l < 1 | let s:l = 1 | endif exe s:l normal! zt -1 +25 normal! 0 wincmd w argglobal -edit griffon-app/views/com/jdbernard/pit/swing/PITView.groovy +edit griffon-app/views/com/jdbernard/pit/swing/ProjectPanelView.groovy setlocal keymap= setlocal noarabic setlocal autoindent @@ -599,15 +605,15 @@ setlocal nowinfixwidth setlocal wrap setlocal wrapmargin=0 silent! normal! zE -let s:l = 18 - ((17 * winheight(0) + 24) / 48) +let s:l = 143 - ((24 * winheight(0) + 18) / 36) if s:l < 1 | let s:l = 1 | endif exe s:l normal! zt -18 +143 normal! 0 wincmd w argglobal -edit griffon-app/controllers/com/jdbernard/pit/swing/PITController.groovy +edit griffon-app/controllers/com/jdbernard/pit/swing/ProjectPanelController.groovy setlocal keymap= setlocal noarabic setlocal autoindent @@ -703,16 +709,17 @@ setlocal nowinfixwidth setlocal wrap setlocal wrapmargin=0 silent! normal! zE -let s:l = 1 - ((0 * winheight(0) + 39) / 78) +let s:l = 93 - ((11 * winheight(0) + 28) / 57) if s:l < 1 | let s:l = 1 | endif exe s:l normal! zt -1 -normal! 0 +93 +normal! 032l wincmd w -exe '1resize ' . ((&lines * 29 + 40) / 81) +3wincmd w +exe '1resize ' . ((&lines * 20 + 30) / 60) exe 'vert 1resize ' . ((&columns * 91 + 91) / 182) -exe '2resize ' . ((&lines * 48 + 40) / 81) +exe '2resize ' . ((&lines * 36 + 30) / 60) exe 'vert 2resize ' . ((&columns * 91 + 91) / 182) exe 'vert 3resize ' . ((&columns * 90 + 91) / 182) tabedit griffon-app/models/com/jdbernard/pit/swing/NewIssueDialogModel.groovy @@ -729,9 +736,9 @@ set nosplitbelow set nosplitright wincmd t set winheight=1 winwidth=1 -exe '1resize ' . ((&lines * 24 + 40) / 81) +exe '1resize ' . ((&lines * 17 + 30) / 60) exe 'vert 1resize ' . ((&columns * 91 + 91) / 182) -exe '2resize ' . ((&lines * 53 + 40) / 81) +exe '2resize ' . ((&lines * 39 + 30) / 60) exe 'vert 2resize ' . ((&columns * 91 + 91) / 182) exe 'vert 3resize ' . ((&columns * 90 + 91) / 182) argglobal @@ -830,7 +837,7 @@ setlocal nowinfixwidth setlocal wrap setlocal wrapmargin=0 silent! normal! zE -let s:l = 1 - ((0 * winheight(0) + 12) / 24) +let s:l = 1 - ((0 * winheight(0) + 8) / 17) if s:l < 1 | let s:l = 1 | endif exe s:l normal! zt @@ -934,7 +941,7 @@ setlocal nowinfixwidth setlocal wrap setlocal wrapmargin=0 silent! normal! zE -let s:l = 1 - ((0 * winheight(0) + 26) / 53) +let s:l = 1 - ((0 * winheight(0) + 19) / 39) if s:l < 1 | let s:l = 1 | endif exe s:l normal! zt @@ -1038,17 +1045,17 @@ setlocal nowinfixwidth setlocal wrap setlocal wrapmargin=0 silent! normal! zE -let s:l = 1 - ((0 * winheight(0) + 39) / 78) +let s:l = 1 - ((0 * winheight(0) + 28) / 57) if s:l < 1 | let s:l = 1 | endif exe s:l normal! zt 1 normal! 0 wincmd w -2wincmd w -exe '1resize ' . ((&lines * 24 + 40) / 81) +3wincmd w +exe '1resize ' . ((&lines * 17 + 30) / 60) exe 'vert 1resize ' . ((&columns * 91 + 91) / 182) -exe '2resize ' . ((&lines * 53 + 40) / 81) +exe '2resize ' . ((&lines * 39 + 30) / 60) exe 'vert 2resize ' . ((&columns * 91 + 91) / 182) exe 'vert 3resize ' . ((&columns * 90 + 91) / 182) tabedit griffon-app/conf/Application.groovy @@ -1159,7 +1166,7 @@ setlocal nowinfixwidth setlocal wrap setlocal wrapmargin=0 silent! normal! zE -let s:l = 16 - ((15 * winheight(0) + 39) / 78) +let s:l = 16 - ((11 * winheight(0) + 28) / 57) if s:l < 1 | let s:l = 1 | endif exe s:l normal! zt @@ -1263,14 +1270,14 @@ setlocal nowinfixwidth setlocal wrap setlocal wrapmargin=0 silent! normal! zE -let s:l = 56 - ((55 * winheight(0) + 39) / 78) +let s:l = 56 - ((40 * winheight(0) + 28) / 57) if s:l < 1 | let s:l = 1 | endif exe s:l normal! zt 56 normal! 0 wincmd w -2wincmd w +3wincmd w exe 'vert 1resize ' . ((&columns * 91 + 91) / 182) exe 'vert 2resize ' . ((&columns * 90 + 91) / 182) tabedit griffon-app/lifecycle/Initialize.groovy @@ -1375,14 +1382,14 @@ setlocal nowinfixwidth setlocal wrap setlocal wrapmargin=0 silent! normal! zE -let s:l = 1 - ((0 * winheight(0) + 39) / 79) +let s:l = 1 - ((0 * winheight(0) + 29) / 58) if s:l < 1 | let s:l = 1 | endif exe s:l normal! zt 1 normal! 0 -2wincmd w -tabnext 3 +3wincmd w +tabnext 2 if exists('s:wipebuf') silent exe 'bwipe ' . s:wipebuf endif diff --git a/pit-swing/test/fest/com/jdbernard/pit/swing/NewIssueDialogTestTests.groovy b/pit-swing/test/fest/com/jdbernard/pit/swing/NewIssueDialogTestTests.groovy new file mode 100644 index 0000000..c865a7c --- /dev/null +++ b/pit-swing/test/fest/com/jdbernard/pit/swing/NewIssueDialogTestTests.groovy @@ -0,0 +1,33 @@ +package com.jdbernard.pit.swing + + + +import org.fest.swing.fixture.* +import griffon.test.FestSwingTestCase + +import javax.swing.JDialog + +class NewIssueDialogTestTests extends FestSwingTestCase { + // instance variables: + // app - current application + // window - value returned from initWindow() + // defaults to app.appFrames[0] + + JDialog newIssueDialog + + void testSomething() { + + } + + protected void onSetUp() throws Exception { + println app.appFrames + } + + protected void onTearDown() throws Exception { } + + /* + protected FrameFixture initWindow() { + return new FrameFixture(app.appFrames[0]) + } + */ +}