Browse Source

reorganize source codes under package com.crystaldecisions

sunyj 8 years ago
parent
commit
55d72c2764

+ 38 - 38
crystal-replace-view/src/main/java/com/crystaldecisions/client/helper/ObjectState.java

@@ -9,7 +9,7 @@ import com.crystaldecisions.sdk.occa.report.lib.ReportSDKException;
 import java.util.Locale;
 
 public class ObjectState {
-    private int readyToProcess;
+    private int state;
     private int newV;
     private int tryV;
     private int ifV;
@@ -22,8 +22,8 @@ public class ObjectState {
     private String Error_DocIsOpenedAlready;
     private Locale locale;
 
-    public ObjectState(Locale var1, int var2, String var3, int var4, String var5, int var6, String var7, int var8, String var9, int var10, String var11) {
-        this.readyToProcess = ObjectStateEnum.undefined.value();
+    public ObjectState(Locale locale, int var2, String var3, int var4, String var5, int var6, String var7, int var8, String var9, int var10, String var11) {
+        this.state = ObjectStateEnum.undefined.value();
         this.newV = 0;
         this.tryV = 0;
         this.ifV = 0;
@@ -35,7 +35,7 @@ public class ObjectState {
         this.Error_DocIsClosed = null;
         this.Error_DocIsOpenedAlready = null;
         this.locale = null;
-        this.locale = var1;
+        this.locale = locale;
         this.newV = var2;
         this.tryV = var4;
         this.ifV = var6;
@@ -49,95 +49,95 @@ public class ObjectState {
     }
 
     public void enter() throws ReportSDKException {
-        if (!isReadyToProcess(this.readyToProcess)) {
-            this.ifM(this.readyToProcess);
+        if (!isReadyToProcess(this.state)) {
+            this.checkState(this.state);
         }
 
-        ++this.readyToProcess;
+        ++this.state;
     }
 
     public int getObjectState() {
-        return this.readyToProcess;
+        return this.state;
     }
 
-    public static boolean isProcessing(int var0) {
-        return var0 > 0;
+    public static boolean isProcessing(int state) {
+        return state > 0;
     }
 
-    public static boolean isReadyToProcess(int var0) {
-        return var0 >= 0;
+    public static boolean isReadyToProcess(int state) {
+        return state >= 0;
     }
 
     public void leave() throws ReportSDKException {
-        --this.readyToProcess;
+        --this.state;
     }
 
-    private void ifM(int var1) throws ReportSDKException {
-        if (var1 == -4) {
+    private void checkState(int state) throws ReportSDKException {
+        if (state == -4) {
             if (this.Error_DocIsNotOpen != null) {
-                this.a(this.newV, this.Error_DocIsNotOpen);
+                this.throwReportSDKException(this.newV, this.Error_DocIsNotOpen);
             }
-        } else if (var1 == -3) {
+        } else if (state == -3) {
             if (this.Error_DocIsOpening != null) {
-                this.a(this.tryV, this.Error_DocIsOpening);
+                this.throwReportSDKException(this.tryV, this.Error_DocIsOpening);
             }
-        } else if (var1 == -2) {
+        } else if (state == -2) {
             if (this.Error_DocIsClosing != null) {
-                this.a(this.ifV, this.Error_DocIsClosing);
+                this.throwReportSDKException(this.ifV, this.Error_DocIsClosing);
             }
-        } else if (var1 == -1 && this.Error_DocIsClosed != null) {
-            this.a(this.gotoV, this.Error_DocIsClosed);
+        } else if (state == -1 && this.Error_DocIsClosed != null) {
+            this.throwReportSDKException(this.gotoV, this.Error_DocIsClosed);
         }
 
     }
 
     public void reset() {
-        this.a(-4);
+        this.setState(-4);
     }
 
-    public void setLocale(Locale var1) {
-        this.locale = var1;
+    public void setLocale(Locale locale) {
+        this.locale = locale;
     }
 
-    private void a(int var1) {
-        if (!isProcessing(this.readyToProcess)) {
-            this.readyToProcess = var1;
+    private void setState(int state) {
+        if (!isProcessing(this.state)) {
+            this.state = state;
         }
 
     }
 
     public void started() {
-        this.a(0);
+        this.setState(0);
     }
 
     public void starting() throws ReportSDKException {
         int var1 = this.getObjectState();
         if (var1 != -4) {
             if (var1 == 0) {
-                this.a(this.caseV, this.Error_DocIsOpenedAlready);
+                this.throwReportSDKException(this.caseV, this.Error_DocIsOpenedAlready);
             } else {
-                this.ifM(var1);
+                this.checkState(var1);
             }
         }
 
-        this.a(-3);
+        this.setState(-3);
     }
 
     public void stopped() {
-        this.a(-1);
+        this.setState(-1);
     }
 
     public void stopping() throws ReportSDKException {
         int var1 = this.getObjectState();
         if (!isReadyToProcess(var1)) {
-            this.ifM(var1);
+            this.checkState(var1);
         }
 
-        this.a(-2);
+        this.setState(-2);
     }
 
-    private void a(int var1, String var2) throws ReportSDKException {
-        String var3 = SDKResourceManager.getString(var2, this.locale);
-        ReportSDKException.throwReportSDKException(var1, var3);
+    private void throwReportSDKException(int errorCode, String key) throws ReportSDKException {
+        String message = SDKResourceManager.getString(key, this.locale);
+        ReportSDKException.throwReportSDKException(errorCode, message);
     }
 }