This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository jtimer. See http://git.chorem.org/jtimer.git commit 3003962ada8f894ceee0ffc66a98358cb6b6726c Author: Eric Chatellier <chatellier@codelutin.com> Date: Tue Mar 8 16:56:19 2016 +0100 Replace GBL by grid layout (better visual effect) --- .../org/chorem/jtimer/ui/report/ReportView.java | 30 ++++++++++++---------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/main/java/org/chorem/jtimer/ui/report/ReportView.java b/src/main/java/org/chorem/jtimer/ui/report/ReportView.java index ae5079d..a34bad6 100644 --- a/src/main/java/org/chorem/jtimer/ui/report/ReportView.java +++ b/src/main/java/org/chorem/jtimer/ui/report/ReportView.java @@ -28,6 +28,7 @@ import java.awt.Dimension; import java.awt.Font; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; +import java.awt.GridLayout; import java.awt.Insets; import java.io.IOException; import java.net.URI; @@ -42,6 +43,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +import javax.swing.BorderFactory; import javax.swing.ButtonGroup; import javax.swing.JButton; import javax.swing.JCheckBox; @@ -182,7 +184,7 @@ public class ReportView extends FrameView implements DocumentListener { datePickerFrom = new JXDatePicker(); datePickerFrom.getMonthView().setDayForeground(Calendar.SUNDAY, Color.RED); datePickerFrom.setFormats(DateFormat.getDateInstance(DateFormat.FULL)); - panelGeneral.add(datePickerFrom, new GridBagConstraints(1, 0, 2, 1, 1, 0, + panelGeneral.add(datePickerFrom, new GridBagConstraints(1, 0, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(1, 1, 1, 1), 0, 0)); // second date picker @@ -192,7 +194,7 @@ public class ReportView extends FrameView implements DocumentListener { datePickerTo = new JXDatePicker(); datePickerTo.getMonthView().setDayForeground(Calendar.SUNDAY, Color.RED); datePickerTo.setFormats(DateFormat.getDateInstance(DateFormat.FULL)); - panelGeneral.add(datePickerTo, new GridBagConstraints(1, 1, 2, 1, 0, 0, + panelGeneral.add(datePickerTo, new GridBagConstraints(1, 1, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(1, 1, 1, 1), 0, 0)); // set current week by default @@ -200,15 +202,18 @@ public class ReportView extends FrameView implements DocumentListener { // action button to show current or previous week JButton currentWeekButton = new JButton(); + currentWeekButton.setBorder(BorderFactory.createEmptyBorder()); currentWeekButton.setAction(getContext().getActionMap(this).get("currentWeek")); - panelGeneral.add(currentWeekButton, new GridBagConstraints(3, 0, 1, 1, 0, 0, + panelGeneral.add(currentWeekButton, new GridBagConstraints(2, 0, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(1, 1, 1, 1), 0, 0)); JButton previousWeekButton = new JButton(); + previousWeekButton.setBorder(BorderFactory.createEmptyBorder()); previousWeekButton.setAction(getContext().getActionMap(this).get("previousWeek")); - panelGeneral.add(previousWeekButton, new GridBagConstraints(3, 1, 1, 1, 0, 0, + panelGeneral.add(previousWeekButton, new GridBagConstraints(2, 1, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(1, 1, 1, 1), 0, 0)); // Option for period grouping + JPanel typePanel = new JPanel(new GridLayout(0, 2)); radioByDay = new JRadioButton(getResourceMap().getString("reportDaily"), true); radioByMonth = new JRadioButton(getResourceMap().getString("reportMonthly")); radioByWeek = new JRadioButton(getResourceMap().getString("reportWeekly")); @@ -222,16 +227,13 @@ public class ReportView extends FrameView implements DocumentListener { group.add(radioByYear); group.add(radioByProject); - panelGeneral.add(radioByDay, new GridBagConstraints(0, 2, 2, 1, 2, 0, - GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(1, 1, 1, 1), 0, 0)); - panelGeneral.add(radioByMonth, new GridBagConstraints(2, 2, 2, 1, 2, 0, - GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(1, 1, 1, 1), 0, 0)); - panelGeneral.add(radioByWeek, new GridBagConstraints(0, 3, 2, 1, 0, 0, - GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(1, 1, 1, 1), 0, 0)); - panelGeneral.add(radioByYear, new GridBagConstraints(2, 3, 2, 1, 0, 0, - GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(1, 1, 1, 1), 0, 0)); - panelGeneral.add(radioByProject, new GridBagConstraints(0, 4, 4, 1, 0, 0, - GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(1, 1, 1, 1), 0, 0)); + typePanel.add(radioByDay); + typePanel.add(radioByMonth); + typePanel.add(radioByWeek); + typePanel.add(radioByYear); + typePanel.add(radioByProject); + panelGeneral.add(typePanel, new GridBagConstraints(0, 2, 3, 1, 0, 0, + GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); // miscellaneous JXTaskPane panelOption = new JXTaskPane(getResourceMap().getString("reportOptions")); -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.