Search in sources :

Example 1 with ConnectionStrategyType

use of net.parostroj.timetable.model.freight.ConnectionStrategyType in project grafikon by jub77.

the class SettingsDialog method updateValues.

private void updateValues() {
    if (diagram != null) {
        // set original values ...
        scaleComboBox.setSelectedItem(diagram.getAttribute(TrainDiagram.ATTR_SCALE, Object.class));
        ratioComboBox.setSelectedItem(format.format(diagram.getAttribute(TrainDiagram.ATTR_TIME_SCALE, Double.class)));
        // sorting
        TrainsData trainsData = diagram.getTrainsData();
        SortPatternGroup firstGroup = trainsData.getTrainSortPattern().getGroups().get(0);
        sortComboBox.setSelectedIndex(firstGroup.getType() == SortPatternGroup.Type.NUMBER ? 0 : 1);
        roundingComboBox.setSelectedIndex(diagram.getTimeConverter().getRounding().ordinal());
        cNameTemplateEditBox.setTemplate(trainsData.getTrainCompleteNameTemplate());
        nameTemplateEditBox.setTemplate(trainsData.getTrainNameTemplate());
        // set crossing time in minutes
        Integer transferTime = diagram.getAttribute(TrainDiagram.ATTR_STATION_TRANSFER_TIME, Integer.class);
        if (transferTime != null) {
            stationTransferTextField.setText(transferTime.toString());
        } else {
            log.warn("Station transfer time information missing.");
            stationTransferTextField.setText("");
        }
        // changes tracking
        changesTrackingCheckBox.setSelected(diagram.getChangesTracker().isTrackingEnabled());
        // script
        scriptEditBox.setScript(trainsData.getRunningTimeScript());
        // route length
        Double routeLengthRatio = diagram.getAttribute(TrainDiagram.ATTR_ROUTE_LENGTH_RATIO, Double.class);
        rlRatioTextField.setNumberValue(routeLengthRatio != null ? BigDecimal.valueOf(routeLengthRatio) : null);
        LengthUnit lUnitRoute = diagram.getAttribute(TrainDiagram.ATTR_ROUTE_LENGTH_UNIT, LengthUnit.class);
        rlUnitComboBox.setSelectedItem(lUnitRoute != null ? lUnitRoute : NO_UNIT);
        // weight -> length conversion
        loadedWeightEditBox.setValueInUnit(new BigDecimal(diagram.getAttribute(TrainDiagram.ATTR_WEIGHT_PER_AXLE, Integer.class)), WeightUnit.KG);
        emptyWeightEditBox.setValueInUnit(new BigDecimal(diagram.getAttribute(TrainDiagram.ATTR_WEIGHT_PER_AXLE_EMPTY, Integer.class)), WeightUnit.KG);
        lengthPerAxleEditBox.setValueInUnit(new BigDecimal(diagram.getAttribute(TrainDiagram.ATTR_LENGTH_PER_AXLE, Integer.class)), LengthUnit.MM);
        lengthUnitComboBox.setSelectedItem(diagram.getAttribute(TrainDiagram.ATTR_LENGTH_UNIT, Object.class));
        // time range
        Integer fromTime = diagram.getAttribute(TrainDiagram.ATTR_FROM_TIME, Integer.class);
        Integer toTime = diagram.getAttribute(TrainDiagram.ATTR_TO_TIME, Integer.class);
        this.setTimeRange(fromTime, toTime);
        LengthUnit lUnit = diagram.getAttributes().get(TrainDiagram.ATTR_EDIT_LENGTH_UNIT, LengthUnit.class);
        SpeedUnit sUnit = diagram.getAttributes().get(TrainDiagram.ATTR_EDIT_SPEED_UNIT, SpeedUnit.class);
        unitComboBox.setSelectedItem(lUnit != null ? lUnit : NO_UNIT);
        speedUnitComboBox.setSelectedItem(sUnit != null ? sUnit : NO_UNIT);
        ConnectionStrategyType strategyType = diagram.getFreightNet().getConnectionStrategyType();
        strategyTypeModel.setSelectedObject(strategyType);
        if (strategyType == ConnectionStrategyType.CUSTOM_CONNECTION_FILTER) {
            filterScriptEditBox.setScript(diagram.getFreightNet().getAttribute(FreightNet.ATTR_CUSTOM_CONNECTION_FILTER, Script.class));
        }
    }
}
Also used : ConnectionStrategyType(net.parostroj.timetable.model.freight.ConnectionStrategyType) BigDecimal(java.math.BigDecimal)

