updated heigth
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/speciesdiscovery@130090 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
2431faf033
commit
7931e76c3b
|
@ -19,7 +19,7 @@ import com.extjs.gxt.ui.client.widget.layout.CardLayout;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class AdvancedSearchPanelManager extends ContentPanel implements AdvancedSearchInterface{
|
public class AdvancedSearchPanelManager extends ContentPanel implements AdvancedSearchInterface{
|
||||||
|
|
||||||
private static AdvancedSearchPanelManager instance;
|
private static AdvancedSearchPanelManager instance;
|
||||||
private BoundsFilter boundsFilter;
|
private BoundsFilter boundsFilter;
|
||||||
private DateFilter dateFilter;
|
private DateFilter dateFilter;
|
||||||
|
@ -40,7 +40,7 @@ public class AdvancedSearchPanelManager extends ContentPanel implements Advanced
|
||||||
}
|
}
|
||||||
|
|
||||||
private AdvancedSearchPanelManager(){
|
private AdvancedSearchPanelManager(){
|
||||||
|
|
||||||
boundsFilter = new BoundsFilter();
|
boundsFilter = new BoundsFilter();
|
||||||
dateFilter = new DateFilter();
|
dateFilter = new DateFilter();
|
||||||
regionFilter = new RegionFilter();
|
regionFilter = new RegionFilter();
|
||||||
|
@ -48,7 +48,7 @@ public class AdvancedSearchPanelManager extends ContentPanel implements Advanced
|
||||||
synonymsFilter = new SynonymsFilter();
|
synonymsFilter = new SynonymsFilter();
|
||||||
unfoldFilter = new UnfoldFilter();
|
unfoldFilter = new UnfoldFilter();
|
||||||
// classificationFilter = new ClassificationFilter();
|
// classificationFilter = new ClassificationFilter();
|
||||||
|
|
||||||
init();
|
init();
|
||||||
// listAdvacedPanels.add(classificationFilter.getName());
|
// listAdvacedPanels.add(classificationFilter.getName());
|
||||||
listAdvacedPanels.add(dataSourceFilter.getName());
|
listAdvacedPanels.add(dataSourceFilter.getName());
|
||||||
|
@ -61,30 +61,26 @@ public class AdvancedSearchPanelManager extends ContentPanel implements Advanced
|
||||||
}
|
}
|
||||||
|
|
||||||
private void init() {
|
private void init() {
|
||||||
|
|
||||||
setLayout(cardLayout);
|
setLayout(cardLayout);
|
||||||
setHeaderVisible(false);
|
setHeaderVisible(false);
|
||||||
|
setSize(925, 95);
|
||||||
setSize(925, 90);
|
|
||||||
|
|
||||||
|
|
||||||
setBodyBorder(false);
|
setBodyBorder(false);
|
||||||
|
|
||||||
add(boundsFilter.getPanel());
|
add(boundsFilter.getPanel());
|
||||||
add(dateFilter.getPanel());
|
add(dateFilter.getPanel());
|
||||||
add(dataSourceFilter.getPanel());
|
add(dataSourceFilter.getPanel());
|
||||||
add(regionFilter.getPanel());
|
add(regionFilter.getPanel());
|
||||||
add(synonymsFilter.getPanel());
|
add(synonymsFilter.getPanel());
|
||||||
add(unfoldFilter.getPanel());
|
add(unfoldFilter.getPanel());
|
||||||
|
|
||||||
cardLayout.setActiveItem(boundsFilter.getPanel());
|
cardLayout.setActiveItem(boundsFilter.getPanel());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public List<String> getListAdvancedSearchPanels(){
|
public List<String> getListAdvancedSearchPanels(){
|
||||||
return listAdvacedPanels;
|
return listAdvacedPanels;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setActivePanel(String name){
|
public void setActivePanel(String name){
|
||||||
if(name.equals(AdvancedSearchPanelEnum.BOUNDS.getLabel()))
|
if(name.equals(AdvancedSearchPanelEnum.BOUNDS.getLabel()))
|
||||||
cardLayout.setActiveItem(boundsFilter.getPanel());
|
cardLayout.setActiveItem(boundsFilter.getPanel());
|
||||||
|
@ -101,13 +97,13 @@ public class AdvancedSearchPanelManager extends ContentPanel implements Advanced
|
||||||
// else if(name.equals(AdvancedSearchPanelEnum.CLASSIFICATION.getLabel()))
|
// else if(name.equals(AdvancedSearchPanelEnum.CLASSIFICATION.getLabel()))
|
||||||
// cardLayout.setActiveItem(classificationFilter.getPanel());
|
// cardLayout.setActiveItem(classificationFilter.getPanel());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public ContentPanel getPanel(){
|
public ContentPanel getPanel(){
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public NumberField getUpperBoundLatitudeField() {
|
public NumberField getUpperBoundLatitudeField() {
|
||||||
return boundsFilter.getUpperBoundLatitudeField();
|
return boundsFilter.getUpperBoundLatitudeField();
|
||||||
}
|
}
|
||||||
|
@ -123,7 +119,7 @@ public class AdvancedSearchPanelManager extends ContentPanel implements Advanced
|
||||||
public NumberField getLowerBoundLongitudeField() {
|
public NumberField getLowerBoundLongitudeField() {
|
||||||
return boundsFilter.getLowerBoundLongitudeField();
|
return boundsFilter.getLowerBoundLongitudeField();
|
||||||
}
|
}
|
||||||
|
|
||||||
public DateField getFromDate() {
|
public DateField getFromDate() {
|
||||||
return dateFilter.getFromDate();
|
return dateFilter.getFromDate();
|
||||||
}
|
}
|
||||||
|
@ -136,29 +132,29 @@ public class AdvancedSearchPanelManager extends ContentPanel implements Advanced
|
||||||
dataSourceFilter.loadDataSource(result);
|
dataSourceFilter.loadDataSource(result);
|
||||||
synonymsFilter.loadDataSource(result);
|
synonymsFilter.loadDataSource(result);
|
||||||
unfoldFilter.loadDataSource(result);
|
unfoldFilter.loadDataSource(result);
|
||||||
|
|
||||||
listDataSources = new HashMap<String, DataSourceModel>();
|
listDataSources = new HashMap<String, DataSourceModel>();
|
||||||
|
|
||||||
//fill hash
|
//fill hash
|
||||||
for(DataSourceModel dsm: result){
|
for(DataSourceModel dsm: result){
|
||||||
listDataSources.put(dsm.getId(), dsm);
|
listDataSources.put(dsm.getId(), dsm);
|
||||||
}
|
}
|
||||||
|
|
||||||
setAvailableInfoAdvancedFilters(result);
|
setAvailableInfoAdvancedFilters(result);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setAvailableInfoAdvancedFilters(List<DataSourceModel> result) {
|
private void setAvailableInfoAdvancedFilters(List<DataSourceModel> result) {
|
||||||
|
|
||||||
for(DataSourceModel dsm: result){
|
for(DataSourceModel dsm: result){
|
||||||
for (DataSourceCapability dsc : dsm.getListCapabilities()) {
|
for (DataSourceCapability dsc : dsm.getListCapabilities()) {
|
||||||
|
|
||||||
ArrayList<SpeciesCapability> properties = dsc.getListFilters();
|
ArrayList<SpeciesCapability> properties = dsc.getListFilters();
|
||||||
|
|
||||||
for (SpeciesCapability capabilityEnum : properties) {
|
for (SpeciesCapability capabilityEnum : properties) {
|
||||||
|
|
||||||
// System.out.println("capability " + capabilityEnum.toString());
|
// System.out.println("capability " + capabilityEnum.toString());
|
||||||
|
|
||||||
if(capabilityEnum.equals(SpeciesCapability.FROMDATE))
|
if(capabilityEnum.equals(SpeciesCapability.FROMDATE))
|
||||||
dateFilter.addAvailablePlugInfo(dsm, SpeciesCapability.FROMDATE);
|
dateFilter.addAvailablePlugInfo(dsm, SpeciesCapability.FROMDATE);
|
||||||
else if(capabilityEnum.equals(SpeciesCapability.LOWERBOUND))
|
else if(capabilityEnum.equals(SpeciesCapability.LOWERBOUND))
|
||||||
|
@ -174,20 +170,20 @@ public class AdvancedSearchPanelManager extends ContentPanel implements Advanced
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCurrentCapability(SpeciesCapability capability){
|
public void setCurrentCapability(SpeciesCapability capability){
|
||||||
|
|
||||||
this.currentSelectedCapability = capability;
|
this.currentSelectedCapability = capability;
|
||||||
|
|
||||||
this.capabilityChange();
|
this.capabilityChange();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setVisibleAllPanel(boolean bool){
|
public void setVisibleAllPanel(boolean bool){
|
||||||
|
|
||||||
boundsFilter.getPanel().setVisible(bool);
|
boundsFilter.getPanel().setVisible(bool);
|
||||||
dateFilter.getPanel().setVisible(bool);
|
dateFilter.getPanel().setVisible(bool);
|
||||||
dataSourceFilter.getPanel().setVisible(bool);
|
dataSourceFilter.getPanel().setVisible(bool);
|
||||||
|
@ -195,51 +191,51 @@ public class AdvancedSearchPanelManager extends ContentPanel implements Advanced
|
||||||
synonymsFilter.getPanel().setVisible(bool);
|
synonymsFilter.getPanel().setVisible(bool);
|
||||||
unfoldFilter.getPanel().setVisible(bool);
|
unfoldFilter.getPanel().setVisible(bool);
|
||||||
// classificationFilter.getPanel().setVisible(bool);
|
// classificationFilter.getPanel().setVisible(bool);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void capabilityChange() {
|
private void capabilityChange() {
|
||||||
|
|
||||||
// dataSourceFilter.disableAllCheck();
|
// dataSourceFilter.disableAllCheck();
|
||||||
dataSourceFilter.enableCheckByCapability(this.currentSelectedCapability);
|
dataSourceFilter.enableCheckByCapability(this.currentSelectedCapability);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<DataSourceModel> getCheckedDataSources() {
|
public List<DataSourceModel> getCheckedDataSources() {
|
||||||
return dataSourceFilter.getCheckedGroupList();
|
return dataSourceFilter.getCheckedGroupList();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<DataSourceModel> getCheckedDataSourceForSynonyms() {
|
public List<DataSourceModel> getCheckedDataSourceForSynonyms() {
|
||||||
return synonymsFilter.getCheckedGroupList();
|
return synonymsFilter.getCheckedGroupList();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public HashMap<String, DataSourceModel> findDataSourceByCapability(SpeciesCapability capability) {
|
public HashMap<String, DataSourceModel> findDataSourceByCapability(SpeciesCapability capability) {
|
||||||
|
|
||||||
if(capability.getName().compareTo(SpeciesCapability.RESULTITEM.getName())==0){
|
if(capability.getName().compareTo(SpeciesCapability.RESULTITEM.getName())==0){
|
||||||
return dataSourceFilter.getHashMapDataSourceOccurrences();
|
return dataSourceFilter.getHashMapDataSourceOccurrences();
|
||||||
}
|
}
|
||||||
else if(capability.getName().compareTo(SpeciesCapability.TAXONOMYITEM.getName())==0){
|
else if(capability.getName().compareTo(SpeciesCapability.TAXONOMYITEM.getName())==0){
|
||||||
|
|
||||||
return dataSourceFilter.getHashMapDataSourceClassification();
|
return dataSourceFilter.getHashMapDataSourceClassification();
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public DataSourceModel findDataSourceByCapabilityAndName(SpeciesCapability capability, String dataSourceName) {
|
public DataSourceModel findDataSourceByCapabilityAndName(SpeciesCapability capability, String dataSourceName) {
|
||||||
|
|
||||||
HashMap<String, DataSourceModel> hashDataSource = findDataSourceByCapability(capability);
|
HashMap<String, DataSourceModel> hashDataSource = findDataSourceByCapability(capability);
|
||||||
|
|
||||||
if(hashDataSource!=null)
|
if(hashDataSource!=null)
|
||||||
return hashDataSource.get(dataSourceName);
|
return hashDataSource.get(dataSourceName);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public SpeciesCapability getCurrentSelectedCapability() {
|
public SpeciesCapability getCurrentSelectedCapability() {
|
||||||
return currentSelectedCapability;
|
return currentSelectedCapability;
|
||||||
|
@ -248,11 +244,11 @@ public class AdvancedSearchPanelManager extends ContentPanel implements Advanced
|
||||||
public List<DataSourceModel> getCheckedDataSourceForUnfold() {
|
public List<DataSourceModel> getCheckedDataSourceForUnfold() {
|
||||||
return unfoldFilter.getCheckedGroupList();
|
return unfoldFilter.getCheckedGroupList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disableFilterForSearchType(SearchType type){
|
public void disableFilterForSearchType(SearchType type){
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
|
||||||
case BY_COMMON_NAME:
|
case BY_COMMON_NAME:
|
||||||
unfoldFilter.activeChecks(false);
|
unfoldFilter.activeChecks(false);
|
||||||
break;
|
break;
|
||||||
|
@ -261,7 +257,7 @@ public class AdvancedSearchPanelManager extends ContentPanel implements Advanced
|
||||||
unfoldFilter.activeChecks(true);
|
unfoldFilter.activeChecks(true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue