JAL-3027 GD#140 checkbox/radio text alignment not coded in
authorhansonr <hansonr@STO24954W.ad.stolaf.edu>
Tue, 21 Aug 2018 17:15:08 +0000 (12:15 -0500)
committerhansonr <hansonr@STO24954W.ad.stolaf.edu>
Tue, 21 Aug 2018 17:15:08 +0000 (12:15 -0500)
JSRadioButtonUI  - requires build-site.xml

swingjs/SwingJS-site.zip
swingjs/timestamp
swingjs/ver/3.2.2/SwingJS-site.zip
swingjs/ver/3.2.2/timestamp
utils/JalviewJSTest.java
utils/test2.png [new file with mode: 0644]

index 8c81161..9c5f0f8 100644 (file)
Binary files a/swingjs/SwingJS-site.zip and b/swingjs/SwingJS-site.zip differ
index a1de09c..a90fc0d 100644 (file)
@@ -1 +1 @@
-20180821075258 
+20180821121206 
index 8c81161..9c5f0f8 100644 (file)
Binary files a/swingjs/ver/3.2.2/SwingJS-site.zip and b/swingjs/ver/3.2.2/SwingJS-site.zip differ
index a1de09c..a90fc0d 100644 (file)
@@ -1 +1 @@
-20180821075258 
+20180821121206 
index 3b6ca2e..5a320a6 100644 (file)
@@ -1,12 +1,15 @@
 import java.awt.BorderLayout;
+import java.awt.ComponentOrientation;
 import java.awt.Container;
 import java.awt.Dimension;
 import java.awt.Font;
 import java.awt.GridLayout;
 
+import javax.swing.ImageIcon;
 import javax.swing.JCheckBox;
 import javax.swing.JFrame;
 import javax.swing.JPanel;
+import javax.swing.JRadioButton;
 import javax.swing.SwingConstants;
 import javax.swing.border.TitledBorder;
 
@@ -40,12 +43,12 @@ public class JalviewJSTest extends JPanel
   Container getVisualPaneContent()
   {
     JPanel panel = new JPanel();
-    panel.setPreferredSize(new Dimension(400, 300));
+    panel.setPreferredSize(new Dimension(400, 500));
     panel.setOpaque(true);
     panel.setLayout(new BorderLayout());
 
     JPanel firstColumn = new JPanel();
-    firstColumn.setLayout(new GridLayout(6, 1));
+    firstColumn.setLayout(new GridLayout(10, 1));
     firstColumn.setBorder(new TitledBorder("column 1"));
 
     /*
@@ -57,7 +60,7 @@ public class JalviewJSTest extends JPanel
     cb1.setFont(font);
     cb1.setText("Maximise Window");
     cb1.setHorizontalTextPosition(SwingConstants.LEADING);
-    cb1.setHorizontalAlignment(SwingConstants.RIGHT);
+    cb1.setHorizontalAlignment(SwingConstants.LEFT);
 
     /*
      * bug 21/08/18:
@@ -70,9 +73,58 @@ public class JalviewJSTest extends JPanel
     // also results in label and checkbox outside container
     //cb2.setHorizontalAlignment(SwingConstants.RIGHT);
 
+    
+//    ImageIcon icon =  new ImageIcon(getClass()
+//            .getClassLoader()
+//            .getResource("test2.png"), "test");
+//    
+    JCheckBox cb3 = new JCheckBox("leading,left-to-right");
+    cb3.setFont(font);
+    cb3.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+    cb3.setHorizontalTextPosition(SwingConstants.LEADING);
+
+    JCheckBox cb4 = new JCheckBox("leading,right-to-left");
+    cb4.setFont(font);
+    cb4.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+    cb4.setHorizontalTextPosition(SwingConstants.LEADING);
+
+    JCheckBox cb5 = new JCheckBox("trailing,left-to-right");
+    cb5.setFont(font);
+    cb5.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+    cb5.setHorizontalTextPosition(SwingConstants.TRAILING);
+
+    JCheckBox cb6 = new JCheckBox("trailing,right-to-left");
+    cb6.setFont(font);
+    cb6.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+    cb6.setHorizontalTextPosition(SwingConstants.TRAILING);
+
+    JRadioButton rb1 = new JRadioButton("trailing,right-to-left");
+    rb1.setFont(font);
+    rb1.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+    rb1.setHorizontalTextPosition(SwingConstants.TRAILING);
+
+    JRadioButton rb2 = new JRadioButton("right,left-to-right");
+    rb2.setFont(font);
+    rb2.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+    rb2.setHorizontalTextPosition(SwingConstants.RIGHT);
+
+    JRadioButton rb3 = new JRadioButton("right,right-to-left");
+    rb3.setFont(font);
+    rb3.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+    rb3.setHorizontalTextPosition(SwingConstants.RIGHT);
+
+
+    
     firstColumn.add(cb1);
     firstColumn.add(cb2);
-    firstColumn.setBounds(20, 20, 200, 200);
+    firstColumn.add(cb3);
+    firstColumn.add(cb4);
+    firstColumn.add(cb5);
+    firstColumn.add(cb6);
+    firstColumn.add(rb1);
+    firstColumn.add(rb2);
+    firstColumn.add(rb3);
+    firstColumn.setBounds(20, 20, 200, 500);
 
     JPanel theTab = new JPanel();
     theTab.setLayout(null);
diff --git a/utils/test2.png b/utils/test2.png
new file mode 100644 (file)
index 0000000..5950dcc
Binary files /dev/null and b/utils/test2.png differ