In JForex platform update, v 2.21.8 with API v 2.7.5.2 I received the following exception in the Java Console resulting from one of my Strategy modules.
Related to code in IChartObject or IHorizontalLineChartObject I believe.
This is non-urgent because it does not yet appear to affect execution of my Strategy module, but it is just thrown frequently to the Java Console.
Below, I show TWO points in my code which appear to generate the exception. Please advise when you get a chance. I don't mind changing the code to work around it, if possible.
I did a recompilation of the .jfx but the issue is still there. No code was changed, and it was fine on the prior version. Might be interesting to know why?
// draw a horizontal line
final IHorizontalLineChartObject myDrawDashedHorizontalLine(final IChart chart,final String key, IChart.Type type, long time, double price) {
IChartObject existing = chart.get(key);
if (existing!=null) {
chart.remove(existing); // otherwise, they accumulate?
}
IChartObjectFactory factory = chart.getChartObjectFactory();
IHorizontalLineChartObject co = factory.createHorizontalLine(key, price); // .createLabel(key, time, price);
co.setStroke(dashedStroke); // <-- Line 280 exception generated here
return co;
}
Here is the definition of dashedStroke:
final static Stroke dashedStroke = new BasicStroke(
1.0f,
BasicStroke.CAP_BUTT,
BasicStroke.JOIN_BEVEL,
0,
new float[] {3,7},//dashed line
0);
20.11.2012 13:11:06.500 SEVERE settings.f ] Node has been removed.
java.lang.IllegalStateException: Node has been removed.
at java.util.prefs.AbstractPreferences.put(Unknown Source)
at java.util.prefs.AbstractPreferences.putByteArray(Unknown Source)
at com.dukascopy.dds2.greed.gui.settings.f.a(Unknown Source)
at com.dukascopy.dds2.greed.gui.settings.f.e(Unknown Source)
at com.dukascopy.dds2.greed.gui.settings.b.c(Unknown Source)
at com.dukascopy.dds2.greed.gui.component.chart.aa.n(Unknown Source)
at com.dukascopy.charts.b.b.n(Unknown Source)
at com.dukascopy.charts.chartbuilder.f.propertyChange(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at com.dukascopy.charts.drawings.ChartObject.firePropertyChange(Unknown Source)
at com.dukascopy.charts.drawings.ChartObject.setStroke(Unknown Source)
at com.fs.jforex.HyperScalperDashboardImpl.myDrawDashedHorizontalLine(HyperScalperDashboardImpl.java:280)
at com.fs.jforex.HyperScalperDashboardImpl.onTick(HyperScalperDashboardImpl.java:543)
at com.fs.jforex.HyperScalperDashboard.onTick(HyperScalperDashboard.java:88)
at com.dukascopy.api.impl.execution.w.bK(Unknown Source)
at com.dukascopy.api.impl.execution.a.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at com.dukascopy.api.impl.execution.g$a.f(Unknown Source)
at com.dukascopy.api.impl.execution.g$a.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Also the following related exception from Line 409 of my code:
IChartObject chartObject = myDrawHorizontalLine(chart,"BidLine", IChart.Type.HLINE, nowTime, tickBid);
chartObject.setColor(Color.GRAY); // <-- Line 409 Exception from here
chart.addToMainChart(chartObject);
20.11.2012 13:18:53.425 SEVERE settings.f ] Node has been removed.
java.lang.IllegalStateException: Node has been removed.
at java.util.prefs.AbstractPreferences.put(Unknown Source)
at java.util.prefs.AbstractPreferences.putByteArray(Unknown Source)
at com.dukascopy.dds2.greed.gui.settings.f.a(Unknown Source)
at com.dukascopy.dds2.greed.gui.settings.f.e(Unknown Source)
at com.dukascopy.dds2.greed.gui.settings.b.c(Unknown Source)
at com.dukascopy.dds2.greed.gui.component.chart.aa.n(Unknown Source)
at com.dukascopy.charts.b.b.n(Unknown Source)
at com.dukascopy.charts.chartbuilder.f.propertyChange(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at com.dukascopy.charts.drawings.ChartObject.firePropertyChange(Unknown Source)
at com.dukascopy.charts.drawings.ChartObject.setColor(Unknown Source)
at com.fs.jforex.HyperScalperDashboardImpl.onTick(HyperScalperDashboardImpl.java:409)
at com.fs.jforex.HyperScalperDashboard.onTick(HyperScalperDashboard.java:88)
at com.dukascopy.api.impl.execution.w.bK(Unknown Source)
at com.dukascopy.api.impl.execution.a.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at com.dukascopy.api.impl.execution.g$a.f(Unknown Source)
at com.dukascopy.api.impl.execution.g$a.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)