1 18 package org.apache.batik.ext.awt.image; 19 20 27 public final class PadMode implements java.io.Serializable { 28 29 public static final int MODE_ZERO_PAD = 1; 30 31 32 public static final int MODE_REPLICATE = 2; 33 34 35 public static final int MODE_WRAP = 3; 36 37 38 public static final PadMode ZERO_PAD = new PadMode(MODE_ZERO_PAD); 39 40 41 public static final PadMode REPLICATE = new PadMode(MODE_REPLICATE); 42 43 44 public static final PadMode WRAP = new PadMode(MODE_WRAP); 45 46 49 public int getMode() { 50 return mode; 51 } 52 53 56 private int mode; 57 58 private PadMode(int mode) { 59 this.mode = mode; 60 } 61 62 69 private Object readResolve() throws java.io.ObjectStreamException { 70 switch(mode){ 71 case MODE_ZERO_PAD: 72 return ZERO_PAD; 73 case MODE_REPLICATE: 74 return REPLICATE; 75 case MODE_WRAP: 76 return WRAP; 77 default: 78 throw new Error ("Unknown Pad Mode type"); 79 } 80 } 81 } 82 | Popular Tags |