String regularExp = "\\d{1,4}";
CharSequence charSeq = param1;
if (param1.equals("")){
inputCount = 2;
OrGate og = new OrGate(inputCount);
System.out.println(og.getName() + " CREATED with " + inputCount + " inports.");
output += og.getName() + " CREATED with " + inputCount + " inports.\n";
//Prototype.PrintStateAfterUpdate(og);
Main.controller.getDisplayView().addComponentView(new OrGateView(0, 0, og));
}else if (param2.equals("") && Pattern.matches(regularExp, param1)) {
inputCount = Integer.parseInt(param1);
OrGate og = new OrGate(inputCount);
System.out.println(og.getName() + " CREATED with " + inputCount + " inports.");
output += og.getName() + " CREATED with " + inputCount + " inports.\n";
//Prototype.PrintStateAfterUpdate(og);
Main.controller.getDisplayView().addComponentView(new OrGateView(100, 0, og));
} else if (param2.equals("") && Pattern.matches("\\(\\d{1,4}\\,\\d{1,4}\\)", param1)){
inputCount = 2;
OrGate og = new OrGate(inputCount);
System.out.println(og.getName() + " CREATED with " + inputCount + " inports.");
output += og.getName() + " CREATED with " + inputCount + " inports.\n";
//Prototype.PrintStateAfterUpdate(og);
Main.controller.getDisplayView().addComponentView(new OrGateView(getPosX(param1), getPosY(param1), og));
} else if(Pattern.matches(regularExp, param1) && Pattern.matches("\\(\\d{1,4}\\,\\d{1,4}\\)", param2)) {
if (Pattern.matches(regularExp, charSeq)) {
inputCount = Integer.parseInt(param1);
OrGate og = new OrGate(inputCount);
System.out.println(og.getName() + " CREATED with " + inputCount + " inports.");
output += og.getName() + " CREATED with " + inputCount + " inports.\n";
//Prototype.PrintStateAfterUpdate(og);
//View készítése
Main.controller.getDisplayView().addComponentView(new OrGateView(getPosX(param2), getPosY(param2), og));
} else {