[Biojava-l] Highlight Features when clicked? newbie

Matthew Pocock matthew_pocock at yahoo.co.uk
Tue May 11 10:54:55 EDT 2004


Hi,

One solution is to have 2 top-level renderers. One is painted 'behind' 
the other, and highlights a range. The one in front is your normal 
renderer. Wire the events so that selecting a feature sets the 
highlighting range on the 'behind' renderer.

If you check out the das client code from cvs (it's in a different cvs 
module to biojava-live), you should be able to find some example code 
for this.

Matthew

Maximilian Haeussler wrote:

> Hi everyone,
>
> is there a simple way to highlight a feature when it is clicked? Just 
> like in most programs with a gui, word or whatever, I want to draw 
> something a around a selected feature, a black rectangle for instance 
> when the user clicks on it. I suppose this is a pretty common problem 
> for everyone using the gui-classes.
> I'm playing around with a FeatureFilter.ByFeature in conjunction with 
> a RectangularBeadRenderer but this can't be way that the authors of 
> the gui classes had imagined when they wrote them. (As features are 
> not graphical objects in Biojava, I can't send them messages directly.)
>
> So I have to draw the rectangle directly onto the graphics, right? But 
> how could I find out the coordinates of the feature's edges?? Is there 
> some mechanism in those javadocs ( I've come to hate them pretty much 
> :-) that I've overlooked?
>
> Thanks
> Max
>
>
> _______________________________________________
> Biojava-l mailing list  -  Biojava-l at biojava.org
> http://biojava.org/mailman/listinfo/biojava-l
>



More information about the Biojava-l mailing list