[gme-users] connections to ports w/ decorator

Jeff Parsons parsons at isis.vanderbilt.edu
Thu Jul 8 18:39:56 CDT 2004


Hi,

> -----Original Message-----
> From: Peter Volgyesi [mailto:peter.volgyesi at vanderbilt.edu] 
> Sent: Thursday, July 08, 2004 5:18 AM
> To: gme-users
> Subject: RE: [gme-users] connections to ports w/ decorator
> 
> 
> Hi,
> 
> Hotspots are not controlled by the decorator. The decorator 
> is able (should) specify only the ports and their locations. 
> The two relevant methods (COM
> level):
> 
> HRESULT GetPortLocation([in] IMgaFCO *fco, [out] long *sx, 
> [out] long *sy, [out] long *ex, [out] long *ey); HRESULT 
> GetPorts([out, retval] IMgaFCOs **portFCOs); 
> 
> The methods are implemented in the BoxDecorator as
> 
> STDMETHODIMP CBoxDecorator::GetPortLocation( IMgaFCO *pFCO, 
> long *sx, long *sy, long *ex, long *ey ); STDMETHODIMP 
> CBoxDecorator::GetPorts( IMgaFCOs **portFCOs );
> 
> First, GME calls GetPorts, where you can specify a collection 
> of child objects (visible as ports). Next, GME calls the 
> GetPortLocation() method repeatedly for each port object in 
> that collection.
> 
> Ports are automatically handled as hotspots (connectable 
> points) by the GUI along with the primeter of the bounding object.
> 
> Hope, this helps.

Yes, it does. I guess I figured that, since my decorator is calling
elsewhere to gets its own port information anyway, and not creating
or destroying ports, that it holds nothing that GME can't get
somewhere else. But even if that were true, GME would still need
the port location info, since a decorator could draw the port
somewhere other than where the default decorator would draw it
(which my decorator does). So, duh, once I implemented those
2 callback methods in my decorator, it worked fine. Thanks
for the explanation.

Jeff

> 
> --
> peter
> 
> 
> > -----Original Message-----
> > From: gme-users-bounces at list.isis.vanderbilt.edu
> > [mailto:gme-users-bounces at list.isis.vanderbilt.edu] On Behalf 
> > Of Jeff Parsons
> > Sent: Wednesday, July 07, 2004 7:09 PM
> > To: gme-users
> > Subject: [gme-users] connections to ports w/ decorator
> > 
> > Hi,
> > 
> > I have written a decorator that takes over the drawing of
> > just a few things in a model, the relevant one being one 
> > certain kind of model and its ports. What the decorator does 
> > is choose between mirror image icons depending on which side 
> > of the model the port is drawn on. These ports can have 
> > connections to other ports in the same kind of model. It 
> > seems that, using the decorator, connections don't appear in 
> > the model, whereas without it they do.
> > I've borrowed some code from GME source
> > code for this stuff, leaving out some things since my use 
> > case is not as general as GME's default decorator. I've 
> > looked for something I left out relating to hotspots but all 
> > that stuff seems to be outside the decorator part of GEM and 
> > I don't see how I could change my decorator code to make this 
> > work. Can anyone help me out with info about what code in 
> > ModelDecorator or PortDecorator controls hotspots, if any?
> > 
> > thanks,
> > 
> > Jeff
> > _______________________________________________
> > gme-users mailing list
> > gme-users at list.isis.vanderbilt.edu
> > http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users
> 
> _______________________________________________
> gme-users mailing list
> gme-users at list.isis.vanderbilt.edu
> http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users
> 


More information about the gme-users mailing list