Example usage for java.awt Label LEFT

List of usage examples for java.awt Label LEFT

Introduction

In this page you can find the example usage for java.awt Label LEFT.

Prototype

int LEFT

To view the source code for java.awt Label LEFT.

Click Source Link

Document

Indicates that the label should be left justified.

Usage

From source file:jotp.java

public void init() {

    setBackground(Color.white);/*from w ww  . j ava2s .co  m*/
    setLayout(new GridLayout(6, 1));

    Panel panel1 = new Panel();
    add(panel1);
    Font titlefont = new Font("TimesRoman", Font.BOLD, 14);
    panel1.setFont(titlefont);
    panel1.add(new Label(String.valueOf(version) + ": The Java OTP (aka S/Key) calculator!"));
    Panel panel2 = new Panel();
    panel2.setLayout(new FlowLayout());
    add(panel2);
    panel2.add(new Label("Challenge (e.g. \"55 latour1\"):"));
    chaltf = new TextField(24);
    panel2.add(chaltf);

    Panel panel3 = new Panel();
    panel3.setLayout(new FlowLayout());
    add(panel3);
    panel3.add(new Label("Secret Password:"));
    pwtf = new TextField(24);
    pwtf.setEchoCharacter('*');
    panel3.add(pwtf);

    Panel panel4 = new Panel();
    panel4.setLayout(new FlowLayout());
    add(panel4);

    panel4.add(new Button(String.valueOf(md4label)));
    panel4.add(new Button(String.valueOf(md5label)));

    Panel panel6 = new Panel();
    panel6.setLayout(new FlowLayout());
    add(panel6);
    panel6.add(new Label("One-Time Password:", Label.LEFT));
    otptf = new TextField(40);
    panel6.add(otptf);

    Panel panel7 = new Panel();
    add(panel7);
    panel7.add(new Label("jotp by Harry Mantakos, " + "http://www.cs.umd.edu/~harry/jotp"));
}

From source file:width.java

 public void init() {
Button button = new Button("Clear");
     add(label);/*w ww . j av a 2s  .  c  om*/
     add(button);
button.addActionListener(this);
     add(new Label("(My name is " + getParameter("name") 
                   + ".)", 
                   Label.LEFT)); 
 }

From source file:mesquite.chromaseq.InterpretASNGenBank.InterpretASNGenBank.java

public boolean getExportOptions(boolean dataSelected, boolean taxaSelected) {
    MesquiteInteger buttonPressed = new MesquiteInteger(1);
    ExporterDialog exportDialog = new ExporterDialog(this, containerOfModule(),
            "Export ASN for GenBank Options", buttonPressed);
    exportDialog.appendToHelpString(//from   w  w  w.  j av  a 2s.c  o  m
            "Choose the options for exporting the matrix as a ASN file prepared for submission NCBI's Sequin.");
    exportDialog.appendToHelpString(
            "<br><br><b>SeqID Suffix</b>: this will be added to each taxon name to form the unique SeqID.");
    exportDialog.appendToHelpString(
            "<br><b>Description of gene fragment</b>: this will be added to each sequence's DEFINITION.");
    exportDialog.appendToHelpString(
            "<br><b>Text before VoucherCode in DEFINITION</b>: this will inserted between the organism name and the VoucherCode in the DEFINITION.");

    SingleLineTextField uniqueSuffixField = exportDialog.addTextField("SeqID Suffix", "", 20);
    TextArea fsText = null;
    exportDialog.addLabel("Description of gene fragment:", Label.LEFT);
    fsText = exportDialog.addTextAreaSmallFont(addendum, 4);
    SingleLineTextField codeLabelField = exportDialog.addTextField("Text before VoucherCode in DEFINITION",
            "DNAVoucher", 20);

    Checkbox includeGapsCheckBox = exportDialog.addCheckBox("include gaps", includeGaps);
    exportDialog.addHorizontalLine(1);
    int releaseB = 1;
    if (releaseImmediately)
        releaseB = 0;
    RadioButtons releaseButtons = exportDialog
            .addRadioButtons(new String[] { "release immediately", "release date:" }, releaseB);
    IntegerField releaseYearField = exportDialog.addIntegerField("Release Year", releaseYear, 6);
    IntegerField releaseMonthField = exportDialog.addIntegerField("Release Month", releaseMonth, 4);
    IntegerField releaseDayField = exportDialog.addIntegerField("Release Day", releaseDay, 4);

    exportDialog.completeAndShowDialog(dataSelected, taxaSelected);

    addendum = fsText.getText();
    codeLabel = codeLabelField.getText();
    uniqueSuffix = uniqueSuffixField.getText();

    boolean ok = (exportDialog.query(dataSelected, taxaSelected) == 0);

    if (ok) {
        includeGaps = includeGapsCheckBox.getState();
        if (releaseButtons.getValue() == 0) {
            releaseImmediately = true;
        } else {
            releaseYear = releaseYearField.getValue();
            releaseMonth = releaseMonthField.getValue();
            releaseDay = releaseDayField.getValue();
            releaseImmediately = false;
        }
    }

    exportDialog.dispose();
    if (ok)
        ok = contact.queryValues();
    if (ok)
        ok = authors.queryValues();
    if (ok)
        ok = affiliation.queryValues();
    if (ok)
        storePreferences();
    return ok;

}

From source file:SplineAnim.java

private void createControlPanel(Panel p) {

    GridBagLayout gl = new GridBagLayout();
    GridBagConstraints gbc = new GridBagConstraints();

    p.setLayout(gl);/*from  w  ww  . ja v a 2 s .  c  o m*/
    gbc.weightx = 100;
    gbc.weighty = 100;
    gbc.fill = GridBagConstraints.BOTH;

    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.gridwidth = 1;
    gbc.gridheight = 1;
    interpLabel = new Label("Interpolation Type", Label.LEFT);
    p.add(interpLabel, gbc);

    gbc.gridx = 1;
    gbc.gridy = 0;
    gbc.gridwidth = 1;
    gbc.gridheight = 1;
    interpChoice = new Choice();
    interpChoice.add("Spline");
    interpChoice.add("Linear");
    p.add(interpChoice, gbc);
    interpChoice.addItemListener(this);

    gbc.gridx = 0;
    gbc.gridy = 2;
    gbc.gridwidth = 2;
    gbc.gridheight = 1;
    speedSlider = new Scrollbar(Scrollbar.HORIZONTAL, 2, 1, 0, 11);
    speedSlider.setUnitIncrement(1);
    p.add(speedSlider, gbc);
    speedSlider.addAdjustmentListener(this);

    gbc.gridx = 0;
    gbc.gridy = 3;
    gbc.gridwidth = 2;
    gbc.gridheight = 1;
    speedLabel = new Label(" - Animation Speed +", Label.CENTER);
    p.add(speedLabel, gbc);

    gbc.gridx = 0;
    gbc.gridy = 5;
    gbc.gridwidth = 2;
    gbc.gridheight = 1;
    animateButton = new Button("Stop Animation");
    p.add(animateButton, gbc);
    animateButton.addActionListener(this);

}

From source file:mesquite.zephyr.lib.RAxMLRunner.java

