Merge lp:~tapaal-contributor/tapaal/edit-interval-1940402 into lp:tapaal

Proposed by Lena Ernstsen
Status: Merged
Approved by: Jiri Srba
Approved revision: 1138
Merged at revision: 1141
Proposed branch: lp:~tapaal-contributor/tapaal/edit-interval-1940402
Merge into: lp:tapaal
Diff against target: 71 lines (+28/-26)
1 file modified
src/pipe/gui/widgets/GuardDialogue.java (+28/-26)
To merge this branch: bzr merge lp:~tapaal-contributor/tapaal/edit-interval-1940402
Reviewer Review Type Date Requested Status
Jiri Srba Approve
Review via email: mp+407601@code.launchpad.net

Commit message

Fixed not being able to edit right part of intervals

To post a comment you must log in.
Revision history for this message
Jiri Srba (srba) wrote :

tested and fixes the problem

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/pipe/gui/widgets/GuardDialogue.java'
--- src/pipe/gui/widgets/GuardDialogue.java 2021-04-08 08:30:29 +0000
+++ src/pipe/gui/widgets/GuardDialogue.java 2021-08-24 09:34:51 +0000
@@ -561,7 +561,7 @@
561 rightDelimiter.setEnabled(true);561 rightDelimiter.setEnabled(true);
562 else562 else
563 rightDelimiter.setEnabled(!inf.isSelected());563 rightDelimiter.setEnabled(!inf.isSelected());
564 secondIntervalNumber.setVisible(!value);564 secondIntervalNumber.setVisible(!value);
565 rightConstantsComboBox.setVisible(value);565 rightConstantsComboBox.setVisible(value);
566566
567 repackIfWindow();567 repackIfWindow();
@@ -671,31 +671,33 @@
671 String oldRight = rightConstantsComboBox.getSelectedItem() != null ? rightConstantsComboBox671 String oldRight = rightConstantsComboBox.getSelectedItem() != null ? rightConstantsComboBox
672 .getSelectedItem().toString()672 .getSelectedItem().toString()
673 : null;673 : null;
674 rightConstantsComboBox.removeAllItems();674 rightConstantsComboBox.removeAllItems();
675 Collection<Constant> constants = CreateGui.getCurrentTab().network()675 Collection<Constant> constants = CreateGui.getCurrentTab().network()
676 .constants();676 .constants();
677 677
678 //List <Constant> constantList = new ArrayList(constants);678 //List <Constant> constantList = new ArrayList(constants);
679 List <Constant> constantList = new ArrayList<Constant>();679 List <Constant> constantList = new ArrayList<Constant>();
680 constantList.addAll(constants);680 constantList.addAll(constants);
681 681
682 constantList.sort((o1, o2) -> o1.name().compareToIgnoreCase(o2.name()));682 constantList.sort((o1, o2) -> o1.name().compareToIgnoreCase(o2.name()));
683683
684 684
685 for (Constant c : constantList) {685 for (Constant c : constantList) {
686 if (c.value() >= value) {686 if (c.value() >= value) {
687 rightConstantsComboBox.addItem(c.name());687 rightConstantsComboBox.addItem(c.name());
688 }688 }
689 }689 }
690690
691 if(rightConstantsComboBox.getItemCount() == 0){691 if(rightConstantsComboBox.getItemCount() == 0){
692 rightUseConstant.setEnabled(false);692 rightUseConstant.setEnabled(false);
693 } else {693 rightUseConstant.setSelected(false);
694 rightUseConstant.setEnabled(true);694 updateRightComponents();
695 }695 } else {
696696 rightUseConstant.setEnabled(true);
697 if (oldRight != null)697 }
698 rightConstantsComboBox.setSelectedItem(oldRight);698
699 if (oldRight != null)
700 rightConstantsComboBox.setSelectedItem(oldRight);
699 }701 }
700702
701 private void firstSpinnerStateChanged(ChangeEvent evt) {703 private void firstSpinnerStateChanged(ChangeEvent evt) {

Subscribers

People subscribed via source and target branches