Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Changing rules of diagram at runtime
Changing rules of diagram at runtime [message #78449] Fri, 17 November 2006 07:34 Go to next message
Eclipse UserFriend
Originally posted by: awm_abu.yahoo.com

Hello folks,

I am creating a diagram at the moment with a fixed (grid like) layout.

I have Blocks and BlockContainers.
Blocks have semantic meaning while Containers are for visual use only.

The rules are at the moment:
Only InputBlocks in InputBlockContainers
Only OutputBlocks in OutputBlockContainers
Only LogicBlocks in LogicBlockContainers

However we're not sure at this point whether the user will necessarily want
these restrictions.
We may want them to be able to change these using preferences.

At the moment the BlockContainers are linked to certain Blocks in the
mapping file.

What I am wondering is is there a way to setup it up so these rules can be
changed at runtime ?
So I would say any Container type can hold any Block type by default but the
user can choose to add the restrictions.

One other thing is that the way it currently works prevents you creating a
LogicBlock in an InputBlockContainer.
But it does not stop you from dragging and dropping a LogicBlock into an
InputBlockContainer after creation.
I had a look at the DragDropEditPolicy installed on the EditParts but no
method jumped out at me as the place to check
what is being dropped.

Any help greatly appreciated.
Re: Changing rules of diagram at runtime [message #78576 is a reply to message #78449] Fri, 17 November 2006 11:30 Go to previous message
Eclipse UserFriend
Originally posted by: vcciubot.uwaterloo.ca

Look in you generated <Your Diagram>VisualIDRegistry. It's enforcing the
way views can be nested into one another. Similar restrictions are
scattered through the code, just search for references to this class.

vlad

On Fri, 17 Nov 2006 12:34:53 +0000, Alan wrote:

> Hello folks,
>
> I am creating a diagram at the moment with a fixed (grid like) layout.
>
> I have Blocks and BlockContainers.
> Blocks have semantic meaning while Containers are for visual use only.
>
> The rules are at the moment:
> Only InputBlocks in InputBlockContainers
> Only OutputBlocks in OutputBlockContainers
> Only LogicBlocks in LogicBlockContainers
>
> However we're not sure at this point whether the user will necessarily want
> these restrictions.
> We may want them to be able to change these using preferences.
>
> At the moment the BlockContainers are linked to certain Blocks in the
> mapping file.
>
> What I am wondering is is there a way to setup it up so these rules can be
> changed at runtime ?
> So I would say any Container type can hold any Block type by default but the
> user can choose to add the restrictions.
>
> One other thing is that the way it currently works prevents you creating a
> LogicBlock in an InputBlockContainer.
> But it does not stop you from dragging and dropping a LogicBlock into an
> InputBlockContainer after creation.
> I had a look at the DragDropEditPolicy installed on the EditParts but no
> method jumped out at me as the place to check
> what is being dropped.
>
> Any help greatly appreciated.
Previous Topic:Initalize an IProgressMonitor?
Next Topic:Semantic v Notation Model
Goto Forum:
  


Current Time: Mon May 12 05:10:28 EDT 2025

Powered by FUDForum. Page generated in 0.03584 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top