Search in sources :

Example 1 with ComponentCreation

use of org.nhindirect.trustbundle.utils.ComponentCreation in project nhin-d by DirectProject.

the class PreviewTrustBundle method addComponentsToPane.

/**
	 * Set the orientation of the components inside the pane.
	 * @param pane Accept the container pane and set its orientation.
	 * @return void 
	 */
public static void addComponentsToPane(Container pane) {
    if (RIGHT_TO_LEFT) {
        pane.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
    }
    pane.setLayout(new GridBagLayout());
    ComponentCreation creation = new ComponentCreation();
    /**
	 * Below block create the screen by using the ComponentCreation class and its method to create components.
	 * The componentCreation class has various methods exposed which will take the pane and type of component with its position.
	 * Radio, label, File, Directory etc are different type of pane can be created using the class. 
	 */
    GridBagConstraints c = new GridBagConstraints();
    c.anchor = (c.gridx == 0) ? GridBagConstraints.EAST : GridBagConstraints.WEST;
    c.weighty = 1.5;
    c.weightx = 0.5;
    creation.createComponent("TEXTAREA", conent, false, c, pane, null, 0, 0);
}
Also used : GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) ComponentCreation(org.nhindirect.trustbundle.utils.ComponentCreation)

Example 2 with ComponentCreation

use of org.nhindirect.trustbundle.utils.ComponentCreation in project nhin-d by DirectProject.

the class ViewTrustBundle method addComponentsToPane.

/**
	 * Set the orientation of the components inside the pane.
	 * @param pane Accept the container pane and set its orientation.
	 * @return void 
	 */
public static void addComponentsToPane(Container pane) {
    if (RIGHT_TO_LEFT) {
        pane.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
    }
    pane.setLayout(new GridBagLayout());
    ComponentCreation creation = new ComponentCreation();
    /**
	 * Below block create the screen by using the ComponentCreation class and its method to create components.
	 * The componentCreation class has various methods exposed which will take the pane and type of component with its position.
	 * Radio, label, File, Directory etc are different type of pane can be created using the class. 
	 */
    GridBagConstraints c = new GridBagConstraints();
    c.anchor = (c.gridx == 0) ? GridBagConstraints.EAST : GridBagConstraints.WEST;
    c.weighty = 1.5;
    c.weightx = 0.5;
    ButtonGroup myButtonGroup = new ButtonGroup();
    creation.createComponent("RADIO", "  Create Unsigned Trust Bundle", false, c, pane, myButtonGroup, 0, 0);
    creation.createComponent("RADIO", "  Create Signed Trust Bundle", false, c, pane, myButtonGroup, 1, 0);
    creation.createComponent("RADIO", "  View Trust Bundle", true, c, pane, myButtonGroup, 2, 0);
    creation.createComponent("LABEL", "  Trust Bundle", false, c, pane, null, 0, 1);
    creation.createBrowseFile("FILE", "Select Trust Bundle File", c, pane, 1, 1);
    creation.createComponent("BUTTON", "View Bundle", false, c, pane, null, 1, 5);
    c.fill = GridBagConstraints.NONE;
    creation.createComponent("LABEL", " 	Feedback:", false, c, pane, null, 0, 6);
    creation.createComponent("TEXTPANE", "", false, c, pane, null, 1, 6);
}
Also used : GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) ButtonGroup(javax.swing.ButtonGroup) ComponentCreation(org.nhindirect.trustbundle.utils.ComponentCreation)

Example 3 with ComponentCreation

use of org.nhindirect.trustbundle.utils.ComponentCreation in project nhin-d by DirectProject.

the class SignedTrustBundle method addComponentsToPane.

/**
	 * Set the orientation of the components inside the pane.
	 * @param pane Accept the container pane and set its orientation.
	 * @return void 
	 */