Example 2 with ConnectionStrategyType

use of net.parostroj.timetable.model.freight.ConnectionStrategyType in project grafikon by jub77.

the class SettingsDialog method initComponents.

private void initComponents() {
    JTabbedPane tabbedPane = new JTabbedPane();
    getContentPane().setLayout(new BorderLayout());
    getContentPane().add(tabbedPane, BorderLayout.CENTER);
    javax.swing.JPanel dataPanel = new javax.swing.JPanel();
    // NOI18N
    tabbedPane.addTab(ResourceLoader.getString("modelinfo.tab.config"), dataPanel);
    javax.swing.JPanel scriptPanel = new javax.swing.JPanel();
    // NOI18N
    tabbedPane.addTab(ResourceLoader.getString("modelinfo.tab.script"), scriptPanel);
    javax.swing.JPanel freightPanel = new javax.swing.JPanel();
    // NOI18N
    tabbedPane.addTab(ResourceLoader.getString("modelinfo.tab.freight"), freightPanel);
    java.awt.GridBagConstraints gridBagConstraints;
    javax.swing.JLabel jLabel1 = new javax.swing.JLabel();
    scaleComboBox = new javax.swing.JComboBox<>();
    javax.swing.JLabel jLabel2 = new javax.swing.JLabel();
    ratioComboBox = new javax.swing.JComboBox<>();
    roundingComboBox = new javax.swing.JComboBox<>();
    javax.swing.JLabel jLabel3 = new javax.swing.JLabel();
    nameTemplateEditBox = new net.parostroj.timetable.gui.components.TextTemplateEditBox();
    javax.swing.JLabel jLabel4 = new javax.swing.JLabel();
    cNameTemplateEditBox = new net.parostroj.timetable.gui.components.TextTemplateEditBox();
    javax.swing.JLabel jLabel5 = new javax.swing.JLabel();
    sortComboBox = new javax.swing.JComboBox<>();
    javax.swing.JLabel jLabel6 = new javax.swing.JLabel();
    changesTrackingCheckBox = new javax.swing.JCheckBox();
    javax.swing.JLabel jLabel11 = new javax.swing.JLabel();
    javax.swing.JPanel routeLengthPanel = new javax.swing.JPanel();
    javax.swing.JLabel jLabel12 = new javax.swing.JLabel();
    javax.swing.JLabel jLabel14 = new javax.swing.JLabel();
    rlRatioTextField = new NumberTextField();
    javax.swing.JLabel jLabel13 = new javax.swing.JLabel();
    rlUnitComboBox = new javax.swing.JComboBox<>();
    javax.swing.JPanel weightPerAxlePanel = new javax.swing.JPanel();
    javax.swing.JLabel jLabel7 = new javax.swing.JLabel();
    javax.swing.JLabel jLabel8 = new javax.swing.JLabel();
    loadedWeightEditBox = new net.parostroj.timetable.gui.components.ValueWithUnitEditBox();
    javax.swing.JLabel jLabel9 = new javax.swing.JLabel();
    emptyWeightEditBox = new net.parostroj.timetable.gui.components.ValueWithUnitEditBox();
    javax.swing.JPanel lengthPanel = new javax.swing.JPanel();
    javax.swing.JLabel jLabel10 = new javax.swing.JLabel();
    lengthPerAxleEditBox = new net.parostroj.timetable.gui.components.ValueWithUnitEditBox();
    javax.swing.JLabel jLabel15 = new javax.swing.JLabel();
    lengthUnitComboBox = new javax.swing.JComboBox<>();
    javax.swing.JPanel timeRangePanel = new javax.swing.JPanel();
    javax.swing.JLabel jLabel16 = new javax.swing.JLabel();
    fromTimeTextField = new javax.swing.JTextField();
    javax.swing.JLabel jLabel17 = new javax.swing.JLabel();
    toTimeTextField = new javax.swing.JTextField();
    scriptEditBox = new net.parostroj.timetable.gui.components.ScriptEditBox();
    javax.swing.JPanel buttonPanel = new javax.swing.JPanel();
    FlowLayout flowLayout = (FlowLayout) buttonPanel.getLayout();
    flowLayout.setAlignment(FlowLayout.RIGHT);
    okButton = new javax.swing.JButton();
    cancelButton = new javax.swing.JButton();
    setDefaultCloseOperation(javax.swing.WindowConstants.HIDE_ON_CLOSE);
    // NOI18N
    setTitle(ResourceLoader.getString("modelinfo"));
    dataPanel.setLayout(new GridBagLayout());
    // NOI18N
    jLabel1.setText(ResourceLoader.getString("modelinfo.scales"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridx = 0;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new Insets(5, 5, 5, 5);
    dataPanel.add(jLabel1, gridBagConstraints);
    GridBagConstraints gridBagConstraints_2 = new java.awt.GridBagConstraints();
    gridBagConstraints_2.gridx = 1;
    gridBagConstraints_2.gridy = 0;
    gridBagConstraints_2.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints_2.insets = new Insets(5, 2, 5, 10);
    dataPanel.add(scaleComboBox, gridBagConstraints_2);
    // NOI18N
    jLabel2.setText(ResourceLoader.getString("modelinfo.ratio"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new Insets(0, 5, 5, 5);
    dataPanel.add(jLabel2, gridBagConstraints);
    ratioComboBox.setEditable(true);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.insets = new java.awt.Insets(0, 2, 5, 10);
    dataPanel.add(ratioComboBox, gridBagConstraints);
    JLabel label = new JLabel(ResourceLoader.getString("modelinfo.rounding"));
    GridBagConstraints gbc_label = new GridBagConstraints();
    gbc_label.anchor = GridBagConstraints.WEST;
    gbc_label.insets = new Insets(0, 5, 5, 5);
    gbc_label.gridx = 0;
    gbc_label.gridy = 2;
    dataPanel.add(label, gbc_label);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.insets = new java.awt.Insets(0, 2, 5, 10);
    dataPanel.add(roundingComboBox, gridBagConstraints);
    // NOI18N
    jLabel3.setText(ResourceLoader.getString("edit.traintypes.nametemplate"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.gridwidth = 2;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new Insets(0, 5, 5, 5);
    dataPanel.add(jLabel3, gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 4;
    gridBagConstraints.gridwidth = 3;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new Insets(0, 5, 5, 5);
    dataPanel.add(nameTemplateEditBox, gridBagConstraints);
    // NOI18N
    jLabel4.setText(ResourceLoader.getString("edit.traintypes.completenametemplate"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 5;
    gridBagConstraints.gridwidth = 2;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new Insets(0, 5, 5, 5);
    dataPanel.add(jLabel4, gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 6;
    gridBagConstraints.gridwidth = 3;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new Insets(0, 5, 5, 5);
    dataPanel.add(cNameTemplateEditBox, gridBagConstraints);
    // NOI18N
    jLabel5.setText(ResourceLoader.getString("modelinfo.sort"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 7;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new Insets(0, 5, 5, 5);
    dataPanel.add(jLabel5, gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 7;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.insets = new java.awt.Insets(0, 2, 5, 10);
    dataPanel.add(sortComboBox, gridBagConstraints);
    // NOI18N
    jLabel6.setText(ResourceLoader.getString("modelinfo.crossing"));
    java.awt.GridBagConstraints gridBagConstraints_7 = new java.awt.GridBagConstraints();
    gridBagConstraints_7.gridwidth = 3;
    gridBagConstraints_7.gridx = 0;
    gridBagConstraints_7.gridy = 8;
    gridBagConstraints_7.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints_7.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints_7.insets = new Insets(0, 0, 5, 0);
    javax.swing.JPanel crossingPanel = new javax.swing.JPanel(new FlowLayout(java.awt.FlowLayout.LEFT));
    crossingPanel.add(jLabel6);
    dataPanel.add(crossingPanel, gridBagConstraints_7);
    stationTransferTextField = new javax.swing.JTextField();
    stationTransferTextField.setColumns(5);
    crossingPanel.add(stationTransferTextField);
    JLabel lblMin = new JLabel("min");
    crossingPanel.add(lblMin);
    // NOI18N
    changesTrackingCheckBox.setText(ResourceLoader.getString("modelinfo.tracking.changes"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 9;
    gridBagConstraints.gridwidth = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new Insets(0, 2, 5, 10);
    dataPanel.add(changesTrackingCheckBox, gridBagConstraints);
    routeLengthPanel.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));
    // NOI18N
    jLabel12.setText(ResourceLoader.getString("modelinfo.route.length") + " -");
    routeLengthPanel.add(jLabel12);
    // NOI18N
    jLabel14.setText(ResourceLoader.getString("modelinfo.route.length.ratio") + ":");
    routeLengthPanel.add(jLabel14);
    rlRatioTextField.setColumns(7);
    routeLengthPanel.add(rlRatioTextField);
    // NOI18N
    jLabel13.setText(ResourceLoader.getString("modelinfo.route.length.unit") + ":");
    routeLengthPanel.add(jLabel13);
    routeLengthPanel.add(rlUnitComboBox);
    GridBagConstraints gridBagConstraints_3 = new java.awt.GridBagConstraints();
    gridBagConstraints_3.insets = new Insets(0, 0, 5, 0);
    gridBagConstraints_3.gridx = 0;
    gridBagConstraints_3.gridy = 12;
    gridBagConstraints_3.gridwidth = 3;
    gridBagConstraints_3.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints_3.anchor = java.awt.GridBagConstraints.WEST;
    dataPanel.add(routeLengthPanel, gridBagConstraints_3);
    weightPerAxlePanel.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));
    // NOI18N
    jLabel7.setText(ResourceLoader.getString("modelinfo.weight.per.axle") + " - ");
    weightPerAxlePanel.add(jLabel7);
    // NOI18N
    jLabel8.setText(ResourceLoader.getString("modelinfo.weight.per.axle.loaded") + ":");
    weightPerAxlePanel.add(jLabel8);
    loadedWeightEditBox.setValueColumns(5);
    weightPerAxlePanel.add(loadedWeightEditBox);
    // NOI18N
    jLabel9.setText(ResourceLoader.getString("modelinfo.weight.per.axle.empty") + ":");
    weightPerAxlePanel.add(jLabel9);
    emptyWeightEditBox.setValueColumns(5);
    weightPerAxlePanel.add(emptyWeightEditBox);
    GridBagConstraints gridBagConstraints_1 = new java.awt.GridBagConstraints();
    gridBagConstraints_1.insets = new Insets(0, 0, 5, 0);
    gridBagConstraints_1.gridx = 0;
    gridBagConstraints_1.gridy = 10;
    gridBagConstraints_1.gridwidth = 3;
    gridBagConstraints_1.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints_1.anchor = java.awt.GridBagConstraints.WEST;
    dataPanel.add(weightPerAxlePanel, gridBagConstraints_1);
    lengthPanel.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));
    // NOI18N
    jLabel10.setText(ResourceLoader.getString("modelinfo.axle.length") + ":");
    lengthPanel.add(jLabel10);
    lengthPerAxleEditBox.setValueColumns(5);
    lengthPanel.add(lengthPerAxleEditBox);
    // NOI18N
    jLabel15.setText(ResourceLoader.getString("modelinfo.length.unit") + ":");
    lengthPanel.add(jLabel15);
    lengthPanel.add(lengthUnitComboBox);
    GridBagConstraints gridBagConstraints_4 = new java.awt.GridBagConstraints();
    gridBagConstraints_4.insets = new Insets(0, 0, 5, 0);
    gridBagConstraints_4.gridx = 0;
    gridBagConstraints_4.gridy = 11;
    gridBagConstraints_4.gridwidth = 3;
    gridBagConstraints_4.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints_4.anchor = java.awt.GridBagConstraints.WEST;
    dataPanel.add(lengthPanel, gridBagConstraints_4);
    timeRangePanel.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));
    // NOI18N
    jLabel16.setText(ResourceLoader.getString("modelinfo.from.time"));
    timeRangePanel.add(jLabel16);
    fromTimeTextField.setColumns(7);
    fromTimeTextField.addFocusListener(new java.awt.event.FocusAdapter() {

        @Override
        public void focusLost(java.awt.event.FocusEvent evt) {
            timeTextFieldFocusLost(evt);
        }
    });
    timeRangePanel.add(fromTimeTextField);
    // NOI18N
    jLabel17.setText(ResourceLoader.getString("modelinfo.to.time"));
    timeRangePanel.add(jLabel17);
    toTimeTextField.setColumns(7);
    toTimeTextField.addFocusListener(new java.awt.event.FocusAdapter() {

        @Override
        public void focusLost(java.awt.event.FocusEvent evt) {
            timeTextFieldFocusLost(evt);
        }
    });
    timeRangePanel.add(toTimeTextField);
    GridBagConstraints gridBagConstraints_5 = new java.awt.GridBagConstraints();
    gridBagConstraints_5.insets = new Insets(0, 0, 5, 0);
    gridBagConstraints_5.gridx = 0;
    gridBagConstraints_5.gridy = 13;
    gridBagConstraints_5.gridwidth = 3;
    gridBagConstraints_5.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints_5.anchor = java.awt.GridBagConstraints.WEST;
    dataPanel.add(timeRangePanel, gridBagConstraints_5);
    javax.swing.JPanel unitsPanel = new javax.swing.JPanel();
    unitsPanel.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));
    gridBagConstraints_5 = new java.awt.GridBagConstraints();
    gridBagConstraints_5.insets = new Insets(0, 0, 0, 0);
    gridBagConstraints_5.gridx = 0;
    gridBagConstraints_5.gridy = 14;
    gridBagConstraints_5.gridwidth = 3;
    gridBagConstraints_5.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints_5.anchor = java.awt.GridBagConstraints.WEST;
    dataPanel.add(unitsPanel, gridBagConstraints_5);
    unitsPanel.add(new javax.swing.JLabel(ResourceLoader.getString("modelinfo.unit")));
    unitComboBox = new javax.swing.JComboBox<>();
    unitsPanel.add(unitComboBox);
    unitsPanel.add(new javax.swing.JLabel(ResourceLoader.getString("modelinfo.speed.unit")));
    speedUnitComboBox = new javax.swing.JComboBox<>();
    unitsPanel.add(speedUnitComboBox);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 15;
    gridBagConstraints.gridwidth = 3;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    dataPanel.add(Box.createVerticalGlue(), gridBagConstraints);
    freightPanel.setLayout(new BorderLayout());
    javax.swing.JPanel freightStrategyPanel = new javax.swing.JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
    freightStrategyPanel.setBorder(BorderFactory.createEmptyBorder(2, 5, 0, 0));
    freightPanel.add(freightStrategyPanel, BorderLayout.NORTH);
    freightStrategyPanel.add(new JLabel(ResourceLoader.getString("modelinfo.freight.connection.strategy") + ": "));
    strategyTypeModel = new WrapperListModel<>(true);
    javax.swing.JComboBox<Wrapper<ConnectionStrategyType>> strategyType = new javax.swing.JComboBox<>();
    strategyType.setModel(strategyTypeModel);
    freightStrategyPanel.add(strategyType);
    strategyType.addItemListener(e -> {
        if (e.getStateChange() == ItemEvent.SELECTED) {
            ConnectionStrategyType sType = strategyTypeModel.getSelectedObject();
            if (sType == ConnectionStrategyType.CUSTOM_CONNECTION_FILTER) {
                filterScriptEditBox.setEnabled(true);
                filterScriptEditBox.setScriptText("builder.netFilter = { context, dest, level -> ok }\nbuilder.trainFilter = { context, dest, level -> ok }");
            } else {
                filterScriptEditBox.setScript(null);
                filterScriptEditBox.setEnabled(false);
            }
        }
    });
    filterScriptEditBox = new net.parostroj.timetable.gui.components.ScriptEditBox();
    // NOI18N
    filterScriptEditBox.setScriptFont(new java.awt.Font("Monospaced", 0, 12));
    // allow only groovy script language for the filter
    filterScriptEditBox.setScriptLanguage(Script.Language.GROOVY);
    filterScriptEditBox.setLanguageChange(false);
    freightPanel.add(filterScriptEditBox, BorderLayout.CENTER);
    scriptPanel.setLayout(new GridBagLayout());
    // NOI18N
    jLabel11.setText(ResourceLoader.getString("modelinfo.running.time.script"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridwidth = 3;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new Insets(5, 5, 0, 0);
    scriptPanel.add(jLabel11, gridBagConstraints);
    scriptEditBox.setRows(8);
    // NOI18N
    scriptEditBox.setScriptFont(new java.awt.Font("Monospaced", 0, 12));
    GridBagConstraints gridBagConstraints_6 = new java.awt.GridBagConstraints();
    gridBagConstraints_6.insets = new Insets(0, 0, 5, 0);
    gridBagConstraints_6.gridx = 0;
    gridBagConstraints_6.gridy = 1;
    gridBagConstraints_6.gridwidth = 3;
    gridBagConstraints_6.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints_6.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints_6.weightx = 1.0;
    gridBagConstraints_6.weighty = 1.0;
    scriptPanel.add(scriptEditBox, gridBagConstraints_6);
    // NOI18N
    okButton.setText(ResourceLoader.getString("button.ok"));
    okButton.addActionListener(evt -> okButtonActionPerformed(evt));
    buttonPanel.add(okButton);
    // NOI18N
    cancelButton.setText(ResourceLoader.getString("button.cancel"));
    cancelButton.addActionListener(evt -> cancelButtonActionPerformed(evt));
    buttonPanel.add(cancelButton);
    getContentPane().add(buttonPanel, BorderLayout.SOUTH);
    pack();
}
Also used : NumberTextField(net.parostroj.timetable.gui.components.NumberTextField) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) FlowLayout(java.awt.FlowLayout) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) ConnectionStrategyType(net.parostroj.timetable.model.freight.ConnectionStrategyType) JTabbedPane(javax.swing.JTabbedPane) BorderLayout(java.awt.BorderLayout) FlowLayout(java.awt.FlowLayout) Wrapper(net.parostroj.timetable.gui.wrappers.Wrapper) JLabel(javax.swing.JLabel) GridBagConstraints(java.awt.GridBagConstraints) JLabel(javax.swing.JLabel)

Aggregations

ConnectionStrategyType (net.parostroj.timetable.model.freight.ConnectionStrategyType)2 BorderLayout (java.awt.BorderLayout)1 FlowLayout (java.awt.FlowLayout)1 GridBagConstraints (java.awt.GridBagConstraints)1 GridBagLayout (java.awt.GridBagLayout)1 Insets (java.awt.Insets)1 BigDecimal (java.math.BigDecimal)1 JLabel (javax.swing.JLabel)1 JTabbedPane (javax.swing.JTabbedPane)1 NumberTextField (net.parostroj.timetable.gui.components.NumberTextField)1 Wrapper (net.parostroj.timetable.gui.wrappers.Wrapper)1