[kepler-dev] Java 1.7

Christopher Brooks cxh at eecs.berkeley.edu
Mon Nov 5 09:52:23 PST 2012


Hi Tomasz,
I believe we added a workaround to the Ptolemy II svn repository.

In the svn tree, ptolemy/actor/gui/TextEditor.java is now:
> /** Get the background color.
>      *  @return The background color of the scroll pane.
>      *  If _scrollPane is null, then null is returned.
>      *  @see #setBackground(Color)
>      */
>     public Color getBackground() {
>         // Under Java 1.7 on the Mac, the _scrollbar is sometimes null.
>         // See http://bugzilla.ecoinformatics.org/show_bug.cgi?id=5574
>         if (_scrollPane != null) {
>             return _scrollPane.getBackground();
>         } else {
>             return null;
>         }
>     }

_Christopher

On 11/5/12 12:39 AM, Tomasz Żok wrote:
> On 11/04/12 at 10:40am, Christopher Brooks wrote:
>> To my knowledge, Ptolemy II and Kepler compile and run properly
>> under Java 1.7.
> There is one problem with Java 1.7 I know of. When you try to edit the script
> in PythonScript actor, you get an exception: "Failed to open a dialog to edit
> the target" with the stacktrace starting with:
>
>      java.lang.NullPointerException
>          at ptolemy.actor.gui.TextEditor.getBackground(TextEditor.java:144)
>
> AFAIR, there was some discussion about this problem, but I do not think we got
> to solve it anyhow. Also, it probably concerns not only the PythonScript actor.
>
>
> Some information about my environment: (this is the latest java 1.7)
>
>      $ java -version
>      java version "1.7.0_09"
>      OpenJDK Runtime Environment (IcedTea7 2.3.3) (ArchLinux build 7.u9_2.3.3-1-x86_64)
>      OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)
>
> I am using kepler-2.3 from:
> http://code.kepler-project.org/code/kepler/releases/release-branches/kepler-2.3
>
>
> Here is the whole stacktrace:
>
>      java.lang.NullPointerException
>          at ptolemy.actor.gui.TextEditor.getBackground(TextEditor.java:144)
>          at java.awt.Window.setBackground(Window.java:3798)
>          at java.awt.Frame.setBackground(Frame.java:988)
>          at ptolemy.gui.Top.access$1001(Top.java:141)
>          at ptolemy.gui.Top$SetBackgroundRunnable.run(Top.java:1889)
>          at ptolemy.gui.Top.deferIfNecessary(Top.java:247)
>          at ptolemy.gui.Top.setBackground(Top.java:501)
>          at ptolemy.actor.gui.TextEditor.setBackground(TextEditor.java:238)
>          at javax.swing.JFrame.frameInit(JFrame.java:253)
>          at javax.swing.JFrame.<init>(JFrame.java:175)
>          at ptolemy.gui.Top.<init>(Top.java:162)
>          at ptolemy.actor.gui.TableauFrame.<init>(TableauFrame.java:133)
>          at ptolemy.actor.gui.TableauFrame.<init>(TableauFrame.java:168)
>          at ptolemy.actor.gui.TextEditor.<init>(TextEditor.java:104)
>          at ptolemy.actor.gui.TextEditor.<init>(TextEditor.java:91)
>          at ptolemy.actor.gui.TextEditor.<init>(TextEditor.java:81)
>          at ptolemy.vergil.toolbox.TextEditorForStringAttributes.<init>(TextEditorForStringAttributes.java:59)
>          at ptolemy.vergil.toolbox.TextEditorConfigureFactory.createEditor(TextEditorConfigureFactory.java:135)
>          at ptolemy.vergil.toolbox.ConfigureAction._openDialog(ConfigureAction.java:143)
>          at ptolemy.vergil.toolbox.ConfigureAction.actionPerformed(ConfigureAction.java:99)
>          at diva.canvas.interactor.ActionInteractor.mousePressed(ActionInteractor.java:74)
>          at diva.canvas.interactor.CompositeInteractor.mousePressed(CompositeInteractor.java:199)
>          at diva.canvas.interactor.SelectionInteractor.mousePressed(SelectionInteractor.java:202)
>          at diva.canvas.FigureLayer.dispatchEventUpTree(FigureLayer.java:551)
>          at diva.canvas.FigureLayer.grabPointer(FigureLayer.java:319)
>          at diva.canvas.FigureLayer.processLayerEvent(FigureLayer.java:673)
>          at diva.canvas.FigureLayer.dispatchEvent(FigureLayer.java:203)
>          at diva.canvas.CanvasPane.processLayerEvent(CanvasPane.java:280)
>          at diva.canvas.CanvasPane.dispatchEvent(CanvasPane.java:89)
>          at diva.canvas.JCanvas.internalProcessMouseEvent(JCanvas.java:520)
>          at diva.canvas.JCanvas.processMouseEvent(JCanvas.java:474)
>          at java.awt.Component.processEvent(Component.java:6270)
>          at java.awt.Container.processEvent(Container.java:2229)
>          at java.awt.Component.dispatchEventImpl(Component.java:4861)
>          at java.awt.Container.dispatchEventImpl(Container.java:2287)
>          at java.awt.Component.dispatchEvent(Component.java:4687)
>          at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
>          at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4489)
>          at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
>          at java.awt.Container.dispatchEventImpl(Container.java:2273)
>          at java.awt.Window.dispatchEventImpl(Window.java:2719)
>          at java.awt.Component.dispatchEvent(Component.java:4687)
>          at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:723)
>          at java.awt.EventQueue.access$200(EventQueue.java:103)
>          at java.awt.EventQueue$3.run(EventQueue.java:682)
>          at java.awt.EventQueue$3.run(EventQueue.java:680)
>          at java.security.AccessController.doPrivileged(Native Method)
>          at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
>          at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
>          at java.awt.EventQueue$4.run(EventQueue.java:696)
>          at java.awt.EventQueue$4.run(EventQueue.java:694)
>          at java.security.AccessController.doPrivileged(Native Method)
>          at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
>          at java.awt.EventQueue.dispatchEvent(EventQueue.java:693)
>          at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)
>          at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)
>          at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
>          at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147)
>          at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139)
>          at java.awt.EventDispatchThread.run(EventDispatchThread.java:97)
>
>
> Regards,
> Tomek
>

-- 
Christopher Brooks, PMP                       University of California
CHESS Executive Director                      US Mail: 337 Cory Hall
Programmer/Analyst CHESS/Ptolemy/Trust        Berkeley, CA 94720-1774
ph: 510.643.9841                                (Office: 545Q Cory)
home: (F-Tu) 707.665.0131 cell: 707.332.0670



More information about the Kepler-dev mailing list