CursorTool

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
Turc
Newbie
Newbie
Posts: 34
Joined: Wed Feb 03, 2010 12:00 am

CursorTool

Post by Turc » Tue Dec 21, 2010 6:41 pm

I have a main chart with about 10 traces that capture live data. There's an option to capture that chart - which basically clones it and copies it to another panel. On this capture panel, there are 2 Cursor Tools.

When i first implemented the cursorTools, they worked fine, then out of no where the cursors that appear when you mouse over the lines stopped showing. I had no idea what caused it since i didn't changed the code. I then just remade the class, added everything to it again and it work just fine. Now again, they stopped working. The lines still show up, you can move them, etc. but the cursors that appear when you mouse over the lines do not show up.

Turc
Newbie
Newbie
Posts: 34
Joined: Wed Feb 03, 2010 12:00 am

Re: CursorTool

Post by Turc » Tue Dec 21, 2010 6:49 pm

Here's the code:

Code: Select all

private CursorTool      tool1, tool2;

...

tool1 = new CursorTool(this.getChart());
tool1.setStyle(CursorToolStyle.HORIZONTAL);
tool1.getPen().setColor(Color.YELLOW);
tool1.setActive(false);
tool1.addCursorListener(new CursorTool.CursorListener() {
public void cursorMoved(CursorEvent e)
{
      ....
 }
 });

...
//Another class class enables or disables them
public void enableCursorTools()
{
     tool1.setActive(true);
}

public void disableCursorTools()
{
    tool1.setActive(false);
}

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: CursorTool

Post by Yeray » Wed Dec 22, 2010 3:24 pm

Hi Turc,

If you activate your cursor tools, I don't see any reason why they can't work fine.
Here is the code I'm using and the tools seem to work fine:

Code: Select all

    private com.steema.teechart.styles.Points points1;
    private com.steema.teechart.tools.CursorTool tool1, tool2;
    private void initChart() {
        tChart1.getAspect().setView3D(false);

        points1 = new com.steema.teechart.styles.Points(tChart1.getChart());
        points1.fillSampleValues(10);

        tool1 = new com.steema.teechart.tools.CursorTool(tChart1.getChart());
        tool1.setStyle(com.steema.teechart.tools.CursorToolStyle.HORIZONTAL);
        tool1.getPen().setColor(com.steema.teechart.drawing.Color.YELLOW);
        tool1.addCursorListener(new com.steema.teechart.tools.CursorTool.CursorListener() {
        public void cursorMoved(com.steema.teechart.tools.CursorTool.CursorEvent e)
        {

        }
        });

        tool2 = new com.steema.teechart.tools.CursorTool(tChart1.getChart());
        tool2.setStyle(com.steema.teechart.tools.CursorToolStyle.VERTICAL);
        tool2.getPen().setColor(com.steema.teechart.drawing.Color.BLUE);
    }
Could you please arrange a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Turc
Newbie
Newbie
Posts: 34
Joined: Wed Feb 03, 2010 12:00 am

Re: CursorTool

Post by Turc » Wed Dec 22, 2010 5:25 pm

The code for the CursorTools were never changed after they were implemented - and worked. I did however add code to that class (CapturedChart) and the main class where the CapturedChart gets its chart from, but why would any of that affect the cursor tools?

I made a simple program and the cursortools worked - as in the cursor appears on top of the line, but on my main program, the lines appear but the cursors still DO NOT appear when i mouse over them.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: CursorTool

Post by Narcís » Fri Dec 24, 2010 12:15 pm

Hi Turc,
Turc wrote:The code for the CursorTools were never changed after they were implemented - and worked. I did however add code to that class (CapturedChart) and the main class where the CapturedChart gets its chart from, but why would any of that affect the cursor tools?
This is impossible for us to predict without knowing what changed in that class. Can you reproduce the problem with the code snippet Yeray posted?
Turc wrote:I made a simple program and the cursortools worked - as in the cursor appears on top of the line, but on my main program, the lines appear but the cursors still DO NOT appear when i mouse over them.
If the problem persists, could you please attach a simple example project we can run "as-is" to reproduce the problem here using the binary release of TeeChart?

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply