branch feature/8209 updated (9abb952 -> ff7f247)
This is an automated email from the git hooks/post-receive script. New change to branch feature/8209 in repository tutti. See https://gitlab.nuiton.org/codelutin/tutti.git omits 9abb952 l'ui qui permet d'avoir la popup plus large doit etre mise sur la combo à la création, sinon ça a l'air de virer des listeners (fixes #8209) adds f56397f lecture de la mesure venant de l'ichtyometre, qu'importe le mode de copie (fixes #8206) adds 4365ccc livrable #8206 Merge branch 'feature/8206' into develop new ff7f247 l'ui qui permet d'avoir la popup plus large doit etre mise sur la combo à la création, sinon ça a l'air de virer des listeners (fixes #8209) This update added new revisions after undoing existing revisions. That is to say, some revisions that were in the old version of the branch are not in the new version. This situation occurs when a user --force pushes a change and generates a repository containing something like this: * -- * -- B -- O -- O -- O (9abb952) \ N -- N -- N refs/heads/feature/8209 (ff7f247) You should already have received notification emails for all of the O revisions, and so the following emails describe only the N revisions from the common base, B. Any revisions marked "omits" are not gone; other references still refer to them. Any revisions marked "discards" are gone forever. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit ff7f247cdefda9acc6b4883cb5bcaa9e0908d8d2 Author: Kevin Morin <morin@codelutin.com> Date: Mon Apr 4 10:48:30 2016 +0200 l'ui qui permet d'avoir la popup plus large doit etre mise sur la combo à la création, sinon ça a l'air de virer des listeners (fixes #8209) Summary of changes: .../actions/ApplySpeciesFrequencyRafaleAction.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/8209 in repository tutti. See https://gitlab.nuiton.org/codelutin/tutti.git commit ff7f247cdefda9acc6b4883cb5bcaa9e0908d8d2 Author: Kevin Morin <morin@codelutin.com> Date: Mon Apr 4 10:48:30 2016 +0200 l'ui qui permet d'avoir la popup plus large doit etre mise sur la combo à la création, sinon ça a l'air de virer des listeners (fixes #8209) --- .../species/frequency/SpeciesFrequencyUI.jaxx | 7 ++-- .../frequency/SpeciesFrequencyUIHandler.java | 6 --- .../swing/util/WideDataBeanFilterableComboBox.java | 26 ++++++++++++ .../tutti/ui/swing/util/WideDataComboBoxUI.java | 48 ++++++++++++++++------ 4 files changed, 66 insertions(+), 21 deletions(-) diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUI.jaxx b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUI.jaxx index cf06030..8993320 100644 --- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUI.jaxx +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUI.jaxx @@ -37,6 +37,7 @@ fr.ifremer.tutti.ui.swing.content.operation.catches.species.frequency.actions.SaveAndContinueSpeciesFrequencyAction fr.ifremer.tutti.ui.swing.util.TuttiUI fr.ifremer.tutti.ui.swing.util.TuttiUIUtil + fr.ifremer.tutti.ui.swing.util.WideDataBeanFilterableComboBox fr.ifremer.tutti.ui.swing.util.caracteristics.CaracteristicMapEditorUI fr.ifremer.tutti.ui.swing.util.computable.ComputableDataEditor @@ -160,9 +161,9 @@ protected int getLengthStepPanelPreferedWidth() { <JLabel id='lengthStepCaracteristicLabel'/> </cell> <cell> - <BeanFilterableComboBox id='lengthStepCaracteristicComboBox' - constructorParams='this' - genericType='Caracteristic'/> + <WideDataBeanFilterableComboBox id='lengthStepCaracteristicComboBox' + constructorParams='this' + genericType='Caracteristic'/> </cell> <cell> <JButton id='addLengthStepCaracteristicButton'/> diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java index f427f13..5b9865d 100644 --- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java @@ -60,7 +60,6 @@ import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor; import fr.ifremer.tutti.ui.swing.util.TuttiNumberTickUnitSource; import fr.ifremer.tutti.ui.swing.util.TuttiUI; import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil; -import fr.ifremer.tutti.ui.swing.util.WideDataComboBoxUI; import fr.ifremer.tutti.ui.swing.util.attachment.AttachmentCellEditor; import fr.ifremer.tutti.ui.swing.util.attachment.AttachmentCellRenderer; import fr.ifremer.tutti.ui.swing.util.caracteristics.CaracteristicMapCellComponent; @@ -95,7 +94,6 @@ import org.nuiton.decorator.Decorator; import org.nuiton.jaxx.application.ApplicationBusinessException; import org.nuiton.jaxx.application.swing.AbstractApplicationUIHandler; -import javax.swing.JComboBox; import javax.swing.JComponent; import javax.swing.JFrame; import javax.swing.JLabel; @@ -529,10 +527,6 @@ public class SpeciesFrequencyUIHandler extends AbstractTuttiTableUIHandler<Speci lengthStepCaracteristics, modelCaracteristic); - // on change l'ui pour pouvoir redimensionner la liste mais pas sa popup - JComboBox lengthStepCaracteristicComboBox = ui.getLengthStepCaracteristicComboBox().getCombobox(); - lengthStepCaracteristicComboBox.setUI(new WideDataComboBoxUI(lengthStepCaracteristicComboBox.getPreferredSize())); - // get step from the pmfm float step = getStep(modelCaracteristic); model.setStep(step); diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/WideDataBeanFilterableComboBox.java b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/WideDataBeanFilterableComboBox.java new file mode 100644 index 0000000..26d1336 --- /dev/null +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/WideDataBeanFilterableComboBox.java @@ -0,0 +1,26 @@ +package fr.ifremer.tutti.ui.swing.util; + +import jaxx.runtime.JAXXContext; +import jaxx.runtime.swing.editor.bean.BeanFilterableComboBox; + +/** + * @author Kevin Morin (Code Lutin) + * @since 4.5 + */ +public class WideDataBeanFilterableComboBox<O> extends BeanFilterableComboBox<O> { + + public WideDataBeanFilterableComboBox() { + super(); + } + + public WideDataBeanFilterableComboBox(JAXXContext parentContext) { + super(parentContext); + } + + @Override + protected void createCombobox() { + super.createCombobox(); + // on change l'ui pour pouvoir redimensionner la liste mais pas sa popup + combobox.setUI(new WideDataComboBoxUI(combobox.getPreferredSize())); + } +} diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/WideDataComboBoxUI.java b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/WideDataComboBoxUI.java index af23295..06704ab 100644 --- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/WideDataComboBoxUI.java +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/WideDataComboBoxUI.java @@ -24,6 +24,7 @@ package fr.ifremer.tutti.ui.swing.util; * #L% */ +import javax.swing.ListSelectionModel; import javax.swing.plaf.basic.BasicComboPopup; import javax.swing.plaf.basic.ComboPopup; import javax.swing.plaf.synth.SynthComboBoxUI; @@ -47,25 +48,48 @@ public class WideDataComboBoxUI extends SynthComboBoxUI { protected ComboPopup createPopup() { BasicComboPopup popup = new BasicComboPopup(comboBox) { - public void show() { + /** + * Configures the list which is used to hold the combo box items in the + * popup. This method is called when the UI class + * is created. + * + * @see #createList + */ + @Override + protected void configureList() { + list.setFont( comboBox.getFont() ); + list.setCellRenderer( comboBox.getRenderer() ); + list.setFocusable( false ); + list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION ); + int selectedIndex = comboBox.getSelectedIndex(); + if ( selectedIndex == -1 ) { + list.clearSelection(); + } + else { + list.setSelectedIndex( selectedIndex ); + list.ensureIndexIsVisible( selectedIndex ); + } + installListListeners(); + } + + /** + * @inheritDoc + * + * Overridden to take into account any popup insets specified in + * SynthComboBoxUI + */ + @Override + protected Rectangle computePopupBounds(int px, int py, int pw, int ph) { int width = Math.max(popupSize.width, comboBox.getPreferredSize().width); popupSize.setSize(width, getPopupHeightForRowCount(comboBox.getMaximumRowCount())); - Rectangle popupBounds = computePopupBounds(0, comboBox.getBounds().height, width, popupSize.height); + Rectangle popupBounds = super.computePopupBounds(0, comboBox.getBounds().height, width, popupSize.height); scroller.setMaximumSize(popupBounds.getSize()); scroller.setPreferredSize(popupBounds.getSize()); scroller.setMinimumSize(popupBounds.getSize()); list.invalidate(); - int selectedIndex = comboBox.getSelectedIndex(); - if (selectedIndex == -1) { - list.clearSelection(); - } else { - list.setSelectedIndex(selectedIndex); - } - list.ensureIndexIsVisible(list.getSelectedIndex()); - setLightWeightPopupEnabled(comboBox.isLightWeightPopupEnabled()); - - show(comboBox, popupBounds.x, popupBounds.y); + return popupBounds; } + }; popup.getAccessibleContext().setAccessibleParent(comboBox); return popup; -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm