Release 2.1.0

libpit:
* hidden directories are ignored

pit-swing:
* added new/delete project/issue buttons
* added word wrap
* changed default issue status to NEW
This commit is contained in:
Jonathan Bernard 2010-02-27 03:06:35 -06:00
parent 3208be8e04
commit 85bd269c55
22 changed files with 154 additions and 71 deletions

View File

@ -0,0 +1,4 @@
Ignore hidden directories.
==========================
Directories that are hidden (determined via File.isHidden()) should not be traversed.

View File

@ -1 +0,0 @@
Add an optional word-wrap at 80 characters for the Issue display

View File

@ -0,0 +1,2 @@
Add an optional word-wrap at 80 characters for the Issue display.
=================================================================

View File

@ -0,0 +1,4 @@
Ignore Hidden directories.
==========================
Directories that are hidden should be ignored (File.isHidden() determines).

View File

@ -1,10 +1,10 @@
#Fri Feb 26 11:43:12 CST 2010 #Fri Feb 26 23:58:36 CST 2010
build.dir=build build.dir=build
src.dir=src src.dir=src
lib.shared.dir=../shared-libs lib.shared.dir=../shared-libs
test.dir=test test.dir=test
build.number=2 build.number=2
expected.application.version=2.0.1 expected.application.version=2.1.0
lib.dir=lib lib.dir=lib
release.dir=release release.dir=release
release.jar=pit-${application.version}.jar release.jar=pit-${application.version}.jar

Binary file not shown.

Binary file not shown.

View File

