Getting the source code of a FAMIXClass

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Getting the source code of a FAMIXClass

Alberto Bacchelli
Hi,

 I've parsed a Java system by using Verveine-J (pretty fast :) and imported
the resulting MSE file in the Moose Suite 4.6 Development I downloaded from
the moose website. Everything went fine.

I saw that each non-stub FAMIXClass has a FAMIXFileAnchor that correctly
points to the java source code file that contains the class declaration.
However, I cannot find the right way to directly access this declaration
(even though the FAMIXFileAnchor contains also
startLine,startColumn,endLine, and endColumn). I tried to call the method
FAMIXFileAnchor>>sourceText, but I only get an empty string.

Is there a way to access the source code?

Thanks.

Cheers,
 Alberto

--
View this message in context: http://moose-dev.97923.n3.nabble.com/Getting-the-source-code-of-a-FAMIXClass-tp3494193p3494193.html
Sent from the moose-dev mailing list archive at Nabble.com.
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Getting the source code of a FAMIXClass

Andre Hora
You should set the root folder.
http://www.themoosebook.org/book/externals/import-export/root-folder

Cheers,

On Wed, Nov 9, 2011 at 6:20 PM, Alberto Bacchelli <[hidden email]> wrote:
Hi,

 I've parsed a Java system by using Verveine-J (pretty fast :) and imported
the resulting MSE file in the Moose Suite 4.6 Development I downloaded from
the moose website. Everything went fine.

I saw that each non-stub FAMIXClass has a FAMIXFileAnchor that correctly
points to the java source code file that contains the class declaration.
However, I cannot find the right way to directly access this declaration
(even though the FAMIXFileAnchor contains also
startLine,startColumn,endLine, and endColumn). I tried to call the method
FAMIXFileAnchor>>sourceText, but I only get an empty string.

Is there a way to access the source code?

Thanks.

Cheers,
 Alberto

--
View this message in context: http://moose-dev.97923.n3.nabble.com/Getting-the-source-code-of-a-FAMIXClass-tp3494193p3494193.html
Sent from the moose-dev mailing list archive at Nabble.com.
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev



--
Andre Hora


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Getting the source code of a FAMIXClass

Alberto Bacchelli
In reply to this post by Alberto Bacchelli
I start by replying to myself :)

I had a look at the method FAMIXFileAnchor>>completeText, which contains
this line:

fsReference := (FSFilesystem onDisk referenceTo: self rootFolder, self
fileName).

by printing rootFolder I get this content:

'/Applications/Moose.app/Contents/Resources/src/output/'

and by printing fileName (I just put an example):


'/Users/sback/Desktop/java/2009-03-23-argoUML_0.28/argouml/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultiComposite.java'

the fileName is taken by the MSE generated by Verveine-J.
By composing the rootFolder and the fileName, the method cannot locate the
correct file.
Simply by changing the aforementioned line to:

fsReference := (FSFilesystem onDisk referenceTo: self fileName).

the method worked and I got the source file of the class
(it is very nice that it just outputs the declaration of the class within
the containing file ;).

So, it seems to be an inconsistency between Verveine-J (head on the
repository) and Moose 4.6.

What should be done?

Cheers,
 Alberto

--
View this message in context: http://moose-dev.97923.n3.nabble.com/Getting-the-source-code-of-a-FAMIXClass-tp3494193p3494265.html
Sent from the moose-dev mailing list archive at Nabble.com.
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Getting the source code of a FAMIXClass

Alberto Bacchelli
In reply to this post by Andre Hora
Yep, you are right!
Unfortunately, I cannot set the rootFolder to be '/' from the contextual
menu: I have to choose a folder to set it.  And it seems that '/' is not an
option.


Andre Hora wrote:

