/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package domain;
import data.UserController;
/**
*
* @author jose.alberto.villaverde
*/
public class PreferencesController {
private static PreferencesController singleton = null;
public static PreferencesController getInstance() {
if(singleton == null) {
singleton = new PreferencesController();
}
return singleton;
}
public int getN(int id) {
if (id == 0) {
return 6;
}
return Constants.getN();
}
public float getG(int id) {
if (id == 0) {
return 0;
}
return Constants.getGAMMA();
}
public int getS(int id) {
if (id == 0) {
return 5;
}
return Constants.getSUGGESTIONS();
}
public void setN(int id, int N) {
if (id != 0) {
Constants.setN(N);
}
}
public void setG(int id, float G) {
if (id != 0) {
Constants.setGAMMA(G);
}
}
public void setS(int id, int S) {
if (id != 0) {
Constants.setSUGGESTIONS(S);
}
}
public String getColor(int id) {
if (id == 0) {
return "BLUE";
}
UserController usrcntrl = new UserController();
return usrcntrl.getColor(id);
}
public int getSize(int id) {
if (id == 0) {
return 14;
}
UserController usrcntrl = new UserController();
return usrcntrl.getSize(id);
}
public void setColor(int id, String color) {
if(id != 0) {
UserController usrcntrl = new UserController();
usrcntrl.setColor(id, color);
}
}
public void setSize(int id, int size) {
if(id != 0) {
UserController usrcntrl = new UserController();
usrcntrl.setSize(id, size);
}
}
public int getAssistant(int id) {
if (id == 0) {
return 1;
}
UserController usrcntrl = new UserController();
return usrcntrl.getAssistant(id);
}
public void setAssistant(int id, int boolea) {
if (id != 0) {
UserController usrcntrl = new UserController();
usrcntrl.setAssistant(id, boolea);
}
}
}