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 int
DEFAULT_MAX_TOPIC_NAME_LENGTH
static Color
DEFAULT_PANEL_BACKGROUND_COLOUR
static int
EDGE_ORIENTED
static int
EXPAND_NODE
static int
FILTER_DEFAULT
static int
FILTER_IN
static int
FILTER_OUT
static int
GO_TO_TOPIC
static int
LOOSE_ASSOCIATION_SCOPES
static int
NODE_ORIENTED
protected static String
NULL_TOPIC
protected TopicIF
nullTopic
static int
SET_FOCUS_NODE
static int
SHOW_ALL_ASSOCIATION_SCOPES
static int
STRICT_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 void
clearStartTopic()
void
clearTopic(TopicIF aTopic)
Clear the start topic if it was set.boolean
defaultOverrides(boolean isTopicType)
returns true iff the default type is set to verride autogenerated values.Collection
getAssociationScopeFilter()
int
getAssociationScopeFilterStrictness()
Color
getAssociationTypeColor(TopicIF type)
TopicIF
getAssociationTypeColorAutogeneratedTopic()
TopicIF
getAssociationTypeColorTopic()
Font
getAssociationTypeFont(TopicIF type)
TopicIF
getAssociationTypeFontTopic()
int
getAssociationTypeLineWeight(TopicIF selectedType)
TopicIF
getAssociationTypeLineWeightTopic()
int
getAssociationTypeShape(TopicIF selectedType)
TopicIF
getAssociationTypeShapeTopic()
Font
getDefaultFont()
int
getGeneralDoubleClick()
int
getGeneralLocalityAlgorithm()
int
getGeneralMotionKillerDelay()
int
getGeneralSingleClick()
int
getMaxTopicNameLength()
TopicIF
getOverrideColorsTopic()
Color
getPanelBackgroundColour()
TopicIF
getScopingTopic(TopicMapIF graphtm)
INTERNAL: Finds the scoping topic in the given topic map, and returns it.TopicIF
getScopingTopicHolder()
INTERNAL: Finds the scoping topic in the given topic map, and returns it.protected TopicIF
getSourceLocator()
TopicIF
getStartTopic(TopicMapIF graphtm)
INTERNAL: Finds the start topic in the given topic map, and returns it.protected TopicIF
getSubject()
protected TopicIF
getSubjectIndicator()
Color
getTopicTypeColor(TopicIF type)
TopicIF
getTopicTypeColorAutogeneratedTopic()
TopicIF
getTopicTypeColorTopic()
TopicIF
getTopicTypeExcludedTopic()
TopicIF
getTopicTypeFontTopic()
TopicIF
getTopicTypeIconTopic()
int
getTopicTypeShape(TopicIF topictype)
int
getTopicTypeShapePadding(TopicIF selectedType)
TopicIF
getTopicTypeShapePaddingTopic()
TopicIF
getTopicTypeShapeTopic()
VizTopicTypePriorityConfigManager
getTTPriorityManager()
Font
getTypeFont(TopicIF type)
Icon
getTypeIcon(TopicIF type)
String
getTypeIconFilename(TopicIF type)
TopicIF
getTypeInstanceType()
int
getTypeVisibility(TopicIF selectedType)
TopicIF
getTypeVisibleTopic()
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.boolean
hasOccurrence(TopicIF topictype, TopicIF type)
protected void
init()
boolean
isAssociationTypeVisible(TopicIF assoctype)
boolean
isInAssociationScopeFilter(TopicIF scope)
boolean
isMotionKillerEnabled()
boolean
isTopicTypeVisible(TopicIF assoctype)
boolean
isTypeExcluded(TopicIF aType)
boolean
isVisible(AssociationIF assoc)
boolean
isVisible(AssociationRoleIF role)
boolean
isVisible(TopicIF topic)
Color
lookupColor(TopicIF type, TopicIF occtype)
Finds the color for this association or topic type that is stored in the topic map.boolean
lookupVisible(TopicIF type, TopicIF occtype, TopicIF defType)
boolean
matchesFilter(Collection scope)
Checks if a given scope matches the association scope filter.boolean
matchesFilter(Collection scope, Collection filter)
Checks if a given scope (collection of topics) matches a given filter (another collection of topics).Font
parseFont(String fontString)
void
setAssociationScopeFilterStrictness(int strictness)
void
setAssociationTypeLineWeight(TopicIF type, int i, TopicMapView view)
Sets the line weight of the given association 'type' and updates 'view' accordingly.void
setAssociationTypeShape(TopicIF type, int i)
void
setAssociationTypeShape(TopicIF type, int i, TopicMapView view)
Sets the shape of the given association 'type' and updates 'view' accordingly.void
setAssociationTypeVisible(TopicIF type, boolean visible, TopicMapView view)
Sets the given association 'type' to be visible and updates 'view' accordingly.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.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.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.void
setGeneralDoubleClick(int anAction)
void
setGeneralLocalityAlgorithm(int anAction)
void
setGeneralSingleClick(int anAction)
void
setInAssociationScopeFilter(TopicIF scope, boolean included)
void
setMaxTopicNameLength(int length)
void
setMotionKillerDelay(int seconds)
void
setMotionKillerEnabled(boolean value)
void
setPanelBackgroundColour(Color aColor)
void
setScopingTopic(TopicIF scope)
void
setStartTopic(TopicIF extstart)
Sets the start topic of the vizualization.protected void
setTopicReference(TopicIF topic, TopicIF extstart, String base)
void
setTopicTypeShape(TopicIF type, int i)
void
setTopicTypeShape(TopicIF type, int i, TopicMapView view)
Sets the shape of the given topic 'type' and updates 'view' accordingly.void
setTopicTypeShapePadding(TopicIF type, int i)
void
setTopicTypeShapePadding(TopicIF type, int i, TopicMapView view)
Sets the shape padding of the given topic 'type' and updates 'view' accordingly.void
setTypeColor(TopicIF type, Color c)
void
setTypeColor(TopicIF type, Color c, TopicMapView view)
Sets the colour of a given 'type' and updates 'view' accordingly.void
setTypeExcluded(TopicIF type)
void
setTypeExcluded(TopicIF type, TopicMapView view)
Sets the given topic 'type' to be excluded and updates 'view' accordingly.void
setTypeFont(TopicIF type, Font font)
void
setTypeFont(TopicIF type, Font font, TopicMapView view)
Sets the font of the given topic/association 'type' and updates 'view' accordingly.void
setTypeIconFilename(TopicIF type, String string)
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.void
setTypeIncluded(TopicIF type)
void
setTypeIncluded(TopicIF type, TopicMapView view)
Sets the given topic 'type' to be included and updates 'view' accordingly.void
setTypeLineWeight(TopicIF type, int i)
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.void
setTypeVisible(TopicIF type, boolean visible)
void
setTypeVisible(TopicIF type, boolean visible, TopicMapView view)
Sets the given topic 'type' to be visible and updates 'view' accordingly.void
setTypeVisible(TopicIF type, int visibility)
boolean
shouldDisplayRoleHoverHelp()
void
shouldDisplayRoleHoverHelp(boolean value)
boolean
shouldDisplayScopedAssociationNames()
void
shouldDisplayScopedAssociationNames(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:
init
in 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.
-
-