>
> You should set the root folder.
> http://www.themoosebook.org/book/externals/import-export/root-folder
>
> Cheers,
>
> On Wed, Nov 9, 2011 at 6:20 PM, Alberto Bacchelli
> &lt;alberto.bacchelli@&gt;wrote:
>
>> Hi,
>>
>>  I've parsed a Java system by using Verveine-J (pretty fast :) and
>> imported
>> the resulting MSE file in the Moose Suite 4.6 Development I downloaded
>> from
>> the moose website. Everything went fine.
>>
>> I saw that each non-stub FAMIXClass has a FAMIXFileAnchor that correctly
>> points to the java source code file that contains the class declaration.
>> However, I cannot find the right way to directly access this declaration
>> (even though the FAMIXFileAnchor contains also
>> startLine,startColumn,endLine, and endColumn). I tried to call the method
>> FAMIXFileAnchor>>sourceText, but I only get an empty string.
>>
>> Is there a way to access the source code?
>>
>> Thanks.
>>
>> Cheers,
>>  Alberto
>>
>> --
>> View this message in context:
>> http://moose-dev.97923.n3.nabble.com/Getting-the-source-code-of-a-FAMIXClass-tp3494193p3494193.html
>> Sent from the moose-dev mailing list archive at Nabble.com.
>> _______________________________________________
>> Moose-dev mailing list
>> Moose-dev@.unibe
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>
>
>
>
> --
> Andre Hora
>
> _______________________________________________
> Moose-dev mailing list
> Moose-dev@.unibe
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>


--
View this message in context: http://moose-dev.97923.n3.nabble.com/Getting-the-source-code-of-a-FAMIXClass-tp3494193p3494279.html
Sent from the moose-dev mailing list archive at Nabble.com.
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Getting the source code of a FAMIXClass

Fabrizio Perin
the super

This super ugly methods attached they should solve your problems. Just select the root folder of your project.

Let me know,
Fabrizio




On 9 Nov 2011, at 18:39, Alberto Bacchelli wrote:

Yep, you are right!
Unfortunately, I cannot set the rootFolder to be '/' from the contextual
menu: I have to choose a folder to set it.  And it seems that '/' is not an
option.


Andre Hora wrote:

You should set the root folder.
http://www.themoosebook.org/book/externals/import-export/root-folder

Cheers,

On Wed, Nov 9, 2011 at 6:20 PM, Alberto Bacchelli
&lt;alberto.bacchelli@&gt;wrote:

Hi,

I've parsed a Java system by using Verveine-J (pretty fast :) and
imported
the resulting MSE file in the Moose Suite 4.6 Development I downloaded
from
the moose website. Everything went fine.

I saw that each non-stub FAMIXClass has a FAMIXFileAnchor that correctly
points to the java source code file that contains the class declaration.
However, I cannot find the right way to directly access this declaration
(even though the FAMIXFileAnchor contains also
startLine,startColumn,endLine, and endColumn). I tried to call the method
FAMIXFileAnchor>>sourceText, but I only get an empty string.

Is there a way to access the source code?

Thanks.

Cheers,
Alberto

--
View this message in context:
http://moose-dev.97923.n3.nabble.com/Getting-the-source-code-of-a-FAMIXClass-tp3494193p3494193.html
Sent from the moose-dev mailing list archive at Nabble.com.
_______________________________________________
Moose-dev mailing list
Moose-dev@.unibe
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




--
Andre Hora

_______________________________________________
Moose-dev mailing list
Moose-dev@.unibe
https://www.iam.unibe.ch/mailman/listinfo/moose-dev



--
View this message in context: http://moose-dev.97923.n3.nabble.com/Getting-the-source-code-of-a-FAMIXClass-tp3494193p3494279.html
Sent from the moose-dev mailing list archive at Nabble.com.
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

MooseModel-fixFileAnchorsFromGUI.st (662 bytes) Download Attachment
MooseModel-fixFileAnchorsFrom.st (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Getting the source code of a FAMIXClass

Alberto Bacchelli
I will have a look at it tomorrow, in the meanwhile: Thanks!


Fabrizio Perin wrote:

>
> the super
>
> This super ugly methods attached they should solve your problems. Just
> select the root folder of your project.
>
> Let me know,
> Fabrizio
>
>


--
View this message in context: http://moose-dev.97923.n3.nabble.com/Getting-the-source-code-of-a-FAMIXClass-tp3494193p3494476.html
Sent from the moose-dev mailing list archive at Nabble.com.
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev