home *** CD-ROM | disk | FTP | other *** search
- package netscape.application;
-
- import netscape.util.ClassInfo;
- import netscape.util.Codable;
- import netscape.util.CodingException;
- import netscape.util.Decoder;
- import netscape.util.Encoder;
- import netscape.util.InconsistencyException;
-
- public class PackConstraints implements Codable, Cloneable {
- int anchor;
- boolean expand;
- boolean fillX;
- boolean fillY;
- int iPadX;
- int iPadY;
- int padX;
- int padY;
- int side;
- static final String ANCHOR_KEY = "anchor";
- static final String EXPAND_KEY = "expand";
- static final String FILLX_KEY = "fillx";
- static final String FILLY_KEY = "filly";
- static final String IPADX_KEY = "ipadx";
- static final String IPADY_KEY = "ipady";
- static final String PADX_KEY = "padx";
- static final String PADY_KEY = "pady";
- static final String SIDE_KEY = "side";
- public static final int ANCHOR_NORTH = 0;
- public static final int ANCHOR_NORTHEAST = 1;
- public static final int ANCHOR_EAST = 2;
- public static final int ANCHOR_SOUTHEAST = 3;
- public static final int ANCHOR_SOUTH = 4;
- public static final int ANCHOR_SOUTHWEST = 5;
- public static final int ANCHOR_WEST = 6;
- public static final int ANCHOR_NORTHWEST = 7;
- public static final int ANCHOR_CENTER = 8;
- public static final int SIDE_TOP = 0;
- public static final int SIDE_BOTTOM = 1;
- public static final int SIDE_LEFT = 2;
- public static final int SIDE_RIGHT = 3;
-
- public PackConstraints() {
- this.anchor = 8;
- this.expand = false;
- this.fillX = false;
- this.fillY = false;
- this.iPadX = 0;
- this.iPadY = 0;
- this.padX = 0;
- this.padY = 0;
- this.side = 0;
- }
-
- public PackConstraints(int var1, boolean var2, boolean var3, boolean var4, int var5, int var6, int var7, int var8, int var9) {
- this.setAnchor(var1);
- this.setExpand(var2);
- this.setFillX(var3);
- this.setFillY(var4);
- this.setInternalPadX(var5);
- this.setInternalPadY(var6);
- this.setPadX(var7);
- this.setPadY(var8);
- this.setSide(var9);
- }
-
- public void setAnchor(int var1) {
- if (var1 >= 0 && var1 <= 8) {
- this.anchor = var1;
- } else {
- throw new InconsistencyException(this + "Invalid Anchor value: " + var1);
- }
- }
-
- public int anchor() {
- return this.anchor;
- }
-
- public void setExpand(boolean var1) {
- this.expand = var1;
- }
-
- public boolean expand() {
- return this.expand;
- }
-
- public void setFillX(boolean var1) {
- this.fillX = var1;
- }
-
- public boolean fillX() {
- return this.fillX;
- }
-
- public void setFillY(boolean var1) {
- this.fillY = var1;
- }
-
- public boolean fillY() {
- return this.fillY;
- }
-
- public void setInternalPadX(int var1) {
- this.iPadX = var1;
- }
-
- public int internalPadX() {
- return this.iPadX;
- }
-
- public void setInternalPadY(int var1) {
- this.iPadY = var1;
- }
-
- public int internalPadY() {
- return this.iPadY;
- }
-
- public void setPadX(int var1) {
- this.padX = var1;
- }
-
- public int padX() {
- return this.padX;
- }
-
- public void setPadY(int var1) {
- this.padY = var1;
- }
-
- public int padY() {
- return this.padY;
- }
-
- public void setSide(int var1) {
- if (var1 >= 0 && var1 <= 3) {
- this.side = var1;
- } else {
- throw new InconsistencyException(this + "Invalid Side value: " + var1);
- }
- }
-
- public int side() {
- return this.side;
- }
-
- public void describeClassInfo(ClassInfo var1) {
- var1.addClass("netscape.application.PackConstraints", 1);
- var1.addField("anchor", (byte)8);
- var1.addField("expand", (byte)0);
- var1.addField("fillx", (byte)0);
- var1.addField("filly", (byte)0);
- var1.addField("ipadx", (byte)8);
- var1.addField("ipady", (byte)8);
- var1.addField("padx", (byte)8);
- var1.addField("pady", (byte)8);
- var1.addField("side", (byte)8);
- }
-
- public void encode(Encoder var1) throws CodingException {
- var1.encodeInt("anchor", this.anchor);
- var1.encodeBoolean("expand", this.expand);
- var1.encodeBoolean("fillx", this.fillX);
- var1.encodeBoolean("filly", this.fillY);
- var1.encodeInt("ipadx", this.iPadX);
- var1.encodeInt("ipady", this.iPadY);
- var1.encodeInt("padx", this.padX);
- var1.encodeInt("pady", this.padY);
- var1.encodeInt("side", this.side);
- }
-
- public void decode(Decoder var1) throws CodingException {
- this.anchor = var1.decodeInt("anchor");
- this.expand = var1.decodeBoolean("expand");
- this.fillX = var1.decodeBoolean("fillx");
- this.fillY = var1.decodeBoolean("filly");
- this.iPadX = var1.decodeInt("ipadx");
- this.iPadY = var1.decodeInt("ipady");
- this.padX = var1.decodeInt("padx");
- this.padY = var1.decodeInt("pady");
- this.side = var1.decodeInt("side");
- }
-
- public void finishDecoding() throws CodingException {
- }
-
- public Object clone() {
- try {
- return super.clone();
- } catch (CloneNotSupportedException var2) {
- throw new InconsistencyException(this + ": clone() not supported :" + var2);
- }
- }
- }
-