Java Code Examples for java.awt.GridBagConstraints#FIRST_LINE_END

The following examples show how to use java.awt.GridBagConstraints#FIRST_LINE_END . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FifoPopPreProcessorGui.java    From jmeter-plugins with Apache License 2.0 5 votes vote down vote up
private void init() {
    setLayout(new BorderLayout(0, 5));
    setBorder(makeBorder());

    add(JMeterPluginsUtils.addHelpLinkToPanel(makeTitlePanel(), WIKIPAGE), BorderLayout.NORTH);

    JPanel mainPanel = new JPanel(new GridBagLayout());

    GridBagConstraints labelConstraints = new GridBagConstraints();
    labelConstraints.anchor = GridBagConstraints.FIRST_LINE_END;

    GridBagConstraints editConstraints = new GridBagConstraints();
    editConstraints.anchor = GridBagConstraints.FIRST_LINE_START;
    editConstraints.weightx = 1.0;
    editConstraints.fill = GridBagConstraints.HORIZONTAL;

    editConstraints.insets = new java.awt.Insets(2, 0, 0, 0);
    labelConstraints.insets = new java.awt.Insets(2, 0, 0, 0);

    addToPanel(mainPanel, labelConstraints, 0, 0, new JLabel("FIFO Queue Name to Get Data From: ", JLabel.RIGHT));
    addToPanel(mainPanel, editConstraints, 1, 0, queueName = new JTextField(20));

    addToPanel(mainPanel, labelConstraints, 0, 1, new JLabel("Variable Name to Store Data: ", JLabel.RIGHT));
    addToPanel(mainPanel, editConstraints, 1, 1, variableName = new JTextField(20));

    addToPanel(mainPanel, labelConstraints, 0, 2, new JLabel("Timeout: ", JLabel.RIGHT));
    addToPanel(mainPanel, editConstraints, 1, 2, timeout = new JTextField(20));

    JPanel container = new JPanel(new BorderLayout());
    container.add(mainPanel, BorderLayout.NORTH);
    add(container, BorderLayout.CENTER);
}
 
Example 2
Source File: LockFileGui.java    From jmeter-plugins with Apache License 2.0 5 votes vote down vote up
private void init() {
    log.debug("[Lockfile plugin] init");
    setLayout(new BorderLayout(0, 5));
    setBorder(makeBorder());

    add(JMeterPluginsUtils.addHelpLinkToPanel(makeTitlePanel(), WIKIPAGE), BorderLayout.NORTH);

    JPanel mainPanel = new JPanel(new GridBagLayout());

    GridBagConstraints labelConstraints = new GridBagConstraints();
    labelConstraints.anchor = GridBagConstraints.FIRST_LINE_END;

    GridBagConstraints editConstraints = new GridBagConstraints();
    editConstraints.anchor = GridBagConstraints.FIRST_LINE_START;
    editConstraints.weightx = 1.0;
    editConstraints.fill = GridBagConstraints.HORIZONTAL;

    editConstraints.insets = new java.awt.Insets(2, 0, 0, 0);
    labelConstraints.insets = new java.awt.Insets(2, 0, 0, 0);

    addToPanel(mainPanel, labelConstraints, 0, 0, new JLabel("Lock file name: ", JLabel.RIGHT));
    addToPanel(mainPanel, editConstraints, 1, 0, tfFileName = new JTextField(20));
    addToPanel(mainPanel, labelConstraints, 0, 1, new JLabel("Also check filemask: ", JLabel.RIGHT));
    addToPanel(mainPanel, editConstraints, 1, 1, tfFileMask = new JTextField(20));

    JPanel container = new JPanel(new BorderLayout());
    container.add(mainPanel, BorderLayout.NORTH);
    add(container, BorderLayout.CENTER);
}
 
Example 3
Source File: FlexibleFileWriterGui.java    From jmeter-plugins with Apache License 2.0 4 votes vote down vote up
private void init() {
    setLayout(new BorderLayout(0, 5));
    setBorder(makeBorder());

    add(JMeterPluginsUtils.addHelpLinkToPanel(makeTitlePanel(), WIKIPAGE), BorderLayout.NORTH);

    JPanel mainPanel = new JPanel(new GridBagLayout());

    GridBagConstraints labelConstraints = new GridBagConstraints();
    labelConstraints.anchor = GridBagConstraints.FIRST_LINE_END;

    GridBagConstraints editConstraints = new GridBagConstraints();
    editConstraints.anchor = GridBagConstraints.FIRST_LINE_START;
    editConstraints.weightx = 1.0;
    editConstraints.fill = GridBagConstraints.HORIZONTAL;

    addToPanel(mainPanel, labelConstraints, 0, 1, new JLabel("Filename: ", JLabel.RIGHT));
    addToPanel(mainPanel, editConstraints, 1, 1, filename = new JTextField(20));
    JButton browseButton = new JButton("Browse...");
    addToPanel(mainPanel, labelConstraints, 2, 1, browseButton);
    GuiBuilderHelper.strechItemToComponent(filename, browseButton);
    browseButton.addActionListener(new BrowseAction(filename));

    addToPanel(mainPanel, labelConstraints, 0, 2, new JLabel("Overwrite existing file: ", JLabel.RIGHT));
    addToPanel(mainPanel, editConstraints, 1, 2, overwrite = new JCheckBox());

    addToPanel(mainPanel, labelConstraints, 0, 3, new JLabel("Write File Header: ", JLabel.RIGHT));
    header = new JTextArea();
    header.setLineWrap(true);
    addToPanel(mainPanel, editConstraints, 1, 3, GuiBuilderHelper.getTextAreaScrollPaneContainer(header, 3));

    editConstraints.insets = new java.awt.Insets(2, 0, 0, 0);
    labelConstraints.insets = new java.awt.Insets(2, 0, 0, 0);
    addToPanel(mainPanel, labelConstraints, 0, 4, new JLabel("Record each sample as: ", JLabel.RIGHT));
    addToPanel(mainPanel, editConstraints, 1, 4, columns = new JTextField(20));

    editConstraints.insets = new java.awt.Insets(2, 0, 0, 0);
    labelConstraints.insets = new java.awt.Insets(2, 0, 0, 0);
    addToPanel(mainPanel, labelConstraints, 0, 5, new JLabel("Write File Footer: ", JLabel.RIGHT));
    footer = new JTextArea();
    footer.setLineWrap(true);
    addToPanel(mainPanel, editConstraints, 1, 5, GuiBuilderHelper.getTextAreaScrollPaneContainer(footer, 3));

    JPanel container = new JPanel(new BorderLayout());
    container.add(mainPanel, BorderLayout.NORTH);
    add(container, BorderLayout.CENTER);

    add(createHelperPanel(), BorderLayout.SOUTH);
}
 
Example 4
Source File: VariablesFromCSVGui.java    From jmeter-plugins with Apache License 2.0 4 votes vote down vote up
private void init() {
    setLayout(new BorderLayout(0, 5));
    setBorder(makeBorder());

    add(JMeterPluginsUtils.addHelpLinkToPanel(makeTitlePanel(), WIKIPAGE), BorderLayout.NORTH);

    JPanel mainPanel = new JPanel(new GridBagLayout());

    GridBagConstraints labelConstraints = new GridBagConstraints();
    labelConstraints.anchor = GridBagConstraints.FIRST_LINE_END;

    GridBagConstraints editConstraints = new GridBagConstraints();
    editConstraints.anchor = GridBagConstraints.FIRST_LINE_START;
    editConstraints.weightx = 1.0;
    editConstraints.fill = GridBagConstraints.HORIZONTAL;

    addToPanel(mainPanel, labelConstraints, 0, 0, new JLabel("CSV File: ", JLabel.RIGHT));
    addToPanel(mainPanel, editConstraints, 1, 0, fileName = new JTextField(20));
    addToPanel(mainPanel, labelConstraints, 2, 0, browseButton = new JButton("Browse..."));

    GuiBuilderHelper.strechItemToComponent(fileName, browseButton);

    editConstraints.insets = new java.awt.Insets(2, 0, 0, 0);
    labelConstraints.insets = new java.awt.Insets(2, 0, 0, 0);

    browseButton.addActionListener(new BrowseAction(fileName));

    addToPanel(mainPanel, labelConstraints, 0, 1, new JLabel(" Variable prefix: ", JLabel.RIGHT));
    addToPanel(mainPanel, editConstraints, 1, 1, variablePrefix = new JTextField(20));

    addToPanel(mainPanel, labelConstraints, 0, 2, new JLabel("Separator (use '\\t' for tab): ", JLabel.RIGHT));
    addToPanel(mainPanel, editConstraints, 1, 2, separator = new JTextField(20));

    addToPanel(mainPanel, labelConstraints, 0, 3, new JLabel("Skip initial lines: ", JLabel.RIGHT));
    skipLines = new JTextField(20);
    Color lightRed = new Color(255, 202, 197);
    skipLines.setInputVerifier(new IntegerInputVerifier(0, Integer.MAX_VALUE, skipLines.getBackground(), lightRed));
    skipLines.setToolTipText("Number of initial lines of input to skip. Must be an integer >= 0.");
    addToPanel(mainPanel, editConstraints, 1, 3, skipLines);

    addToPanel(mainPanel, labelConstraints, 0, 4, new JLabel("Store variables also in System Properties: ", JLabel.RIGHT));
    addToPanel(mainPanel, editConstraints, 1, 4, storeSysProp = new JCheckBox());

    editConstraints.insets = new java.awt.Insets(4, 0, 0, 0);
    labelConstraints.insets = new java.awt.Insets(4, 0, 0, 2);

    addToPanel(mainPanel, labelConstraints, 0, 5, checkButton = new JButton("Test CSV File"));

    labelConstraints.insets = new java.awt.Insets(4, 0, 0, 0);

    checkInfo = new JTextArea();
    addToPanel(mainPanel, editConstraints, 1, 5, GuiBuilderHelper.getTextAreaScrollPaneContainer(checkInfo, 10));
    checkButton.addActionListener(new TestCsvFileAction(this));
    checkInfo.setEditable(false);
    checkInfo.setOpaque(false);

    JPanel container = new JPanel(new BorderLayout());
    container.add(mainPanel, BorderLayout.NORTH);
    add(container, BorderLayout.CENTER);
}
 
Example 5
Source File: RawRequestSourcePreProcessorGui.java    From jmeter-plugins with Apache License 2.0 4 votes vote down vote up
private void init() {
    setLayout(new BorderLayout(0, 5));
    setBorder(makeBorder());

    add(JMeterPluginsUtils.addHelpLinkToPanel(makeTitlePanel(), WIKIPAGE), BorderLayout.NORTH);

    JPanel mainPanel = new JPanel(new GridBagLayout());

    GridBagConstraints labelConstraints = new GridBagConstraints();
    labelConstraints.anchor = GridBagConstraints.FIRST_LINE_END;

    GridBagConstraints editConstraints = new GridBagConstraints();
    editConstraints.anchor = GridBagConstraints.FIRST_LINE_START;
    editConstraints.weightx = 1.0;
    editConstraints.fill = GridBagConstraints.HORIZONTAL;

    addToPanel(mainPanel, labelConstraints, 0, 0, new JLabel("Rewind on end of file: ", JLabel.RIGHT));
    addToPanel(mainPanel, editConstraints, 1, 0, rewindOnEOF = new JCheckBox());
    addToPanel(mainPanel, labelConstraints, 0, 1, new JLabel("Data file path: ", JLabel.RIGHT));
    addToPanel(mainPanel, editConstraints, 1, 1, fileName = new JTextField(20));
    addToPanel(mainPanel, labelConstraints, 2, 1, browseButton = new JButton("Browse..."));

    GuiBuilderHelper.strechItemToComponent(fileName, browseButton);

    editConstraints.insets = new java.awt.Insets(2, 0, 0, 0);
    labelConstraints.insets = new java.awt.Insets(2, 0, 0, 0);

    browseButton.addActionListener(new BrowseAction(fileName));

    addToPanel(mainPanel, labelConstraints, 0, 2, new JLabel("Variable name: ", JLabel.RIGHT));
    addToPanel(mainPanel, editConstraints, 1, 2, variableName = new JTextField(20));

    addToPanel(mainPanel, labelConstraints, 0, 3, new JLabel("Encode read data as HEX: ", JLabel.RIGHT));
    addToPanel(mainPanel, editConstraints, 1, 3, encodeHex = new JCheckBox());

    editConstraints.insets = new java.awt.Insets(4, 0, 0, 0);
    labelConstraints.insets = new java.awt.Insets(4, 0, 0, 2);

    addToPanel(mainPanel, labelConstraints, 0, 4, checkButton = new JButton("Check File Consistency"));

    labelConstraints.insets = new java.awt.Insets(4, 0, 0, 0);

    checkInfo = new JTextArea();
    addToPanel(mainPanel, editConstraints, 1, 4, GuiBuilderHelper.getTextAreaScrollPaneContainer(checkInfo, 10));
    checkButton.addActionListener(new CheckConsistencyAction(fileName, checkInfo));
    checkInfo.setEditable(false);
    checkInfo.setOpaque(false);

    JPanel container = new JPanel(new BorderLayout());
    container.add(mainPanel, BorderLayout.NORTH);
    add(container, BorderLayout.CENTER);
}