com.yworks.yfiles.server.graphml.flexio.data
Class TemplateStyle

java.lang.Object
  extended bycom.yworks.yfiles.server.graphml.flexio.data.TemplateStyle
All Implemented Interfaces:
ISharedInstanceProvider
Direct Known Subclasses:
TemplateLabelStyle, TemplateNodeStyle

public class TemplateStyle
extends java.lang.Object
implements ISharedInstanceProvider

Base class for all yFiles FLEX styles that use a template class to define the visual appearance of the items.


Constructor Summary
TemplateStyle(java.lang.String templateClass)
          Creates a new instance with the given template class.
 
Method Summary
 java.lang.String getContextPropertyName()
          Gets the contextPropertyName.
 java.lang.String getDataPropertyName()
          Gets the dataPropertyName.
 java.util.Collection getSharedInstances()
          Returns a list containing the user tag provider and the style tag.
 java.lang.Object getStyleTag()
          Gets the style tag.
 java.lang.String getTemplateClass()
          Gets the name of the template class.
 IUserTagProvider getUserTagProvider()
          Gets the IUserTagProvider to retrieve user defined data which is associated with the model item.
 java.lang.String getUserTagProviderClass()
          Gets the name of the user tag provider class.
 boolean isHideSelectionPaintable()
          Whether the standard selection painable should be drawn.
 void setContextPropertyName(java.lang.String contextPropertyName)
          Gets the contextPropertyName.
 void setDataPropertyName(java.lang.String dataPropertyName)
          Sets the dataPropertyName.
 void setHideSelectionPaintable(boolean hideSelectionPaintable)
          Sets whether the standard selection painable should be drawn.
 void setStyleTag(java.lang.Object styleTag)
          Sets the style tag.
 void setTemplateClass(java.lang.String templateClass)
          Sets the name of the template class.
 void setUserTagProvider(IUserTagProvider userTagProvider)
          Sets the IUserTagProvider to retrieve user defined data which is associated with the model item.
 void setUserTagProviderClass(java.lang.String userTagProviderClass)
          Sets the name of the user tag provider class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateStyle

public TemplateStyle(java.lang.String templateClass)
Creates a new instance with the given template class. The template class is the Flex DisplayObject which is used to display the model item.

Parameters:
templateClass - The name of the (Flex) template class, written as "package::Clasname".
Method Detail

getUserTagProvider

public IUserTagProvider getUserTagProvider()
Gets the IUserTagProvider to retrieve user defined data which is associated with the model item.

Default: An instance of TagOwnerUserTagProvider.

Returns:
The user tag provider.

setUserTagProvider

public void setUserTagProvider(IUserTagProvider userTagProvider)
Sets the IUserTagProvider to retrieve user defined data which is associated with the model item.

Default: An instance of TagOwnerUserTagProvider.

Parameters:
userTagProvider - The user tag provider to set.

getStyleTag

public java.lang.Object getStyleTag()
Gets the style tag. The style tag is an arbitrary Object which is associated with this style instance.

Returns:
The style tag.

setStyleTag

public void setStyleTag(java.lang.Object styleTag)
Sets the style tag. The style tag is an arbitrary Object which is associated with this style instance.

Parameters:
styleTag - The style tag to set.

getTemplateClass

public java.lang.String getTemplateClass()
Gets the name of the template class. The template class is the Flex DisplayObject which is used to display the model item. The class is written as "package::Clasname".

Returns:
The name of the template class.

setTemplateClass

public void setTemplateClass(java.lang.String templateClass)
Sets the name of the template class. The template class is the Flex DisplayObject which is used to display the model item. The class is written as "package::Clasname".

Parameters:
templateClass - The name of the template class to set.

getUserTagProviderClass

public java.lang.String getUserTagProviderClass()
Gets the name of the user tag provider class. This is the class which is used to retrieve the user tag.

The class is written as "package::Clasname".

Default is "com.yworks.graph.drawing::TagOwnerUserTagProvider". This class retrieves the user tag from the model item's ITagOwner.

Returns:
The name of the template class.

setUserTagProviderClass

public void setUserTagProviderClass(java.lang.String userTagProviderClass)
Sets the name of the user tag provider class. This is the class which is used to retrieve the user tag.

The class is written as "package::Clasname".

Default is "com.yworks.graph.drawing::TagOwnerUserTagProvider". This class retrieves the user tag from the model item's ITagOwner.

Parameters:
userTagProviderClass - The name of the template class.

getDataPropertyName

public java.lang.String getDataPropertyName()
Gets the dataPropertyName. This is the name of the property of the template class to which the user data will be set.

The default value is "dataObject".

Returns:
The name of the data property.

setDataPropertyName

public void setDataPropertyName(java.lang.String dataPropertyName)
Sets the dataPropertyName. This is the name of the property of the template class to which the user data will be set.

The default value is "dataObject".

Parameters:
dataPropertyName - The name of the data property.

getContextPropertyName

public java.lang.String getContextPropertyName()
Gets the contextPropertyName. This is the name of the property of the template class to which the context will be set.

Returns:
The name of the context property.

setContextPropertyName

public void setContextPropertyName(java.lang.String contextPropertyName)
Gets the contextPropertyName. This is the name of the property of the template class to which the context will be set.

Parameters:
contextPropertyName - The name of the context property.

isHideSelectionPaintable

public boolean isHideSelectionPaintable()
Whether the standard selection painable should be drawn.

Returns:
true if the standard selection paintable is to be hidden.

setHideSelectionPaintable

public void setHideSelectionPaintable(boolean hideSelectionPaintable)
Sets whether the standard selection painable should be drawn. If the template component uses a custom selection visualization, this property has to be set to true in order to hide the standard selection visualization.

Parameters:
hideSelectionPaintable - true if the standard selection paintable is to be hidden.

getSharedInstances

public java.util.Collection getSharedInstances()
Returns a list containing the user tag provider and the style tag.

Specified by:
getSharedInstances in interface ISharedInstanceProvider
Returns:
A list containing the user tag provider and the style tag.
See Also:
getUserTagProvider(), getStyleTag()


Copyright © 2000-2013 yWorks GmbH. All rights reserved