AnsweredAssumed Answered

Graphic class explanation required

Question asked by chirrup on Feb 27, 2014
Latest reply on Mar 5, 2014 by chirrup
Documentation states that Graphic objects are immutable, but they appear to have mutators and none of their members are final (see Graphic.class file). Does framework use those setters to change graphic objects? Why do those setters exist?
getSpacialReference() method is one big mystery. There is no way to pass spacial reference via any constructor or method, yet getter exists (it returns null). Where is spacial reference used by the framework and how do I pass it to the graphic? Is it safe to extend Graphic class and override the getter to return my own spacial reference? Is is safe to override any other method and return custom values?
Graphic.toJson() returns empty json string if spacial reference is not set. Again - makes no sense, because there is no way to pass it. Overriding getSpacialReference() and returning a valid spacial reference fixes the problem.
getUid() and getId() always return -1 (regardless of whether or not graphic is in the layer). What are those for?