Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Create example that uses custom branch and leaf renderers #7

Open
joshtynjala opened this issue Oct 15, 2010 · 2 comments
Open

Create example that uses custom branch and leaf renderers #7

joshtynjala opened this issue Oct 15, 2010 · 2 comments
Labels

Comments

@joshtynjala
Copy link
Owner

To keep it simple, just use the LiteTreeMapBranchRenderer and LiteTreeMapLeafRenderer that comes with the source.

@earlPeriscopic
Copy link

Yes please! I keep getting an error that I need to implement the IFactory interface, but I cannot find that interface anywhere. How does this work?

@joshtynjala
Copy link
Owner Author

It refers to mx.core.IFactory. The most commonly used implementation of this interface is mx.core.ClassFactory. If you ever use a custom item renderer in a List or a Tree, you've probably used it. Anyway, here's the most basic example:

treemap.leafRenderer = new ClassFactory( LiteTreeMapLeafRenderer );

ClassFactory also allows you to set properties on the instantiated object. Custom factories could possibly do even more to the object, like set styles or call methods.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants