|
Re: GEF4 Add extra visual elements [message #1742641 is a reply to message #1739732] |
Tue, 06 September 2016 10:01 |
|
Hi,
this is due to the tools registering event filters on the scene, i.e. they will process all events. If no part can be identified as the target for an event, the root part is used as the target part. At the root part, a policy scrolls when arrow keys are pressed and allows marquee selection when the mouse is dragged.
Since an ITargetPolicyResolver is used to determine the policies that should be executed, you can exchange it and return an empty list for the meta panel:
- MvcFxModule#bindITargetPolicyResolver() registers DefaultTargetPolicyResolver for ITargetPolicyResolver. This can be overridden and a CustomTargetPolicyResolver can be used.
- Within the CustomTargetPolicyResolver (extends DefaultTargetPolicyResolver) you can test if the target node is your meta panel:
@Override
@SuppressWarnings({ "serial", "unchecked" })
public <T extends IPolicy<Node>> List<? extends T> getTargetPolicies(
ITool<Node> contextTool, Node target, IViewer<Node> viewer,
Class<T> policyClass) {
if (target instanceof MyMetaPanel) {
return Collections.emptyList();
}
return super.getTargetPolicies(...);
}
Best regards,
Matthias
|
|
|
|
Powered by
FUDForum. Page generated in 0.02342 seconds