[gme-users] connections to ports w/ decorator

Peter Volgyesi peter.volgyesi at vanderbilt.edu
Thu Jul 8 13:17:33 CDT 2004


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.

--
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



More information about the gme-users mailing list