> - Explain exactly what it is you are trying to do in as few sentences as > possible. > >> >> Create reusable behaviors with minimalistic API and usage requirements.
Could you use the Action API here? >> I am putting a >> cross-cutting concern into the Component's scope and allowing it to >> initialize itself on the component. I'm pushing code up into the class >> inheritance tree but not using a dynamic language to do it. I assume you mean "component hierarchy" (or "object hiearchy") vs. "class inheritance tree", since you mentioned that you were trying to do this without subclassing - correct? > - Describe how you have tried to apply existing Pivot constructs to solve > the problem, including source code as needed. > >> >> By scripting and subclassing the serializer. That's a pretty big hammer. The reason that I'm continuing to try to draw out your requirements is because I suspect there may be a simpler solution (or at least part of a solution). > a) Added a find method to UserDataDictionary I could potentially see an argument for adding this type of functionality. Even though styles don't inherit, there is no reason that user data can't. On the other hand, it's pretty easy to put the tree traversal code at the app level, and, as you pointed out, there are some hidden gotchas if you try to access data that hasn't been defined yet. So for now, I think this is probably best left to the application. > b) Intercepted the paint(Graphics2D) method. Don't know if that's the right > place. But it was the only place I could find to apply the styles > consistently and the tree was fully built: Maybe you could solve this problem via decorators? Decorators are designed specifically to allow a caller to add additional painting behavior to a component without subclassing (which sounds a lot like what you are trying to do). Also, your pre- and post-processing methods look a lot like Decorator's prepare() and update() methods. > To be honest, I have spent more time trying to get a > split pane (horizontal) to show another split pane (right side, but > vertical) than inherited styles. This is supported and is demonstrated in the Kitchen Sink tutorial. What is the problem you are running into?