/* */ package quicktime.qd;
/* */
/* */ import quicktime.QTException;
/* */ import quicktime.QTObject;
/* */ import quicktime.QTRuntimeException;
/* */ import quicktime.QTSession;
/* */ import quicktime.jdirect.QTNative;
/* */ import quicktime.std.StdQTException;
/* */ import quicktime.util.QTHandleRef;
/* */ import quicktime.util.UtilException;
/* */
/* */ public final class Polygon extends QTHandleRef
/* */ implements Cloneable
/* */ {
/* 29 */ private static boolean apriori = QTSession.apriori();
/* */
/* 37 */ private static final int[] savedPort = { 0 };
/* 38 */ private static final int[] savedDevice = { 0 };
/* */
/* 77 */ private transient QDGraphics gw = null;
/* */
/* */ private static int allocate(QDGraphics paramQDGraphics)
/* */ throws QTException
/* */ {
/* 41 */ if (paramQDGraphics == null) {
/* 42 */ throw new StdQTException(-50);
/* */ }
/* 44 */ int i = 0;
/* 45 */ synchronized (QTNative.globalsLock) {
/* 46 */ if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 47 */ GetGWorld(savedPort, savedDevice);
/* 48 */ SetGWorld(QTObject.ID(paramQDGraphics), 0);
/* 49 */ i = OpenPoly();
/* 50 */ if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 51 */ SetGWorld(savedPort[0], savedDevice[0]);
/* */ }
/* 53 */ if (i == 0)
/* 54 */ throw new UtilException(-108);
/* 55 */ return i;
/* */ }
/* */
/* */ public Polygon(QDGraphics paramQDGraphics)
/* */ throws QTException
/* */ {
/* 64 */ super(allocate(paramQDGraphics), null, false);
/* 65 */ if (QTObject.ID(this) == 0)
/* 66 */ QDException.checkError(-108);
/* 67 */ this.gw = paramQDGraphics;
/* */ }
/* */
/* */ private Polygon(int paramInt) throws QTException {
/* 71 */ super(paramInt, null, false);
/* 72 */ if (QTObject.ID(this) == 0)
/* 73 */ QDException.checkError(-108);
/* */ }
/* */
/* */ public void close()
/* */ throws QDException
/* */ {
/* 85 */ if (this.gw != null) {
/* 86 */ synchronized (QTNative.globalsLock) {
/* 87 */ if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 88 */ GetGWorld(savedPort, savedDevice);
/* 89 */ SetGWorld(QTObject.ID(this.gw), 0);
/* 90 */ ClosePoly();
/* 91 */ if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 92 */ SetGWorld(savedPort[0], savedDevice[0]);
/* */ }
/* */ }
/* 95 */ this.gw = null;
/* */ }
/* */
/* */ public int getSize() {
/* 99 */ return getShortAt(0);
/* */ }
/* */
/* */ public QDRect getPolyBBox()
/* */ {
/* 105 */ byte[] arrayOfByte = new byte[8];
/* 106 */ getBytesAt(2, 8, arrayOfByte, 0);
/* 107 */ return QDRect.fromArray(arrayOfByte, 8);
/* */ }
/* */
/* */ public QDRect getBounds()
/* */ {
/* 114 */ return getPolyBBox();
/* */ }
/* */
/* */ public Polygon copy()
/* */ throws QTException
/* */ {
/* 122 */ return new Polygon(makeAndCopyHandle());
/* */ }
/* */
/* */ public Object clone()
/* */ {
/* */ try
/* */ {
/* 132 */ return copy();
/* */ } catch (QTException localQTException) {
/* 134 */ throw new QTRuntimeException(localQTException);
/* */ }
/* */ }
/* */
/* */ public String toString()
/* */ {
/* 143 */ return super.toString() + "[polyBBox=" + getPolyBBox() + "]";
/* */ }
/* */
/* */ public void offset(int paramInt1, int paramInt2)
/* */ throws QDException
/* */ {
/* 161 */ OffsetPoly(_ID(), (short)paramInt1, (short)paramInt2);
/* */ }
/* */
/* */ private static native int OpenPoly();
/* */
/* */ private static native void ClosePoly();
/* */
/* */ private static native void OffsetPoly(int paramInt, short paramShort1, short paramShort2);
/* */
/* */ private static native void SetGWorld(int paramInt1, int paramInt2);
/* */
/* */ private static native void GetGWorld(int[] paramArrayOfInt1, int[] paramArrayOfInt2);
/* */ }
/* Location: Z:\System\Library\Java\Extensions\QTJava.zip
* Qualified Name: quicktime.qd.Polygon
* JD-Core Version: 0.6.2
*/