X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src2%2Fnet%2Fmiginfocom%2Flayout%2FResizeConstraint.java;fp=src%2Fnet%2Fmiginfocom%2Flayout%2FResizeConstraint.java;h=d4fff62f57748a05d3b4b7c51d8bea22b854a301;hb=665d2c2f4c1310e6985b93b7c2c8a8eec2fa9086;hp=6a4b7f98c88d5dcf0f6658b7d5bfde8e9526245e;hpb=0e684f72690bd6532272a39ab6c188a27559fd09;p=jalview.git diff --git a/src/net/miginfocom/layout/ResizeConstraint.java b/src2/net/miginfocom/layout/ResizeConstraint.java similarity index 78% rename from src/net/miginfocom/layout/ResizeConstraint.java rename to src2/net/miginfocom/layout/ResizeConstraint.java index 6a4b7f9..d4fff62 100644 --- a/src/net/miginfocom/layout/ResizeConstraint.java +++ b/src2/net/miginfocom/layout/ResizeConstraint.java @@ -1,5 +1,6 @@ package net.miginfocom.layout; +import java.io.*; /* * License (BSD): * ============== @@ -33,12 +34,11 @@ package net.miginfocom.layout; * @author Mikael Grev, MiG InfoCom AB * Date: 2006-sep-08 */ -//import java.io.Externalizable; /** A parsed constraint that specifies how an entity (normally column/row or component) can shrink or * grow compared to other entities. */ -final class ResizeConstraint //implements Externalizable +final class ResizeConstraint implements Externalizable { static final Float WEIGHT_100 = 100f; @@ -70,25 +70,25 @@ final class ResizeConstraint //implements Externalizable this.grow = growWeight; } -// // ************************************************ -// // Persistence Delegate and Serializable combined. -// // ************************************************ -// -// private Object readResolve() throws ObjectStreamException -// { -// return LayoutUtil.getSerializedObject(this); -// } -// -// @Override -// public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException -// { -// LayoutUtil.setSerializedObject(this, LayoutUtil.readAsXML(in)); -// } -// -// @Override -// public void writeExternal(ObjectOutput out) throws IOException -// { -// if (getClass() == ResizeConstraint.class) -// LayoutUtil.writeAsXML(out, this); -// } + // ************************************************ + // Persistence Delegate and Serializable combined. + // ************************************************ + + private Object readResolve() throws ObjectStreamException + { + return LayoutUtil.getSerializedObject(this); + } + + @Override + public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException + { + LayoutUtil.setSerializedObject(this, LayoutUtil.readAsXML(in)); + } + + @Override + public void writeExternal(ObjectOutput out) throws IOException + { + if (getClass() == ResizeConstraint.class) + LayoutUtil.writeAsXML(out, this); + } }