edu.umd.cfar.lamp.viper.gui.core
Interface NodeVisibilityManager

All Superinterfaces:
ViperSelection

public interface NodeVisibilityManager
extends ViperSelection

Checks to see if the given ViPER data node is currently visible according to the filters. Note that hiding applies down the heirarchy: a Config node can be marked as interesting even if none of its kids are, but an attribute won't be interesting if its containing descriptor or describing config isn't.

Author:
David Mihalcik

Field Summary
static int HIDDEN
           
static int LOCKED
           
static int VISIBLE
           
 
Method Summary
 int getAttrConfigVisibility(AttrConfig ac)
          Gets the visibility level of the attribute type.
 int getAttributeVisibility(Attribute a)
          Gets the visibility level of the attribute.
 int getConfigVisibility(Config c)
          Gets the visibility level of the descriptor class.
 int getDescriptorVisibility(Descriptor d)
          Gets the visibility level of the descriptor.
 AttrConfig[] getHidingAttrConfigs()
          Gets the hidden attribute configs.
 Attribute[] getHidingAttributes()
          Gets the specifically hidden attributes.
 Config[] getHidingConfigs()
          Gets the descriptor types that are currently hidden.
 Descriptor[] getHidingDescriptors()
          Gets the specifically hidden descriptor instances.
 int[] getHidingTypes()
          Gets the types of descriptors that are hidden.
 int getTypeVisibility(int type)
          Gets the visibility level of the descriptor class.
 boolean setVisibilityByAttrConfig(AttrConfig acfg, int visible)
          Sets the visibility of the given attribute definition.
 boolean setVisibilityByAttribute(Attribute a, int visible)
          Sets the visibility of the given attribute.
 boolean setVisibilityByConfig(Config cfg, int visible)
          Sets the visibility of the given class of descriptors.
 boolean setVisibilityByDescriptor(Descriptor desc, int visible)
          Sets the visibility of the given descriptor.
 boolean setVisibilityByType(int type, int visible)
          Sets the visibility of the type of config.
 boolean showAll()
          Reveal all the hidden nodes.
 
Methods inherited from interface edu.umd.cfar.lamp.viper.util.ViperSelection
addChangeListener, getChangeListeners, isEmpty, isSelected, removeChangeListener
 

Field Detail

HIDDEN

public static final int HIDDEN
See Also:
Constant Field Values

LOCKED

public static final int LOCKED
See Also:
Constant Field Values

VISIBLE

public static final int VISIBLE
See Also:
Constant Field Values
Method Detail

showAll

public boolean showAll()
Reveal all the hidden nodes.

Returns:
if this changed the set of hidden nodes

getHidingTypes

public int[] getHidingTypes()
Gets the types of descriptors that are hidden.

Returns:
the types, e.g. Config.CONTENT

getHidingConfigs

public Config[] getHidingConfigs()
Gets the descriptor types that are currently hidden. This doesn't include those configs whose type is hidden.

Returns:
the descriptor types that are hidden

getHidingAttrConfigs

public AttrConfig[] getHidingAttrConfigs()
Gets the hidden attribute configs. This won't return any of the ones whose parents are hidden.

Returns:
the specifically marked as hidden attribute types

getHidingDescriptors

public Descriptor[] getHidingDescriptors()
Gets the specifically hidden descriptor instances. This won't return any of the ones whose config is marked as hidden.

Returns:
the hidden descriptors.

getHidingAttributes

public Attribute[] getHidingAttributes()
Gets the specifically hidden attributes. This won't return any whose attribute config or parent descriptor is hidden.

Returns:
the hidden attributes

getTypeVisibility

public int getTypeVisibility(int type)
Gets the visibility level of the descriptor class.

Returns:
the visibility of the requested item

getConfigVisibility

public int getConfigVisibility(Config c)
Gets the visibility level of the descriptor class.

Returns:
the visibility of the requested item

getAttrConfigVisibility

public int getAttrConfigVisibility(AttrConfig ac)
Gets the visibility level of the attribute type.

Returns:
the visibility of the requested item

getDescriptorVisibility

public int getDescriptorVisibility(Descriptor d)
Gets the visibility level of the descriptor.

Returns:
the visibility of the requested item

getAttributeVisibility

public int getAttributeVisibility(Attribute a)
Gets the visibility level of the attribute.

Returns:
the visibility of the requested item

setVisibilityByType

public boolean setVisibilityByType(int type,
                                   int visible)
Sets the visibility of the type of config.

Parameters:
type - the type, e.g. Config.OBJECT
visible - false for hidden
Returns:
if the set of hiders changed

setVisibilityByConfig

public boolean setVisibilityByConfig(Config cfg,
                                     int visible)
Sets the visibility of the given class of descriptors.

Parameters:
cfg - the descriptor class
visible - false to hide
Returns:
if the set of hiders changed

setVisibilityByDescriptor

public boolean setVisibilityByDescriptor(Descriptor desc,
                                         int visible)
Sets the visibility of the given descriptor.

Parameters:
desc - the descriptor instance
visible - false to hide
Returns:
if the set of hiders changed

setVisibilityByAttrConfig

public boolean setVisibilityByAttrConfig(AttrConfig acfg,
                                         int visible)
Sets the visibility of the given attribute definition.

Parameters:
acfg - the set of attributes to hide
visible - false to hide
Returns:
if the set of hiders changed

setVisibilityByAttribute

public boolean setVisibilityByAttribute(Attribute a,
                                        int visible)
Sets the visibility of the given attribute.

Parameters:
a - the attribute to hide or reveal
visible - false to hide
Returns:
if the set of hiders changed