Package net.ontopia.topicmaps.viz
Class VizTopicMapConfigurationManager
- java.lang.Object
-
- net.ontopia.topicmaps.viz.VizConfigurationManager
-
- net.ontopia.topicmaps.viz.VizTopicMapConfigurationManager
-
public class VizTopicMapConfigurationManager extends VizConfigurationManager
INTERNAL: Stores and manages configuration. The configuration information is stored as a topic map.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_MAX_TOPIC_NAME_LENGTHstatic ColorDEFAULT_PANEL_BACKGROUND_COLOURstatic intEDGE_ORIENTEDstatic intEXPAND_NODEstatic intFILTER_DEFAULTstatic intFILTER_INstatic intFILTER_OUTstatic intGO_TO_TOPICstatic intLOOSE_ASSOCIATION_SCOPESstatic intNODE_ORIENTEDprotected static StringNULL_TOPICprotected TopicIFnullTopicstatic intSET_FOCUS_NODEstatic intSHOW_ALL_ASSOCIATION_SCOPESstatic intSTRICT_ASSOCIATION_SCOPES-
Fields inherited from class net.ontopia.topicmaps.viz.VizConfigurationManager
BASE, builder, DEFAULT_ASSOCIATION_TYPE, DEFAULT_TYPE, defaultAssociationType, defaultType, GENERAL_TOPIC, generalTopic, topicmap, UNTYPED, untypedTopic
-
-
Constructor Summary
Constructors Constructor Description VizTopicMapConfigurationManager()Creates an empty configuration manager where everything is set to default.VizTopicMapConfigurationManager(File tmfile)Constructor initializes the configuration by loading a topic map from the URL given in the parameter.VizTopicMapConfigurationManager(URL tmurl)Constructor initializes the configuration by loading a topic map from the URL given in the parameter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearStartTopic()voidclearTopic(TopicIF aTopic)Clear the start topic if it was set.booleandefaultOverrides(boolean isTopicType)returns true iff the default type is set to verride autogenerated values.CollectiongetAssociationScopeFilter()intgetAssociationScopeFilterStrictness()ColorgetAssociationTypeColor(TopicIF type)TopicIFgetAssociationTypeColorAutogeneratedTopic()TopicIFgetAssociationTypeColorTopic()FontgetAssociationTypeFont(TopicIF type)TopicIFgetAssociationTypeFontTopic()intgetAssociationTypeLineWeight(TopicIF selectedType)TopicIFgetAssociationTypeLineWeightTopic()intgetAssociationTypeShape(TopicIF selectedType)TopicIFgetAssociationTypeShapeTopic()FontgetDefaultFont()intgetGeneralDoubleClick()intgetGeneralLocalityAlgorithm()intgetGeneralMotionKillerDelay()intgetGeneralSingleClick()intgetMaxTopicNameLength()TopicIFgetOverrideColorsTopic()ColorgetPanelBackgroundColour()TopicIFgetScopingTopic(TopicMapIF graphtm)INTERNAL: Finds the scoping topic in the given topic map, and returns it.TopicIFgetScopingTopicHolder()INTERNAL: Finds the scoping topic in the given topic map, and returns it.protected TopicIFgetSourceLocator()TopicIFgetStartTopic(TopicMapIF graphtm)INTERNAL: Finds the start topic in the given topic map, and returns it.protected TopicIFgetSubject()protected TopicIFgetSubjectIndicator()ColorgetTopicTypeColor(TopicIF type)TopicIFgetTopicTypeColorAutogeneratedTopic()TopicIFgetTopicTypeColorTopic()TopicIFgetTopicTypeExcludedTopic()TopicIFgetTopicTypeFontTopic()TopicIFgetTopicTypeIconTopic()intgetTopicTypeShape(TopicIF topictype)intgetTopicTypeShapePadding(TopicIF selectedType)TopicIFgetTopicTypeShapePaddingTopic()TopicIFgetTopicTypeShapeTopic()VizTopicTypePriorityConfigManagergetTTPriorityManager()FontgetTypeFont(TopicIF type)IcongetTypeIcon(TopicIF type)StringgetTypeIconFilename(TopicIF type)TopicIFgetTypeInstanceType()intgetTypeVisibility(TopicIF selectedType)TopicIFgetTypeVisibleTopic()booleangetUsesDefault(TopicIF type, boolean isTopicType)returns true iff the given topic type is set to use default when it doesn't its own colour.booleanhasOccurrence(TopicIF topictype, TopicIF type)protected voidinit()booleanisAssociationTypeVisible(TopicIF assoctype)booleanisInAssociationScopeFilter(TopicIF scope)booleanisMotionKillerEnabled()booleanisTopicTypeVisible(TopicIF assoctype)booleanisTypeExcluded(TopicIF aType)booleanisVisible(AssociationIF assoc)booleanisVisible(AssociationRoleIF role)booleanisVisible(TopicIF topic)ColorlookupColor(TopicIF type, TopicIF occtype)Finds the color for this association or topic type that is stored in the topic map.booleanlookupVisible(TopicIF type, TopicIF occtype, TopicIF defType)booleanmatchesFilter(Collection scope)Checks if a given scope matches the association scope filter.booleanmatchesFilter(Collection scope, Collection filter)Checks if a given scope (collection of topics) matches a given filter (another collection of topics).FontparseFont(String fontString)voidsetAssociationScopeFilterStrictness(int strictness)voidsetAssociationTypeLineWeight(TopicIF type, int i, TopicMapView view)Sets the line weight of the given association 'type' and updates 'view' accordingly.voidsetAssociationTypeShape(TopicIF type, int i)voidsetAssociationTypeShape(TopicIF type, int i, TopicMapView view)Sets the shape of the given association 'type' and updates 'view' accordingly.voidsetAssociationTypeVisible(TopicIF type, boolean visible, TopicMapView view)Sets the given association 'type' to be visible and updates 'view' accordingly.voidsetAssociationTypeVisible(TopicIF type, int visibility, TopicMapView view)Sets the given association 'type' be either filtered in, filtered out or to use the filter setting of the default type.voidsetColorToDefault(TopicIF type, boolean topicType, TopicMapView view)Sets the color of a given topic/association 'type' to the default value and updates 'view' accordingly.voidsetFontToDefault(TopicIF type, boolean topicType, TopicMapView view)Sets the font of a given topic/association 'type' to the default value and updates 'view' accordingly.voidsetGeneralDoubleClick(int anAction)voidsetGeneralLocalityAlgorithm(int anAction)voidsetGeneralSingleClick(int anAction)voidsetInAssociationScopeFilter(TopicIF scope, boolean included)voidsetMaxTopicNameLength(int length)voidsetMotionKillerDelay(int seconds)voidsetMotionKillerEnabled(boolean value)voidsetPanelBackgroundColour(Color aColor)voidsetScopingTopic(TopicIF scope)voidsetStartTopic(TopicIF extstart)Sets the start topic of the vizualization.protected voidsetTopicReference(TopicIF topic, TopicIF extstart, String base)voidsetTopicTypeShape(TopicIF type, int i)voidsetTopicTypeShape(TopicIF type, int i, TopicMapView view)Sets the shape of the given topic 'type' and updates 'view' accordingly.voidsetTopicTypeShapePadding(TopicIF type, int i)voidsetTopicTypeShapePadding(TopicIF type, int i, TopicMapView view)Sets the shape padding of the given topic 'type' and updates 'view' accordingly.voidsetTypeColor(TopicIF type, Color c)voidsetTypeColor(TopicIF type, Color c, TopicMapView view)Sets the colour of a given 'type' and updates 'view' accordingly.voidsetTypeExcluded(TopicIF type)voidsetTypeExcluded(TopicIF type, TopicMapView view)Sets the given topic 'type' to be excluded and updates 'view' accordingly.voidsetTypeFont(TopicIF type, Font font)voidsetTypeFont(TopicIF type, Font font, TopicMapView view)Sets the font of the given topic/association 'type' and updates 'view' accordingly.voidsetTypeIconFilename(TopicIF type, String string)voidsetTypeIconFilename(TopicIF type, String string, TopicMapView view)Sets the name of the icon file (optional) of the given topic 'type' and updates 'view' accordingly.voidsetTypeIncluded(TopicIF type)voidsetTypeIncluded(TopicIF type, TopicMapView view)Sets the given topic 'type' to be included and updates 'view' accordingly.voidsetTypeLineWeight(TopicIF type, int i)voidsetTypeVisibility(TopicIF type, int visibility, TopicMapView view)Sets the given topic 'type' be either filtered in, filtered out or to use the filter setting of the default type.voidsetTypeVisible(TopicIF type, boolean visible)voidsetTypeVisible(TopicIF type, boolean visible, TopicMapView view)Sets the given topic 'type' to be visible and updates 'view' accordingly.voidsetTypeVisible(TopicIF type, int visibility)booleanshouldDisplayRoleHoverHelp()voidshouldDisplayRoleHoverHelp(boolean value)booleanshouldDisplayScopedAssociationNames()voidshouldDisplayScopedAssociationNames(boolean value)-
Methods inherited from class net.ontopia.topicmaps.viz.VizConfigurationManager
getConfigTopic, getOccurrence, getOccurrenceValue, getOccurrenceValue, getOccurrenceValue, getTopic, getTopic, getTopicMap, removeOccurence, removeOccurrence, save, setOccurenceValue, setOccurenceValue, setOccurrenceValue
-
-
-
-
Field Detail
-
DEFAULT_PANEL_BACKGROUND_COLOUR
public static final Color DEFAULT_PANEL_BACKGROUND_COLOUR
-
NODE_ORIENTED
public static final int NODE_ORIENTED
- See Also:
- Constant Field Values
-
EDGE_ORIENTED
public static final int EDGE_ORIENTED
- See Also:
- Constant Field Values
-
EXPAND_NODE
public static final int EXPAND_NODE
- See Also:
- Constant Field Values
-
SET_FOCUS_NODE
public static final int SET_FOCUS_NODE
- See Also:
- Constant Field Values
-
GO_TO_TOPIC
public static final int GO_TO_TOPIC
- See Also:
- Constant Field Values
-
DEFAULT_MAX_TOPIC_NAME_LENGTH
public static final int DEFAULT_MAX_TOPIC_NAME_LENGTH
- See Also:
- Constant Field Values
-
SHOW_ALL_ASSOCIATION_SCOPES
public static final int SHOW_ALL_ASSOCIATION_SCOPES
- See Also:
- Constant Field Values
-
LOOSE_ASSOCIATION_SCOPES
public static final int LOOSE_ASSOCIATION_SCOPES
- See Also:
- Constant Field Values
-
STRICT_ASSOCIATION_SCOPES
public static final int STRICT_ASSOCIATION_SCOPES
- See Also:
- Constant Field Values
-
NULL_TOPIC
protected static final String NULL_TOPIC
- See Also:
- Constant Field Values
-
nullTopic
protected TopicIF nullTopic
-
FILTER_DEFAULT
public static final int FILTER_DEFAULT
- See Also:
- Constant Field Values
-
FILTER_OUT
public static final int FILTER_OUT
- See Also:
- Constant Field Values
-
FILTER_IN
public static final int FILTER_IN
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
VizTopicMapConfigurationManager
public VizTopicMapConfigurationManager(File tmfile) throws IOException
Constructor initializes the configuration by loading a topic map from the URL given in the parameter.- Throws:
IOException
-
VizTopicMapConfigurationManager
public VizTopicMapConfigurationManager(URL tmurl) throws IOException
Constructor initializes the configuration by loading a topic map from the URL given in the parameter.- Throws:
IOException
-
VizTopicMapConfigurationManager
public VizTopicMapConfigurationManager()
Creates an empty configuration manager where everything is set to default.
-
-
Method Detail
-
init
protected void init()
- Overrides:
initin classVizConfigurationManager
-
getOverrideColorsTopic
public TopicIF getOverrideColorsTopic()
-
getTopicTypeShapeTopic
public TopicIF getTopicTypeShapeTopic()
-
getAssociationTypeColorAutogeneratedTopic
public TopicIF getAssociationTypeColorAutogeneratedTopic()
-
getTopicTypeColorAutogeneratedTopic
public TopicIF getTopicTypeColorAutogeneratedTopic()
-
getAssociationTypeShapeTopic
public TopicIF getAssociationTypeShapeTopic()
-
getTopicTypeShapePaddingTopic
public TopicIF getTopicTypeShapePaddingTopic()
-
getTopicTypeIconTopic
public TopicIF getTopicTypeIconTopic()
-
getTopicTypeFontTopic
public TopicIF getTopicTypeFontTopic()
-
getTopicTypeColorTopic
public TopicIF getTopicTypeColorTopic()
-
getAssociationTypeColorTopic
public TopicIF getAssociationTypeColorTopic()
-
getTypeVisibleTopic
public TopicIF getTypeVisibleTopic()
-
getTopicTypeExcludedTopic
public TopicIF getTopicTypeExcludedTopic()
-
getAssociationTypeLineWeightTopic
public TopicIF getAssociationTypeLineWeightTopic()
-
getAssociationTypeFontTopic
public TopicIF getAssociationTypeFontTopic()
-
getTTPriorityManager
public VizTopicTypePriorityConfigManager getTTPriorityManager()
-
defaultOverrides
public boolean defaultOverrides(boolean isTopicType)
returns true iff the default type is set to verride autogenerated values.- Parameters:
isTopicType- Set to true to check for the association default type, and false for the topic default type.
-
getUsesDefault
public boolean getUsesDefault(TopicIF type, boolean isTopicType)
returns true iff the given topic type is set to use default when it doesn't its own colour.- Parameters:
type- The type to check.isTopicType-
-
getTopicTypeShape
public int getTopicTypeShape(TopicIF topictype)
-
getDefaultFont
public Font getDefaultFont()
-
setTypeColor
public void setTypeColor(TopicIF type, Color c, TopicMapView view)
Sets the colour of a given 'type' and updates 'view' accordingly. If the type is defaultType/defaultTopicType, all topic/association types that have no explicit colour setting are updated with this colour.
-
setColorToDefault
public void setColorToDefault(TopicIF type, boolean topicType, TopicMapView view)
Sets the color of a given topic/association 'type' to the default value and updates 'view' accordingly.
-
setTypeVisibility
public void setTypeVisibility(TopicIF type, int visibility, TopicMapView view)
Sets the given topic 'type' be either filtered in, filtered out or to use the filter setting of the default type. For defaultType, updates all types with no explicit setting. Updates view accordingly.
-
setAssociationTypeVisible
public void setAssociationTypeVisible(TopicIF type, int visibility, TopicMapView view)
Sets the given association 'type' be either filtered in, filtered out or to use the filter setting of the default type. For defaultAssociationType, updates all types with no explicit setting. Updates view accordingly.
-
setTypeVisible
public void setTypeVisible(TopicIF type, boolean visible, TopicMapView view)
Sets the given topic 'type' to be visible and updates 'view' accordingly. For defaultType, updates all types with no explicit setting.
-
setAssociationTypeVisible
public void setAssociationTypeVisible(TopicIF type, boolean visible, TopicMapView view)
Sets the given association 'type' to be visible and updates 'view' accordingly. For defaultAssociationType, updates all types with no explicit setting.
-
setTopicTypeShape
public void setTopicTypeShape(TopicIF type, int i, TopicMapView view)
Sets the shape of the given topic 'type' and updates 'view' accordingly. For defaultType, updates all types with no explicit setting.
-
setAssociationTypeShape
public void setAssociationTypeShape(TopicIF type, int i, TopicMapView view)
Sets the shape of the given association 'type' and updates 'view' accordingly. For defaultType, updates all types with no explicit setting.
-
setFontToDefault
public void setFontToDefault(TopicIF type, boolean topicType, TopicMapView view)
Sets the font of a given topic/association 'type' to the default value and updates 'view' accordingly.
-
setTypeFont
public void setTypeFont(TopicIF type, Font font, TopicMapView view)
Sets the font of the given topic/association 'type' and updates 'view' accordingly. For defaultType/defaultAssociationType, updates all types with no explicit setting.
-
setAssociationTypeLineWeight
public void setAssociationTypeLineWeight(TopicIF type, int i, TopicMapView view)
Sets the line weight of the given association 'type' and updates 'view' accordingly. For defaultAssociationType, updates all types with no explicit setting.
-
setTopicTypeShapePadding
public void setTopicTypeShapePadding(TopicIF type, int i, TopicMapView view)
Sets the shape padding of the given topic 'type' and updates 'view' accordingly. For defaultType, updates all types with no explicit setting.
-
setTypeIconFilename
public void setTypeIconFilename(TopicIF type, String string, TopicMapView view)
Sets the name of the icon file (optional) of the given topic 'type' and updates 'view' accordingly. For defaultType, updates all types with no explicit setting.
-
setTypeIncluded
public void setTypeIncluded(TopicIF type, TopicMapView view)
Sets the given topic 'type' to be included and updates 'view' accordingly. For defaultType, updates all types with no explicit setting.
-
setTypeExcluded
public void setTypeExcluded(TopicIF type, TopicMapView view)
Sets the given topic 'type' to be excluded and updates 'view' accordingly. For defaultType, updates all types with no explicit setting.
-
setTopicTypeShape
public void setTopicTypeShape(TopicIF type, int i)
-
setAssociationTypeShape
public void setAssociationTypeShape(TopicIF type, int i)
-
setTypeLineWeight
public void setTypeLineWeight(TopicIF type, int i)
-
setTopicTypeShapePadding
public void setTopicTypeShapePadding(TopicIF type, int i)
-
setTypeVisible
public void setTypeVisible(TopicIF type, int visibility)
-
setTypeVisible
public void setTypeVisible(TopicIF type, boolean visible)
-
isAssociationTypeVisible
public boolean isAssociationTypeVisible(TopicIF assoctype)
-
isTopicTypeVisible
public boolean isTopicTypeVisible(TopicIF assoctype)
-
isVisible
public boolean isVisible(TopicIF topic)
-
isVisible
public boolean isVisible(AssociationIF assoc)
-
matchesFilter
public boolean matchesFilter(Collection scope)
Checks if a given scope matches the association scope filter. See matchScope(scope, filter) for details.- Parameters:
scope- The scope to check for matching.- Returns:
- true iff scope matches the association scope filter.
-
matchesFilter
public boolean matchesFilter(Collection scope, Collection filter)
Checks if a given scope (collection of topics) matches a given filter (another collection of topics).- Parameters:
scope- The scope to match with the filter.filter- The filter for the scope to be matched with.- Returns:
- true iff scope matches filter. The scope either has to contain one, all or none of the topics in filter, depending on getAssociationFilterTightness().
-
isVisible
public boolean isVisible(AssociationRoleIF role)
-
lookupColor
public Color lookupColor(TopicIF type, TopicIF occtype)
Finds the color for this association or topic type that is stored in the topic map. Returns null if no color is stored in the topic map.
-
getStartTopic
public TopicIF getStartTopic(TopicMapIF graphtm)
INTERNAL: Finds the start topic in the given topic map, and returns it.
-
getScopingTopic
public TopicIF getScopingTopic(TopicMapIF graphtm)
INTERNAL: Finds the scoping topic in the given topic map, and returns it.
-
getScopingTopicHolder
public TopicIF getScopingTopicHolder()
INTERNAL: Finds the scoping topic in the given topic map, and returns it.
-
setStartTopic
public void setStartTopic(TopicIF extstart)
Sets the start topic of the vizualization. We use the srclocator stored in an occurrence as not all topics have a subjind.
-
clearTopic
public void clearTopic(TopicIF aTopic)
Clear the start topic if it was set.
-
getTypeInstanceType
public TopicIF getTypeInstanceType()
-
getTypeVisibility
public int getTypeVisibility(TopicIF selectedType)
-
getAssociationTypeShape
public int getAssociationTypeShape(TopicIF selectedType)
-
getAssociationTypeLineWeight
public int getAssociationTypeLineWeight(TopicIF selectedType)
-
getTopicTypeShapePadding
public int getTopicTypeShapePadding(TopicIF selectedType)
-
shouldDisplayRoleHoverHelp
public boolean shouldDisplayRoleHoverHelp()
-
isMotionKillerEnabled
public boolean isMotionKillerEnabled()
-
shouldDisplayScopedAssociationNames
public boolean shouldDisplayScopedAssociationNames()
-
shouldDisplayRoleHoverHelp
public void shouldDisplayRoleHoverHelp(boolean value)
-
setMotionKillerEnabled
public void setMotionKillerEnabled(boolean value)
-
shouldDisplayScopedAssociationNames
public void shouldDisplayScopedAssociationNames(boolean value)
-
setPanelBackgroundColour
public void setPanelBackgroundColour(Color aColor)
-
getPanelBackgroundColour
public Color getPanelBackgroundColour()
-
setGeneralSingleClick
public void setGeneralSingleClick(int anAction)
-
setGeneralLocalityAlgorithm
public void setGeneralLocalityAlgorithm(int anAction)
-
setMotionKillerDelay
public void setMotionKillerDelay(int seconds)
-
setMaxTopicNameLength
public void setMaxTopicNameLength(int length)
-
setGeneralDoubleClick
public void setGeneralDoubleClick(int anAction)
-
getGeneralDoubleClick
public int getGeneralDoubleClick()
-
getGeneralSingleClick
public int getGeneralSingleClick()
-
getGeneralLocalityAlgorithm
public int getGeneralLocalityAlgorithm()
-
getGeneralMotionKillerDelay
public int getGeneralMotionKillerDelay()
-
getMaxTopicNameLength
public int getMaxTopicNameLength()
-
setTypeIncluded
public void setTypeIncluded(TopicIF type)
-
setTypeExcluded
public void setTypeExcluded(TopicIF type)
-
isTypeExcluded
public boolean isTypeExcluded(TopicIF aType)
-
setScopingTopic
public void setScopingTopic(TopicIF scope)
-
clearStartTopic
public void clearStartTopic()
-
getSourceLocator
protected TopicIF getSourceLocator()
-
getSubject
protected TopicIF getSubject()
-
getSubjectIndicator
protected TopicIF getSubjectIndicator()
-
setInAssociationScopeFilter
public void setInAssociationScopeFilter(TopicIF scope, boolean included)
-
isInAssociationScopeFilter
public boolean isInAssociationScopeFilter(TopicIF scope)
-
setAssociationScopeFilterStrictness
public void setAssociationScopeFilterStrictness(int strictness)
-
getAssociationScopeFilterStrictness
public int getAssociationScopeFilterStrictness()
-
getAssociationScopeFilter
public Collection getAssociationScopeFilter()
- Returns:
- All topics that are used as scopes of associations and are used to filter associations in Vizigator.
-
-