/**
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
package de.vanitasvitae.enigmandroid.layout;
import android.widget.Spinner;
import de.vanitasvitae.enigmandroid.MainActivity;
import de.vanitasvitae.enigmandroid.R;
import de.vanitasvitae.enigmandroid.enigma.Enigma;
import de.vanitasvitae.enigmandroid.enigma.EnigmaStateBundle;
import de.vanitasvitae.enigmandroid.enigma.Enigma_T;
/**
* LayoutContainer for the Enigma Model T
* This class contains the layout and controls the layout elements such as spinners and stuff
* Copyright (C) 2015 Paul Schaub
*/
public class LayoutContainer_T extends LayoutContainer
{
private Enigma_T enigma;
private Spinner rotor1View;
private Spinner rotor2View;
private Spinner rotor3View;
private Spinner rotor1PositionView;
private Spinner rotor2PositionView;
private Spinner rotor3PositionView;
private Spinner reflectorPositionView;
public LayoutContainer_T()
{
super();
main.setTitle("T - EnigmAndroid");
this.resetLayout();
}
@Override
public void doCrypto()
{
if(inputView.getText().length()!=0)
{
syncStateFromLayoutToEnigma();
String message = inputView.getText().toString();
//
boolean egg = false;
if(message.hashCode() == -1475861192) egg = true;
message = inputPreparer.prepareString(message);
input.setText(message);
if(egg) output.setText("ENIGMA