[SCM] JAS(2) Plotter branch, patch/tablelayout, updated. upstream/2.2.6-16-g8095d9e

Gabriele Giacone gg0-guest at alioth.debian.org
Sun Jan 17 17:31:52 UTC 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "JAS(2) Plotter".

The branch, patch/tablelayout has been updated
       via  8095d9ee5ffc75e9c7788fff1a92496e86785fd0 (commit)
      from  85be5eb1aa4ef4bdd02c55dff1ee3cc5e0ff5ee3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 8095d9ee5ffc75e9c7788fff1a92496e86785fd0
Author: Gabriele Giacone <1o5g4r8o at gmail.com>
Date:   Sun Jan 17 18:31:06 2010 +0100

    To compile against Debian libtablelayout

-----------------------------------------------------------------------

Summary of changes:
 .topmsg                                           |    8 +-
 src/main/java/jas/hist/JASHistPropertyDialog.java |  150 +++++++--------------
 2 files changed, 52 insertions(+), 106 deletions(-)

diff --git a/.topmsg b/.topmsg
index bbb6e73..549a781 100644
--- a/.topmsg
+++ b/.topmsg
@@ -1,7 +1,7 @@
-From: Giovanni Mascellani <mascellani at poisson.phc.unipi.it>
+From: Gabriele Giacone <1o5g4r8o at gmail.com>
 Subject: [PATCH] patch/tablelayout
 
-This patch removes any dependency of JAS Plotter on TableLayout, which
-is non DFSG compliant. GridBagLayout is used instead of TableLayout.
+To compile against Debian libtablelayout-java under
+/usr/share/java/tablelayout.jar
 
-Signed-off-by: Giovanni Mascellani <mascellani at poisson.phc.unipi.it>
+Signed-off-by: Gabriele Giacone <1o5g4r8o at gmail.com>
diff --git a/src/main/java/jas/hist/JASHistPropertyDialog.java b/src/main/java/jas/hist/JASHistPropertyDialog.java
index aa14f7d..9a9f250 100644
--- a/src/main/java/jas/hist/JASHistPropertyDialog.java
+++ b/src/main/java/jas/hist/JASHistPropertyDialog.java
@@ -18,14 +18,10 @@ import java.awt.Dimension;
 import java.awt.FlowLayout;
 import java.awt.Frame;
 import java.awt.Graphics;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
 import java.awt.Insets;
 import java.awt.LayoutManager;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
 import java.util.Date;
 import java.util.Enumeration;
 import javax.swing.BorderFactory;
@@ -36,8 +32,6 @@ import javax.swing.DefaultListModel;
 import javax.swing.JButton;
 import javax.swing.JCheckBox;
 import javax.swing.JComboBox;
-import javax.swing.JComponent;
-import javax.swing.JFrame;
 import javax.swing.JLabel;
 import javax.swing.JList;
 import javax.swing.JPanel;
@@ -52,32 +46,11 @@ import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 import javax.swing.event.ListSelectionEvent;
 import javax.swing.event.ListSelectionListener;
+import org.debian.tablelayout.TableLayout;
+
 
 public final class JASHistPropertyDialog extends PropertyDialog
 {
-	/*
-	 * The commented code is used by Debian maintainers to ease
-	 * the switch from TableLayout (non DFSG compliant) to
-	 * GridBagLayout.
-	 */
-	/*public static void main(String[] args) {
-		tryFrame(new JASHist2DPropStyle().create2DPanel(), "Mine");
-		tryFrame(new JASHist2DPropStyle().origCreate2DPanel(), "Original");
-		//dialog.show();
-	}
-	public static JFrame tryFrame(JPanel p, String title) {
-		JFrame frame = new JFrame();
-		frame.setSize(700, 300);
-		frame.setTitle(title);
-		frame.add(p);
-		frame.addWindowListener(new WindowAdapter() {
-			public void windowClosing(WindowEvent e) {
-				System.exit(0);
-			}
-		});
-		frame.setVisible(true);
-		return frame;
-	}*/
    public JASHistPropertyDialog(Frame f,JASHist bean)
    {
       this(f, bean, DEFAULT);
@@ -268,28 +241,6 @@ final class JASHistPropXAxis extends PropertyPage implements PropertySite
    }
    private JASHistPropAxis m_propAxis;
 }
