[kepler-dev] Icons within Kepler

Sean Riddle swriddle at gmail.com
Fri Sep 24 12:24:27 PDT 2010


Kepler has a different method of determining actor icons than Ptolemy  
does. You can either assign an icon by actor classname, or by LSID; to  
do this, you would want to modify the file  
uiSVGIconMappingsByClass.xml or uiSVGIconMappingsByLSID.xml,  
respectively (both of these are found in KEPLER/gui/resources/ 
configurations/). Note that icons cannot be assigned for parameters or  
for composites by classname, but must be assigned by LSID.

So you would add an entry in, for example, uiSVGIconMappingsByClass.xml:

	<pair>
		<name>your classname here</name>
		<value>my-icon</value>
	</pair>

Then you would want to save your SVG definition to KEPLER/common/lib/ 
images/svg/my-icon.svg, and save a GIF format thumbnail (for  
displaying in search results, dimensions 16x16) into KEPLER/common/lib/ 
images/actorthumbs/my-icon-sm.gif.

To re-cap:

* svg
	* goes in the svg directory
	* basename = value tag content in the XML
* gif
	* goes in the actorthumbs directory
	* basename = value tag content in the XML + "-sm"

- Sean

On Sep 23, 2010, at 2:32 AM, Michal Owsiak wrote:

> Hello all,
>
> I have few questions related to icons management within Kepler.
>
> I am trying to set actor's Icon and I am using following way to set  
> it:
>
> _attachText("_iconDescription", "<svg>\n"
>                + "<rect x=\"-20\" y=\"-15\" " + "width=\"40\" height= 
> \"30\" "
>                + "style=\"fill:lightGrey\"/>\n" + "<rect x=\"-15\" y= 
> \"-10\" "
>                + "width=\"30\" height=\"20\" " + "style=\"fill:white 
> \"/>\n"
>                + "<line x1=\"-13\" y1=\"-6\" x2=\"-4\" y2=\"-6\" "
>                + "style=\"stroke:grey\"/>\n"
>                + "<line x1=\"-13\" y1=\"-2\" x2=\"0\" y2=\"-2\" "
>                + "style=\"stroke:grey\"/>\n"
>                + "<line x1=\"-13\" y1=\"2\" x2=\"-8\" y2=\"2\" "
>                + "style=\"stroke:grey\"/>\n"
>                + "<line x1=\"-13\" y1=\"6\" x2=\"4\" y2=\"6\" "
>                + "style=\"stroke:grey\"/>\n" + "</svg>\n");
>
> I'd like to have the same icon as Display actor has.
>
> Is it mandatory to subclass from certain class in order to use this  
> method for setting actor's icon?
>
> Another question is:
>
> How can I refer to icons that are contained within kepler-icons.jar?  
> Is it possible to retrieve them through the Kepler engine? Are they  
> stored somewhere and are accessible via class/icon name?
>
> Another question is. I'd like to set JFrame icon to the icon that is  
> used by Kepler itself using setIconImage. However, I don't know how  
> to refer to this icon.
>
> How can I retrieve Image object for the icon that is used for main  
> Kepler windows? How can I find it's (icon's) package name?
>
> And the last question. If I want to add new icon into Kepler how  
> should I proceed if I don't want to put the icon into kepler- 
> icons.jar? Is there any way to do that?
>
> Thanks in advance
>
> Cheers
>
> Michal
>
> -- 
> Michal Owsiak <michal.owsiak at man.poznan.pl>
>
> Institute of Bioorganic Chemistry PAS
> Poznan Supercomputing and Networking Center
> Noskowskiego 12/14, 61-704 Poznan, POLAND
>
> http://www.man.poznan.pl
> _______________________________________________
> Kepler-dev mailing list
> Kepler-dev at kepler-project.org
> http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-dev



More information about the Kepler-dev mailing list