You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Jérôme Serré <je...@gmail.com> on 2011/11/18 16:46:04 UTC

How to refresh a HighLowChartView

Hello,

I try to refresh a chartview when a new candlestisk is add. It doesn’t work
!

After this code:

((ValueSeries)this.getChartData().get(0)).add(recordToCandlestick(record));

I place this : this.repaint(true);

But nothing happen.

 

Could you help me please.

Thank you

 

Jérôme Serré

____________________________

Manage your cellar

 <http://www.macave.eu/> http://www.macave.eu

 

 


RE: How to refresh a HighLowChartView

Posted by Jérôme Serré <je...@gmail.com>.
Even i do not call run() chart is not updated. May be I make a mistake.

 

 

Jérôme Serré

____________________________

Manage your cellar

 <http://www.macave.eu/> http://www.macave.eu

 

 

De : Greg Brown [mailto:gk_brown@verizon.net] 
Envoyé : lundi 21 novembre 2011 15:13
À : user@pivot.apache.org
Objet : Re: How to refresh a HighLowChartView

 

You don't need to call run() on the return value. Just call queueCallback()
- the system will take care of running it for you later. If you call run()
yourself, it still gets executed on the background thread. 

 

On Nov 21, 2011, at 8:45 AM, Jérôme Serré wrote:





I wrote ProcessClass:

public void run() {

      bla bla bla

     

            ApplicationContext.queueCallback(myChart).run();

 

      }

     

My chart implements runnable

And

myChart.run() {

((ValueSeries<Candlestick>)this.getChartData().get(0)).add(recordToCandlesti
ck(record));

}

 

Is it correct ?

Jérôme Serré

____________________________

Manage your cellar

 <http://www.macave.eu/> http://www.macave.eu

 

 

De : Greg Brown [mailto:gk_brown@verizon.net] 
Envoyé : lundi 21 novembre 2011 14:04
À : user@pivot.apache.org
Objet : Re: How to refresh a HighLowChartView

 

It sounds like you might still be updating the UI from the background
thread. Have you updated your code to use
ApplicationContext#queueCallback()?

 

On Nov 19, 2011, at 3:56 AM, Jérôme Serré wrote:






Ok, I didn’t know. It works. Thank you Greg.

But… there is a but J

For the changes to appear on the chart I must "move" by hand. How can I get
it to refresh automatically ?

 

Jérôme Serré

____________________________

Manage your cellar

 <http://www.macave.eu/> http://www.macave.eu

 

 

De : Greg Brown  <mailto:[mailto:gk_brown@verizon.net]>
[mailto:gk_brown@verizon.net] 
Envoyé : vendredi 18 novembre 2011 23:11
À :  <ma...@pivot.apache.org> user@pivot.apache.org
Objet : Re: How to refresh a HighLowChartView

 

You can't call any method that will update the UI from a background thread.
Most UI toolkits have a similar restriction.

 

On Nov 18, 2011, at 5:03 PM, Jérôme Serré wrote:







Correct. In fact in the run method (daemon) I add a “Record” in a pivot
arrayList and my Chart Class (and some others) listen this event :

public void itemInserted(List<T> list, int index) {

            “Update ChartData”

}

Ok, I think, I cannot use the event ?

Jérôme Serré

____________________________

Manage your cellar

http://www.macave.eu <http://www.macave.eu/> 

 

 

De : Greg Brown  <mailto:[mailto:gk_brown@verizon.net]>
[mailto:gk_brown@verizon.net] 
Envoyé : vendredi 18 novembre 2011 21:17
À :  <ma...@pivot.apache.org> user@pivot.apache.org
Objet : Re: How to refresh a HighLowChartView

 

I assume you have an implementation of Runnable that performs the background
action of your thread, correct? When the thread's run() method completes,
you need to call ApplicationContext#queueCallback() with a new Runnable that
updates your UI.

 

 

On Nov 18, 2011, at 2:59 PM, Jérôme Serré wrote:








I’m really sorry but i don’t understand.

 

