Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » - getMapMode() has private in WrapLabel???
- getMapMode() has private in WrapLabel??? [message #61311] Thu, 12 October 2006 05:44 Go to next message
Eclipse UserFriend
Originally posted by: nikolay.diakov.fredhopper.com

I generated a diagram editor with GMF 1.0.1 using IMapNode (checked).

In the resulting diagram editor source code I get a compiel error about
the visibility of getMapMode(). Is this a bug or a feature?

--Nikolay
Re: - getMapMode() has private in WrapLabel??? [message #61382 is a reply to message #61311] Thu, 12 October 2006 06:38 Go to previous messageGo to next message
Eclipse UserFriend
Well, this is definitely a bug introduced in the maintenance stream.
However, there should be no need for map mode in the generated label's code.
Could you please post either generated code or respective part of
..gmfgraph - I wonder why there's access to map mode at all.

Artem

"Nikolay Diakov" <nikolay.diakov@fredhopper.com> wrote in message
news:egl2pc$66a$1@utils.eclipse.org...
>I generated a diagram editor with GMF 1.0.1 using IMapNode (checked).
>
> In the resulting diagram editor source code I get a compiel error about
> the visibility of getMapMode(). Is this a bug or a feature?
>
> --Nikolay
Re: - getMapMode() has private in WrapLabel??? [message #61585 is a reply to message #61382] Thu, 12 October 2006 09:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nikolay.diakov.fredhopper.com

Artem Tikhomirov wrote:
> Well, this is definitely a bug introduced in the maintenance stream.
> However, there should be no need for map mode in the generated label's code.
> Could you please post either generated code or respective part of
> .gmfgraph - I wonder why there's access to map mode at all.
>
> Artem
>
> "Nikolay Diakov" <nikolay.diakov@fredhopper.com> wrote in message
> news:egl2pc$66a$1@utils.eclipse.org...
>> I generated a diagram editor with GMF 1.0.1 using IMapNode (checked).
>>
>> In the resulting diagram editor source code I get a compiel error about
>> the visibility of getMapMode(). Is this a bug or a feature?
>>
>> --Nikolay
>
>

Well, in my graph model I have a Label on which I set Line Border with
thickness 0. (When I do not do the line border the generated code
compiles OK).

This produces the following code

public class ChannelLabelFigureTemplate extends
org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel {

/**
* @generated
*/
public ChannelLabelFigureTemplate() {

this.setText("...");
this.setBorder(new org.eclipse.draw2d.LineBorder(getMapMode()
.DPtoLP(0)));
createContents();
}

/**
* @generated
*/
private void createContents() {
}

/**
* @generated
*/
private boolean myUseLocalCoordinates = false;

/**
* @generated
*/
protected boolean useLocalCoordinates() {
return myUseLocalCoordinates;
}

/**
* @generated
*/
protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
myUseLocalCoordinates = useLocalCoordinates;
}

}


One can see the call to getMapMode(). I guess the visibility should
actually be "protected" instead of "private" as someone may have
hierarcical modifiers of labels in their graph model.

Tell me if you want my graph model file too.

Cheers,
Nikolay
Re: - getMapMode() has private in WrapLabel??? [message #61655 is a reply to message #61585] Thu, 12 October 2006 09:45 Go to previous messageGo to next message
Eclipse UserFriend
No, the reason is obvious. the private getMapMode was added in 1.0.1
milestone without checking generated code. In 1.0.0, there was no such
method and, getMapMode was taken from enclosing EditPart.

Btw, what's the purpose of such a border for a label?


Artem

"Nikolay Diakov" <nikolay.diakov@fredhopper.com> wrote in message
news:eglggl$pls$1@utils.eclipse.org...
> Artem Tikhomirov wrote:
>> Well, this is definitely a bug introduced in the maintenance stream.
>> However, there should be no need for map mode in the generated label's
>> code. Could you please post either generated code or respective part of
>> .gmfgraph - I wonder why there's access to map mode at all.
>>
>> Artem
>>
>> "Nikolay Diakov" <nikolay.diakov@fredhopper.com> wrote in message
>> news:egl2pc$66a$1@utils.eclipse.org...
>>> I generated a diagram editor with GMF 1.0.1 using IMapNode (checked).
>>>
>>> In the resulting diagram editor source code I get a compiel error about
>>> the visibility of getMapMode(). Is this a bug or a feature?
>>>
>>> --Nikolay
>>
>>
>
> Well, in my graph model I have a Label on which I set Line Border with
> thickness 0. (When I do not do the line border the generated code compiles
> OK).
>
> This produces the following code
>
> public class ChannelLabelFigureTemplate extends
> org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel {
>
> /**
> * @generated
> */
> public ChannelLabelFigureTemplate() {
>
> this.setText("...");
> this.setBorder(new org.eclipse.draw2d.LineBorder(getMapMode()
> .DPtoLP(0)));
> createContents();
> }
>
> /**
> * @generated
> */
> private void createContents() {
> }
>
> /**
> * @generated
> */
> private boolean myUseLocalCoordinates = false;
>
> /**
> * @generated
> */
> protected boolean useLocalCoordinates() {
> return myUseLocalCoordinates;
> }
>
> /**
> * @generated
> */
> protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
> myUseLocalCoordinates = useLocalCoordinates;
> }
>
> }
>
>
> One can see the call to getMapMode(). I guess the visibility should
> actually be "protected" instead of "private" as someone may have
> hierarcical modifiers of labels in their graph model.
>
> Tell me if you want my graph model file too.
>
> Cheers,
> Nikolay
Re: - getMapMode() has private in WrapLabel??? [message #61678 is a reply to message #61655] Thu, 12 October 2006 09:50 Go to previous message
Eclipse UserFriend
Originally posted by: nikolay.diakov.fredhopper.com

Artem Tikhomirov wrote:
> No, the reason is obvious. the private getMapMode was added in 1.0.1
> milestone without checking generated code. In 1.0.0, there was no such
> method and, getMapMode was taken from enclosing EditPart.
>
> Btw, what's the purpose of such a border for a label?

Absolutely no purpose, just playing around when I found this. I find
usefull setting the border of the label to some thickness > 1. Thanks, I
now know where to get the map mode from.

--N

>
>
> Artem
>
> "Nikolay Diakov" <nikolay.diakov@fredhopper.com> wrote in message
> news:eglggl$pls$1@utils.eclipse.org...
>> Artem Tikhomirov wrote:
>>> Well, this is definitely a bug introduced in the maintenance stream.
>>> However, there should be no need for map mode in the generated label's
>>> code. Could you please post either generated code or respective part of
>>> .gmfgraph - I wonder why there's access to map mode at all.
>>>
>>> Artem
>>>
>>> "Nikolay Diakov" <nikolay.diakov@fredhopper.com> wrote in message
>>> news:egl2pc$66a$1@utils.eclipse.org...
>>>> I generated a diagram editor with GMF 1.0.1 using IMapNode (checked).
>>>>
>>>> In the resulting diagram editor source code I get a compiel error about
>>>> the visibility of getMapMode(). Is this a bug or a feature?
>>>>
>>>> --Nikolay
>>>
>> Well, in my graph model I have a Label on which I set Line Border with
>> thickness 0. (When I do not do the line border the generated code compiles
>> OK).
>>
>> This produces the following code
>>
>> public class ChannelLabelFigureTemplate extends
>> org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel {
>>
>> /**
>> * @generated
>> */
>> public ChannelLabelFigureTemplate() {
>>
>> this.setText("...");
>> this.setBorder(new org.eclipse.draw2d.LineBorder(getMapMode()
>> .DPtoLP(0)));
>> createContents();
>> }
>>
>> /**
>> * @generated
>> */
>> private void createContents() {
>> }
>>
>> /**
>> * @generated
>> */
>> private boolean myUseLocalCoordinates = false;
>>
>> /**
>> * @generated
>> */
>> protected boolean useLocalCoordinates() {
>> return myUseLocalCoordinates;
>> }
>>
>> /**
>> * @generated
>> */
>> protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
>> myUseLocalCoordinates = useLocalCoordinates;
>> }
>>
>> }
>>
>>
>> One can see the call to getMapMode(). I guess the visibility should
>> actually be "protected" instead of "private" as someone may have
>> hierarcical modifiers of labels in their graph model.
>>
>> Tell me if you want my graph model file too.
>>
>> Cheers,
>> Nikolay
>
>
Previous Topic:How to add a tooltip for element on the diagram?
Next Topic:commands never disposed
Goto Forum:
  


Current Time: Fri May 09 23:51:56 EDT 2025

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

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

Back to the top