From: SourceForge.net <no...@so...> - 2005-10-25 15:38:53
|
Bugs item #1337592, was opened at 2005-10-25 17:38 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112867&aid=1337592&group_id=12867 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Magnus Lie Hetland (mlh) Assigned to: Nobody/Anonymous (nobody) Summary: Graphics2D properties erratic Initial Comment: The following code is a "literal" translation from a Java 2D API example (from a book on the subject): class Drawing(JComponent): def paint(self, g): shape = Rectangle(40, 40, 200, 100) g.paint = Color.orange g.fill(shape) g.stroke = BasicStroke(10) g.paint = Color(128, 0, 0) g.draw(shape) It does not work as it should. When the shape is drawn (using g.draw) the stroke and color have reverted to what they were at some earlier point. I.e., the color reverts to Color.orange, and the stroke reverts to the default (1 point wide). If, however, the line g.stroke = BasicStroke(10) is replaced with g.setStroke(BasicStroke(10)) the example works. As far as I can tell from the Jython docs, these two statements are supposed to be equivalent. Also, the fact that it's only necessary to change *one* of these statements (and not, say, the assignment to g.paint) makes this seem like a bug to me... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112867&aid=1337592&group_id=12867 |