Hallo, ...
ich habe in anderen Projekten (reines Java) schon mit Jfree Chart rumgehampelt; allerdings ist das schon ein wenig her ;)
Nun habe ich mir gedachtd as man das ja auch in Notes einbetten könnte; mit iText hat es ja schliesslich auch schonmal gut geklappt.
Nun habe ich ein "beispiel" gebastelt um zu testen ob das überhaupt funktioniert:
import lotus.domino.*;
import org.jfree.chart.*;
import org.jfree.data.*;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartFrame;
import org.jfree.chart.JFreeChart;
import org.jfree.data.general.DefaultPieDataset;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
DefaultPieDataset data = new DefaultPieDataset();
data.setValue("Category 1", 43.2);
data.setValue("Category 2", 27.9);
data.setValue("Category 3", 79.5);
JFreeChart chart = ChartFactory.createPieChart3D("3d Chart", data, true, true, false);
ChartFrame frame = new ChartFrame("First", chart);
frame.pack();
frame.setVisible(true);
} catch(Exception e) {
e.printStackTrace();
}
}
}
Agent läuft auch, leider bleibt das Fenster / Frame leer.
Habe ich jetzt mit Notes 6.5.4 und Notes 7.0.2 getestet.
Beidesmal leider gleich.
Agent wird von mir gestartet mit vollen Rechten.
jemand ne idee?
grüße rene
debugger:
Exception occurred during event dispatching:
java.lang.ExceptionInInitializerError: java.security.AccessControlException: access denied (java.lang.RuntimePermission getClassLoader)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:286)
at java.security.AccessController.checkPermission(AccessController.java:413)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:565)
at COM.ibm.JEmpower.applet.AppletSecurity.superDotCheckPermission(AppletSecurity.java:1371)
at COM.ibm.JEmpower.applet.AppletSecurity.checkRuntimePermission(AppletSecurity.java:1244)
at COM.ibm.JEmpower.applet.AppletSecurity.checkPermission(AppletSecurity.java:1448)
at COM.ibm.JEmpower.applet.AppletSecurity.checkPermission(AppletSecurity.java:1386)
at java.lang.Thread.getContextClassLoader(Thread.java:1139)
at org.jfree.util.ObjectUtilities.getClassLoader(ObjectUtilities.java:268)
at org.jfree.util.ObjectUtilities.isJDK14(ObjectUtilities.java:441)
at org.jfree.text.TextUtilities.<clinit>(TextUtilities.java:102)
at org.jfree.chart.title.TextTitle.arrangeRR(TextTitle.java:588)
at org.jfree.chart.title.TextTitle.arrange(TextTitle.java:459)
at org.jfree.chart.JFreeChart.drawTitle(JFreeChart.java:1308)
at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1198)
at org.jfree.chart.ChartPanel.paintComponent(ChartPanel.java:1354)
at javax.swing.JComponent.paint(JComponent.java:718)
at javax.swing.JComponent.paintChildren(JComponent.java:529)
at javax.swing.JComponent.paint(JComponent.java:727)
at javax.swing.JLayeredPane.paint(JLayeredPane.java:556)
at javax.swing.JComponent.paintChildren(JComponent.java:529)
at javax.swing.JComponent.paint(JComponent.java:700)
at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:46)
at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:68)
at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:105)
at java.awt.Container.paint(Container.java:998)
at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:37)
at sun.awt.RepaintArea.paint(RepaintArea.java:323)
at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:210)
at java.awt.Component.dispatchEventImpl(Component.java:2747)
at java.awt.Container.dispatchEventImpl(Container.java:1252)
at java.awt.Window.dispatchEventImpl(Window.java:964)
at java.awt.Component.dispatchEvent(Component.java:2581)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:434)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:141)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:132)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:124)
Exception occurred during event dispatching:
java.lang.NoClassDefFoundError: org/jfree/text/TextUtilities
at org.jfree.chart.title.TextTitle.arrangeRR(TextTitle.java:588)
at org.jfree.chart.title.TextTitle.arrange(TextTitle.java:459)
at org.jfree.chart.JFreeChart.drawTitle(JFreeChart.java:1308)
at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1198)
at org.jfree.chart.ChartPanel.paintComponent(ChartPanel.java:1354)
at javax.swing.JComponent.paint(JComponent.java:718)
at javax.swing.JComponent.paintChildren(JComponent.java:529)
at javax.swing.JComponent.paint(JComponent.java:727)
at javax.swing.JLayeredPane.paint(JLayeredPane.java:556)
at javax.swing.JComponent.paintChildren(JComponent.java:529)
at javax.swing.JComponent.paint(JComponent.java:700)
at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:46)
at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:68)
at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:105)
at java.awt.Container.paint(Container.java:998)
at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:37)
at sun.awt.RepaintArea.paint(RepaintArea.java:323)
at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:210)
at java.awt.Component.dispatchEventImpl(Component.java:2747)
at java.awt.Container.dispatchEventImpl(Container.java:1252)
at java.awt.Window.dispatchEventImpl(Window.java:964)
at java.awt.Component.dispatchEvent(Component.java:2581)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:434)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:141)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:132)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:124)
Exception occurred during event dispatching:
java.lang.NullPointerException
at lotus.domino.AgentLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(ClassLoader.java:448)
at java.lang.Class.forName1(Native Method)
at java.lang.Class.forName(Class.java:142)
at org.jfree.chart.ChartPanel.class$(ChartPanel.java:1711)
at org.jfree.chart.ChartPanel.mouseMoved(ChartPanel.java:1746)
at java.awt.AWTEventMulticaster.mouseMoved(AWTEventMulticaster.java:284)
at java.awt.Component.processMouseMotionEvent(Component.java:3840)
at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:2358)
at java.awt.Component.processEvent(Component.java:3632)
at java.awt.Container.processEvent(Container.java:1203)
at java.awt.Component.dispatchEventImpl(Component.java:2678)
at java.awt.Container.dispatchEventImpl(Container.java:1252)
at java.awt.Component.dispatchEvent(Component.java:2581)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2498)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2291)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2172)
at java.awt.Container.dispatchEventImpl(Container.java:1239)
at java.awt.Window.dispatchEventImpl(Window.java:964)
at java.awt.Component.dispatchEvent(Component.java:2581)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:434)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:141)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:132)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:124
laut hp von jfree sind die kompatibel.
komisch
grüße rene