001// License: GPL. For details, see LICENSE file. 002package org.openstreetmap.josm.data.osm; 003 004/** 005 * An interface used to indicate that a primitive is filterable 006 * @author Taylor Smock 007 * @since 17862 008 */ 009public interface IFilterablePrimitive { 010 /** 011 * Get binary property used internally by the filter mechanism. 012 * @return {@code true} if this object has the "hidden type" flag enabled 013 */ 014 boolean getHiddenType(); 015 016 /** 017 * Get binary property used internally by the filter mechanism. 018 * @return {@code true} if this object has the "disabled type" flag enabled 019 */ 020 boolean getDisabledType(); 021 022 /** 023 * Make the primitive disabled (e.g. if a filter applies). 024 * 025 * To enable the primitive again, use unsetDisabledState. 026 * @param hidden if the primitive should be completely hidden from view or 027 * just shown in gray color. 028 * @return true, any flag has changed; false if you try to set the disabled 029 * state to the value that is already preset 030 */ 031 boolean setDisabledState(boolean hidden); 032 033 /** 034 * Remove the disabled flag from the primitive. 035 * Afterwards, the primitive is displayed normally and can be selected again. 036 * @return {@code true} if a change occurred 037 */ 038 boolean unsetDisabledState(); 039 040 /** 041 * Set binary property used internally by the filter mechanism. 042 * @param isExplicit new "disabled type" flag value 043 */ 044 void setDisabledType(boolean isExplicit); 045 046 /** 047 * Set binary property used internally by the filter mechanism. 048 * @param isExplicit new "hidden type" flag value 049 */ 050 void setHiddenType(boolean isExplicit); 051}