public class Test implements Application {

**** some components ***

final Thread t = ExtractProcess.getProcess(resolution, data, chart);

ApplicationContext.queueCallback(t).run();

 

 

The thread is running but none graphics elements are visible on ihm !

 

Jérôme Serré

____________________________

Manage your cellar

http://www.macave.eu <http://www.macave.eu/> 

 

 

De : Greg Brown  <mailto:[mailto:gk_brown@verizon.net]>
[mailto:gk_brown@verizon.net] 
Envoyé : vendredi 18 novembre 2011 19:29
À :  <ma...@pivot.apache.org> user@pivot.apache.org
Objet : Re: How to refresh a HighLowChartView

 

I tested without thread and it works, I use Thread not TaskAdapter or
ApplicationContext#queueCallback()

May I keep Thread and use  ApplicationContext#queueCallback()

 

Yes.









And How to use it ?

 

Just put the code you want to run on the UI thread in the run() method (same
as SwingUtilities#invokeLater() in Swing).

 

 

 

 

 

 

 


Re: How to refresh a HighLowChartView

Posted by Greg Brown <gk...@verizon.net>.
You don't need to call run() on the return value. Just call queueCallback() - the system will take care of running it for you later. If you call run() yourself, it still gets executed on the background thread. 

On Nov 21, 2011, at 8:45 AM, Jérôme Serré wrote:

> I wrote ProcessClass:
> public void run() {
>       bla bla bla
>      
>             ApplicationContext.queueCallback(myChart).run();
>  
>       }
>      
> My chart implements runnable
> And
> myChart.run() {
> ((ValueSeries<Candlestick>)this.getChartData().get(0)).add(recordToCandlestick(record));
> }
>  
> Is it correct ?
> Jérôme Serré
> ____________________________
> Manage your cellar
> http://www.macave.eu
>  
>  
> De : Greg Brown [mailto:gk_brown@verizon.net] 
> Envoyé : lundi 21 novembre 2011 14:04
> À : user@pivot.apache.org
> Objet : Re: How to refresh a HighLowChartView
>  
> It sounds like you might still be updating the UI from the background thread. Have you updated your code to use ApplicationContext#queueCallback()?
>  
> On Nov 19, 2011, at 3:56 AM, Jérôme Serré wrote:
> 
> 
> Ok, I didn’t know. It works. Thank you Greg.
> But… there is a but J
> For the changes to appear on the chart I must "move" by hand. How can I get it to refresh automatically ?
>  
> Jérôme Serré
> ____________________________
> Manage your cellar
> http://www.macave.eu
>  
>  
> De : Greg Brown [mailto:gk_brown@verizon.net] 
> Envoyé : vendredi 18 novembre 2011 23:11
> À : user@pivot.apache.org
> Objet : Re: How to refresh a HighLowChartView
>  
> You can't call any method that will update the UI from a background thread. Most UI toolkits have a similar restriction.
>  
> On Nov 18, 2011, at 5:03 PM, Jérôme Serré wrote:
> 
> 
> 
> Correct. In fact in the run method (daemon) I add a “Record” in a pivot arrayList and my Chart Class (and some others) listen this event :
> public void itemInserted(List<T> list, int index) {
>             “Update ChartData”
> }
> Ok, I think, I cannot use the event ?
> Jérôme Serré
> ____________________________
> Manage your cellar
> http://www.macave.eu
>  
>  
> De : Greg Brown [mailto:gk_brown@verizon.net] 
> Envoyé : vendredi 18 novembre 2011 21:17
> À : user@pivot.apache.org
> Objet : Re: How to refresh a HighLowChartView
>  
> I assume you have an implementation of Runnable that performs the background action of your thread, correct? When the thread's run() method completes, you need to call ApplicationContext#queueCallback() with a new Runnable that updates your UI.
>  
>  
> On Nov 18, 2011, at 2:59 PM, Jérôme Serré wrote:
> 
> 
> 
> 
> I’m really sorry but i don’t understand.
>  
> public class Test implements Application {
> **** some components ***
> final Thread t = ExtractProcess.getProcess(resolution, data, chart);
> ApplicationContext.queueCallback(t).run();
>  
>  
> The thread is running but none graphics elements are visible on ihm !
>  
> Jérôme Serré
> ____________________________
> Manage your cellar
> http://www.macave.eu
>  
>  
> De : Greg Brown [mailto:gk_brown@verizon.net] 
> Envoyé : vendredi 18 novembre 2011 19:29
> À : user@pivot.apache.org
> Objet : Re: How to refresh a HighLowChartView
>  
> I tested without thread and it works, I use Thread not TaskAdapter or ApplicationContext#queueCallback()
> May I keep Thread and use  ApplicationContext#queueCallback()
>  
> Yes.
> 
> 
> 
> 
> 
> And How to use it ?
>  
> Just put the code you want to run on the UI thread in the run() method (same as SwingUtilities#invokeLater() in Swing).
>  
>  
>  
>  
>  
>  


RE: How to refresh a HighLowChartView

Posted by Jérôme Serré <je...@gmail.com>.
I wrote ProcessClass:

public void run() {

      bla bla bla

      

            ApplicationContext.queueCallback(myChart).run();

 

      }

      

My chart implements runnable 

And 

myChart.run() {

((ValueSeries<Candlestick>)this.getChartData().get(0)).add(recordToCandlesti
ck(record));

}

 

Is it correct ?

Jérôme Serré

____________________________

Manage your cellar

 <http://www.macave.eu/> http://www.macave.eu

 

 

De : Greg Brown [mailto:gk_brown@verizon.net] 
Envoyé : lundi 21 novembre 2011 14:04
À : user@pivot.apache.org
Objet : Re: How to refresh a HighLowChartView

 

It sounds like you might still be updating the UI from the background
thread. Have you updated your code to use
ApplicationContext#queueCallback()?

 

On Nov 19, 2011, at 3:56 AM, Jérôme Serré wrote:





Ok, I didn’t know. It works. Thank you Greg.

But… there is a but J

For the changes to appear on the chart I must "move" by hand. How can I get
it to refresh automatically ?

 

Jérôme Serré

____________________________

Manage your cellar

 <http://www.macave.eu/> http://www.macave.eu

 

 

De : Greg Brown  <mailto:[mailto:gk_brown@verizon.net]>
[mailto:gk_brown@verizon.net] 
Envoyé : vendredi 18 novembre 2011 23:11
À :  <ma...@pivot.apache.org> user@pivot.apache.org
Objet : Re: How to refresh a HighLowChartView

 

You can't call any method that will update the UI from a background thread.
Most UI toolkits have a similar restriction.

 

On Nov 18, 2011, at 5:03 PM, Jérôme Serré wrote:






Correct. In fact in the run method (daemon) I add a “Record” in a pivot
arrayList and my Chart Class (and some others) listen this event :

public void itemInserted(List<T> list, int index) {

            “Update ChartData”

}

Ok, I think, I cannot use the event ?

Jérôme Serré

____________________________

Manage your cellar

http://www.macave.eu <http://www.macave.eu/> 

 

 

De : Greg Brown  <mailto:[mailto:gk_brown@verizon.net]>
[mailto:gk_brown@verizon.net] 
Envoyé : vendredi 18 novembre 2011 21:17
À :  <ma...@pivot.apache.org> user@pivot.apache.org
Objet : Re: How to refresh a HighLowChartView

 

I assume you have an implementation of Runnable that performs the background
action of your thread, correct? When the thread's run() method completes,
you need to call ApplicationContext#queueCallback() with a new Runnable that
updates your UI.

 

 

On Nov 18, 2011, at 2:59 PM, Jérôme Serré wrote:







I’m really sorry but i don’t understand.

 

public class Test implements Application {

**** some components ***

final Thread t = ExtractProcess.getProcess(resolution, data, chart);

ApplicationContext.queueCallback(t).run();

 

 

The thread is running but none graphics elements are visible on ihm !

 

Jérôme Serré

____________________________

Manage your cellar

http://www.macave.eu <http://www.macave.eu/> 

 

 

De : Greg Brown  <mailto:[mailto:gk_brown@verizon.net]>
[mailto:gk_brown@verizon.net] 
Envoyé : vendredi 18 novembre 2011 19:29
À :  <ma...@pivot.apache.org> user@pivot.apache.org
Objet : Re: How to refresh a HighLowChartView

 

I tested without thread and it works, I use Thread not TaskAdapter or
ApplicationContext#queueCallback()

May I keep Thread and use  ApplicationContext#queueCallback()

 

Yes.








And How to use it ?

 

Just put the code you want to run on the UI thread in the run() method (same
as SwingUtilities#invokeLater() in Swing).

 

 

 

 

 

 


Re: How to refresh a HighLowChartView

Posted by Greg Brown <gk...@verizon.net>.
It sounds like you might still be updating the UI from the background thread. Have you updated your code to use ApplicationContext#queueCallback()?

On Nov 19, 2011, at 3:56 AM, Jérôme Serré wrote:

> Ok, I didn’t know. It works. Thank you Greg.
> But… there is a but J
> For the changes to appear on the chart I must "move" by hand. How can I get it to refresh automatically ?
>  
> Jérôme Serré
> ____________________________
> Manage your cellar
> http://www.macave.eu
>  
>  
> De : Greg Brown [mailto:gk_brown@verizon.net] 
> Envoyé : vendredi 18 novembre 2011 23:11
> À : user@pivot.apache.org
> Objet : Re: How to refresh a HighLowChartView
>  
> You can't call any method that will update the UI from a background thread. Most UI toolkits have a similar restriction.
>  
> On Nov 18, 2011, at 5:03 PM, Jérôme Serré wrote:
> 
> 
> Correct. In fact in the run method (daemon) I add a “Record” in a pivot arrayList and my Chart Class (and some others) listen this event :
> public void itemInserted(List<T> list, int index) {
>             “Update ChartData”
> }
> Ok, I think, I cannot use the event ?
> Jérôme Serré
> ____________________________
> Manage your cellar
> http://www.macave.eu
>  
>  
> De : Greg Brown [mailto:gk_brown@verizon.net] 
> Envoyé : vendredi 18 novembre 2011 21:17
> À : user@pivot.apache.org
> Objet : Re: How to refresh a HighLowChartView
>  
> I assume you have an implementation of Runnable that performs the background action of your thread, correct? When the thread's run() method completes, you need to call ApplicationContext#queueCallback() with a new Runnable that updates your UI.
>  
>  
> On Nov 18, 2011, at 2:59 PM, Jérôme Serré wrote:
> 
> 
> 
> I’m really sorry but i don’t understand.
>  
> public class Test implements Application {
> **** some components ***
> final Thread t = ExtractProcess.getProcess(resolution, data, chart);
> ApplicationContext.queueCallback(t).run();
>  
>  
> The thread is running but none graphics elements are visible on ihm !
>  
> Jérôme Serré
> ____________________________
> Manage your cellar
> http://www.macave.eu
>  
>  
> De : Greg Brown [mailto:gk_brown@verizon.net] 
> Envoyé : vendredi 18 novembre 2011 19:29
> À : user@pivot.apache.org
> Objet : Re: How to refresh a HighLowChartView
>  
> I tested without thread and it works, I use Thread not TaskAdapter or ApplicationContext#queueCallback()
> May I keep Thread and use  ApplicationContext#queueCallback()
>  
> Yes.
> 
> 
> 
> 
> And How to use it ?
>  
> Just put the code you want to run on the UI thread in the run() method (same as SwingUtilities#invokeLater() in Swing).
>  
>  
>  
>  
>  


TR: How to refresh a HighLowChartView

Posted by Jérôme Serré <je...@gmail.com>.
Hello,

 

If this is an issue, I can turn around by changing the title which update
chart.
However, I would like to manage myself the scales of X-coordinate  and
Y-coordinate. How can I do?
Thank you.

 

Jérôme Serré

____________________________

Manage your cellar

 <http://www.macave.eu/> http://www.macave.eu

 

 

De : Jérôme Serré [mailto:jerome.michel.serre@gmail.com] 
Envoyé : samedi 19 novembre 2011 09:56
À : user@pivot.apache.org
Objet : RE: How to refresh a HighLowChartView

 

Ok, I didn’t know. It works. Thank you Greg.

But… there is a but J 

For the changes to appear on the chart I must "move" by hand. How can I get
it to refresh automatically ?

 

Jérôme Serré

____________________________

Manage your cellar

 <http://www.macave.eu/> http://www.macave.eu

 

 

De : Greg Brown  <mailto:[mailto:gk_brown@verizon.net]>
[mailto:gk_brown@verizon.net] 
Envoyé : vendredi 18 novembre 2011 23:11
À :  <ma...@pivot.apache.org> user@pivot.apache.org
Objet : Re: How to refresh a HighLowChartView

 

You can't call any method that will update the UI from a background thread.
Most UI toolkits have a similar restriction.

 

On Nov 18, 2011, at 5:03 PM, Jérôme Serré wrote:

 

Correct. In fact in the run method (daemon) I add a “Record” in a pivot
arrayList and my Chart Class (and some others) listen this event :

public void itemInserted(List<T> list, int index) {

            “Update ChartData”

}

Ok, I think, I cannot use the event ?

Jérôme Serré

____________________________

Manage your cellar

http://www.macave.eu <http://www.macave.eu/> 

 

 

 

 


RE: How to refresh a HighLowChartView

Posted by Jérôme Serré <je...@gmail.com>.
Ok, I didn’t know. It works. Thank you Greg.

But… there is a but J 

For the changes to appear on the chart I must "move" by hand. How can I get
it to refresh automatically ?

 

Jérôme Serré

____________________________

Manage your cellar

 <http://www.macave.eu/> http://www.macave.eu

 

 

De : Greg Brown [mailto:gk_brown@verizon.net] 
Envoyé : vendredi 18 novembre 2011 23:11
À : user@pivot.apache.org
Objet : Re: How to refresh a HighLowChartView

 

You can't call any method that will update the UI from a background thread.
Most UI toolkits have a similar restriction.

 

On Nov 18, 2011, at 5:03 PM, Jérôme Serré wrote:





Correct. In fact in the run method (daemon) I add a “Record” in a pivot
arrayList and my Chart Class (and some others) listen this event :

public void itemInserted(List<T> list, int index) {

            “Update ChartData”

}

Ok, I think, I cannot use the event ?

Jérôme Serré

____________________________

Manage your cellar

http://www.macave.eu <http://www.macave.eu/> 

 

 

De : Greg Brown  <mailto:[mailto:gk_brown@verizon.net]>
[mailto:gk_brown@verizon.net] 
Envoyé : vendredi 18 novembre 2011 21:17
À :  <ma...@pivot.apache.org> user@pivot.apache.org
Objet : Re: How to refresh a HighLowChartView

 

I assume you have an implementation of Runnable that performs the background
action of your thread, correct? When the thread's run() method completes,
you need to call ApplicationContext#queueCallback() with a new Runnable that
updates your UI.

 

 

On Nov 18, 2011, at 2:59 PM, Jérôme Serré wrote:






I’m really sorry but i don’t understand.

 

public class Test implements Application {

**** some components ***

final Thread t = ExtractProcess.getProcess(resolution, data, chart);

ApplicationContext.queueCallback(t).run();

 

 

The thread is running but none graphics elements are visible on ihm !

 

Jérôme Serré

____________________________

Manage your cellar

http://www.macave.eu <http://www.macave.eu/> 

 

 

De : Greg Brown  <mailto:[mailto:gk_brown@verizon.net]>
[mailto:gk_brown@verizon.net] 
Envoyé : vendredi 18 novembre 2011 19:29
À :  <ma...@pivot.apache.org> user@pivot.apache.org
Objet : Re: How to refresh a HighLowChartView

 

I tested without thread and it works, I use Thread not TaskAdapter or
ApplicationContext#queueCallback()

May I keep Thread and use  ApplicationContext#queueCallback()

 

Yes.







And How to use it ?

 

Just put the code you want to run on the UI thread in the run() method (same
as SwingUtilities#invokeLater() in Swing).

 

 

 

 

 


Re: How to refresh a HighLowChartView

Posted by Greg Brown <gk...@verizon.net>.
You can't call any method that will update the UI from a background thread. Most UI toolkits have a similar restriction.

On Nov 18, 2011, at 5:03 PM, Jérôme Serré wrote:

> Correct. In fact in the run method (daemon) I add a “Record” in a pivot arrayList and my Chart Class (and some others) listen this event :
> public void itemInserted(List<T> list, int index) {
>             “Update ChartData”
> }
> Ok, I think, I cannot use the event ?
> Jérôme Serré
> ____________________________
> Manage your cellar
> http://www.macave.eu
>  
>  
> De : Greg Brown [mailto:gk_brown@verizon.net] 
> Envoyé : vendredi 18 novembre 2011 21:17
> À : user@pivot.apache.org
> Objet : Re: How to refresh a HighLowChartView
>  
> I assume you have an implementation of Runnable that performs the background action of your thread, correct? When the thread's run() method completes, you need to call ApplicationContext#queueCallback() with a new Runnable that updates your UI.
>  
>  
> On Nov 18, 2011, at 2:59 PM, Jérôme Serré wrote:
> 
> 
> I’m really sorry but i don’t understand.
>  
> public class Test implements Application {
> **** some components ***
> final Thread t = ExtractProcess.getProcess(resolution, data, chart);
> ApplicationContext.queueCallback(t).run();
>  
>  
> The thread is running but none graphics elements are visible on ihm !
>  
> Jérôme Serré
> ____________________________
> Manage your cellar
> http://www.macave.eu
>  
>  
> De : Greg Brown [mailto:gk_brown@verizon.net] 
> Envoyé : vendredi 18 novembre 2011 19:29
> À : user@pivot.apache.org
> Objet : Re: How to refresh a HighLowChartView
>  
> I tested without thread and it works, I use Thread not TaskAdapter or ApplicationContext#queueCallback()
> May I keep Thread and use  ApplicationContext#queueCallback()
>  
> Yes.
> 
> 
> 
> And How to use it ?
>  
> Just put the code you want to run on the UI thread in the run() method (same as SwingUtilities#invokeLater() in Swing).
>  
>  
>  
>  


RE: How to refresh a HighLowChartView

Posted by Jérôme Serré <je...@gmail.com>.
Correct. In fact in the run method (daemon) I add a “Record” in a pivot
arrayList and my Chart Class (and some others) listen this event : 

public void itemInserted(List<T> list, int index) {

            “Update ChartData”

}

Ok, I think, I cannot use the event ? 

Jérôme Serré

____________________________

Manage your cellar

 <http://www.macave.eu/> http://www.macave.eu

 

 

De : Greg Brown [mailto:gk_brown@verizon.net] 
Envoyé : vendredi 18 novembre 2011 21:17
À : user@pivot.apache.org
Objet : Re: How to refresh a HighLowChartView

 

I assume you have an implementation of Runnable that performs the background
action of your thread, correct? When the thread's run() method completes,
you need to call ApplicationContext#queueCallback() with a new Runnable that
updates your UI.

 

 

On Nov 18, 2011, at 2:59 PM, Jérôme Serré wrote:





I’m really sorry but i don’t understand.

 

public class Test implements Application {

**** some components ***

final Thread t = ExtractProcess.getProcess(resolution, data, chart);

ApplicationContext.queueCallback(t).run();

 

 

The thread is running but none graphics elements are visible on ihm !

 

Jérôme Serré

____________________________

Manage your cellar

http://www.macave.eu <http://www.macave.eu/> 

 

 

De : Greg Brown  <mailto:[mailto:gk_brown@verizon.net]>
[mailto:gk_brown@verizon.net] 
Envoyé : vendredi 18 novembre 2011 19:29
À :  <ma...@pivot.apache.org> user@pivot.apache.org
Objet : Re: How to refresh a HighLowChartView

 

I tested without thread and it works, I use Thread not TaskAdapter or
ApplicationContext#queueCallback()

May I keep Thread and use  ApplicationContext#queueCallback()

 

Yes.






And How to use it ?

 

Just put the code you want to run on the UI thread in the run() method (same
as SwingUtilities#invokeLater() in Swing).

 

 

 

 


Re: How to refresh a HighLowChartView

Posted by Greg Brown <gk...@verizon.net>.
I assume you have an implementation of Runnable that performs the background action of your thread, correct? When the thread's run() method completes, you need to call ApplicationContext#queueCallback() with a new Runnable that updates your UI.


On Nov 18, 2011, at 2:59 PM, Jérôme Serré wrote:

> I’m really sorry but i don’t understand.
>  
> public class Test implements Application {
> **** some components ***
> final Thread t = ExtractProcess.getProcess(resolution, data, chart);
> ApplicationContext.queueCallback(t).run();
>  
>  
> The thread is running but none graphics elements are visible on ihm !
>  
> Jérôme Serré
> ____________________________
> Manage your cellar
> http://www.macave.eu
>  
>  
> De : Greg Brown [mailto:gk_brown@verizon.net] 
> Envoyé : vendredi 18 novembre 2011 19:29
> À : user@pivot.apache.org
> Objet : Re: How to refresh a HighLowChartView
>  
> I tested without thread and it works, I use Thread not TaskAdapter or ApplicationContext#queueCallback()
> May I keep Thread and use  ApplicationContext#queueCallback()
>  
> Yes.
> 
> 
> And How to use it ?
>  
> Just put the code you want to run on the UI thread in the run() method (same as SwingUtilities#invokeLater() in Swing).
>  
>  
>  


RE: How to refresh a HighLowChartView

Posted by Jérôme Serré <je...@gmail.com>.
I’m really sorry but i don’t understand.

 

public class Test implements Application {

**** some components ***

final Thread t = ExtractProcess.getProcess(resolution, data, chart);

ApplicationContext.queueCallback(t).run();

 

 

The thread is running but none graphics elements are visible on ihm !

 

Jérôme Serré

____________________________

Manage your cellar

http://www.macave.eu <http://www.macave.eu/> 

 

 

De : Greg Brown [mailto:gk_brown@verizon.net] 
Envoyé : vendredi 18 novembre 2011 19:29
À : user@pivot.apache.org
Objet : Re: How to refresh a HighLowChartView

 

I tested without thread and it works, I use Thread not TaskAdapter or
ApplicationContext#queueCallback()

May I keep Thread and use  ApplicationContext#queueCallback()

 

Yes.





And How to use it ?

 

Just put the code you want to run on the UI thread in the run() method (same
as SwingUtilities#invokeLater() in Swing).

 

 

 


Re: How to refresh a HighLowChartView

Posted by Greg Brown <gk...@verizon.net>.
> I tested without thread and it works, I use Thread not TaskAdapter or ApplicationContext#queueCallback()
> May I keep Thread and use  ApplicationContext#queueCallback()

Yes.

> And How to use it ?

Just put the code you want to run on the UI thread in the run() method (same as SwingUtilities#invokeLater() in Swing).




RE: How to refresh a HighLowChartView

Posted by Jérôme Serré <je...@gmail.com>.
I tested without thread and it works, I use Thread not TaskAdapter or
ApplicationContext#queueCallback()

May I keep Thread and use  ApplicationContext#queueCallback()

And How to use it ?

 

 

Jérôme Serré

____________________________

Manage your cellar

 <http://www.macave.eu/> http://www.macave.eu

 

 

De : Greg Brown [mailto:gk_brown@verizon.net] 
Envoyé : vendredi 18 novembre 2011 17:42
À : user@pivot.apache.org
Objet : Re: How to refresh a HighLowChartView

 

OK, are you performing the update using TaskAdapter or
ApplicationContext#queueCallback()? If not, that might be the problem.

 

On Nov 18, 2011, at 10:57 AM, Jérôme Serré wrote:





yes

 

Jérôme Serré

____________________________

Manage your cellar

http://www.macave.eu <http://www.macave.eu/> 

 

 

De : Greg Brown [mailto:gk_brown@verizon.net] 
Envoyé : vendredi 18 novembre 2011 16:55
À : user@pivot.apache.org
Objet : Re: How to refresh a HighLowChartView

 

You shouldn't need to call repaint() yourself. Are you updating the chart
data in a background thread?

 

On Nov 18, 2011, at 10:46 AM, Jérôme Serré wrote:






Hello,

I try to refresh a chartview when a new candlestisk is add. It doesn’t work
!

After this code:

((ValueSeries)this.getChartData().get(0)).add(recordToCandlestick(record));

I place this : this.repaint(true);

But nothing happen.

 

Could you help me please.

Thank you

 

Jérôme Serré

____________________________

Manage your cellar

 <http://www.macave.eu/> http://www.macave.eu

 

 

 

 


Re: How to refresh a HighLowChartView

Posted by Greg Brown <gk...@verizon.net>.
OK, are you performing the update using TaskAdapter or ApplicationContext#queueCallback()? If not, that might be the problem.

On Nov 18, 2011, at 10:57 AM, Jérôme Serré wrote:

> yes
>  
> Jérôme Serré
> ____________________________
> Manage your cellar
> http://www.macave.eu
>  
>  
> De : Greg Brown [mailto:gk_brown@verizon.net] 
> Envoyé : vendredi 18 novembre 2011 16:55
> À : user@pivot.apache.org
> Objet : Re: How to refresh a HighLowChartView
>  
> You shouldn't need to call repaint() yourself. Are you updating the chart data in a background thread?
>  
> On Nov 18, 2011, at 10:46 AM, Jérôme Serré wrote:
> 
> 
> Hello,
> 
> I try to refresh a chartview when a new candlestisk is add. It doesn’t work !
> 
> After this code:
> 
> ((ValueSeries)this.getChartData().get(0)).add(recordToCandlestick(record));
> 
> I place this : this.repaint(true);
> 
> But nothing happen.
> 
>  
> 
> Could you help me please.
> 
> Thank you
> 
>  
> 
> Jérôme Serré
> ____________________________
> Manage your cellar
> http://www.macave.eu
>  
>  
> 
>  


RE: How to refresh a HighLowChartView

Posted by Jérôme Serré <je...@gmail.com>.
yes

 

Jérôme Serré

____________________________

Manage your cellar

 <http://www.macave.eu/> http://www.macave.eu

 

 

De : Greg Brown [mailto:gk_brown@verizon.net] 
Envoyé : vendredi 18 novembre 2011 16:55
À : user@pivot.apache.org
Objet : Re: How to refresh a HighLowChartView

 

You shouldn't need to call repaint() yourself. Are you updating the chart
data in a background thread?

 

On Nov 18, 2011, at 10:46 AM, Jérôme Serré wrote:





Hello,

I try to refresh a chartview when a new candlestisk is add. It doesn’t work
!

After this code:

((ValueSeries)this.getChartData().get(0)).add(recordToCandlestick(record));

I place this : this.repaint(true);

But nothing happen.

 

Could you help me please.

Thank you

 

Jérôme Serré

____________________________

Manage your cellar

 <http://www.macave.eu/> http://www.macave.eu

 

 

 


Re: How to refresh a HighLowChartView

Posted by Greg Brown <gk...@verizon.net>.
You shouldn't need to call repaint() yourself. Are you updating the chart data in a background thread?

On Nov 18, 2011, at 10:46 AM, Jérôme Serré wrote:

> Hello,
> 
> I try to refresh a chartview when a new candlestisk is add. It doesn’t work !
> 
> After this code:
> 
> ((ValueSeries)this.getChartData().get(0)).add(recordToCandlestick(record));
> 
> I place this : this.repaint(true);
> 
> But nothing happen.
> 
>  
> 
> Could you help me please.
> 
> Thank you
> 
>  
> 
> Jérôme Serré
> ____________________________
> Manage your cellar
> http://www.macave.eu
>  
>  
>