Skip to content

Commit

Permalink
Add some hook points for testing branch (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
iaik-jheher committed Feb 22, 2024
1 parent 69cce41 commit ec38340
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ public class Constants {

/** Default Mobile BKU URL */
public static final URI MOBILE_BKU_URL = URI.create("https://service.a-trust.at/mobile/https-security-layer-request/default.aspx");
public static final URI MOBILE_BKU_URL_TEST = URI.create("https://hs-abnahme.a-trust.at/mobile/https-security-layer-request/default.aspx");

/** How far to displace the signature with the arrow keys */
public static final int SIGNATURE_KEYBOARD_POSITIONING_OFFSET = 15;
Expand Down
44 changes: 24 additions & 20 deletions pdf-over-gui/src/main/java/at/asit/pdfover/gui/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,34 +32,38 @@
*/
@Slf4j
public class Main {
// private static URL url=null;

public static StateMachine setup(String[] args) {
log.info("This is " + Constants.APP_NAME_VERSION + ", " +
"running on " + System.getProperty("os.arch") + " " + System.getProperty("os.name") + ", " +
"powered by "+ System.getProperty("java.vendor") + " Java " + System.getProperty("java.version") + ".");
File configDir = new File(Constants.CONFIG_DIRECTORY);

if (!configDir.exists()) {
configDir.mkdir();
}

// force loading the IAIK JCE (cf. #95)
IAIK.addAsProvider();

// force keystore type (Adoptium JRE 17 still ships with JKS, cf. #95)
System.setProperty("javax.net.ssl.trustStoreType", "jks");

// disable display scaling for AWT components embedded in SWT (cf. #106)
System.setProperty("sun.java2d.uiScale", "1");

return new StateMachine(args);
}

/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
try {
log.info("This is " + Constants.APP_NAME_VERSION + ", " +
"running on " + System.getProperty("os.arch") + " " + System.getProperty("os.name") + ", " +
"powered by "+ System.getProperty("java.vendor") + " Java " + System.getProperty("java.version") + ".");
File configDir = new File(Constants.CONFIG_DIRECTORY);

if (!configDir.exists()) {
configDir.mkdir();
}

// force loading the IAIK JCE (cf. #95)
IAIK.addAsProvider();

// force keystore type (Adoptium JRE 17 still ships with JKS, cf. #95)
System.setProperty("javax.net.ssl.trustStoreType", "jks");

// disable display scaling for AWT components embedded in SWT (cf. #106)
System.setProperty("sun.java2d.uiScale", "1");

StateMachine sm = setup(args);
log.debug("Starting stateMachine ...");
(new StateMachine(args)).start();
sm.start();
log.debug("Ended stateMachine ...");
}
catch (Throwable e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,31 +153,31 @@ public MobileBKUEnterNumberComposite(Composite parent, int style, State state) {
containerComposite.setLayout(new FormLayout());
SWTUtils.anchor(containerComposite).top(50, -120).bottom(50, 120).left(50, -200).right(50, 200);

this.lbl_number = new Label(containerComposite, SWT.NATIVE);
this.lbl_number.setAlignment(SWT.RIGHT);
SWTUtils.anchor(lbl_number).bottom(50, -10).right(50, -10);

this.txt_number = new Text(containerComposite, SWT.SINGLE | SWT.NATIVE | SWT.BORDER);
SWTUtils.anchor(txt_number).bottom(50, -10).left(50, 10).right(100, -20);
this.txt_number.setEditable(true);
SWTUtils.addFocusGainedListener(txt_number, () -> { txt_number.selectAll(); });

this.lbl_number = new Label(containerComposite, SWT.NATIVE);
this.lbl_number.setAlignment(SWT.RIGHT);
SWTUtils.anchor(lbl_number).bottom(50, -10).right(50, -10);

ImageData mobileIconData = new ImageData(this.getClass().getResourceAsStream(Constants.RES_IMG_MOBILE)).scaledTo(90, 90);
Image mobileIcon = new Image(getDisplay(), mobileIconData);

Label lbl_image = new Label(containerComposite, SWT.NATIVE);
SWTUtils.anchor(lbl_image).top(20, -1 * (mobileIconData.width / 2)).bottom(20, mobileIconData.width / 2).left(0, 10).width(mobileIconData.width);
lbl_image.setImage(mobileIcon);

this.lbl_password = new Label(containerComposite, SWT.NATIVE);
SWTUtils.anchor(lbl_password).top(50, 10).right(50, -10);
this.lbl_password.setAlignment(SWT.RIGHT);

this.txt_password = new Text(containerComposite, SWT.SINGLE | SWT.PASSWORD | SWT.BORDER | SWT.NATIVE);
SWTUtils.anchor(txt_password).top(50, 10).left(50, 10).right(100, -20);
this.txt_password.setEditable(true);
SWTUtils.addFocusGainedListener(txt_password, () -> { txt_password.selectAll(); });

this.lbl_password = new Label(containerComposite, SWT.NATIVE);
SWTUtils.anchor(lbl_password).top(50, 10).right(50, -10);
this.lbl_password.setAlignment(SWT.RIGHT);

this.btn_ok = new Button(containerComposite, SWT.NATIVE);
SWTUtils.anchor(btn_ok).bottom(100, -20).right(100, -20);
this.btn_ok.addSelectionListener(this.okListener);
Expand Down

0 comments on commit ec38340

Please sign in to comment.