Browse Source

代码质量

master
XiaXiang 7 years ago
parent
commit
03713f55e6
  1. 14
      designer/src/com/fr/design/mainframe/alphafine/cell/CellModelHelper.java
  2. 5
      designer/src/com/fr/design/mainframe/alphafine/cell/cellModel/ActionModel.java
  3. 1
      designer/src/com/fr/design/mainframe/alphafine/cell/cellModel/AlphaCellModel.java
  4. 7
      designer/src/com/fr/design/mainframe/alphafine/cell/cellModel/DocumentModel.java
  5. 8
      designer/src/com/fr/design/mainframe/alphafine/cell/cellModel/FileModel.java
  6. 7
      designer/src/com/fr/design/mainframe/alphafine/cell/cellModel/PluginModel.java

14
designer/src/com/fr/design/mainframe/alphafine/cell/CellModelHelper.java

@ -12,6 +12,7 @@ import com.fr.json.JSONObject;
* Created by XiaXiang on 2017/5/17.
*/
public class CellModelHelper {
private static final String RESULT = "result";
public static AlphaCellModel jsonToModel(JSONObject object) {
int cellType = object.optInt("cellType");
switch (CellType.parse(cellType)) {
@ -30,17 +31,6 @@ public class CellModelHelper {
}
public static String getResultValueFromModel(AlphaCellModel cellModel) {
switch (cellModel.getType()) {
case ACTION:
return ((ActionModel)cellModel).getActionName();
case DOCUMENT:
return ((DocumentModel)cellModel).getInformationUrl();
case FILE:
return ((FileModel)cellModel).getFilePath();
case REUSE:
case PLUGIN:
return ((PluginModel)cellModel).getInformationUrl();
}
return null;
return cellModel.getStoreInformation();
}
}

5
designer/src/com/fr/design/mainframe/alphafine/cell/cellModel/ActionModel.java

@ -59,6 +59,11 @@ public class ActionModel extends AlphaCellModel implements Serializable {
return object;
}
@Override
public String getStoreInformation() {
return getActionName();
}
public String getActionName() {
return getAction().getClass().getName();
}

1
designer/src/com/fr/design/mainframe/alphafine/cell/cellModel/AlphaCellModel.java

@ -62,5 +62,6 @@ public abstract class AlphaCellModel {
abstract public JSONObject ModelToJson() throws JSONException;
abstract public String getStoreInformation();
}

7
designer/src/com/fr/design/mainframe/alphafine/cell/cellModel/DocumentModel.java

@ -46,10 +46,13 @@ public class DocumentModel extends AlphaCellModel {
return object;
}
@Override
public String getStoreInformation() {
return getInformationUrl();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof DocumentModel)) return false;
DocumentModel that = (DocumentModel) o;

8
designer/src/com/fr/design/mainframe/alphafine/cell/cellModel/FileModel.java

@ -5,6 +5,7 @@ import com.fr.design.mainframe.alphafine.CellType;
import com.fr.general.FRLogger;
import com.fr.json.JSONException;
import com.fr.json.JSONObject;
import org.apache.xerces.impl.xpath.regex.REUtil;
/**
* Created by XiaXiang on 2017/4/20.
@ -41,11 +42,14 @@ public class FileModel extends AlphaCellModel{
return object;
}
@Override
public String getStoreInformation() {
return getFilePath();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof FileModel)) return false;
FileModel fileModel = (FileModel) o;

7
designer/src/com/fr/design/mainframe/alphafine/cell/cellModel/PluginModel.java

@ -109,11 +109,14 @@ public class PluginModel extends AlphaCellModel {
return object;
}
@Override
public String getStoreInformation() {
return getInformationUrl();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof PluginModel)) return false;
PluginModel that = (PluginModel) o;

Loading…
Cancel
Save