Legend for Graphs
I'm developing a plugin to show crossovers between parental sequences and a descendant.
Here an output example:
I would like to have a legend included in the name. Ideally it would allow colors
but at least something like
Crossover new line
AAV2 in Blue
AAV5 in Green
If I do:
@Override
public String getName() {
return "Crossover\nAAV2 in Blue\nAAV5in Green";
}
is not working since I expect that to be a textfield. I also see a couple of methods like drawscale and getLegendName.
How can that be done?
Cheers,
Adrian
-
Hi Adrian,
It sounds like you want to implement the following:
This will allow you to draw whatever you want to the right of the name. You could just draw the two strings in the colours you want.
0 -
Hello Matthew,
Thank you. That works perfectly.
Is there any way to set
@Override
public int getScaleBarWidth() {
return dynamically;
}
dynamically? I need a handle to graphics so I could get the fontMetrics
and calculate the width of the longest sequence name string.
Cheers,
Adrian0 -
Hi Adrian,
Sorry for the extremely late reply. I just realised that I had been replying to posts using our shared Geneious Team account and didn't get notified of your responses.
Anyway hopefully you already figured this one out. There isn't really a way to do it dynamically so you should just return a value that you think is reasonably big enough. If the sequence name extends beyond that then perhaps use "...".
0 -
Hi Matt,
I guess I'll leave it like as is. Maybe you could consider for further versions offering a way to access the Graphics context.
That's fine with the late reply. As a company you are still one of the fastest respondents to the customer queries, well above industry standards.
Cheers
0
Please sign in to leave a comment.
Comments
4 comments