1 package org.splat.service.dto;
3 import java.util.Iterator;
6 import org.splat.service.technical.ProjectSettingsService;
7 import org.splat.dal.bo.som.ProgressState;
8 import org.splat.dal.bo.som.SimulationContext;
9 import org.splat.dal.bo.som.SimulationContextType;
11 public class SimulationContextFacade {
13 private SimulationContext my;
16 private ProgressState state;
18 // ==============================================================================================================================
20 // ==============================================================================================================================
22 public SimulationContextFacade(SimulationContext represented,
23 List<ProjectSettingsService.Step> steps) {
24 // --------------------------------------------------------------
25 SimulationContextType mytype;
28 mytype = my.getType();
29 for (Iterator<ProjectSettingsService.Step> i = steps.iterator(); i
31 ProjectSettingsService.Step step = i.next();
32 if (!mytype.isAttachedTo(step))
34 at = step.getNumber(); // There is no direct service for getting the step number
37 name = my.getType().getName();
38 if (mytype.isApproved()) {
39 state = ProgressState.inCHECK;
40 // RKV: TODO: Do translation in presentation layer by struts tools: name = ResourceBundle.getBundle("som",
41 // ApplicationSettings.getCurrentLocale()).getString("type.context." + name);
43 state = ProgressState.inDRAFT;
47 // ==============================================================================================================================
49 // ==============================================================================================================================
51 public String getEditIcon() {
52 // ----------------------------
53 StringBuffer result = new StringBuffer("icon.ed").append(state).append(
55 return result.toString();
58 public String getIndex() {
59 // -------------------------
60 return String.valueOf(my.getIndex());
63 public int getStepNumber() {
64 // ---------------------------
68 public String getTypeName() {
69 // ----------------------------
73 public String getValue() {
74 // -------------------------