Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » getMinimumSize()/getPreferredSize() of Figure
getMinimumSize()/getPreferredSize() of Figure [message #69355] Tue, 11 March 2003 23:57 Go to next message
yinglcs is currently offline yinglcsFriend
Messages: 64
Registered: July 2009
Member
I am using the MVC pattern in GEF application. And my (V)iew is a subclass
of IFigure() which has method of getMinimumSize()/getPreferredSize(). But
how can the (M)odel find out the minimumSize() and preferred size() of the
(V)iew?

Only EditPart has reference to both Figure And Model. Model does not have
reference to Figure.
But Model itself has the setSize()/getSize() method.

I am studying the Logic Example in GEF.
Re: getMinimumSize()/getPreferredSize() of Figure [message #69436 is a reply to message #69355] Wed, 12 March 2003 15:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

I don't understand the question. Why would the model care about
preferred/minimum size?

"yinglcs" <yinglcs@netscape.com> wrote in message
news:b4ltjm$mcu$1@rogue.oti.com...
> I am using the MVC pattern in GEF application. And my (V)iew is a subclass
> of IFigure() which has method of getMinimumSize()/getPreferredSize(). But
> how can the (M)odel find out the minimumSize() and preferred size() of the
> (V)iew?
>
> Only EditPart has reference to both Figure And Model. Model does not have
> reference to Figure.
> But Model itself has the setSize()/getSize() method.
>
> I am studying the Logic Example in GEF.
>
>
>
Re: getMinimumSize()/getPreferredSize() of Figure [message #69475 is a reply to message #69436] Wed, 12 March 2003 15:47 Go to previous messageGo to next message
yinglcs is currently offline yinglcsFriend
Messages: 64
Registered: July 2009
Member
The reason I ask this question is LogicSubpart (a model) has a getSize() and
setSize() function. What if I want to put a check in the setSize() of the
model so that is has to be greater than the minimum size?

I don't want user to set the size of a edit part too small. It has to be
greater than the minimum size. So I am thinking to check this in the
setSize() of the model. I notice that function (setSize()) get called when I
select the figure and resize it.

Thank you.

"Randy Hudson" <none@us.ibm.com> wrote in message
news:b4nkl2$rv8$1@rogue.oti.com...
> I don't understand the question. Why would the model care about
> preferred/minimum size?
>
> "yinglcs" <yinglcs@netscape.com> wrote in message
> news:b4ltjm$mcu$1@rogue.oti.com...
> > I am using the MVC pattern in GEF application. And my (V)iew is a
subclass
> > of IFigure() which has method of getMinimumSize()/getPreferredSize().
But
> > how can the (M)odel find out the minimumSize() and preferred size() of
the
> > (V)iew?
> >
> > Only EditPart has reference to both Figure And Model. Model does not
have
> > reference to Figure.
> > But Model itself has the setSize()/getSize() method.
> >
> > I am studying the Logic Example in GEF.
> >
> >
> >
>
>
Re: getMinimumSize()/getPreferredSize() of Figure [message #69576 is a reply to message #69475] Wed, 12 March 2003 16:35 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

The minimum size is known for simple cases like the gates. They are 17x17
pixels of something like that.

If the size is not known, for example a label, then you will have other
problems anyway. The use may first resize the label, then increase that
label's text, causing its desired size to grow. I think the solution is to
handle this in the layout, not in the model. So, an XYLayout might verify
that a given constraint does not size the figure smaller than it's minimum
size, and if it does, it would correct this. The size in the model would
still be smaller than the figure's minimum size, but this probably doesn't
matter.

"yinglcs" <yinglcs@netscape.com> wrote in message
news:b4nl87$sh4$1@rogue.oti.com...
> The reason I ask this question is LogicSubpart (a model) has a getSize()
and
> setSize() function. What if I want to put a check in the setSize() of the
> model so that is has to be greater than the minimum size?
>
> I don't want user to set the size of a edit part too small. It has to be
> greater than the minimum size. So I am thinking to check this in the
> setSize() of the model. I notice that function (setSize()) get called when
I
> select the figure and resize it.
>
> Thank you.
>
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:b4nkl2$rv8$1@rogue.oti.com...
> > I don't understand the question. Why would the model care about
> > preferred/minimum size?
> >
> > "yinglcs" <yinglcs@netscape.com> wrote in message
> > news:b4ltjm$mcu$1@rogue.oti.com...
> > > I am using the MVC pattern in GEF application. And my (V)iew is a
> subclass
> > > of IFigure() which has method of getMinimumSize()/getPreferredSize().
> But
> > > how can the (M)odel find out the minimumSize() and preferred size() of
> the
> > > (V)iew?
> > >
> > > Only EditPart has reference to both Figure And Model. Model does not
> have
> > > reference to Figure.
> > > But Model itself has the setSize()/getSize() method.
> > >
> > > I am studying the Logic Example in GEF.
> > >
> > >
> > >
> >
> >
>
>
Previous Topic:hiding editparts inside a container
Next Topic:JFace TreeView and GEF EditPart
Goto Forum:
  


Current Time: Sat Oct 19 16:19:35 GMT 2024

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

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

Back to the top