[kepler-dev] [kepler-users] Personal actor's icon...

HSU JIMS jimshsu at gmail.com
Wed Aug 20 19:27:54 PDT 2008


hi,Quentin
I share my experience for you, I used its period of time.

1.I developed a custom actor, and checked  README(locate:kepler\src\actors\)
  Follow README, Give my custom actor a LSID :537
2.I used  "\kepler\configs\ptolemy\configs\kepler\uiSVGIconMappingsByLSID.properties,"
  to locate my actor's ICON
  add info to  "uiSVGIconMappingsByLSID.properties"

find this comment..
### ATOMIC ACTOR ICONS ##############################

add below text
#GAP
urn\:lsid\:kepler-project.org\:actor\:537\:1=gap_grid

(gap_grid is my custom name for my project)

3.Create Your SVG ICON
I use Inkscape open a blank svg icon(Directory:\kepler\lib\images\svg)
Modify it and Save as "gap_grid.svg"

(svg file neme should mapping to uiSVGIconMappingsByLSID.properties)

4.Create actorthumbs GIF
Use Inkscape export your SVG ICON to BMP
and you should transfer BMP to GIF(modify size 16*16 pix)
This actorthumbs FILE NAME should be "gap_grid-sm.svg"
and locate it "kepler\lib\images\actorthumbs"

(you could copying an existing one actorthumbs .GIF but should change
filename to gap_grid-sm.svg or your custom XXX-sm.gif)

5.Start your kepler..

I hope this info could help..

Jim


>
> I believe the icons all have to be in the same location.  Did you try
> putting the svg file in the same directory where all the others are?
>
> chad
>
>
> Quentin BEY wrote:
>> Hi Chad,
>>
>> In fact I face another problem, when I use the mapping by class with
>> an already existing icon it works, but if I use a new one it doesn't
>> find it: it uses a blank rectangle. I tried copying an existing one
>> and change its name for both the svg and the raster icon, it doesn't
>> work either.
>>
>> Do I need to declare the new icon somewhere ?
>>
>> Thanks again,
>>
>>
>> Quentin BEY -ONERA- France
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Hi Chad,
>>
>> Thanks for answering so fast. I tried those mechanisms you proposed to
>> me. The one using class works easily, I tried it with an already
>> existing icon. The other one seems to be more complex: when I add my
>> actor to the library, it gives me the LSID:
>>
>> urn:lsid:localhost:onto:2:1#GeneralPurpose
>>
>> then I add the lines in the file:
>>
>> # Node
>> urn\:lsid\:localhost\:onto\:2\:1\#GeneralPurpose=control
>>
>> But nothing changes. Actually it doesn't really matter for the first one
>> works well.
>> By the way, I wonder if it's possible to easily add a category of actor
>> in the library such as General Purpose, for instance.
>>
>> One other thing is I haven't find the file named
>> kepler/configs/ptolemy/configs/kepler/svgIconDefaults.properties
>> neither in the final version 1.0 of Kepler nor on the Nightly Build
>> version I use.
>>
>>
>> Thanks,
>>
>>
>> Quentin BEY -ONERA- France
>>
>>
>> Le mardi 19 ao?t 2008 ? 09:18 -0700, Chad Berkley a ?crit :
>>> Hi Quentin,
>>>
>>> In kepler, there is a different mechanism for assigning icons.  Look at
>>> the files
>>> kepler/configs/ptolemy/configs/kepler/uiSVGIconMappingsByClass.properties
>>>   and
>>> kepler/configs/ptolemy/configs/kepler/uiSVGIconMappingsByLSID.properties
>>>
>>> You can assign the icon by either class or LSID.  Let me know if you
>>> have any problems getting it to work.
>>>
>>> thanks,
>>> chad
>>>
>>> Quentin BEY wrote:
>>>> Hi all,
>>>>
>>>> I'm facing a problem I can't solve. For all actors I create, I can't
>>>> change the default icon they have (the green rectangular icon). I
>>>> inserted the lines:
>>>>
>>>> //----------------------------------------------------------
>>>> // Icon is a stop sign.
>>>> _attachText("_iconDescription", "<svg>\n"
>>>>                 + "<polygon points=\"-8,-19 8,-19 19,-8 19,8 8,19 "
>>>>                 + "-8,19 -19,8 -19,-8\" "
>>>>                 + "style=\"fill:red\"/>\n"
>>>>                 + "<text x=\"-15\" y=\"4\""
>>>>                 + "style=\"font-size:11; fill:white;
>>>> font-family:SansSerif\">"
>>>>                 + "STOP</text>\n"
>>>>                 + "</svg>\n");
>>>> //------------------------------------------------------------
>>>>
>>>> as told in the tutorial concerning the creation of a Stop actor, but
>>>> when I instantiate it with the Tools-Instantiate Component menu I only
>>>> got the green rectangle. The actor works properly.
>>>>
>>>> I also tried copying the code of an existing actor and compile then
>>>> instantiate, it's the same.
>>>>
>>>> Has anybody an idea?
>>>>
>>>> Thanks in advance.
>>>>
>>>>
>>>>
>>>> Quentin BEY -ONERA- France
>>>>
>>>> _______________________________________________
>>>> Kepler-users mailing list
>>>> Kepler-users at ecoinformatics.org
>>>> http://mercury.nceas.ucsb.edu/ecoinformatics/mailman/listinfo/kepler-users
>>


More information about the Kepler-dev mailing list