Home » Eclipse Projects » GEF » Determining bounds for Label text
Determining bounds for Label text [message #42308] |
Thu, 14 November 2002 16:59  |
Eclipse User |
|
|
|
I'm trying to create a composite Figure that is composed of a couple Images
as well as a text Label. I've subclassed Figure for my edit part figure and
in my constructor, I add all of the images as child Figures as well as the
label. I am using an XYLayout for my figure and when I add each, I add the
figure w/ a constraint Rectangle.
Currently, it seems that i have to set a static constraint for the text;
however if the text extends beyond the bounds, the label shows the text
truncated with an elipisis. Is there anyway to make the bounds of the text
dynamic (thus making my figure size dynamic)??
Thanks,
Erik
|
|
| | |
Re: Determining bounds for Label text [message #42771 is a reply to message #42308] |
Fri, 15 November 2002 16:25   |
Eclipse User |
|
|
|
Originally posted by: hudsonr.us.eye-bee-em.com
"Erik Johnson" <ejohnson@avaya.com> wrote in message
news:ar1478$e9k$1@rogue.oti.com...
> I'm trying to create a composite Figure that is composed of a couple
Images
> as well as a text Label. I've subclassed Figure for my edit part figure
and
> in my constructor, I add all of the images as child Figures as well as the
> label. I am using an XYLayout for my figure and when I add each, I add
the
> figure w/ a constraint Rectangle.
Can you post a picture of what you are trying to achieve? XYLayout is not
the best layout for this type of stuff. But, if you set your label's
constraint to have width=-1, height=-1, it will be sized to its "preferred"
size, which will not need an ellipsis.
Your figure's size will not be dynamic unless it similarly is give (-1, -1)
width height in an XYLayout, or it is in some other layout that asks it its
preferred size.
>
> Currently, it seems that i have to set a static constraint for the text;
> however if the text extends beyond the bounds, the label shows the text
> truncated with an elipisis. Is there anyway to make the bounds of the
text
> dynamic (thus making my figure size dynamic)??
>
> Thanks,
> Erik
>
>
|
|
|
Re: Determining bounds for Label text [message #43047 is a reply to message #42771] |
Fri, 15 November 2002 21:13   |
Eclipse User |
|
|
|
I was able to get it to partially work using DelegatingLayout and using a
RelativeLocator; however it still isn't quite right. I just can't spend
anymore time on trying to get it to draw properly right now.
I was trying to get this to work (see exampleNode.gif).
The figure is composed of:
0-4 connector/terminal items (where connectors anchor)
1 image icon
1 title
The title is dynamic and will be based on user input from the properties
view.
The input/output anchors are dynamic based on the edit part type which is
controlled via. the palette.
What I would like to do is have the composite image bounds be based on the
height of the image icon + text (and north/south anchor figures if the are
part of the figure) and the Max( text.width, (east/west anchor figure if
there) + image width.
The Delegating layout & Relative locator got me close to where I want to be,
but not quite as there are still some minor glitches with sizing--you can
see that the bounding box is not quite right also.
Any ideas/recommendations on what I should be using??
Thanks,
Erik
"Randy Hudson" <hudsonr@us.eye-bee-em.com> wrote in message
news:ar3mm8$qbs$1@rogue.oti.com...
>
> "Erik Johnson" <ejohnson@avaya.com> wrote in message
> news:ar1478$e9k$1@rogue.oti.com...
> > I'm trying to create a composite Figure that is composed of a couple
> Images
> > as well as a text Label. I've subclassed Figure for my edit part figure
> and
> > in my constructor, I add all of the images as child Figures as well as
the
> > label. I am using an XYLayout for my figure and when I add each, I add
> the
> > figure w/ a constraint Rectangle.
>
> Can you post a picture of what you are trying to achieve? XYLayout is not
> the best layout for this type of stuff. But, if you set your label's
> constraint to have width=-1, height=-1, it will be sized to its
"preferred"
> size, which will not need an ellipsis.
>
> Your figure's size will not be dynamic unless it similarly is give
(-1, -1)
> width height in an XYLayout, or it is in some other layout that asks it
its
> preferred size.
>
> >
> > Currently, it seems that i have to set a static constraint for the text;
> > however if the text extends beyond the bounds, the label shows the text
> > truncated with an elipisis. Is there anyway to make the bounds of the
> text
> > dynamic (thus making my figure size dynamic)??
> >
> > Thanks,
> > Erik
> >
> >
>
>
|
|
|
Re: Determining bounds for Label text [message #43084 is a reply to message #43047] |
Fri, 15 November 2002 23:08   |
Eclipse User |
|
|
|
Originally posted by: hudsonr.us.eye-bee-em.com
I would use a figure in vertical FlowLayout(), with 4 children:
1) the top terminal (a Label with just an Icon)
2) a row described below
3) a Label figure (just text, no Icon)
4) the bottom terminal (a Label with just an Icon)
The second child above would be another Figure in a horizontal FlowLayout(),
with 3 children:
a) label for the left terminal
b) label for the Primary Icon
c) label for the right terminal
"Erik Johnson" <ejohnson@avaya.com> wrote in message
news:ar47g5$16i$1@rogue.oti.com...
> I was able to get it to partially work using DelegatingLayout and using a
> RelativeLocator; however it still isn't quite right. I just can't spend
> anymore time on trying to get it to draw properly right now.
>
> I was trying to get this to work (see exampleNode.gif).
> The figure is composed of:
> 0-4 connector/terminal items (where connectors anchor)
> 1 image icon
> 1 title
>
> The title is dynamic and will be based on user input from the properties
> view.
> The input/output anchors are dynamic based on the edit part type which is
> controlled via. the palette.
>
> What I would like to do is have the composite image bounds be based on the
> height of the image icon + text (and north/south anchor figures if the are
> part of the figure) and the Max( text.width, (east/west anchor figure if
> there) + image width.
>
> The Delegating layout & Relative locator got me close to where I want to
be,
> but not quite as there are still some minor glitches with sizing--you can
> see that the bounding box is not quite right also.
>
> Any ideas/recommendations on what I should be using??
>
> Thanks,
> Erik
>
>
>
>
>
>
> "Randy Hudson" <hudsonr@us.eye-bee-em.com> wrote in message
> news:ar3mm8$qbs$1@rogue.oti.com...
> >
> > "Erik Johnson" <ejohnson@avaya.com> wrote in message
> > news:ar1478$e9k$1@rogue.oti.com...
> > > I'm trying to create a composite Figure that is composed of a couple
> > Images
> > > as well as a text Label. I've subclassed Figure for my edit part
figure
> > and
> > > in my constructor, I add all of the images as child Figures as well as
> the
> > > label. I am using an XYLayout for my figure and when I add each, I
add
> > the
> > > figure w/ a constraint Rectangle.
> >
> > Can you post a picture of what you are trying to achieve? XYLayout is
not
> > the best layout for this type of stuff. But, if you set your label's
> > constraint to have width=-1, height=-1, it will be sized to its
> "preferred"
> > size, which will not need an ellipsis.
> >
> > Your figure's size will not be dynamic unless it similarly is give
> (-1, -1)
> > width height in an XYLayout, or it is in some other layout that asks it
> its
> > preferred size.
> >
> > >
> > > Currently, it seems that i have to set a static constraint for the
text;
> > > however if the text extends beyond the bounds, the label shows the
text
> > > truncated with an elipisis. Is there anyway to make the bounds of the
> > text
> > > dynamic (thus making my figure size dynamic)??
> > >
> > > Thanks,
> > > Erik
> > >
> > >
> >
> >
>
>
>
|
|
|
Re: Determining bounds for Label text [message #43616 is a reply to message #43084] |
Tue, 19 November 2002 15:13  |
Eclipse User |
|
|
|
That helped. Thanks!
"Randy Hudson" <hudsonr@us.eye-bee-em.com> wrote in message
news:ar4eap$2rt$1@rogue.oti.com...
> I would use a figure in vertical FlowLayout(), with 4 children:
> 1) the top terminal (a Label with just an Icon)
> 2) a row described below
> 3) a Label figure (just text, no Icon)
> 4) the bottom terminal (a Label with just an Icon)
>
> The second child above would be another Figure in a horizontal
FlowLayout(),
> with 3 children:
> a) label for the left terminal
> b) label for the Primary Icon
> c) label for the right terminal
>
> "Erik Johnson" <ejohnson@avaya.com> wrote in message
> news:ar47g5$16i$1@rogue.oti.com...
> > I was able to get it to partially work using DelegatingLayout and using
a
> > RelativeLocator; however it still isn't quite right. I just can't spend
> > anymore time on trying to get it to draw properly right now.
> >
> > I was trying to get this to work (see exampleNode.gif).
> > The figure is composed of:
> > 0-4 connector/terminal items (where connectors anchor)
> > 1 image icon
> > 1 title
> >
> > The title is dynamic and will be based on user input from the properties
> > view.
> > The input/output anchors are dynamic based on the edit part type which
is
> > controlled via. the palette.
> >
> > What I would like to do is have the composite image bounds be based on
the
> > height of the image icon + text (and north/south anchor figures if the
are
> > part of the figure) and the Max( text.width, (east/west anchor figure if
> > there) + image width.
> >
> > The Delegating layout & Relative locator got me close to where I want to
> be,
> > but not quite as there are still some minor glitches with sizing--you
can
> > see that the bounding box is not quite right also.
> >
> > Any ideas/recommendations on what I should be using??
> >
> > Thanks,
> > Erik
> >
> >
> >
> >
> >
> >
> > "Randy Hudson" <hudsonr@us.eye-bee-em.com> wrote in message
> > news:ar3mm8$qbs$1@rogue.oti.com...
> > >
> > > "Erik Johnson" <ejohnson@avaya.com> wrote in message
> > > news:ar1478$e9k$1@rogue.oti.com...
> > > > I'm trying to create a composite Figure that is composed of a couple
> > > Images
> > > > as well as a text Label. I've subclassed Figure for my edit part
> figure
> > > and
> > > > in my constructor, I add all of the images as child Figures as well
as
> > the
> > > > label. I am using an XYLayout for my figure and when I add each, I
> add
> > > the
> > > > figure w/ a constraint Rectangle.
> > >
> > > Can you post a picture of what you are trying to achieve? XYLayout is
> not
> > > the best layout for this type of stuff. But, if you set your label's
> > > constraint to have width=-1, height=-1, it will be sized to its
> > "preferred"
> > > size, which will not need an ellipsis.
> > >
> > > Your figure's size will not be dynamic unless it similarly is give
> > (-1, -1)
> > > width height in an XYLayout, or it is in some other layout that asks
it
> > its
> > > preferred size.
> > >
> > > >
> > > > Currently, it seems that i have to set a static constraint for the
> text;
> > > > however if the text extends beyond the bounds, the label shows the
> text
> > > > truncated with an elipisis. Is there anyway to make the bounds of
the
> > > text
> > > > dynamic (thus making my figure size dynamic)??
> > > >
> > > > Thanks,
> > > > Erik
> > > >
> > > >
> > >
> > >
> >
> >
> >
>
>
|
|
|
Goto Forum:
Current Time: Wed Jul 16 09:41:21 EDT 2025
Powered by FUDForum. Page generated in 0.09546 seconds
|