Search in sources :

Example 1 with JTimeSetting

use of course_generator.utils.JTimeSetting in project Course_Generator by patrovite.

the class frmEditPosition method initComponents.

private void initComponents() {
    int line = 0;
    // jPanelMainWindowsColor = new javax.swing.JPanel();
    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setTitle(bundle.getString("frmEditPosition.title"));
    setAlwaysOnTop(true);
    setResizable(false);
    setMinimumSize(new Dimension(1000, 400));
    setType(java.awt.Window.Type.UTILITY);
    // -- Layout
    // ------------------------------------------------------------
    Container paneGlobal = getContentPane();
    paneGlobal.setLayout(new GridBagLayout());
    // == Left panel
    panelLeft = new JPanel();
    panelLeft.setBorder(BorderFactory.createLineBorder(Color.GRAY));
    panelLeft.setBackground(Color.WHITE);
    panelLeft.setOpaque(true);
    panelLeft.setLayout(new GridBagLayout());
    Utils.addComponent(paneGlobal, panelLeft, 0, 0, 1, 1, 0, 1, 10, 10, 20, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    // -- Line
    line = 0;
    lbLine = new javax.swing.JLabel();
    Font font = lbLine.getFont();
    font = font.deriveFont(Collections.singletonMap(TextAttribute.WEIGHT, TextAttribute.WEIGHT_EXTRABOLD));
    lbLine.setFont(font);
    // "Line"
    lbLine.setText(bundle.getString("frmEditPosition.lbLine.Text"));
    Utils.addComponent(panelLeft, lbLine, 0, line, 1, 1, 0, 0, 5, 10, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    lbLineVal = new javax.swing.JLabel();
    Utils.addComponent(panelLeft, lbLineVal, 1, line++, 1, 1, 1, 0, 5, 0, 0, 10, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    // ======================================================================
    // -- Latitude
    lbLatitude = new javax.swing.JLabel();
    lbLatitude.setFont(font);
    // "Latitude"
    lbLatitude.setText(bundle.getString("frmEditPosition.lbLatitude.Text"));
    Utils.addComponent(panelLeft, lbLatitude, 0, line, 1, 1, 0, 0, 5, 10, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    lbLatitudeVal = new javax.swing.JLabel();
    Utils.addComponent(panelLeft, lbLatitudeVal, 1, line++, 1, 1, 0, 0, 5, 0, 0, 10, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    // -- Longitude
    lbLongitude = new javax.swing.JLabel();
    lbLongitude.setFont(font);
    // "Longitude"
    lbLongitude.setText(bundle.getString("frmEditPosition.lbLongitude.Text"));
    Utils.addComponent(panelLeft, lbLongitude, 0, line, 1, 1, 0, 0, 5, 10, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    lbLongitudeVal = new javax.swing.JLabel();
    Utils.addComponent(panelLeft, lbLongitudeVal, 1, line++, 1, 1, 1, 0, 5, 0, 0, 10, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    // ======================================================================
    // -- Distance
    lbDistance = new javax.swing.JLabel();
    lbDistance.setFont(font);
    // "Distance"
    lbDistance.setText(bundle.getString("frmEditPosition.lbDistance.Text"));
    Utils.addComponent(panelLeft, lbDistance, 0, line, 1, 1, 0, 0, 5, 10, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    lbDistanceVal = new javax.swing.JLabel();
    Utils.addComponent(panelLeft, lbDistanceVal, 1, line++, 1, 1, 0, 0, 5, 0, 0, 10, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    // -- Total
    lbTotal = new javax.swing.JLabel();
    lbTotal.setFont(font);
    // "Total distance"
    lbTotal.setText(bundle.getString("frmEditPosition.lbTotal.Text"));
    Utils.addComponent(panelLeft, lbTotal, 0, line, 1, 1, 0, 0, 5, 10, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    lbTotalVal = new javax.swing.JLabel();
    Utils.addComponent(panelLeft, lbTotalVal, 1, line++, 1, 1, 1, 0, 5, 0, 0, 10, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    // ======================================================================
    // -- Time
    lbTime = new javax.swing.JLabel();
    lbTime.setFont(font);
    // "Time"
    lbTime.setText(bundle.getString("frmEditPosition.lbTime.Text"));
    Utils.addComponent(panelLeft, lbTime, 0, line, 1, 1, 0, 0, 5, 10, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    lbTimeVal = new javax.swing.JLabel();
    Utils.addComponent(panelLeft, lbTimeVal, 1, line++, 1, 1, 0, 0, 5, 0, 0, 10, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    // -- Hour
    lbHour = new javax.swing.JLabel();
    lbHour.setFont(font);
    // "Hour"
    lbHour.setText(bundle.getString("frmEditPosition.lbHout.Text"));
    Utils.addComponent(panelLeft, lbHour, 0, line, 1, 1, 0, 1, 5, 10, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    lbHourVal = new javax.swing.JLabel();
    Utils.addComponent(panelLeft, lbHourVal, 1, line++, 1, 1, 1, 1, 5, 0, 0, 10, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    // == Right panel
    line = 0;
    panelRight = new JPanel();
    panelRight.setLayout(new GridBagLayout());
    Utils.addComponent(paneGlobal, panelRight, 1, 0, 1, 1, 1, 1, 10, 10, 20, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    // -- Name
    lbName = new javax.swing.JLabel();
    lbName.setFont(font);
    // "Name"
    lbName.setText(bundle.getString("frmEditPosition.lbName.Text"));
    Utils.addComponent(panelRight, lbName, 0, line, 1, 1, 0, 0, 0, 0, 0, 5, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    // tfName = new javax.swing.JTextField(16);
    tfName = new JTextFieldLimit(40);
    Utils.addComponent(panelRight, tfName, 1, line, 10, 1, 1, 0, 0, 0, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    lbNameHelp = new javax.swing.JLabel("", new javax.swing.ImageIcon(getClass().getResource("/course_generator/images/help_dialog.png")), JLabel.LEFT);
    lbNameHelp.setToolTipText(bundle.getString("frmEditPosition.lbNameHelp.toolTipText"));
    Utils.addComponent(panelRight, lbNameHelp, 11, line++, 1, 1, 0, 0, 0, 5, 0, 10, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    // -- Elevation
    lbElevation = new javax.swing.JLabel();
    lbElevation.setFont(font);
    // "Elevation"
    lbElevation.setText(bundle.getString("frmEditPosition.lbElevation.Text"));
    Utils.addComponent(panelRight, lbElevation, 0, line, 1, 1, 0, 0, 5, 0, 0, 5, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    spinElevation = new CgSpinner(0, 0, 100000, 1);
    Utils.addComponent(panelRight, spinElevation, 1, line, 3, 1, 0, 0, 5, 0, 0, 5, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    lbElevationHelp = new javax.swing.JLabel("", new javax.swing.ImageIcon(getClass().getResource("/course_generator/images/attention.png")), JLabel.LEFT);
    lbElevationHelp.setToolTipText(bundle.getString("frmEditPosition.lbElevationHelp.toolTipText"));
    Utils.addComponent(panelRight, lbElevationHelp, 4, line++, 1, 1, 0, 0, 5, 0, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    // -- Tags
    lbTags = new javax.swing.JLabel();
    lbTags.setFont(font);
    // "Tags"
    lbTags.setText(bundle.getString("frmEditPosition.lbTags.Text"));
    Utils.addComponent(panelRight, lbTags, 0, line, 1, 1, 0, 0, 0, 0, 0, 5, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    // -- Tag : Mark
    lbMark = new javax.swing.JLabel(// "Mark position",
    bundle.getString("frmEditPosition.lbMark.Text"), new javax.swing.ImageIcon(getClass().getResource("/course_generator/images/flag.png")), JLabel.LEFT);
    Utils.addComponent(panelRight, lbMark, 1, line, 1, 1, 0, 0, 5, 0, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    chkMark = new javax.swing.JCheckBox();
    Utils.addComponent(panelRight, chkMark, 2, line++, 1, 1, 0, 0, 5, 5, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    // -- Tag : High point
    lbHighPoint = new javax.swing.JLabel(// "High point",
    bundle.getString("frmEditPosition.lbHighPoint.Text"), new javax.swing.ImageIcon(getClass().getResource("/course_generator/images/high_point.png")), JLabel.LEFT);
    Utils.addComponent(panelRight, lbHighPoint, 1, line, 1, 1, 0, 0, 5, 0, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    chkHighPoint = new javax.swing.JCheckBox();
    chkHighPoint.setBackground(Color.GREEN);
    chkHighPoint.setOpaque(true);
    chkHighPoint.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            if (chkHighPoint.isSelected() && chkLowPoint.isSelected()) {
                chkLowPoint.setSelected(false);
            }
        }
    });
    Utils.addComponent(panelRight, chkHighPoint, 2, line++, 1, 1, 0, 0, 5, 5, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    // -- Tag : Low point
    lbLowPoint = new javax.swing.JLabel(// "Low point",
    bundle.getString("frmEditPosition.lbLowPoint.Text"), new javax.swing.ImageIcon(getClass().getResource("/course_generator/images/low_point.png")), JLabel.LEFT);
    Utils.addComponent(panelRight, lbLowPoint, 1, line, 1, 1, 0, 0, 5, 0, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    chkLowPoint = new javax.swing.JCheckBox();
    chkLowPoint.setBackground(Color.GREEN);
    chkLowPoint.setOpaque(true);
    chkLowPoint.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            if (chkLowPoint.isSelected() && chkHighPoint.isSelected()) {
                chkHighPoint.setSelected(false);
            }
        }
    });
    Utils.addComponent(panelRight, chkLowPoint, 2, line++, 1, 1, 0, 0, 5, 5, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    // -- Tag : eat station
    lbEat = new javax.swing.JLabel(// "Eat station",
    bundle.getString("frmEditPosition.lbEat.Text"), new javax.swing.ImageIcon(getClass().getResource("/course_generator/images/eat.png")), JLabel.LEFT);
    Utils.addComponent(panelRight, lbEat, 1, line, 1, 1, 0, 0, 5, 0, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    chkEat = new javax.swing.JCheckBox();
    chkEat.setBackground(Color.YELLOW);
    chkEat.setOpaque(true);
    chkEat.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            if (chkEat.isSelected() && chkDrink.isSelected()) {
                chkDrink.setSelected(false);
            }
        }
    });
    Utils.addComponent(panelRight, chkEat, 2, line++, 1, 1, 0, 0, 5, 5, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    // -- Tag : drink station
    lbDrink = new javax.swing.JLabel(// "Drink station",
    bundle.getString("frmEditPosition.lbDrink.Text"), new javax.swing.ImageIcon(getClass().getResource("/course_generator/images/drink.png")), JLabel.LEFT);
    Utils.addComponent(panelRight, lbDrink, 1, line, 1, 1, 0, 0, 5, 0, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    chkDrink = new javax.swing.JCheckBox();
    chkDrink.setBackground(Color.YELLOW);
    chkDrink.setOpaque(true);
    chkDrink.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            if (chkDrink.isSelected() && chkEat.isSelected()) {
                chkEat.setSelected(false);
            }
        }
    });
    Utils.addComponent(panelRight, chkDrink, 2, line++, 1, 1, 0, 0, 5, 5, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    // -- Tag : Place to see
    lbPhoto = new javax.swing.JLabel(// "Place to see",
    bundle.getString("frmEditPosition.lbPhoto.Text"), new javax.swing.ImageIcon(getClass().getResource("/course_generator/images/photo.png")), JLabel.LEFT);
    Utils.addComponent(panelRight, lbPhoto, 1, line, 1, 1, 0, 0, 5, 0, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    chkPhoto = new javax.swing.JCheckBox();
    Utils.addComponent(panelRight, chkPhoto, 2, line++, 1, 1, 0, 0, 5, 5, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    // -- Tag : note
    lbNote = new javax.swing.JLabel(// "Note",
    bundle.getString("frmEditPosition.lbNote.Text"), new javax.swing.ImageIcon(getClass().getResource("/course_generator/images/note.png")), JLabel.LEFT);
    Utils.addComponent(panelRight, lbNote, 1, line, 1, 1, 0, 0, 5, 0, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    chkNote = new javax.swing.JCheckBox();
    Utils.addComponent(panelRight, chkNote, 2, line++, 1, 1, 0, 0, 5, 5, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    // -- Tag : info
    lbInfo = new javax.swing.JLabel(// "Information",
    bundle.getString("frmEditPosition.lbInfo.Text"), new javax.swing.ImageIcon(getClass().getResource("/course_generator/images/info.png")), JLabel.LEFT);
    Utils.addComponent(panelRight, lbInfo, 1, line, 1, 1, 0, 0, 5, 0, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    chkInfo = new javax.swing.JCheckBox();
    Utils.addComponent(panelRight, chkInfo, 2, line++, 1, 1, 0, 0, 5, 5, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    // -- Tag : Roadbook
    lbRoadbook = new javax.swing.JLabel(// "Roadbook",
    bundle.getString("frmEditPosition.lbRoadbook.Text"), new javax.swing.ImageIcon(getClass().getResource("/course_generator/images/roadbook.png")), JLabel.LEFT);
    Utils.addComponent(panelRight, lbRoadbook, 1, line, 1, 1, 0, 0, 5, 0, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    chkRoadbook = new javax.swing.JCheckBox();
    Utils.addComponent(panelRight, chkRoadbook, 2, line++, 1, 1, 0, 0, 5, 5, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    // -- Diff
    lbDiff = new javax.swing.JLabel();
    lbDiff.setFont(font);
    // "Difficulty"
    lbDiff.setText(bundle.getString("frmEditPosition.lbDiff.Text"));
    Utils.addComponent(panelRight, lbDiff, 0, line, 1, 1, 0, 0, 5, 0, 0, 5, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    spinDiff = new CgSpinner(100, 1, 100, 1);
    Utils.addComponent(panelRight, spinDiff, 1, line, 3, 1, 0, 0, 5, 0, 0, 5, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    lbDiffHelp = new javax.swing.JLabel("", new javax.swing.ImageIcon(getClass().getResource("/course_generator/images/help_dialog.png")), JLabel.LEFT);
    lbDiffHelp.setToolTipText(bundle.getString("frmEditPosition.lbDiffHelp.toolTipText"));
    Utils.addComponent(panelRight, lbDiffHelp, 4, line, 1, 1, 0, 0, 5, 0, 0, 5, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    btVeryEasy = new javax.swing.JButton();
    btVeryEasy.setOpaque(true);
    btVeryEasy.setBackground(Color.WHITE);
    btVeryEasy.setToolTipText(bundle.getString("frmEditPosition.btVeryEasy.toolTipText"));
    btVeryEasy.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            spinDiff.setValue(100);
        }
    });
    Utils.addComponent(panelRight, btVeryEasy, 5, line, 1, 1, 0, 0, 5, 0, 0, 5, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    btEasy = new javax.swing.JButton();
    btEasy.setOpaque(true);
    btEasy.setBackground(Color.GREEN);
    btEasy.setToolTipText(bundle.getString("frmEditPosition.btEasy.toolTipText"));
    btEasy.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            spinDiff.setValue(98);
        }
    });
    Utils.addComponent(panelRight, btEasy, 6, line, 1, 1, 0, 0, 5, 0, 0, 5, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    btAverage = new javax.swing.JButton();
    btAverage.setOpaque(true);
    btAverage.setBackground(Color.BLUE);
    btAverage.setToolTipText(bundle.getString("frmEditPosition.btAverage.toolTipText"));
    btAverage.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            spinDiff.setValue(95);
        }
    });
    Utils.addComponent(panelRight, btAverage, 7, line, 1, 1, 0, 0, 5, 0, 0, 5, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    btHard = new javax.swing.JButton();
    btHard.setOpaque(true);
    btHard.setBackground(Color.RED);
    btHard.setToolTipText(bundle.getString("frmEditPosition.btHard.toolTipText"));
    btHard.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            spinDiff.setValue(88);
        }
    });
    Utils.addComponent(panelRight, btHard, 8, line, 1, 1, 0, 0, 5, 0, 0, 5, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    btVeryHard = new javax.swing.JButton();
    btVeryHard.setOpaque(true);
    btVeryHard.setBackground(Color.BLACK);
    btVeryHard.setToolTipText(bundle.getString("frmEditPosition.btVeryHard.toolTipText"));
    btVeryHard.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            spinDiff.setValue(80);
        }
    });
    Utils.addComponent(panelRight, btVeryHard, 9, line++, 1, 1, 0, 0, 5, 0, 0, 5, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    // -- Coeff
    lbCoeff = new javax.swing.JLabel();
    lbCoeff.setFont(font);
    // "Health coefficient"
    lbCoeff.setText(bundle.getString("frmEditPosition.lbCoeff.Text"));
    Utils.addComponent(panelRight, lbCoeff, 0, line, 1, 1, 0, 0, 5, 0, 0, 5, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    spinCoeff = new CgSpinnerDouble(100.0, 0.1, 200.0, 0.1);
    Utils.addComponent(panelRight, spinCoeff, 1, line, 3, 1, 0, 0, 5, 0, 0, 5, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    lbCoeffHelp = new javax.swing.JLabel("", new javax.swing.ImageIcon(getClass().getResource("/course_generator/images/help_dialog.png")), JLabel.LEFT);
    lbCoeffHelp.setToolTipText(bundle.getString("frmEditPosition.lbCoeffHelp.toolTipText"));
    Utils.addComponent(panelRight, lbCoeffHelp, 4, line++, 1, 1, 0, 0, 5, 0, 0, 5, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    // -- Recup
    lbRecovery = new javax.swing.JLabel();
    lbRecovery.setFont(font);
    // "Recovery"
    lbRecovery.setText(bundle.getString("frmEditPosition.lbRecovery.Text"));
    Utils.addComponent(panelRight, lbRecovery, 0, line, 1, 1, 0, 0, 5, 0, 0, 5, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    spinRecovery = new CgSpinnerDouble(0.0, 0.0, 100.0, 0.1);
    Utils.addComponent(panelRight, spinRecovery, 1, line, 3, 1, 0, 0, 5, 0, 0, 5, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    lbRecoveryHelp = new javax.swing.JLabel("", new javax.swing.ImageIcon(getClass().getResource("/course_generator/images/help_dialog.png")), JLabel.LEFT);
    lbRecoveryHelp.setToolTipText(bundle.getString("frmEditPosition.lbRecoveryHelp.toolTipText"));
    Utils.addComponent(panelRight, lbRecoveryHelp, 4, line++, 1, 1, 0, 0, 5, 0, 0, 5, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    // -- Time limit
    lbTimelimit = new javax.swing.JLabel();
    lbTimelimit.setFont(font);
    // "Time limit"
    lbTimelimit.setText(bundle.getString("frmEditPosition.lbTimelimit.Text"));
    Utils.addComponent(panelRight, lbTimelimit, 0, line, 1, 1, 0, 0, 5, 0, 0, 5, GridBagConstraints.WEST, GridBagConstraints.BOTH);
    hsTimelimit = new JTimeSetting(999);
    Utils.addComponent(panelRight, hsTimelimit, 1, line, 3, 1, 0, 0, 5, 0, 0, 10, GridBagConstraints.WEST, GridBagConstraints.VERTICAL);
    lbTimelimitHelp = new javax.swing.JLabel("", new javax.swing.ImageIcon(getClass().getResource("/course_generator/images/help_dialog.png")), JLabel.LEFT);
    lbTimelimitHelp.setToolTipText(bundle.getString("frmEditPosition.lbTimelimitHelp.toolTipText"));
    Utils.addComponent(panelRight, lbTimelimitHelp, 4, line++, 1, 1, 0, 0, 5, 0, 0, 5, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    // -- Station
    lbStation = new javax.swing.JLabel();
    lbStation.setFont(font);
    // "Station time"
    lbStation.setText(bundle.getString("frmEditPosition.lbStation.Text"));
    Utils.addComponent(panelRight, lbStation, 0, line, 1, 1, 0, 0, 5, 0, 0, 5, GridBagConstraints.WEST, GridBagConstraints.BOTH);
    // new JHourSetting();
    hsStation = new JTimeSetting(999);
    Utils.addComponent(panelRight, hsStation, 1, line, 3, 1, 0, 0, 5, 0, 0, 10, GridBagConstraints.WEST, GridBagConstraints.VERTICAL);
    lbStationHelp = new javax.swing.JLabel("", new javax.swing.ImageIcon(getClass().getResource("/course_generator/images/help_dialog.png")), JLabel.LEFT);
    lbStationHelp.setToolTipText(bundle.getString("frmEditPosition.lbStationHelp.toolTipText"));
    Utils.addComponent(panelRight, lbStationHelp, 4, line++, 1, 1, 0, 0, 5, 0, 0, 5, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    // -- Comment
    lbComment = new javax.swing.JLabel();
    lbComment.setFont(font);
    // "Comment"
    lbComment.setText(bundle.getString("frmEditPosition.lbComment.Text"));
    Utils.addComponent(panelRight, lbComment, 0, line, 1, 1, 0, 1, 5, 0, 0, 5, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    tfComment = new javax.swing.JTextField();
    Utils.addComponent(panelRight, tfComment, 1, line++, GridBagConstraints.REMAINDER, 1, 1, 1, 5, 0, 0, 10, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    // == BUTTONS
    // ===========================================================
    jPanelButtons = new javax.swing.JPanel();
    jPanelButtons.setLayout(new FlowLayout());
    Utils.addComponent(paneGlobal, jPanelButtons, 0, 1, GridBagConstraints.REMAINDER, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL);
    btCancel = new javax.swing.JButton();
    btCancel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/course_generator/images/cancel.png")));
    btCancel.setText(bundle.getString("Global.btCancel.text"));
    btCancel.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            setVisible(false);
        }
    });
    btOk = new javax.swing.JButton();
    btOk.setIcon(new javax.swing.ImageIcon(getClass().getResource("/course_generator/images/valid.png")));
    btOk.setText(bundle.getString("Global.btOk.text"));
    btOk.setMinimumSize(btCancel.getMinimumSize());
    btOk.setPreferredSize(btCancel.getPreferredSize());
    btOk.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            RequestToClose();
        }
    });
    // -- Add buttons
    jPanelButtons.add(btOk);
    jPanelButtons.add(btCancel);
    // --
    pack();
    setLocationRelativeTo(null);
}
Also used : JPanel(javax.swing.JPanel) JButton(javax.swing.JButton) FlowLayout(java.awt.FlowLayout) GridBagLayout(java.awt.GridBagLayout) JTextField(javax.swing.JTextField) Dimension(java.awt.Dimension) JTimeSetting(course_generator.utils.JTimeSetting) ActionEvent(java.awt.event.ActionEvent) Font(java.awt.Font) Container(java.awt.Container) CgSpinner(course_generator.utils.CgSpinner) JLabel(javax.swing.JLabel) JTextFieldLimit(course_generator.utils.JTextFieldLimit) JCheckBox(javax.swing.JCheckBox) JPanel(javax.swing.JPanel) CgSpinnerDouble(course_generator.utils.CgSpinnerDouble)

Aggregations

CgSpinner (course_generator.utils.CgSpinner)1 CgSpinnerDouble (course_generator.utils.CgSpinnerDouble)1 JTextFieldLimit (course_generator.utils.JTextFieldLimit)1 JTimeSetting (course_generator.utils.JTimeSetting)1 Container (java.awt.Container)1 Dimension (java.awt.Dimension)1 FlowLayout (java.awt.FlowLayout)1 Font (java.awt.Font)1 GridBagLayout (java.awt.GridBagLayout)1 ActionEvent (java.awt.event.ActionEvent)1 JButton (javax.swing.JButton)1 JCheckBox (javax.swing.JCheckBox)1 JLabel (javax.swing.JLabel)1 JPanel (javax.swing.JPanel)1 JTextField (javax.swing.JTextField)1