public boolean queryOptions() {
    if (!okToInteractWithUser(CAN_PROCEED_ANYWAY, "Querying Options")) //Debugg.println needs to check that options set well enough to proceed anyway
        return true;

    boolean closeWizard = false;

    if ((MesquiteTrunk.isMacOSXBeforeSnowLeopard()) && MesquiteDialog.currentWizard == null) {
        CommandRecord cRec = null;/*from   ww w .  j  a  v  a  2 s  . c  o  m*/
        cRec = MesquiteThread.getCurrentCommandRecordDefIfNull(null);
        if (cRec != null) {
            cRec.requestEstablishWizard(true);
            closeWizard = true;
        }
    }

    MesquiteInteger buttonPressed = new MesquiteInteger(1);
    ExtensibleDialog dialog = new ExtensibleDialog(containerOfModule(), "RAxML Options & Locations",
            buttonPressed); //MesquiteTrunk.mesquiteTrunk.containerOfModule()
    //   dialog.addLabel("RAxML - Options and Locations");
    String helpString = "This module will prepare a matrix for RAxML, and ask RAxML do to an analysis.  A command-line version of RAxML must be installed. "
            + "You can ask it to do multiple searches for optimal trees, OR to do a bootstrap analysis (but not both). "
            + "Mesquite will read in the trees found by RAxML, and, for non-bootstrap analyses, also read in the value of the RAxML score (-ln L) of the tree. "
            + "You can see the RAxML score by choosing Taxa&Trees>List of Trees, and then in the List of Trees for that trees block, choose "
            + "Columns>Number for Tree>Other Choices, and then in the Other Choices dialog, choose RAxML Score.";

    dialog.appendToHelpString(helpString);
    dialog.setHelpURL(zephyrRunnerEmployer.getProgramURL());

    MesquiteTabbedPanel tabbedPanel = dialog.addMesquiteTabbedPanel();

    tabbedPanel.addPanel("RAxML Program Details", true);
    externalProcRunner.addItemsToDialogPanel(dialog);
    addRunnerOptions(dialog);
    if (treeInferer != null)
        treeInferer.addItemsToDialogPanel(dialog);

    tabbedPanel.addPanel("Search Replicates & Bootstrap", true);
    doBootstrapCheckbox = dialog.addCheckBox("do bootstrap analysis", doBootstrap);
    dialog.addHorizontalLine(1);
    dialog.addLabel("Bootstrap Options", Label.LEFT, false, true);
    doBootstrapCheckbox.addItemListener(this);
    bootStrapRepsField = dialog.addIntegerField("Bootstrap Replicates", bootstrapreps, 8, 0,
            MesquiteInteger.infinite);
    seedField = dialog.addIntegerField("Random number seed: ", randomIntSeed, 20);
    dialog.addHorizontalLine(1);
    dialog.addLabel("Maximum Likelihood Tree Search Options", Label.LEFT, false, true);
    numRunsField = dialog.addIntegerField("Number of Search Replicates", numRuns, 8, 1,
            MesquiteInteger.infinite);
    onlyBestBox = dialog.addCheckBox("save only best tree", onlyBest);
    checkEnabled(doBootstrap);

    tabbedPanel.addPanel("Character Models & Constraints", true);
    dnaModelField = dialog.addTextField("DNA Model:", dnaModel, 20);
    proteinModelField = dialog.addTextField("Protein Model:", proteinModel, 20);
    dialog.addHorizontalLine(1);
    dialog.addLabel("Constraint tree:", Label.LEFT, false, true);
    constraintButtons = dialog.addRadioButtons(
            new String[] { "No Constraint", "Partial Resolution", "Skeletal Constraint" }, useConstraintTree);
    constraintButtons.addItemListener(this);

    /*      dialog.addHorizontalLine(1);
    MPISetupField = dialog.addTextField("MPI setup command: ", MPIsetupCommand, 20);
     */

    tabbedPanel.addPanel("Other options", true);
    otherOptionsField = dialog.addTextField("Other RAxML options:", otherOptions, 40);

    commandLabel = dialog.addLabel("");
    commandField = dialog.addSingleLineTextArea("", 2);
    dialog.addBlankLine();
    Button showCommand = dialog.addAListenedButton("Compose Command", null, this);
    showCommand.setActionCommand("composeRAxMLCommand");
    Button clearCommand = dialog.addAListenedButton("Clear", null, this);
    clearCommand.setActionCommand("clearCommand");

    tabbedPanel.cleanup();
    dialog.nullifyAddPanel();

    dialog.addHorizontalLine(1);
    //      retainFilescheckBox = dialog.addCheckBox("Retain Files", retainFiles);

    dialog.completeAndShowDialog(true);
    if (buttonPressed.getValue() == 0) {
        boolean infererOK = (treeInferer == null || treeInferer.optionsChosen());
        if (externalProcRunner.optionsChosen() && infererOK) {
            dnaModel = dnaModelField.getText();
            proteinModel = proteinModelField.getText();
            numRuns = numRunsField.getValue();
            randomIntSeed = seedField.getValue();
            bootstrapreps = bootStrapRepsField.getValue();
            onlyBest = onlyBestBox.getState();
            doBootstrap = doBootstrapCheckbox.getState();
            useConstraintTree = constraintButtons.getValue();
            otherOptions = otherOptionsField.getText();
            processRunnerOptions();
            storeRunnerPreferences();
        }
    }
    dialog.dispose();
    return (buttonPressed.getValue() == 0);
}

From source file:mesquite.zephyr.lib.GarliRunner.java