-
-class GridBagPanel {
-	private static final long serialVersionUID = 326390698286127169L;
-	private GridBagLayout layout;
-	private JPanel panel;
-
-	GridBagPanel(JPanel panel) {
-		this.layout = new GridBagLayout();
-		this.panel = panel;
-		this.panel.setLayout(this.layout);
-	}
-
-	public void add(JComponent comp, GridBagConstraints constraints) {
-		this.layout.addLayoutComponent(comp, constraints);
-		this.panel.add(comp);
-	}
-
-	public JPanel getPanel() {
-		return this.panel;
-	}
-}
-
 final class JASHistPropAxis extends PropertyPage implements ActionListener
 {
    public JASHistPropAxis()
@@ -309,17 +260,15 @@ final class JASHistPropAxis extends PropertyPage implements ActionListener
       
       addBinding(new PropertyBinding(label,"Label"));
       addBinding(new PropertyBinding(m_log,"logarithmic"));
-
-      JPanel p = new FixedHeightPanel();
-      GridBagPanel panel = new GridBagPanel(p);
-      panel.add(new JLabel("Label:"), new GridBagConstraints(0, 0, 1, 1, 0, 100, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
-      panel.add(new JLabel("Type:"), new GridBagConstraints(0, 1, 1, 1, 0, 100, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
-      panel.add(label, new GridBagConstraints(1, 0, 2, 1, 100, 100, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
-      panel.add(m_type, new GridBagConstraints(1, 1, 1, 1, 100, 100, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
-      panel.add(m_log, new GridBagConstraints(2, 1, 1, 1, 100, 100, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
+      
+      JPanel p = new FixedHeightPanel(new TableLayout());
+      p.add("0 0 rw", new JLabel("Label:"));
+      p.add("0 1 rw", new JLabel("Type:"));
+      p.add("1 0 2",label);
+      p.add("1 1",m_type);
+      p.add("2 1",m_log);
       return p;
    }
-
    private JPanel createRangePanel()
    {
       min = new JASTextField(15);
@@ -337,22 +286,20 @@ final class JASHistPropAxis extends PropertyPage implements ActionListener
       t1.addActionListener(this);
       t2.addActionListener(this);
       
-      JPanel p = new FixedHeightPanel();
-      GridBagPanel panel = new GridBagPanel(p);
+      JPanel p = new FixedHeightPanel(new TableLayout());
       p.setBorder(new TitledBorder("Range"));
-      panel.add(new JLabel("Min:"), new GridBagConstraints(0, 0, 1, 1, 0, 100, GridBagConstraints.EAST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
-      panel.add(new JLabel("Max:"), new GridBagConstraints(0, 1, 1, 1, 0, 100, GridBagConstraints.EAST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
-      panel.add(min, new GridBagConstraints(1, 0, 1, 1, 100, 100, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
-      panel.add(max, new GridBagConstraints(1, 1, 1, 1, 100, 100, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
-      panel.add(t1, new GridBagConstraints(2, 0, 1, 1, 0, 100, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
-      panel.add(t2, new GridBagConstraints(2, 1, 1, 1, 0, 100, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
-      panel.add(auto, new GridBagConstraints(3, 0, 1, 1, 0, 100, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
-      panel.add(m_zero, new GridBagConstraints(3, 1, 1, 1, 0, 100, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
+      p.add("0 0 rw",new JLabel("Min:"));
+      p.add("0 1 rw",new JLabel("Max:"));
+      p.add("1 0 h",min);
+      p.add("1 1 h",max);
+      p.add("2 0 w",t1);
+      p.add("2 1 w",t2);
+      p.add("3 0 lW",auto);
+      p.add("3 1 lW",m_zero);
       
       m_rangePanel = p;
       return p;
    }
-   
    private JPanel createBinsPanel()
    {
       m_bins = new JASTextField(10);
@@ -637,7 +584,7 @@ final class JASHistPropStyle extends PropertyPage
 {
    JASHistPropStyle()
    {
-      GridBagPanel panel = new GridBagPanel(this);
+      setLayout(new TableLayout());
       setBorder(BorderFactory.createTitledBorder("1D Plot Style"));
       
       
@@ -660,9 +607,9 @@ final class JASHistPropStyle extends PropertyPage
       p.add(histStyle);
       p.add(histWidth);
       
-      panel.add(hist, new GridBagConstraints(0, 0, 1, 1, 100, 100, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
-      panel.add(histOutlineColor, new GridBagConstraints(1, 0, 1, 1, 100, 100, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
-      panel.add(p, new GridBagConstraints(2, 0, 1, 1, 100, 100, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
+      add("0 0 w",hist);
+      add("1 0 Hw",histOutlineColor);
+      add("2 0 lW",p);
       
       final JCheckBox error  = new JCheckBox("Error Bars");
       final ColorChooser errorColor = new ColorChooser();
@@ -677,9 +624,9 @@ final class JASHistPropStyle extends PropertyPage
       p.add(errorStyle);
       p.add(errorWidth);
       
-      panel.add(error, new GridBagConstraints(0, 1, 1, 1, 100, 100, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
-      panel.add(errorColor, new GridBagConstraints(1, 1, 1, 1, 100, 100, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
-      panel.add(p, new GridBagConstraints(2, 1, 1, 1, 100, 100, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
+      add("0 1 w",error);
+      add("1 1 Hw",errorColor);
+      add("2 1 lW",p);
       
       final JCheckBox points = new JCheckBox("Data Points");
       final ColorChooser pointColor = new ColorChooser();
@@ -691,10 +638,10 @@ final class JASHistPropStyle extends PropertyPage
       p.add(pointStyle);
       p.add(pointSize);
       
-      panel.add(points, new GridBagConstraints(0, 2, 1, 1, 100, 100, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
-      panel.add(pointColor, new GridBagConstraints(1, 2, 1, 1, 100, 100, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
-      panel.add(p, new GridBagConstraints(2, 2, 1, 1, 100, 100, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
-
+      add("0 2 w",points);
+      add("1 2 Hw",pointColor);
+      add("2 2 lW",p);
+      
       final JCheckBox lines  = new JCheckBox("Lines Between Points");
       final ColorChooser lineColor = new ColorChooser();
       final JComboBox lineStyle = new JComboBox();
@@ -708,10 +655,10 @@ final class JASHistPropStyle extends PropertyPage
       p.add(lineStyle);
       p.add(lineWidth);
       
-      panel.add(lines, new GridBagConstraints(0, 3, 1, 1, 100, 100, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
-      panel.add(lineColor, new GridBagConstraints(1, 3, 1, 1, 100, 100, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
-      panel.add(p, new GridBagConstraints(2, 3, 1, 1, 100, 100, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
-
+      add("0 3 w",lines);
+      add("1 3 Hw",lineColor);
+      add("2 3 lW",p);
+      
       addBinding(new PropertyBinding(pointColor,"DataPointColor"));
       addBinding(new PropertyBinding(pointStyle,"DataPointStyle"));
       addBinding(new PropertyBinding(pointSize,"DataPointSize"));
@@ -751,7 +698,6 @@ final class JASHistPropStyle extends PropertyPage
    }
 }// 1D JASHistPropStyle
 
-
 final class JASHistScatterPropStyle extends PropertyPage
 {
    JASHistScatterPropStyle()
@@ -906,7 +852,7 @@ final class JASHist2DPropStyle extends PropertyPage
    private CheckBoxBorderPanel create2DPanel()
    {
       CheckBoxBorderPanel p = new CheckBoxBorderPanel("2D Plot Style");
-      GridBagPanel panel = new GridBagPanel(p);
+      p.setLayout(new TableLayout());
       
       //////////Plot Scheme//////////
       plotSchemePanel = new JPanel(new FlowLayout());
@@ -931,31 +877,31 @@ final class JASHist2DPropStyle extends PropertyPage
       plotSchemePanel.add(colorMapLabel);
       plotSchemePanel.add(colorMapScheme);
       
-      panel.add(plotSchemePanel, new GridBagConstraints(0, 0, 5, 1, 100, 100, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
-     
+      p.add("0 0 5 1",plotSchemePanel);
+      
       shapeColorLabel = new JLabel("Bin Color");
       shapeColor = new ColorChooser(Color.black);
       
-      panel.add(shapeColor, new GridBagConstraints(1, 1, 1, 1, 0, 100, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
-      panel.add(shapeColorLabel, new GridBagConstraints(0, 1, 1, 1, 100, 100, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
-     
+      p.add("1 1 w",shapeColor);
+      p.add("0 1 Wr",shapeColorLabel);
+      
       startColorLabel = new JLabel("Set Range Min");
       startColor = new ColorChooser(Color.white);
       
-      panel.add(startColor, new GridBagConstraints(3, 1, 1, 1, 0, 100, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
-      panel.add(startColorLabel, new GridBagConstraints(2, 1, 1, 1, 100, 100, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
-     
+      p.add("3 1 w",startColor);
+      p.add("2 1 Wr",startColorLabel);
+      
       overFlowColorLabel = new JLabel("OverFlow Color");
       overFlowColor = new ColorChooser(Color.red);
       
-      panel.add(overFlowColor, new GridBagConstraints(1, 2, 1, 1, 0, 100, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
-      panel.add(overFlowColorLabel, new GridBagConstraints(0, 2, 1, 1, 100, 100, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
-
+      p.add("1 2 w",overFlowColor);
+      p.add("0 2 Wr",overFlowColorLabel);
+      
       endColorLabel = new JLabel("Set Range Max");
       endColor = new ColorChooser(Color.black);
       
-      panel.add(endColor, new GridBagConstraints(3, 2, 1, 1, 0, 100, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
-      panel.add(endColorLabel, new GridBagConstraints(2, 2, 1, 1, 100, 100, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
+      p.add("3 2 w",endColor);
+      p.add("2 2 Wr",endColorLabel);
       
       invertRange = new JButton("Invert")
       {
@@ -967,7 +913,7 @@ final class JASHist2DPropStyle extends PropertyPage
          }
       };
       
-      panel.add(invertRange, new GridBagConstraints(4, 1, 1, 2, 100, 100, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
+      p.add("4 1 1 2 HWl",invertRange);
       
       addBinding(new PropertyBinding(plotScheme,"HistStyle"));
       addBinding(new PropertyBinding(colorMapScheme,"ColorMapScheme"));


hooks/post-receive
-- 
JAS(2) Plotter



More information about the pkg-java-commits mailing list