r713 - in trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing: content/cruise content/operation util
Author: kmorin Date: 2013-03-29 17:30:41 +0100 (Fri, 29 Mar 2013) New Revision: 713 Url: http://forge.codelutin.com/projects/tutti/repository/revisions/713 Log: use a scrollpane when the ui can be too high Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.css trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.jaxx trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.css =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.css 2013-03-29 15:01:19 UTC (rev 712) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.css 2013-03-29 16:30:41 UTC (rev 713) @@ -54,6 +54,10 @@ _help: {"tutti.editCruise.help"}; } +#cruiseScrollPane { + _onlyVerticalScrollable: true; +} + #nameLabel { text: "tutti.editCruise.field.name"; labelFor: {nameField}; Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.jaxx =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.jaxx 2013-03-29 15:01:19 UTC (rev 712) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.jaxx 2013-03-29 16:30:41 UTC (rev 713) @@ -92,157 +92,156 @@ constructorParams='getHandler().getContext(), getModel()'/> </JToolBar> - <Table fill='both' constraints='BorderLayout.CENTER'> + <JScrollPane id='cruiseScrollPane' constraints='BorderLayout.CENTER'> + <Table fill='both'> - <!-- cruise program / survey part --> - <row> - <cell anchor='west'> - <JLabel id='programLabel'/> - </cell> - <cell weightx='0.3'> - <BeanFilterableComboBox id='programComboBox' constructorParams='this' - genericType='Program'/> - </cell> - <cell> - <JLabel id='surveyPartLabel'/> - </cell> - <cell weightx='0.3'> - <JTextField id='surveyPartField' - onKeyReleased='handler.setText(event, "surveyPart")'/> - </cell> - </row> + <!-- cruise program / survey part --> + <row> + <cell anchor='west'> + <JLabel id='programLabel'/> + </cell> + <cell weightx='0.3'> + <BeanFilterableComboBox id='programComboBox' constructorParams='this' + genericType='Program'/> + </cell> + <cell> + <JLabel id='surveyPartLabel'/> + </cell> + <cell weightx='0.3'> + <JTextField id='surveyPartField' + onKeyReleased='handler.setText(event, "surveyPart")'/> + </cell> + </row> - <!-- departure harbour / begin date --> - <row> - <cell anchor='west'> - <JLabel id='departureLocationLabel'/> - </cell> - <cell> - <BeanFilterableComboBox id='departureLocationComboBox' - constructorParams='this' - genericType='TuttiLocation'/> - </cell> - <cell> - <JLabel id='beginDateLabel'/> - </cell> - <cell> - <JXDatePicker id='beginDateField' - onActionPerformed='handler.setDate(event, "beginDate")'/> - </cell> - </row> + <!-- departure harbour / begin date --> + <row> + <cell anchor='west'> + <JLabel id='departureLocationLabel'/> + </cell> + <cell> + <BeanFilterableComboBox id='departureLocationComboBox' + constructorParams='this' + genericType='TuttiLocation'/> + </cell> + <cell> + <JLabel id='beginDateLabel'/> + </cell> + <cell> + <JXDatePicker id='beginDateField' + onActionPerformed='handler.setDate(event, "beginDate")'/> + </cell> + </row> - <!-- landing harbour / end date --> - <row> - <cell anchor='west'> - <JLabel id='returnLocationLabel'/> - </cell> - <cell> - <BeanFilterableComboBox id='returnLocationComboBox' - constructorParams='this' - genericType='TuttiLocation'/> - </cell> - <cell> - <JLabel id='endDateLabel'/> - </cell> - <cell> - <JXDatePicker id='endDateField' - onActionPerformed='handler.setDate(event, "endDate")'/> - </cell> - </row> + <!-- landing harbour / end date --> + <row> + <cell anchor='west'> + <JLabel id='returnLocationLabel'/> + </cell> + <cell> + <BeanFilterableComboBox id='returnLocationComboBox' + constructorParams='this' + genericType='TuttiLocation'/> + </cell> + <cell> + <JLabel id='endDateLabel'/> + </cell> + <cell> + <JXDatePicker id='endDateField' + onActionPerformed='handler.setDate(event, "endDate")'/> + </cell> + </row> - <!-- cruise name / multirigNumber --> - <row> - <cell> - <JLabel id='nameLabel'/> - </cell> - <cell> - <JTextField id='nameField' - onKeyReleased='handler.setText(event, "name")'/> - </cell> - <cell columns='2'> - <JButton id='generateNameButton' - onActionPerformed='handler.generateCampaignName()'/> - </cell> - </row> + <!-- cruise name / multirigNumber --> + <row> + <cell> + <JLabel id='nameLabel'/> + </cell> + <cell> + <JTextField id='nameField' + onKeyReleased='handler.setText(event, "name")'/> + </cell> + <cell columns='2'> + <JButton id='generateNameButton' + onActionPerformed='handler.generateCampaignName()'/> + </cell> + </row> - <!-- cruise name / multirigNumber --> - <row> - <cell> - <JLabel id='multirigNumberLabel'/> - </cell> - <cell> - <NumberEditor id='multirigNumberField' constructorParams='this'/> - </cell> - <cell columns="2"> - <JLabel/> - </cell> - </row> + <!-- cruise name / multirigNumber --> + <row> + <cell> + <JLabel id='multirigNumberLabel'/> + </cell> + <cell> + <NumberEditor id='multirigNumberField' constructorParams='this'/> + </cell> + <cell columns="2"> + <JLabel/> + </cell> + </row> - <!-- cruise vessel / gear --> - <row> - <cell columns='4'> - <JSeparator constructorParams='SwingConstants.HORIZONTAL'/> - </cell> - </row> - <row> - <cell columns='4'> - <JPanel id='vesselFilterPane'> - <JLabel id='filterVesselLabel'/> - <JRadioButton id='filterVesselAllButton' - onActionPerformed='model.setVesselType(VesselTypeEnum.ALL)'/> - <JRadioButton id='filterVesselScientificButton' - onActionPerformed='model.setVesselType(VesselTypeEnum.SCIENTIFIC)'/> - <JRadioButton id='filterVesselFishingButton' - onActionPerformed='model.setVesselType(VesselTypeEnum.FISHING)'/> - </JPanel> - </cell> - </row> - <row> - <cell> - <JLabel id='vesselLabel'/> - </cell> - <cell columns="3"> - <BeanFilterableComboBox id='vesselComboBox' constructorParams='this' - genericType='Vessel'/> + <!-- cruise vessel / gear --> + <row> + <cell columns='4'> + <JSeparator constructorParams='SwingConstants.HORIZONTAL'/> + </cell> + </row> + <row> + <cell columns='4'> + <JPanel id='vesselFilterPane'> + <JLabel id='filterVesselLabel'/> + <JRadioButton id='filterVesselAllButton' + onActionPerformed='model.setVesselType(VesselTypeEnum.ALL)'/> + <JRadioButton id='filterVesselScientificButton' + onActionPerformed='model.setVesselType(VesselTypeEnum.SCIENTIFIC)'/> + <JRadioButton id='filterVesselFishingButton' + onActionPerformed='model.setVesselType(VesselTypeEnum.FISHING)'/> + </JPanel> + </cell> + </row> + <row> + <cell> + <JLabel id='vesselLabel'/> + </cell> + <cell columns="3"> + <BeanFilterableComboBox id='vesselComboBox' constructorParams='this' + genericType='Vessel'/> - </cell> - </row> - <row weighty='0.3'> - <cell columns="4"> - <BeanDoubleList id='gearList' genericType='Gear'/> - </cell> - </row> + </cell> + </row> + <row weighty='0.3'> + <cell columns="4"> + <BeanDoubleList id='gearList' genericType='Gear'/> + </cell> + </row> - <!-- cruise headOfMission / headOfSortRoom --> - <row weighty='0.3'> - <cell columns='4'> - <JPanel layout='{new GridLayout(1, 0)}'> - <BeanDoubleList id='headOfMissionList' genericType='Person'/> - <BeanDoubleList id='headOfSortRoomList' genericType='Person'/> - </JPanel> - </cell> - </row> + <!-- cruise headOfMission / headOfSortRoom --> + <row weighty='0.3'> + <cell columns='4'> + <JPanel layout='{new GridLayout(1, 0)}'> + <BeanDoubleList id='headOfMissionList' genericType='Person'/> + <BeanDoubleList id='headOfSortRoomList' genericType='Person'/> + </JPanel> + </cell> + </row> - <!-- cruise comment --> - <row weighty='0.3'> - <cell columns='4'> - <JScrollPane id='commentPane' - onFocusGained='commentField.requestFocus()'> - <JTextArea id='commentField' - onKeyReleased='handler.setText(event, "comment")'/> - </JScrollPane> - </cell> - </row> + <!-- cruise comment --> + <row weighty='0.3'> + <cell columns='4'> + <JScrollPane id='commentPane' + onFocusGained='commentField.requestFocus()'> + <JTextArea id='commentField' + onKeyReleased='handler.setText(event, "comment")'/> + </JScrollPane> + </cell> + </row> - <!-- Form Actions --> - <row> - <cell columns='4'> - <JPanel layout='{new GridLayout(1, 0)}'> - <JButton id='closeButton'/> - <JButton id='saveButton'/> - </JPanel> - </cell> - </row> - </Table> + </Table> + </JScrollPane> + <!-- Form Actions --> + <JPanel layout='{new GridLayout(1, 0)}' constraints='BorderLayout.SOUTH'> + <JButton id='closeButton'/> + <JButton id='saveButton'/> + </JPanel> + </JPanel> \ No newline at end of file Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css 2013-03-29 15:01:19 UTC (rev 712) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css 2013-03-29 16:30:41 UTC (rev 713) @@ -70,6 +70,10 @@ borderPainted: false; } +#fishingOperationTabScrollPane { + _onlyVerticalScrollable: true; +} + #fishingOperationAttachmentsButton { enabled: {model.getId() != null}; toolTipText: "tutti.editFishingOperation.action.attachments.tip"; Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx 2013-03-29 15:01:19 UTC (rev 712) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx 2013-03-29 16:30:41 UTC (rev 713) @@ -158,344 +158,344 @@ <JTabbedPane id='fishingOperationTabPane' constraints='BorderLayout.CENTER'> <tab id='traitGeneralTab'> <JXTitledPanel id='traitGeneralTabPane'> - <!-- <JScrollPane id='fishingOperationTabScrollPane'>--> - <Table fill='both' id='generalForm'> + <JScrollPane id='fishingOperationTabScrollPane'> + <Table fill='both' id='generalForm'> - <!-- Numero station / Numéro trait / Numéro de poche --> - <row> - <cell> - <JLabel id='stationNumberLabel'/> - </cell> - <cell weightx='0.3'> - <JTextField id='stationNumberField' - onKeyReleased='handler.setText(event, "stationNumber")'/> - </cell> - <cell> - <JLabel id='fishingOperationNumberLabel'/> - </cell> - <cell weightx='0.3'> - <NumberEditor id='fishingOperationNumberField' - constructorParams='this'/> - </cell> - <cell> - <JLabel id='multirigAggregationLabel'/> - </cell> - <cell weightx='0.3'> - <JTextField id='multirigAggregationField' - onKeyReleased='handler.setText(event, "multirigAggregation")'/> - </cell> - </row> + <!-- Numero station / Numéro trait / Numéro de poche --> + <row> + <cell> + <JLabel id='stationNumberLabel'/> + </cell> + <cell weightx='0.3'> + <JTextField id='stationNumberField' + onKeyReleased='handler.setText(event, "stationNumber")'/> + </cell> + <cell> + <JLabel id='fishingOperationNumberLabel'/> + </cell> + <cell weightx='0.3'> + <NumberEditor id='fishingOperationNumberField' + constructorParams='this'/> + </cell> + <cell> + <JLabel id='multirigAggregationLabel'/> + </cell> + <cell weightx='0.3'> + <JTextField id='multirigAggregationField' + onKeyReleased='handler.setText(event, "multirigAggregation")'/> + </cell> + </row> - <!-- Strate d'association / Sous Strate / Localité --> - <row> - <cell> - <JLabel id='strataLabel'/> - </cell> - <cell weightx='0.3'> - <BeanFilterableComboBox id='strataComboBox' - constructorParams='this' - genericType='TuttiLocation'/> - </cell> - <cell> - <JLabel id='subStrataLabel'/> - </cell> - <cell weightx='0.3'> - <BeanFilterableComboBox id='subStrataComboBox' - constructorParams='this' - genericType='TuttiLocation'/> - </cell> - <cell> - <JLabel id='locationLabel'/> - </cell> - <cell weightx='0.3'> - <BeanFilterableComboBox id='locationComboBox' - constructorParams='this' - genericType='TuttiLocation'/> - </cell> - </row> + <!-- Strate d'association / Sous Strate / Localité --> + <row> + <cell> + <JLabel id='strataLabel'/> + </cell> + <cell weightx='0.3'> + <BeanFilterableComboBox id='strataComboBox' + constructorParams='this' + genericType='TuttiLocation'/> + </cell> + <cell> + <JLabel id='subStrataLabel'/> + </cell> + <cell weightx='0.3'> + <BeanFilterableComboBox id='subStrataComboBox' + constructorParams='this' + genericType='TuttiLocation'/> + </cell> + <cell> + <JLabel id='locationLabel'/> + </cell> + <cell weightx='0.3'> + <BeanFilterableComboBox id='locationComboBox' + constructorParams='this' + genericType='TuttiLocation'/> + </cell> + </row> - <!-- début de traine long-lat-date-heure - fin de traine long-lat-date-heure --> - <row> - <cell columns='6'> - <JPanel layout="{new BorderLayout()}"> - <Table id="gearCaracteristicsTable" fill="both" weightx='1' - constraints='BorderLayout.CENTER'> - <row> - <cell> - <JPanel/> - </cell> - <cell> - <JLabel id='gearLatitudeLabel'/> - </cell> - <cell> - <JLabel id='gearLongitudeLabel'/> - </cell> - <cell> - <JLabel id='gearDateLabel'/> - </cell> - <cell> - <JLabel id='gearTimeLabel'/> - </cell> - </row> + <!-- début de traine long-lat-date-heure + fin de traine long-lat-date-heure --> + <row> + <cell columns='6'> + <JPanel layout="{new BorderLayout()}"> + <Table id="gearCaracteristicsTable" fill="both" weightx='1' + constraints='BorderLayout.CENTER'> + <row> + <cell> + <JPanel/> + </cell> + <cell> + <JLabel id='gearLatitudeLabel'/> + </cell> + <cell> + <JLabel id='gearLongitudeLabel'/> + </cell> + <cell> + <JLabel id='gearDateLabel'/> + </cell> + <cell> + <JLabel id='gearTimeLabel'/> + </cell> + </row> - <row> - <cell> - <JLabel id='gearShootingStartLabel'/> - </cell> - <cell weightx='1'> - <JPanel id='gearShootingStartLatitudePanel'> - <NumberEditor id='gearShootingStartLatitudeDDField' - constraints='"DD"' - constructorParams='this'/> - <JPanel layout="{new GridLayout(1,0)}" - constraints='"DMS"'> - <NumberEditor - id='gearShootingStartLatitudeDMSDegreeField' - constructorParams='this' styleClass='degree'/> + <row> + <cell> + <JLabel id='gearShootingStartLabel'/> + </cell> + <cell weightx='1'> + <JPanel id='gearShootingStartLatitudePanel'> + <NumberEditor id='gearShootingStartLatitudeDDField' + constraints='"DD"' + constructorParams='this'/> + <JPanel layout="{new GridLayout(1,0)}" + constraints='"DMS"'> + <NumberEditor + id='gearShootingStartLatitudeDMSDegreeField' + constructorParams='this' styleClass='degree'/> - <NumberEditor - id='gearShootingStartLatitudeDMSMinuteField' - constructorParams='this' styleClass='minute'/> + <NumberEditor + id='gearShootingStartLatitudeDMSMinuteField' + constructorParams='this' styleClass='minute'/> - <NumberEditor - id='gearShootingStartLatitudeDMSSecondField' - constructorParams='this' styleClass='second'/> - </JPanel> - <JPanel layout="{new GridLayout(1,0)}" - constraints='"DMD"'> - <NumberEditor - id='gearShootingStartLatitudeDMDDegreeField' - constructorParams='this' styleClass='degree'/> + <NumberEditor + id='gearShootingStartLatitudeDMSSecondField' + constructorParams='this' styleClass='second'/> + </JPanel> + <JPanel layout="{new GridLayout(1,0)}" + constraints='"DMD"'> + <NumberEditor + id='gearShootingStartLatitudeDMDDegreeField' + constructorParams='this' styleClass='degree'/> - <NumberEditor - id='gearShootingStartLatitudeDMDMinuteField' - constructorParams='this' - styleClass='decimalMinute'/> + <NumberEditor + id='gearShootingStartLatitudeDMDMinuteField' + constructorParams='this' + styleClass='decimalMinute'/> + </JPanel> </JPanel> - </JPanel> - </cell> - <cell weightx='1'> - <JPanel id='gearShootingStartLongitudePanel'> - <NumberEditor id='gearShootingStartLongitudeDDField' - constraints='"DD"' - constructorParams='this'/> - <JPanel layout="{new GridLayout(1,0)}" - constraints='"DMS"'> - <NumberEditor - id='gearShootingStartLongitudeDMSDegreeField' - constructorParams='this' styleClass='degree'/> + </cell> + <cell weightx='1'> + <JPanel id='gearShootingStartLongitudePanel'> + <NumberEditor id='gearShootingStartLongitudeDDField' + constraints='"DD"' + constructorParams='this'/> + <JPanel layout="{new GridLayout(1,0)}" + constraints='"DMS"'> + <NumberEditor + id='gearShootingStartLongitudeDMSDegreeField' + constructorParams='this' styleClass='degree'/> - <NumberEditor - id='gearShootingStartLongitudeDMSMinuteField' - constructorParams='this' styleClass='minute'/> + <NumberEditor + id='gearShootingStartLongitudeDMSMinuteField' + constructorParams='this' styleClass='minute'/> - <NumberEditor - id='gearShootingStartLongitudeDMSSecondField' - constructorParams='this' styleClass='second'/> - </JPanel> - <JPanel layout="{new GridLayout(1,0)}" - constraints='"DMD"'> - <NumberEditor - id='gearShootingStartLongitudeDMDDegreeField' - constructorParams='this' styleClass='degree'/> + <NumberEditor + id='gearShootingStartLongitudeDMSSecondField' + constructorParams='this' styleClass='second'/> + </JPanel> + <JPanel layout="{new GridLayout(1,0)}" + constraints='"DMD"'> + <NumberEditor + id='gearShootingStartLongitudeDMDDegreeField' + constructorParams='this' styleClass='degree'/> - <NumberEditor - id='gearShootingStartLongitudeDMDMinuteField' - constructorParams='this' - styleClass='decimalMinute'/> + <NumberEditor + id='gearShootingStartLongitudeDMDMinuteField' + constructorParams='this' + styleClass='decimalMinute'/> + </JPanel> </JPanel> - </JPanel> - </cell> - <cell> - <JXDatePicker id='gearShootingStartDateField' - onActionPerformed='handler.setDate(event, "gearShootingStartDate")'/> - </cell> - <cell> - <SimpleTimeEditor id='gearShootingStartTimeField' + </cell> + <cell> + <JXDatePicker id='gearShootingStartDateField' + onActionPerformed='handler.setDate(event, "gearShootingStartDate")'/> + </cell> + <cell> + <SimpleTimeEditor id='gearShootingStartTimeField' + constructorParams='this'/> + </cell> + </row> + <row> + <cell> + <JLabel id='gearShootingEndLabel'/> + </cell> + <cell weightx='1'> + <JPanel id='gearShootingEndLatitudePanel'> + <NumberEditor id='gearShootingEndLatitudeDDField' + constraints='"DD"' constructorParams='this'/> - </cell> - </row> - <row> - <cell> - <JLabel id='gearShootingEndLabel'/> - </cell> - <cell weightx='1'> - <JPanel id='gearShootingEndLatitudePanel'> - <NumberEditor id='gearShootingEndLatitudeDDField' - constraints='"DD"' - constructorParams='this'/> - <JPanel layout="{new GridLayout(1,0)}" - constraints='"DMS"'> - <NumberEditor - id='gearShootingEndLatitudeDMSDegreeField' - constructorParams='this' styleClass='degree'/> + <JPanel layout="{new GridLayout(1,0)}" + constraints='"DMS"'> + <NumberEditor + id='gearShootingEndLatitudeDMSDegreeField' + constructorParams='this' styleClass='degree'/> - <NumberEditor - id='gearShootingEndLatitudeDMSMinuteField' - constructorParams='this' styleClass='minute'/> + <NumberEditor + id='gearShootingEndLatitudeDMSMinuteField' + constructorParams='this' styleClass='minute'/> - <NumberEditor - id='gearShootingEndLatitudeDMSSecondField' - constructorParams='this' styleClass='second'/> - </JPanel> - <JPanel layout="{new GridLayout(1,0)}" - constraints='"DMD"'> - <NumberEditor - id='gearShootingEndLatitudeDMDDegreeField' - constructorParams='this' styleClass='degree'/> + <NumberEditor + id='gearShootingEndLatitudeDMSSecondField' + constructorParams='this' styleClass='second'/> + </JPanel> + <JPanel layout="{new GridLayout(1,0)}" + constraints='"DMD"'> + <NumberEditor + id='gearShootingEndLatitudeDMDDegreeField' + constructorParams='this' styleClass='degree'/> - <NumberEditor - id='gearShootingEndLatitudeDMDMinuteField' - constructorParams='this' - styleClass='decimalMinute'/> + <NumberEditor + id='gearShootingEndLatitudeDMDMinuteField' + constructorParams='this' + styleClass='decimalMinute'/> + </JPanel> </JPanel> - </JPanel> - </cell> - <cell weightx='1'> - <JPanel id='gearShootingEndLongitudePanel'> - <NumberEditor id='gearShootingEndLongitudeDDField' - constraints='"DD"' - constructorParams='this'/> - <JPanel layout="{new GridLayout(1,0)}" - constraints='"DMS"'> - <NumberEditor - id='gearShootingEndLongitudeDMSDegreeField' - constructorParams='this' styleClass='degree'/> + </cell> + <cell weightx='1'> + <JPanel id='gearShootingEndLongitudePanel'> + <NumberEditor id='gearShootingEndLongitudeDDField' + constraints='"DD"' + constructorParams='this'/> + <JPanel layout="{new GridLayout(1,0)}" + constraints='"DMS"'> + <NumberEditor + id='gearShootingEndLongitudeDMSDegreeField' + constructorParams='this' styleClass='degree'/> - <NumberEditor - id='gearShootingEndLongitudeDMSMinuteField' - constructorParams='this' styleClass='minute'/> + <NumberEditor + id='gearShootingEndLongitudeDMSMinuteField' + constructorParams='this' styleClass='minute'/> - <NumberEditor - id='gearShootingEndLongitudeDMSSecondField' - constructorParams='this' styleClass='second'/> + <NumberEditor + id='gearShootingEndLongitudeDMSSecondField' + constructorParams='this' styleClass='second'/> + </JPanel> + <JPanel layout="{new GridLayout(1,0)}" + constraints='"DMD"'> + <NumberEditor + id='gearShootingEndLongitudeDMDDegreeField' + constructorParams='this' styleClass='degree'/> + + <NumberEditor + id='gearShootingEndLongitudeDMDMinuteField' + constructorParams='this' + styleClass='decimalMinute'/> + </JPanel> </JPanel> - <JPanel layout="{new GridLayout(1,0)}" - constraints='"DMD"'> - <NumberEditor - id='gearShootingEndLongitudeDMDDegreeField' - constructorParams='this' styleClass='degree'/> + </cell> + <cell> + <JXDatePicker id='gearShootingEndDateField' + onActionPerformed='handler.setDate(event, "gearShootingEndDate")'/> + </cell> + <cell> + <SimpleTimeEditor id='gearShootingEndTimeField' + constructorParams='this'/> + </cell> + </row> - <NumberEditor - id='gearShootingEndLongitudeDMDMinuteField' - constructorParams='this' - styleClass='decimalMinute'/> + <!-- FishingOperation rectiligne / distance chalutee / durée --> + <row> + <cell> + <JLabel/> + </cell> + <cell> + <JCheckBox id='fishingOperationRectiligneCheckBox' + onItemStateChanged='handler.setBoolean(event, "fishingOperationRectiligne")'/> + </cell> + <cell> + <JPanel layout="{new BorderLayout()}"> + <JLabel id='trawlDistanceLabel' + constraints='BorderLayout.WEST'/> + <NumberEditor id='trawlDistanceField' + constraints='BorderLayout.CENTER' + constructorParams='this'/> </JPanel> - </JPanel> - </cell> - <cell> - <JXDatePicker id='gearShootingEndDateField' - onActionPerformed='handler.setDate(event, "gearShootingEndDate")'/> - </cell> - <cell> - <SimpleTimeEditor id='gearShootingEndTimeField' - constructorParams='this'/> - </cell> - </row> + </cell> + <cell> + <JLabel/> + </cell> + <cell> + <JPanel layout="{new BorderLayout()}"> + <JLabel id='durationLabel' + constraints='BorderLayout.WEST'/> + <JTextField id='durationField' + constraints='BorderLayout.CENTER'/> + </JPanel> + </cell> + </row> - <!-- FishingOperation rectiligne / distance chalutee / durée --> - <row> - <cell> - <JLabel/> - </cell> - <cell> - <JCheckBox id='fishingOperationRectiligneCheckBox' - onItemStateChanged='handler.setBoolean(event, "fishingOperationRectiligne")'/> - </cell> - <cell> - <JPanel layout="{new BorderLayout()}"> - <JLabel id='trawlDistanceLabel' - constraints='BorderLayout.WEST'/> - <NumberEditor id='trawlDistanceField' - constraints='BorderLayout.CENTER' - constructorParams='this'/> - </JPanel> - </cell> - <cell> - <JLabel/> - </cell> - <cell> - <JPanel layout="{new BorderLayout()}"> - <JLabel id='durationLabel' - constraints='BorderLayout.WEST'/> - <JTextField id='durationField' - constraints='BorderLayout.CENTER'/> - </JPanel> - </cell> - </row> + <!-- Fishing operation valid / invalid--> + <row> + <cell> + <JToolBar id='fishingOperationValidPanel' + layout='{new BorderLayout()}'> + <JButton id='resetValidStateButton' + constraints='BorderLayout.WEST' + onActionPerformed="model.setFishingOperationValid(null)"/> + <JRadioButton id='fishingOperationResetRadio' + constraints='BorderLayout.EAST'/> + </JToolBar> + </cell> + <cell> + <HBox> + <JRadioButton id='fishingOperationValidRadio' + onActionPerformed='model.setFishingOperationValid(Boolean.TRUE)'/> + <JRadioButton id='fishingOperationInvalidRadio' + onActionPerformed='model.setFishingOperationValid(Boolean.FALSE)'/> + </HBox> + </cell> + <cell columns="4"> + <JPanel/> + </cell> + </row> + </Table> + </JPanel> + </cell> + </row> - <!-- Fishing operation valid / invalid--> - <row> - <cell> - <JToolBar id='fishingOperationValidPanel' - layout='{new BorderLayout()}'> - <JButton id='resetValidStateButton' - constraints='BorderLayout.WEST' - onActionPerformed="model.setFishingOperationValid(null)"/> - <JRadioButton id='fishingOperationResetRadio' - constraints='BorderLayout.EAST'/> - </JToolBar> - </cell> - <cell> - <HBox> - <JRadioButton id='fishingOperationValidRadio' - onActionPerformed='model.setFishingOperationValid(Boolean.TRUE)'/> - <JRadioButton id='fishingOperationInvalidRadio' - onActionPerformed='model.setFishingOperationValid(Boolean.FALSE)'/> - </HBox> - </cell> - <cell columns="4"> - <JPanel/> - </cell> - </row> - </Table> - </JPanel> - </cell> - </row> + <!-- RecorderPerson / Vessel / Gear --> + <row weighty='0.2'> + <cell columns='6'> + <JPanel layout='{new GridLayout(1,0)}'> + <BeanDoubleList id='recorderPersonList' genericType='Person'/> + <Table fill="both" weightx='1' id='traitVesselPanel'> + <row> + <cell anchor='west'> + <JLabel id='vesselLabel'/> + </cell> + <cell weightx="1.0" fill="both"> + <JLabel id='vesselField'/> + </cell> + </row> + <row> + <cell anchor='west'> + <JLabel id='gearLabel'/> + </cell> + <cell> + <BeanFilterableComboBox id='gearComboBox' + constructorParams='this' + genericType='Gear'/> + </cell> + </row> + </Table> + </JPanel> + </cell> + </row> - <!-- RecorderPerson / Vessel / Gear --> - <row weighty='0.2'> - <cell columns='6'> - <JPanel layout='{new GridLayout(1,0)}'> - <BeanDoubleList id='recorderPersonList' genericType='Person'/> - <Table fill="both" weightx='1' id='traitVesselPanel'> - <row> - <cell anchor='west'> - <JLabel id='vesselLabel'/> - </cell> - <cell weightx="1.0" fill="both"> - <JLabel id='vesselField'/> - </cell> - </row> - <row> - <cell anchor='west'> - <JLabel id='gearLabel'/> - </cell> - <cell> - <BeanFilterableComboBox id='gearComboBox' - constructorParams='this' - genericType='Gear'/> - </cell> - </row> - </Table> - </JPanel> - </cell> - </row> - - <!-- Commentaire --> - <row weighty='0.8'> - <cell columns='6'> - <JScrollPane id='commentPane' - onFocusGained='commentField.requestFocus()'> - <JTextArea id='commentField' - onKeyReleased='handler.setText(event, "comment")'/> - </JScrollPane> - </cell> - </row> - </Table> + <!-- Commentaire --> + <row weighty='0.8'> + <cell columns='6'> + <JScrollPane id='commentPane' + onFocusGained='commentField.requestFocus()'> + <JTextArea id='commentField' + onKeyReleased='handler.setText(event, "comment")'/> + </JScrollPane> + </cell> + </row> + </Table> + </JScrollPane> </JXTitledPanel> - <!--</JScrollPane>--> </tab> <tab id='gearUseFeatureTab'> Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java 2013-03-29 15:01:19 UTC (rev 712) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java 2013-03-29 16:30:41 UTC (rev 713) @@ -63,29 +63,9 @@ import org.nuiton.util.decorator.JXPathDecorator; import org.nuiton.validator.bean.simple.SimpleBeanValidator; -import javax.swing.AbstractAction; -import javax.swing.AbstractButton; -import javax.swing.Action; -import javax.swing.DefaultComboBoxModel; -import javax.swing.JComboBox; -import javax.swing.JComponent; -import javax.swing.JDialog; -import javax.swing.JLabel; -import javax.swing.JList; -import javax.swing.JOptionPane; -import javax.swing.JPopupMenu; -import javax.swing.JRootPane; -import javax.swing.JSpinner; -import javax.swing.JTable; -import javax.swing.JTextField; -import javax.swing.KeyStroke; -import javax.swing.ListCellRenderer; -import javax.swing.ListSelectionModel; -import javax.swing.SwingUtilities; +import javax.swing.*; import javax.swing.border.LineBorder; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.TableModelEvent; -import javax.swing.event.TableModelListener; +import javax.swing.event.*; import javax.swing.table.TableCellEditor; import javax.swing.table.TableCellRenderer; import javax.swing.table.TableColumnModel; @@ -405,6 +385,9 @@ } else if (component instanceof AbstractButton) { initButton((AbstractButton) component); + } else if (component instanceof JScrollPane) { + + initScrollPane((JScrollPane) component); } } } @@ -594,6 +577,24 @@ } } + protected void initScrollPane(JScrollPane scrollPane) { + Boolean onlyVerticalScrollable = (Boolean) scrollPane.getClientProperty("onlyVerticalScrollable"); + if (onlyVerticalScrollable != null && onlyVerticalScrollable) { + scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); + scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); + + final JViewport viewport = scrollPane.getViewport(); + viewport.addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + Dimension newDimension = new Dimension(viewport.getExtentSize().width, + viewport.getViewSize().height); + viewport.setViewSize(newDimension); + } + }); + } + } + protected boolean isAutoSelectOnFocus(JComponent comp) { Object selectOnFocus = comp.getClientProperty("selectOnFocus"); return selectOnFocus != null && Boolean.valueOf(selectOnFocus.toString()); @@ -955,4 +956,5 @@ } } } + }
participants (1)
-
kmorin@users.forge.codelutin.com