public boolean queryOptions() {
    if (!okToInteractWithUser(CAN_PROCEED_ANYWAY, "Querying Options")) // Debugg.println needs to check that options set well enough to proceed anyway

        return true;

    boolean closeWizard = false;

    if ((MesquiteTrunk.isMacOSXBeforeSnowLeopard()) && MesquiteDialog.currentWizard == null) {
        CommandRecord cRec = null;/*from www.  j  a v  a2 s  .c  om*/
        cRec = MesquiteThread.getCurrentCommandRecordDefIfNull(null);
        if (cRec != null) {
            cRec.requestEstablishWizard(true);
            closeWizard = true;
        }
    }

    MesquiteInteger buttonPressed = new MesquiteInteger(1);
    ExtensibleDialog dialog = new ExtensibleDialog(containerOfModule(), "GARLI Options & Locations",
            buttonPressed);

    // dialog.addLabel("GARLI - Options and Locations");

    String helpString = "This module will prepare a matrix for GARLI, and ask GARLI do to an analysis.  A command-line version of GARLI must be installed. "
            + "You can ask it to do multiple searches for optimal trees, OR to do a bootstrap analysis (but not both). "
            + "Mesquite will read in the trees found by GARLI, and, for non-bootstrap analyses, also read in the value of the GARLI score (-ln L) of the tree. "
            + "You can see the GARLI score by choosing Taxa&Trees>List of Trees, and then in the List of Trees for that trees block, choose "
            + "Columns>Number for Tree>Other Choices, and then in the Other Choices dialog, choose GARLI Score.";

    dialog.appendToHelpString(helpString);
    dialog.setHelpURL(zephyrRunnerEmployer.getProgramURL());

    MesquiteTabbedPanel tabbedPanel = dialog.addMesquiteTabbedPanel();

    tabbedPanel.addPanel("GARLI Program Details", true);
    addRunnerOptions(dialog);
    dialog.addLabelSmallText(
            "This version of Zephyr tested on the following GARLI version(s): " + getTestedProgramVersions());
    if (treeInferer != null)
        treeInferer.addItemsToDialogPanel(dialog);

    tabbedPanel.addPanel("Search Replicates & Bootstrap", true);
    doBootstrapCheckbox = dialog.addCheckBox("do bootstrap analysis", doBootstrap);
    dialog.addHorizontalLine(1);
    dialog.addLabel("Bootstrap Options", Label.LEFT, false, true);
    doBootstrapCheckbox.addItemListener(this);
    IntegerField bootStrapRepsField = dialog.addIntegerField("Bootstrap Reps", bootstrapreps, 8, 0,
            MesquiteInteger.infinite);
    dialog.addHorizontalLine(1);
    dialog.addLabel("Maximum Likelihood Tree Search Options", Label.LEFT, false, true);
    IntegerField numRunsField = dialog.addIntegerField("Number of Search Replicates", numRuns, 8, 1,
            MesquiteInteger.infinite);
    onlyBestBox = dialog.addCheckBox("save only best tree", onlyBest);

    dialog.addHorizontalLine(1);
    dialog.addLabel("Constraint tree:", Label.LEFT, false, true);
    constraintButtons = dialog.addRadioButtons(
            new String[] { "No Constraint", "Positive Constraint", "Negative Constraint" }, useConstraintTree);
    constraintButtons.addItemListener(this);

    tabbedPanel.addPanel("Character Models", true);
    if (!data.hasCharacterGroups()) {
        if (partitionScheme == partitionByCharacterGroups)
            partitionScheme = noPartition;
    }
    if (!(data instanceof DNAData && ((DNAData) data).someCoding())) {
        if (partitionScheme == partitionByCodonPosition)
            partitionScheme = noPartition;
    }
    if (data instanceof ProteinData)
        charPartitionButtons = dialog
                .addRadioButtons(new String[] { "don't partition", "use character groups" }, partitionScheme);
    else
        charPartitionButtons = dialog.addRadioButtons(
                new String[] { "don't partition", "use character groups", "use codon positions" },
                partitionScheme);

    charPartitionButtons.addItemListener(this);
    if (!data.hasCharacterGroups()) {
        charPartitionButtons.setEnabled(1, false);
    }
    if (!(data instanceof DNAData && ((DNAData) data).someCoding())) {
        charPartitionButtons.setEnabled(2, false);
    }

    Checkbox linkModelsBox = dialog.addCheckBox("use same set of model parameters for all partition subsets",
            linkModels);
    Checkbox subsetSpecificRatesBox = dialog
            .addCheckBox("infer overall rate multipliers for each partition subset", subsetSpecificRates);

    dialog.addHorizontalLine(1);
    partitionChoice = dialog.addPopUpMenu("Edit model for this partition subset:",
            new String[] { "All Characters" }, 0);
    preparePartitionChoice(partitionChoice, partitionScheme);
    partitionChoice.addItemListener(this);

    if (data instanceof ProteinData)
        rateMatrixChoice = dialog.addPopUpMenu("Rate Matrix",
                new String[] { "poisson", "jones", "dayhoff", "wag", "mtmam", "mtrev" }, 2);
    else {
        rateMatrixChoice = dialog.addPopUpMenu("Rate Matrix",
                new String[] { "Equal Rates", "2-Parameter", "GTR       ", "Custom" }, 2); //corresponding to 1rate, 2rate, 6rate, custom
        customMatrix = dialog.addTextField("6rate", 20); // since 2 is selected

        // as default in
        // previous
        customMatrix.setEditable(false);
        customMatrix.setBackground(ColorDistribution.veryLightGray);
    }
    rateMatrixChoice.addItemListener(this);
    invarSitesChoice = dialog.addPopUpMenu("Invariant Sites", new String[] { "none", "Estimate Proportion" },
            1);
    rateHetChoice = dialog.addPopUpMenu("Gamma Site-to-Site Rate Model",
            new String[] { "none", "Estimate Shape Parameter" }, 1);
    numRateCatField = dialog.addIntegerField("Number of Rate Categories for Gamma", numratecats, 4, 1, 20);

    tabbedPanel.addPanel("Other options", true);
    Checkbox showConfigDetailsBox = dialog.addCheckBox("show config file", showConfigDetails);

    tabbedPanel.cleanup();
    dialog.nullifyAddPanel();

    dialog.completeAndShowDialog(true);

    if (buttonPressed.getValue() == 0) {
        boolean infererOK = (treeInferer == null || treeInferer.optionsChosen());
        if (externalProcRunner.optionsChosen() && infererOK) {
            numRuns = numRunsField.getValue();
            bootstrapreps = bootStrapRepsField.getValue();
            onlyBest = onlyBestBox.getState();
            doBootstrap = doBootstrapCheckbox.getState();
            showConfigDetails = showConfigDetailsBox.getState();
            partitionScheme = charPartitionButtons.getValue();
            useConstraintTree = constraintButtons.getValue();
            linkModels = linkModelsBox.getState();
            subsetSpecificRates = subsetSpecificRatesBox.getState();
            processRunnerOptions();

            // garliOptions = garliOptionsField.getText();

            processCharacterModels();

            storeRunnerPreferences();
        }
    }
    dialog.dispose();
    if (closeWizard)
        MesquiteDialog.closeWizard();

    return (buttonPressed.getValue() == 0);
}

From source file:CircleOfSquares.java

MemoryView(int methodAreaMemSectionSize) {

    setLayout(new GridLayout(memoryLocationsVisibleCount, 4));

    setBackground(Color.lightGray);
    Font plainFont = new Font("TimesRoman", Font.PLAIN, 11);
    setFont(plainFont);/*from w w  w . ja v  a2 s . c o  m*/

    Font italicFont = new Font("TimesRoman", Font.ITALIC, 11);

    for (int i = 0; i < memoryLocationsVisibleCount; ++i) {

        pointer[i] = new Label("", Label.RIGHT);
        pointer[i].setFont(italicFont);
        add(pointer[i]);

        address[i] = new Label("", Label.CENTER);
        add(address[i]);

        byteValue[i] = new Label("", Label.CENTER);
        add(byteValue[i]);

        logicalValue[i] = new Label("", Label.LEFT);
        add(logicalValue[i]);
    }
}

From source file:JVMSimulator.java

MemoryView(int methodAreaMemSectionSize) {

    int[] hComponentCellWidths = new int[4];
    hComponentCellWidths[0] = 2;/* w  w  w .j  av a  2 s . c o  m*/
    hComponentCellWidths[1] = 2;
    hComponentCellWidths[2] = 2;
    hComponentCellWidths[3] = 3;
    setLayout(new GridSnapLayout(memoryLocationsVisibleCount, 9, hComponentCellWidths));

    setBackground(Color.lightGray);
    Font plainFont = new Font("TimesRoman", Font.PLAIN, 11);
    setFont(plainFont);

    Font italicFont = new Font("TimesRoman", Font.ITALIC, 11);

    for (int i = 0; i < memoryLocationsVisibleCount; ++i) {

        pointer[i] = new Label("", Label.RIGHT);
        pointer[i].setFont(italicFont);
        add(pointer[i]);

        address[i] = new Label("", Label.CENTER);
        add(address[i]);

        byteValue[i] = new Label("", Label.CENTER);
        add(byteValue[i]);

        logicalValue[i] = new Label("", Label.LEFT);
        add(logicalValue[i]);
    }
}

From source file:JVMSimulator.java

MemoryViewTitlePanel() {

    int[] hComponentCellWidths = new int[4];
    hComponentCellWidths[0] = 2;/*from  w  ww.ja  va  2 s. c om*/
    hComponentCellWidths[1] = 2;
    hComponentCellWidths[2] = 2;
    hComponentCellWidths[3] = 3;
    setLayout(new GridSnapLayout(1, 9, hComponentCellWidths));

    setFont(new Font("Helvetica", Font.ITALIC, 11));

    add(new Label("", Label.CENTER));
    add(new Label(StringTable.address, Label.CENTER));
    add(new Label(StringTable.bytecodes, Label.CENTER));
    add(new Label(StringTable.mnemonics, Label.LEFT));
}