1 package org.splat.simer.admin;
3 import java.util.Iterator;
5 import java.util.ResourceBundle;
7 import org.splat.service.technical.ProjectSettingsService;
8 import org.splat.simer.ApplicationSettings;
9 import org.splat.dal.bo.som.ProgressState;
10 import org.splat.dal.bo.som.SimulationContext;
11 import org.splat.dal.bo.som.SimulationContextType;
14 public class SimulationContextFacade {
16 private SimulationContext my;
19 private ProgressState state;
21 // ==============================================================================================================================
23 // ==============================================================================================================================
25 public SimulationContextFacade (SimulationContext represented, List<ProjectSettingsService.Step> steps) {
26 // --------------------------------------------------------------
27 SimulationContextType mytype;
30 mytype = my.getType();
31 for (Iterator<ProjectSettingsService.Step> i=steps.iterator(); i.hasNext(); ) {
32 ProjectSettingsService.Step step = i.next();
33 if (!mytype.isAttachedTo(step)) continue;
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 name = ResourceBundle.getBundle("som", ApplicationSettings.getCurrentLocale()).getString("type.context." + name);
42 state = ProgressState.inDRAFT;
46 // ==============================================================================================================================
48 // ==============================================================================================================================
50 public String getEditIcon () {
51 // ----------------------------
52 StringBuffer result = new StringBuffer("icon.ed").append(state).append(".png");
53 return result.toString();
55 public String getIndex () {
56 // -------------------------
57 return String.valueOf(my.getIndex());
59 public int getStepNumber () {
60 // ---------------------------
63 public String getTypeName () {
64 // ----------------------------
67 public String getValue () {
68 // -------------------------