public static void addComponentsToPane(Container pane) {
    if (RIGHT_TO_LEFT) {
        pane.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
    }
    pane.setLayout(new GridBagLayout());
    ComponentCreation creation = new ComponentCreation();
    /**
	 * Below block create the screen by using the ComponentCreation class and its method to create components.
	 * The componentCreation class has various methods exposed which will take the pane and type of component with its position.
	 * Radio, label, File, Directory etc are different type of pane can be created using the class. 
	 */
    GridBagConstraints c = new GridBagConstraints();
    c.anchor = (c.gridx == 0) ? GridBagConstraints.EAST : GridBagConstraints.WEST;
    c.weighty = 1.5;
    c.weightx = 0.5;
    ButtonGroup myButtonGroup = new ButtonGroup();
    creation.createComponent("RADIO", "  Create Unsigned Trust Bundle", false, c, pane, myButtonGroup, 0, 0);
    creation.createComponent("RADIO", "  Create Signed Trust Bundle", true, c, pane, myButtonGroup, 1, 0);
    creation.createComponent("RADIO", "  View Trust Bundle", false, c, pane, myButtonGroup, 2, 0);
    creation.createComponent("LABEL", "  Trust Anchor Directory", false, c, pane, null, 0, 1);
    creation.createBrowseFile("DIRECTORY", "Select Trust Anchor Directory", c, pane, 1, 1);
    creation.createComponent("LABEL", "  Optional Meta Data File", false, c, pane, null, 0, 2);
    creation.createBrowseFile("FILE", "Select Meta Data File", c, pane, 1, 2);
    creation.createComponent("LABEL", "  Signing Certificate", false, c, pane, null, 0, 3);
    creation.createBrowseFile("FILE", "Select Certificate File (.p12)", c, pane, 1, 3);
    creation.createComponent("LABEL", "  Signing Certificate Password Key", false, c, pane, null, 0, 4);
    c.fill = GridBagConstraints.HORIZONTAL;
    creation.createComponent("PASSWORD", "", false, c, pane, null, 1, 4);
    creation.createComponent("LABEL", "  Trust Bundle Destination Directory", false, c, pane, null, 0, 5);
    creation.createBrowseFile("DIRECTORY", "Select Trust Bundle Destination Directory", c, pane, 1, 5);
    creation.createComponent("LABEL", "  Trust Bundle Name", false, c, pane, null, 0, 6);
    c.fill = GridBagConstraints.HORIZONTAL;
    creation.createComponent("TEXT", "", false, c, pane, null, 1, 6);
    c.fill = GridBagConstraints.NONE;
    creation.createComponent("BUTTON", "Create Signed Bundle", false, c, pane, null, 1, 7);
    c.fill = GridBagConstraints.NONE;
    creation.createComponent("LABEL", " 	Feedback:", false, c, pane, null, 0, 8);
    creation.createComponent("TEXTPANE", "", false, c, pane, null, 1, 8);
}
Also used : GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) ButtonGroup(javax.swing.ButtonGroup) ComponentCreation(org.nhindirect.trustbundle.utils.ComponentCreation)

Example 4 with ComponentCreation

use of org.nhindirect.trustbundle.utils.ComponentCreation in project nhin-d by DirectProject.

the class UnSignedTrustBundle method addComponentsToPane.

/**
	 * Set the orientation of the components inside the pane.
	 * @param pane Accept the container pane and set its orientation.
	 * @return void 
	 */
public static void addComponentsToPane(Container pane) {
    if (RIGHT_TO_LEFT) {
        pane.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
    }
    /**
	 * Below block create the screen by using the ComponentCreation class and its method to create components.
	 * The componentCreation class has various methods exposed which will take the pane and type of component with its position.
	 * Radio, label, File, Directory etc are different type of pane can be created using the class. 
	 */
    pane.setLayout(new GridBagLayout());
    ComponentCreation creation = new ComponentCreation();
    GridBagConstraints c = new GridBagConstraints();
    c.anchor = (c.gridx == 0) ? GridBagConstraints.EAST : GridBagConstraints.WEST;
    c.weighty = 1.5;
    c.weightx = 0.5;
    //The radio button group to navigate the three screens.
    ButtonGroup myButtonGroup = new ButtonGroup();
    creation.createComponent("RADIO", "  Create Unsigned Trust Bundle", true, c, pane, myButtonGroup, 0, 0);
    creation.createComponent("RADIO", "  Create Signed Trust Bundle", false, c, pane, myButtonGroup, 1, 0);
    creation.createComponent("RADIO", "  View Trust Bundle", false, c, pane, myButtonGroup, 2, 0);
    // 1st Screen component creation
    creation.createComponent("LABEL", "  Trust Anchor Directory", false, c, pane, null, 0, 1);
    creation.createBrowseFile("DIRECTORY", "Select Trust Anchor Directory", c, pane, 1, 1);
    creation.createComponent("LABEL", "  Optional Meta Data File", false, c, pane, null, 0, 2);
    creation.createBrowseFile("FILE", "Select Meta Data File", c, pane, 1, 2);
    creation.createComponent("LABEL", "  Trust Bundle Destination Directory", false, c, pane, null, 0, 3);
    creation.createBrowseFile("DIRECTORY", "Select Trust Bundle Destination Directory", c, pane, 1, 3);
    creation.createComponent("LABEL", "  Trust Bundle Name", false, c, pane, null, 0, 4);
    c.fill = GridBagConstraints.HORIZONTAL;
    creation.createComponent("TEXT", "", false, c, pane, null, 1, 4);
    creation.createComponent("BUTTON", "Create Bundle", false, c, pane, null, 1, 5);
    //Error or Feedback logs
    c.fill = GridBagConstraints.NONE;
    creation.createComponent("LABEL", " 	Feedback:", false, c, pane, null, 0, 6);
    creation.createComponent("TEXTPANE", "", false, c, pane, null, 1, 6);
}
Also used : GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) ButtonGroup(javax.swing.ButtonGroup) ComponentCreation(org.nhindirect.trustbundle.utils.ComponentCreation)

Aggregations

GridBagConstraints (java.awt.GridBagConstraints)4 GridBagLayout (java.awt.GridBagLayout)4 ComponentCreation (org.nhindirect.trustbundle.utils.ComponentCreation)4 ButtonGroup (javax.swing.ButtonGroup)3