@ -17,7 +17,8 @@ class FileProject extends Project {
// add sub projects // add sub projects
if (child.isDirectory()) { if (child.isDirectory()) {
if ( child.name ==~ /\d+/) return // just an issue folder if (child.name ==~ /\d+/ ||
child.isHidden()) return // just an issue folder
// otherwise build and add to list // otherwise build and add to list
projects[(child.name)] = new FileProject(child) projects[(child.name)] = new FileProject(child)

Binary file not shown.

BIN
pit-cli/lib/pit-2.1.0.jar Normal file

Binary file not shown.

View File

@ -1,9 +1,9 @@
#Fri Feb 26 11:46:27 CST 2010 #Sat Feb 27 03:01:15 CST 2010
build.dir=build build.dir=build
src.dir=src src.dir=src
build.jar=pit-cli-${application.version}.${build.number}.jar build.jar=pit-cli-${application.version}.${build.number}.jar
build.number=2 build.number=1
expected.application.version=2.0.1 expected.application.version=2.1.0
lib.dir=lib lib.dir=lib
release.dir=release release.dir=release
release.jar=pit-cli-${application.version}.jar release.jar=pit-cli-${application.version}.jar

View File

@ -1,4 +1,4 @@
#Sat Feb 13 08:41:16 CST 2010 #Sat Feb 13 08:41:16 CST 2010
app.version=2.0.1 app.version=2.1.0
app.griffon.version=0.2.1 app.griffon.version=0.2.1
app.name=pit-swing app.name=pit-swing

Binary file not shown.

After

Width:  |  Height:  |  Size: 733 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 715 B

View File

@ -7,6 +7,7 @@ import com.jdbernard.pit.Issue
import com.jdbernard.pit.Project import com.jdbernard.pit.Project
import com.jdbernard.pit.FileProject import com.jdbernard.pit.FileProject
import groovy.beans.Bindable import groovy.beans.Bindable
import java.awt.BorderLayout as BL
import java.awt.GridBagConstraints as GBC import java.awt.GridBagConstraints as GBC
import java.awt.Font import java.awt.Font
import java.awt.Point import java.awt.Point
@ -25,6 +26,7 @@ import javax.swing.tree.DefaultTreeModel
import javax.swing.tree.TreeSelectionModel import javax.swing.tree.TreeSelectionModel
import net.miginfocom.swing.MigLayout import net.miginfocom.swing.MigLayout
import java.awt.Color
/* ******************** /* ********************
* VIEW-Specific data * VIEW-Specific data
* ********************/ * ********************/
@ -95,12 +97,20 @@ showIssuePopup = { issue, x, y ->
issuePopupMenu.show(issueList, x, y) issuePopupMenu.show(issueList, x, y)
} }
newIssue = { evt = null ->
titleTextField.text = ""
categoryComboBox.selectedItem = Category.BUG
statusComboBox.selectedItem = Status.NEW
prioritySpinner.setValue(5)
newIssueDialog.visible = true
}
/* **************** /* ****************
* GUI components * GUI components
* ****************/ * ****************/
openDialog = fileChooser(fileSelectionMode: JFileChooser.DIRECTORIES_ONLY) openDialog = fileChooser(fileSelectionMode: JFileChooser.DIRECTORIES_ONLY)
newIssueDialog = dialog(title: 'New Task...', modal: true, pack: true,//size: [300,200], newIssueDialog = dialog(title: 'New Task...', modal: true, pack: true,
locationRelativeTo: null) { locationRelativeTo: null) {
gridBagLayout() gridBagLayout()
@ -155,7 +165,7 @@ newIssueDialog = dialog(title: 'New Task...', modal: true, pack: true,//size: [3
} }
projectPopupMenu = popupMenu() { projectPopupMenu = popupMenu() {
menuItem('New Project...', menuItem('New Project...', icon: imageIcon("/add.png"),
actionPerformed: { actionPerformed: {
def name = JOptionPane.showInputDialog(frame, 'Project name:', def name = JOptionPane.showInputDialog(frame, 'Project name:',
'New Project...', JOptionPane.QUESTION_MESSAGE) 'New Project...', JOptionPane.QUESTION_MESSAGE)
@ -167,7 +177,7 @@ projectPopupMenu = popupMenu() {
projectTree.model = new DefaultTreeModel( projectTree.model = new DefaultTreeModel(
makeNodes(model.rootProject)) makeNodes(model.rootProject))
}) })
menuItem('Delete Project', menuItem('Delete Project', icon: imageIcon("/delete.png"),
actionPerformed: { actionPerformed: {
if (!popupProject) return if (!popupProject) return
popupProject.delete() popupProject.delete()
@ -177,16 +187,10 @@ projectPopupMenu = popupMenu() {
} }
issuePopupMenu = popupMenu() { issuePopupMenu = popupMenu() {
menuItem('New Issue...', menuItem('New Issue...', icon: imageIcon("/add.png"),
actionPerformed: { actionPerformed: newIssue)
titleTextField.text = ""
categoryComboBox.selectedIndex = 0
statusComboBox.selectedIndex = 0
prioritySpinner.setValue(5)
newIssueDialog.visible = true
})
menuItem('Delete Issue', menuItem('Delete Issue', icon: imageIcon("/delete.png"),
actionPerformed: { actionPerformed: {
if (!popupIssue) return if (!popupIssue) return
selectedProject.issues.remove(popupIssue.id) selectedProject.issues.remove(popupIssue.id)
@ -241,11 +245,9 @@ issuePopupMenu = popupMenu() {
} }
frame = application(title:'Personal Issue Tracker', frame = application(title:'Personal Issue Tracker',
locationRelativeTo: null,
minimumSize: [800, 500], minimumSize: [800, 500],
//size:[320,480],
pack:true, pack:true,
//location:[50,50], locationRelativeTo: null,
iconImage: imageIcon('/icon64x64.png').image, iconImage: imageIcon('/icon64x64.png').image,
iconImages: [imageIcon('/icon64x64.png').image, iconImages: [imageIcon('/icon64x64.png').image,
imageIcon('/icon32x32.png').image, imageIcon('/icon32x32.png').image,
@ -313,10 +315,15 @@ frame = application(title:'Personal Issue Tracker',
// main split view // main split view
splitPane(orientation: JSplitPane.HORIZONTAL_SPLIT, splitPane(orientation: JSplitPane.HORIZONTAL_SPLIT,
dividerLocation: 200) { dividerLocation: 280) {
// left side (projects tree and buttons)
panel(constraints: "left") {
gridBagLayout()
// tree view of projects // tree view of projects
scrollPane(constraints: "left") { scrollPane(constraints: gbc(fill: GBC.BOTH, gridx: 0, gridy:0,
gridwidth: 2, weightx: 2, weighty: 2)) {
treeCellRenderer = new DefaultTreeCellRenderer() treeCellRenderer = new DefaultTreeCellRenderer()
treeCellRenderer.leafIcon = treeCellRenderer.closedIcon treeCellRenderer.leafIcon = treeCellRenderer.closedIcon
@ -324,7 +331,8 @@ frame = application(title:'Personal Issue Tracker',
model: bind(source: model, sourceProperty: 'rootProject', model: bind(source: model, sourceProperty: 'rootProject',
sourceValue: { sourceValue: {
if (model.rootProject) { if (model.rootProject) {
projectTree.rootVisible = model.rootProject.issues.size() projectTree.rootVisible =
model.rootProject.issues.size()
new DefaultTreeModel(makeNodes(model.rootProject)) new DefaultTreeModel(makeNodes(model.rootProject))
} else { } else {
projectTree.rootVisible = false projectTree.rootVisible = false
@ -332,8 +340,10 @@ frame = application(title:'Personal Issue Tracker',
} }
}), }),
valueChanged: { evt -> valueChanged: { evt ->
selectedProject = evt?.newLeadSelectionPath?.lastPathComponent?.userObject ?: model.rootProject selectedProject = evt?.newLeadSelectionPath?.
lastPathComponent?.userObject ?: model.rootProject
displayProject(selectedProject) displayProject(selectedProject)
//deleteProjectButton.enabled = selectedProject != null
}, },
mouseClicked: { evt -> mouseClicked: { evt ->
if (evt.button == MouseEvent.BUTTON3) { if (evt.button == MouseEvent.BUTTON3) {
@ -343,18 +353,56 @@ frame = application(title:'Personal Issue Tracker',
evt.x, evt.y) evt.x, evt.y)
} }
}) })
projectTree.model = new DefaultTreeModel(new DefaultMutableTreeNode()) projectTree.model = new DefaultTreeModel(
new DefaultMutableTreeNode())
projectTree.rootVisible = false projectTree.rootVisible = false
projectTree.selectionModel.selectionMode = projectTree.selectionModel.selectionMode =
TreeSelectionModel.SINGLE_TREE_SELECTION TreeSelectionModel.SINGLE_TREE_SELECTION
} }
// project buttons
button('New Project', icon: imageIcon("/add.png"),
constraints: gbc(fill: GBC.NONE, gridx: 0, gridy: 1,
anchor: GBC.WEST),
actionPerformed: {
def name = JOptionPane.showInputDialog(frame,
'Project name:', 'New Project...',
JOptionPane.QUESTION_MESSAGE)
if (!selectedProject) selectedProject = model.rootProject
def newProject = selectedProject.createNewProject(name)
selectedProject.projects[(newProject.name)] = newProject
projectTree.model = new DefaultTreeModel(
makeNodes(model.rootProject))
})
deleteProjectButton = button('Delete Project',
icon: imageIcon("/delete.png"),
constraints: gbc(fill: GBC.NONE, gridx: 1, gridy: 1,
anchor: GBC.WEST),
enabled: bind(source: projectTree, sourceEvent: 'valueChanged',
sourceValue: { projectTree?.lastSelectedPathComponent != null}),
actionPerformed: {
if (!selectedProject) return
selectedProject.delete()
// do not like, tied to Project implementation
model.rootProject = new FileProject(
model.rootProject.source)
})
}
// split between issue list and issue details // split between issue list and issue details
splitPane(orientation: JSplitPane.VERTICAL_SPLIT, splitPane(orientation: JSplitPane.VERTICAL_SPLIT,
dividerLocation: 200, constraints: "") { dividerLocation: 200, constraints: "right") {
panel(constraints: "top") {
gridBagLayout()
scrollPane(constraints: gbc(fill: GBC.BOTH, weightx: 2,
weighty: 2, gridx: 0, gridy: 0, gridwidth: 3)) {
scrollPane(constraints: "top") {
issueList = list( issueList = list(
cellRenderer: new IssueListCellRenderer( cellRenderer: new IssueListCellRenderer(
categoryIcons: categoryIcons, categoryIcons: categoryIcons,
@ -371,9 +419,34 @@ frame = application(title:'Personal Issue Tracker',
} }
}) })
} }
wordWrapCheckBox = checkBox('Word wrap',
constraints: gbc(gridx: 0, gridy: 1, weightx: 2,
anchor: GBC.WEST), selected: true)
button('New Issue',
constraints: gbc(gridx: 1, gridy: 1, anchor: GBC.EAST),
icon: imageIcon("/add.png"), actionPerformed: newIssue)
deleteIssueButton = button('Delete Issue',
constraints: gbc(gridx: 2, gridy: 1, anchor: GBC.EAST),
enabled: bind(source: issueList, sourceEvent: 'valueChanged',
sourceValue: { issueList.selectedValue != null }),
icon: imageIcon("/delete.png"),
actionPerformed: {
if (!issueList?.selectedIssue) return
selectedProject.issues.remove(issueList.selectedValue)
projectListModels[(selectedProject.name)]
.removeElement(issueList.selectedValue)
issueList.selectedIssue.delete()
})
}
scrollPane(constraints: "bottom") { scrollPane(constraints: "bottom") {
issueTextArea = textArea( issueTextArea = textArea(
font: new Font(Font.MONOSPACED, Font.PLAIN, 12), wrapStyleWord: true,
lineWrap: bind(source: wordWrapCheckBox,
sourceProperty: 'selected'),
font: new Font(Font.MONOSPACED, Font.PLAIN, 10),
focusGained: {}, focusGained: {},
focusLost: { focusLost: {
if (!issueList?.selectedValue) return if (!issueList?.selectedValue) return

Binary file not shown.

BIN
pit-swing/lib/pit-2.1.0.jar Normal file

Binary file not shown.

Binary file not shown.

BIN
release/lib/pit-2.1.0.jar Normal file

Binary file not shown.

View File

@ -1 +1 @@
application.version=2.0.1 application.version=2.1.0