X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=src%2Fjavajs%2Fswing%2FGridBagConstraints.java;fp=src%2Fjavajs%2Fswing%2FGridBagConstraints.java;h=578edc351dcaef0fef888a09ea4c01e25d29853a;hp=dfbe4eb368e29f42681ae73921cb166ef7ff5051;hb=b9b7a352eee79b7764c3b09c9d19663075061d8c;hpb=7301a2415adab88038b291fc54caeeb3a5a47a44 diff --git a/src/javajs/swing/GridBagConstraints.java b/src/javajs/swing/GridBagConstraints.java index dfbe4eb..578edc3 100644 --- a/src/javajs/swing/GridBagConstraints.java +++ b/src/javajs/swing/GridBagConstraints.java @@ -1,47 +1,47 @@ -package javajs.swing; - -public class GridBagConstraints { - - public static final int NONE = 0; - public static final int CENTER = 10; - public static final int WEST = 17; - public static final int EAST = 13; - - public int gridx; - public int gridy; - public int gridwidth; - public int gridheight; - double weightx; - double weighty; - public int anchor; - public int fill; - Insets insets; - public int ipadx; - public int ipady; - - public GridBagConstraints(int gridx, int gridy, int gridwidth, - int gridheight, double weightx, double weighty, int anchor, int fill, - Insets insets, int ipadx, int ipady) { - this.gridx = gridx; - this.gridy = gridy; - this.gridwidth = gridwidth; - this.gridheight = gridheight; - this.weightx = weightx; - this.weighty = weighty; - this.anchor = anchor; - this.fill = fill; - if (insets == null) - insets = new Insets(0, 0, 0, 0); - this.insets = insets; - this.ipadx = ipadx; - this.ipady = ipady; - } - - String getStyle(boolean margins) { - return "style='" + (margins ? - "margin:" + insets.top + "px " + (ipady + insets.right) + "px " - + insets.bottom + "px " + (ipadx + insets.left) + "px;" - : "text-align:" + (anchor == EAST ? "right" : anchor == WEST? "left" : "center")) + "'"; - } - -} +package javajs.swing; + +public class GridBagConstraints { + + public static final int NONE = 0; + public static final int CENTER = 10; + public static final int WEST = 17; + public static final int EAST = 13; + + public int gridx; + public int gridy; + public int gridwidth; + public int gridheight; + double weightx; + double weighty; + public int anchor; + public int fill; + Insets insets; + public int ipadx; + public int ipady; + + public GridBagConstraints(int gridx, int gridy, int gridwidth, + int gridheight, double weightx, double weighty, int anchor, int fill, + Insets insets, int ipadx, int ipady) { + this.gridx = gridx; + this.gridy = gridy; + this.gridwidth = gridwidth; + this.gridheight = gridheight; + this.weightx = weightx; + this.weighty = weighty; + this.anchor = anchor; + this.fill = fill; + if (insets == null) + insets = new Insets(0, 0, 0, 0); + this.insets = insets; + this.ipadx = ipadx; + this.ipady = ipady; + } + + String getStyle(boolean margins) { + return "style='" + (margins ? + "margin:" + insets.top + "px " + (ipady + insets.right) + "px " + + insets.bottom + "px " + (ipadx + insets.left) + "px;" + : "text-align:" + (anchor == EAST ? "right" : anchor == WEST? "left" : "center")) + "'"; + } + +}