home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 139 / dpcs0999.iso / Web / CFserver / data1.cab / Java / CFJava.cab / CFJavaRuntime.cab / netscape / application / PackConstraints.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-10-01  |  4.7 KB  |  195 lines

  1. package netscape.application;
  2.  
  3. import netscape.util.ClassInfo;
  4. import netscape.util.Codable;
  5. import netscape.util.CodingException;
  6. import netscape.util.Decoder;
  7. import netscape.util.Encoder;
  8. import netscape.util.InconsistencyException;
  9.  
  10. public class PackConstraints implements Codable, Cloneable {
  11.    int anchor;
  12.    boolean expand;
  13.    boolean fillX;
  14.    boolean fillY;
  15.    int iPadX;
  16.    int iPadY;
  17.    int padX;
  18.    int padY;
  19.    int side;
  20.    static final String ANCHOR_KEY = "anchor";
  21.    static final String EXPAND_KEY = "expand";
  22.    static final String FILLX_KEY = "fillx";
  23.    static final String FILLY_KEY = "filly";
  24.    static final String IPADX_KEY = "ipadx";
  25.    static final String IPADY_KEY = "ipady";
  26.    static final String PADX_KEY = "padx";
  27.    static final String PADY_KEY = "pady";
  28.    static final String SIDE_KEY = "side";
  29.    public static final int ANCHOR_NORTH = 0;
  30.    public static final int ANCHOR_NORTHEAST = 1;
  31.    public static final int ANCHOR_EAST = 2;
  32.    public static final int ANCHOR_SOUTHEAST = 3;
  33.    public static final int ANCHOR_SOUTH = 4;
  34.    public static final int ANCHOR_SOUTHWEST = 5;
  35.    public static final int ANCHOR_WEST = 6;
  36.    public static final int ANCHOR_NORTHWEST = 7;
  37.    public static final int ANCHOR_CENTER = 8;
  38.    public static final int SIDE_TOP = 0;
  39.    public static final int SIDE_BOTTOM = 1;
  40.    public static final int SIDE_LEFT = 2;
  41.    public static final int SIDE_RIGHT = 3;
  42.  
  43.    public PackConstraints() {
  44.       this.anchor = 8;
  45.       this.expand = false;
  46.       this.fillX = false;
  47.       this.fillY = false;
  48.       this.iPadX = 0;
  49.       this.iPadY = 0;
  50.       this.padX = 0;
  51.       this.padY = 0;
  52.       this.side = 0;
  53.    }
  54.  
  55.    public PackConstraints(int var1, boolean var2, boolean var3, boolean var4, int var5, int var6, int var7, int var8, int var9) {
  56.       this.setAnchor(var1);
  57.       this.setExpand(var2);
  58.       this.setFillX(var3);
  59.       this.setFillY(var4);
  60.       this.setInternalPadX(var5);
  61.       this.setInternalPadY(var6);
  62.       this.setPadX(var7);
  63.       this.setPadY(var8);
  64.       this.setSide(var9);
  65.    }
  66.  
  67.    public void setAnchor(int var1) {
  68.       if (var1 >= 0 && var1 <= 8) {
  69.          this.anchor = var1;
  70.       } else {
  71.          throw new InconsistencyException(this + "Invalid Anchor value: " + var1);
  72.       }
  73.    }
  74.  
  75.    public int anchor() {
  76.       return this.anchor;
  77.    }
  78.  
  79.    public void setExpand(boolean var1) {
  80.       this.expand = var1;
  81.    }
  82.  
  83.    public boolean expand() {
  84.       return this.expand;
  85.    }
  86.  
  87.    public void setFillX(boolean var1) {
  88.       this.fillX = var1;
  89.    }
  90.  
  91.    public boolean fillX() {
  92.       return this.fillX;
  93.    }
  94.  
  95.    public void setFillY(boolean var1) {
  96.       this.fillY = var1;
  97.    }
  98.  
  99.    public boolean fillY() {
  100.       return this.fillY;
  101.    }
  102.  
  103.    public void setInternalPadX(int var1) {
  104.       this.iPadX = var1;
  105.    }
  106.  
  107.    public int internalPadX() {
  108.       return this.iPadX;
  109.    }
  110.  
  111.    public void setInternalPadY(int var1) {
  112.       this.iPadY = var1;
  113.    }
  114.  
  115.    public int internalPadY() {
  116.       return this.iPadY;
  117.    }
  118.  
  119.    public void setPadX(int var1) {
  120.       this.padX = var1;
  121.    }
  122.  
  123.    public int padX() {
  124.       return this.padX;
  125.    }
  126.  
  127.    public void setPadY(int var1) {
  128.       this.padY = var1;
  129.    }
  130.  
  131.    public int padY() {
  132.       return this.padY;
  133.    }
  134.  
  135.    public void setSide(int var1) {
  136.       if (var1 >= 0 && var1 <= 3) {
  137.          this.side = var1;
  138.       } else {
  139.          throw new InconsistencyException(this + "Invalid Side value: " + var1);
  140.       }
  141.    }
  142.  
  143.    public int side() {
  144.       return this.side;
  145.    }
  146.  
  147.    public void describeClassInfo(ClassInfo var1) {
  148.       var1.addClass("netscape.application.PackConstraints", 1);
  149.       var1.addField("anchor", (byte)8);
  150.       var1.addField("expand", (byte)0);
  151.       var1.addField("fillx", (byte)0);
  152.       var1.addField("filly", (byte)0);
  153.       var1.addField("ipadx", (byte)8);
  154.       var1.addField("ipady", (byte)8);
  155.       var1.addField("padx", (byte)8);
  156.       var1.addField("pady", (byte)8);
  157.       var1.addField("side", (byte)8);
  158.    }
  159.  
  160.    public void encode(Encoder var1) throws CodingException {
  161.       var1.encodeInt("anchor", this.anchor);
  162.       var1.encodeBoolean("expand", this.expand);
  163.       var1.encodeBoolean("fillx", this.fillX);
  164.       var1.encodeBoolean("filly", this.fillY);
  165.       var1.encodeInt("ipadx", this.iPadX);
  166.       var1.encodeInt("ipady", this.iPadY);
  167.       var1.encodeInt("padx", this.padX);
  168.       var1.encodeInt("pady", this.padY);
  169.       var1.encodeInt("side", this.side);
  170.    }
  171.  
  172.    public void decode(Decoder var1) throws CodingException {
  173.       this.anchor = var1.decodeInt("anchor");
  174.       this.expand = var1.decodeBoolean("expand");
  175.       this.fillX = var1.decodeBoolean("fillx");
  176.       this.fillY = var1.decodeBoolean("filly");
  177.       this.iPadX = var1.decodeInt("ipadx");
  178.       this.iPadY = var1.decodeInt("ipady");
  179.       this.padX = var1.decodeInt("padx");
  180.       this.padY = var1.decodeInt("pady");
  181.       this.side = var1.decodeInt("side");
  182.    }
  183.  
  184.    public void finishDecoding() throws CodingException {
  185.    }
  186.  
  187.    public Object clone() {
  188.       try {
  189.          return super.clone();
  190.       } catch (CloneNotSupportedException var2) {
  191.          throw new InconsistencyException(this + ": clone() not supported :" + var2);
  192.       }
  193.    }
  194. }
  195.