3 import jalview.gui.structurechooser.StructureChooserQuerySource;
4 import jalview.gui.structurechooser.ThreeDBStructureChooserQuerySource;
7 * This inner class provides the data model for the structure filter combo-box
12 public class FilterOption
20 private boolean addSeparatorAfter;
22 private StructureChooserQuerySource querySource;
25 * Model for structure filter option
28 * - the name of the Option
30 * - the value of the option
32 * - the category of the filter option
33 * @param addSeparatorAfter
34 * - if true, a horizontal separator is rendered immediately after
35 * this filter option, otherwise
36 * @param structureChooserQuerySource
37 * - the query source that actions this filter
39 public FilterOption(String name, String value, String view,
40 boolean addSeparatorAfter,
41 StructureChooserQuerySource structureChooserQuerySource)
46 this.querySource = structureChooserQuerySource;
47 this.addSeparatorAfter = addSeparatorAfter;
50 public String getName()
55 public void setName(String name)
60 public String getValue()
65 public void setValue(String value)
70 public String getView()
75 public void setView(String view)
81 public String toString()
86 public boolean isAddSeparatorAfter()
88 return addSeparatorAfter;
91 public void setAddSeparatorAfter(boolean addSeparatorAfter)
93 this.addSeparatorAfter = addSeparatorAfter;
96 public StructureChooserQuerySource getQuerySource()
102 public boolean equals(Object obj)
104 if (obj instanceof FilterOption)
106 FilterOption o = (FilterOption) obj;
107 return o.name.equals(name) && o.querySource == querySource
108 && o.value.equals(value) && o.view == view;
112 return super.equals(obj);
117 public int hashCode()
119 return ("" + name + ":" + value).hashCode()
120 + (view != null ? view.hashCode() : 0)
121 + (querySource != null ? querySource.hashCode() : 0);