[deepamehta-devel] custom renderer question

Torsten Ziegler torsten at ziegi.de
Do Sep 5 13:42:44 CEST 2013


Hi Jörg,

thanks for the good structured answer.

The placement issue is now clear to me
and I know what to do.

Concerning the rendering I agree with you,
one way would be to rewrite the topicmap renderer,
but I would prefer to use some hooks in the standard
implementation.
I would like to use hooks for:
- delivering a custom html rendering for a topic
- defining custom areas where the topic is clickable to activate it 
(might be bigger, smaller than outline or non continuos )
- changing the reaction to a mouse click, doubleclick, drag (move)
- triggering a re-rendering of a topic (might be done by hide and show)

I guess that using these hooks it would be also possible
to work with custom associations that show
arrows or some text besides them as they also
are topics by themselves ?

Thanks a lot,
Torsten

Am 04.09.2013 18:14, schrieb Jörg Richter:
> However, implementing a custom topicmap renderer is possibly overkill 
> in your situation. As I understand your goals you rather want to do 
> only selective changes to the default renderer (and not to reimplement 
> all its rendering and interaction functionality). Probably the way to 
> go is to equip the default renderer with extension points...
>> Is it still so, that the rendering is done by the
>> deepamehta-client only without interaction of the
>> topics or topicmaps except for the icon and custom title field ?
>> I would like to adjust the rendering of just some topictypes,
>> so I would prefer to not replace the client completly
>> to easily stay up with future changes in the deepamehta-client.
> Generally, DM strives for enabling external developers (like you) to extend/adapt the DM standard distro by developing plugins, that is without changing the standard distro itself. For that you rely on the extension points (hooks, events) provided by the standard distro. If the existing extension points are not sufficient we will identify/conceptualize further ones. The new extension points are implemented by the standard distro developers then.
>
>> Where (in which modules) would I have to look for hooks
>> or to rewrite code to implement some of the following:
>> - custon rendering of a topic on the canvas (e.g. no icon, frame around title)
> Currently there is no way for a plugin to modify the topic rendering of the default topicmap renderer. I could equip the default renderer with a mechanism that allows you to hook in a custom topic renderer. This way you could override the default topic rendering (icon + label). Do you want me to do so?
>
>> - custom automatic placement of topics on a special type of topicmap (triggered by a function call in the topicmaps detail pane)
> Just to clarify: do your plugin want
> 1) interfere with the **standard placement strategy** that is applied when a) the user creates a new topic via the standard menu or b) when she reveals a topic via a standard detail panel link? Or
> 2) place topics with explicit coordinates as response to a **custom command** provided by your plugin?
>
> In case of 1) I would have to equip the default renderer with a further extension point.
>
> In case of 2) -- that is when **your plugin** explicitly initiates the topic display -- your plugin could simply call
> 	dm4c.do_create_topic() -- to create a topic in the DB and display it, or
> 	dm4c.show_topic() -- to display a topic which already exists in the DB
> and pass x/y coordinates repectively.
>
> See dm4-webclient/src/main/resources/web/script/webclient.js
>
> Or (still another case) are the topics already displayed and you want move them programmatically?
>
>> - custom rendering of mouse menu (right click on topic) for one topictype to add new functions
> To place additional commands in the topic context menu or detail panel (to appear as buttons below the content) your plugin can register a listener to the "topic_commands" event.
>
> 	dm4c.add_listener("topic_commands", function(topic) {
> 		...
> 	}
>
> The "topic_commands" event is fired every time the context menu is displayed. Your handler could investigate the topic's type or add commands for all types.
>
> For examples see:
> 	dm4-webclient/src/main/resources/web/script/internal_plugins/default_plugin.js
> 	dm4-webbrowser/src/main/resources/web/script/plugin.js
> 	dm4-files/src/main/resources/web/script/plugin.js
>
>> - adding custom keyboard shortcuts
> Currently there is no special support for keyboard shortcuts.
> Lets talk about this later.
>
> So far for a first reply.
> Lets stay in touch to go more into the details.
>
> Unfortunately I can respond to your other mail not before friday.
>
> Cheers,
> Jörg
>
> _______________________________________________
> deepamehta-devel mailing list
> deepamehta-devel at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/deepamehta-devel


-- 
Torsten Ziegler
torsten at ziegi.de




Mehr Informationen über die Mailingliste devel