Bug #2324

SVG - old-style icon still displayed for certain actors

Added by Matthew Brooke almost 17 years ago. Updated over 13 years ago.

In Progress
Target version:
Start date:
Due date:
% Done:


Estimated time:


For certain actors, described below, the old-style icon is still displayed when
an actor is dragged to the canvas:

1) for any actors that have an icon defined in the MOML file thus:
<property name="_icon" class="ptolemy.vergil.icon.BoxedValueIcon">
<property name="attributeName" class="ptolemy.kernel.util.StringAttribute"
<property name="displayWidth" class="" value="60">
(this is an example - not necessarily all "BoxedValueIcon". The thing to look
for is name="_icon")

Note that "ESRI Shape File Displayer" (org.kepler.gis.display.JumpSHPDisplayer)
actually has a custom icon (_iconDescription) defined inthe java code - so I am
not sure where this other "_icon" definition is coming from.

2) actors that have an accompanying "<actorname>Icon.xml" file - like has an accompanying
SequenceToArrayIcon.xml file in ptolemy/domains/sdf/lib/, which is automatically
pulled in by the MOMLParser and added to the actor.


Note that, in many cases, showing the old-style icon may still be appropriate
(for example, uses a box to display the user-entered
string inside. Replacing this with a big icon would probably not be a good idea.
A similar argument also applies to entries in the actor library under the
Variable->Parameter node (eg ColorParameter, FileParameter etc).

However, other actors, like the "ESRI Shape File Displayer"
(org.kepler.gis.display.JumpSHPDisplayer) could (and should) have its existing
icon replaced with an appropriate new-style icon.

So, since we can't distinguish between these 2 general cases programmatically
(without resorting to keeping a hard-coded list of actors in an "omissions"
list), how can we handle the situation?

How about a policy that allows actor developers to override the "designed" icon
by defining this as "<property name="_icon" ..etc" in the MOML, ONLY if it is
absolutely necessary (eg to present a box with user text in it)? Other,
non-essential uses of "<property name="_icon" ..etc" would then just be removed
from the MOML. If users want to define icons to show up under the old-style
rendering scheme, such icons could be defined in the MOML as an SVG
"_iconDescription". Same goeas for separate <actorname>Icon.xml files. However -
some of these exist in the PTII codebase, so we can't remove those.

Not sure what to do. Any comments, thoughts, other solutions?

Related issues

Blocked by Kepler - Bug #2245: TRACKING: Batik SVG Rendering - remaining tasksIn Progress11/04/2005

Blocks Kepler - Bug #2345: Actor Library classname/icon mapping problemsResolved01/26/2006


#1 Updated by Matthew Brooke over 16 years ago

Additional info (specific case), reported by Dan:

if you look at the compositeBiodiversityExample.xml workflow (in workflows/eco/)
we now get a simple yellow rectangle ot the left of the composite labeled
'BiodiversityIndex'. Double clicking on the rectangle does bring up a html page
with equations as it should, but no one would know that from the box! (which is
a 'DocumentationAttribute'). It used to say 'Double click to see documentation'

#2 Updated by Matthew Brooke over 16 years ago

looked thru the 3 workflows created by Matt, which show all the current actors. According to these WFs, the following actors currently do not show the new-style icons (WF's are in kepler/workflows/test):


Array To Sequence
Sequence To Array
TextAttribute (shows val)
Constant (shows val)
String Constant (shows val)
Single Fire Constant (should show val?)
Permanent String Constant (should show val?)
Boolean Switch


Create Expression From Query
File Array Printer
ESRI Shape File Displayer
GML Displayer


SProxy (shows val - should it?)
Multiply Or Divide
Add Or Subtract
Absolute Value
Differential Equation
Dot Product
Uniform Distribution Random Number Generator
Gaussian Distribution Random Number Generator
RequireVersion: 6.0-devel
(plus some repeats)

Other actors that don't have icons are the "shapes" (these show the actual shape reflected in their names - Ellipse etc) and the image display (which displays a user-settable image) - these are (presumably) OK

#3 Updated by Dan Higgins over 16 years ago

DocViewer seems to be missing from your list. It only displays a rectangle. It should have text saying something like 'Show Documentation'.

There is also a 'Documentation Attribute' (which doesn't even show up correctly in the actor tree.

#4 Updated by Matthew Brooke over 16 years ago

ah! - the DocViewer was in there, but it had no text label (as Dan had previously pointed out in an email), and its tooltip said "SingletonAttribute".

See Bug #2382 for a discussion of the missing "Documentation Attribute"

#5 Updated by Matthew Brooke over 16 years ago

changed icon assignments for:

Permanent String Constant (src/org/resurgence/actor/
Single Fire Constant (src/org/geon/ icon actually displays the value of the constant typed in by the user.

#6 Updated by Matthew Brooke over 16 years ago

note to self (or whoever has to change these "*Constant" icons in future...)

Actual icon is ptolemy.vergil.icon.BoxedValueIcon. If we need to change the outline color, rounded corners, etc, we'll need to override this class

For PTII classes (notably and, the icon assignment isn't made in the actor code or the actor moml file - it's made as the moml is parsed at runtime, in the class ptolemy.moml.filter.AddIcon. This class contains a hard-coded HashMap (aptly named "_actorsThatShouldHaveIcons"), which contains the names of actors that get these icons added.

So - instead of adding the Kepler actors to this list (which didn't seem like the right thing to do), I instead assigned the BoxedValueIcon in the specific actor constructors (which also doesn't seem like the right thing to do, but less-not-right than the other option...). Here's the code to put in the constructor:

BoxedValueIcon icon = new BoxedValueIcon(this, "_icon");

(TODO the "25" max width should really be accessible from a common central place, so all actors can be changed easily)

  • NOTE ***
    For future reference, the AddIcon filter contains mappings for:, and,
    ...all of which receive the ptolemy.vergil.icon.AttributeValueIcon (which is the superclass of BoxedValueIcon). HOWEVER - the AttributeValueIcon displays the value ON TOP OF the new svg icon, whereas BoxedValueIcon overrides the new SVG icon completely ===

#7 Updated by Matthew Brooke over 16 years ago

added a line to build-ptolemy.xml, to exclude files of the form *Icon.xml, since these interfere with new SVG icons.

For reference, the remaining actors that still don't display the new icon assignments are now shown in a new test workflow -


#8 Updated by Matthew Brooke over 16 years ago

Fixed some typos in uiSVGMappingsByClass props file, and removed some references to BoxedValueIcon in actor moml.

Only actors that still do not get new icons are all descendents of ptolemy.kernel.util.Attribute, which which does not yet have a call to:

ComponentEntityConfig.addIconTo(this); previously added to Director and ComponentEntity

#9 Updated by Matthew Brooke over 16 years ago

The remaining actors without new icons are as follows:

BasicUnits (
CGSUnitBase (
ElectronicUnitBase (
SI (

DocViewer (ptolemy.kernel.util.SingletonAttribute)

Parameter (
ColorParameter (
FileParameter (
PortParameter (
StringParameter (

ScopeExtendingAttribute (

RequireVersion (ptolemy.kernel.attributes.RequireVersion)

#10 Updated by Matthew Brooke over 16 years ago

OK - set icons by LSID (in for:
BasicUnits, CGSUnitBase, ElectronicUnitBase, SI (all set to blank teal icon)
and DocViewer (set to new Documentation SVG icon).

Remaining changes are low priority:
a) Still need to change all these to a royal blue dot:

Parameter (
FileParameter (
StringParameter (
ScopeExtendingAttribute (
RequireVersion (ptolemy.kernel.attributes.RequireVersion)

b) change to royal blue dot, keep the arrow, but make arrow solid black:
PortParameter (

c) Make dot show the actual color picked:
ColorParameter (

(Note - have removed the test workflow from cvs, now most of these are fixed - kepler/workflows/test/IconsNotShowing.xml)

#11 Updated by Chad Berkley over 13 years ago

As of 4/3/09, this is the status of this bug:

a) Still need to change all these to a royal blue dot:

(done)Parameter (
(green dot)FileParameter (
(red dot)StringParameter (
(done)ScopeExtendingAttribute (
(black dot)RequireVersion (ptolemy.kernel.attributes.RequireVersion)

b) change to royal blue dot, keep the arrow, but make arrow solid black:
(blue dot but with empty arrow)PortParameter (

c) Make dot show the actual color picked:
(always shows pink)ColorParameter (

#12 Updated by Redmine Admin over 9 years ago

Original Bugzilla ID was 2324

Also available in: Atom PDF