Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #2756 > unrolled thread

Re: Problem with overlapp

Started by"Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this>
First post2011-04-27 15:40 +0000
Last post2011-04-27 15:40 +0000
Articles 3 — 3 participants

Back to article view | Back to comp.lang.java.gui

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Problem with overlapp "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:40 +0000
    Re: Problem with overlapp "L I M" <l.i.m@THRWHITE.remove-dii-this> - 2011-04-27 15:40 +0000
      Re: Problem with overlapp "A. Bolmarcich" <a..bolmarcich@THRWHITE.remove-dii-this> - 2011-04-27 15:40 +0000

#2756 — Re: Problem with overlapp

From"Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this>
Date2011-04-27 15:40 +0000
SubjectRe: Problem with overlapp
Message-ID<7b336f1df125e@uwe>
  To: comp.lang.java.gui
Chanchal wrote:
>Hi,

Hi.  

That was almost an excellent SSCCE you posted, but if you 
make some trivial changes, it is possible to post just a single 
(.java) file that helps people see it easier.

The way you would do that is (the same way I just
did to see the code run as Test.java)
- Move all the imports to the 'top'
- demote the 'public class Line' to 'class Line'
- ..that's about it, actually.

The thing is - it is easier for you to do that before posting,
than for two other people to do it while before seeing the 
problem.

>When the program is run, two lines are drawn. First one,  Orange in
>color and has a green border. Sencond line is a blue one with red
>border. the borders are opverlapping.
>
>My issue is that when i move mouse pointer over the part of the blue
>line which is overlapping with the green border, the events are not
>getting fired.

I am not entirely sure I understand.  But I will take a shot.

If you mean that 'the bottom component' is not getting events
when the mouse passes over the 'top component' then I think
that makes sense.

The top component is 'consuming' the events before they 
reach the bottom component.

>Kindly advice on how to overcome this problem

I am not sure that you are following the correct strategy here.

If I were the user about to drag either of those components, I
would expect the 'top one' to be dragged whenever the pointer 
is within its bounds.  Why would I want the bottom one to 
get the events?  

If need be, I might even drag the top one out of the way 
for the moment, just to get at the bottom one.

I suggest instead that you draw an 'animated outline' of the 
bounds of the 'selected' line - then I think it would be fairly
intuitive for the user.  Also, a way to 'reorder' the layering 
might be handy.

What is this all for, by the way?  I can think of a number of 
interesting types of things you might do with this, but what
is this one used for?

-- 
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-gui/200711/1

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [next] | [standalone]


#2758

From"L I M" <l.i.m@THRWHITE.remove-dii-this>
Date2011-04-27 15:40 +0000
Message-ID<1195062261.615584.187620@i13g2000prf.googlegroups.com>
In reply to#2756
  To: comp.lang.java.gui
On Nov 14, 7:49 am, "Andrew Thompson" <u32984@uwe> wrote:
> Chanchal wrote:
> >Hi,
>
> Hi.  
>
> That was almost an excellent SSCCE you posted, but if you
> make some trivial changes, it is possible to post just a single
> (.java) file that helps people see it easier.
>
> The way you would do that is (the same way I just
> did to see the code run as Test.java)
> - Move all the imports to the 'top'
> - demote the 'public class Line' to 'class Line'
> - ..that's about it, actually.
>
> The thing is - it is easier for you to do that before posting,
> than for two other people to do it while before seeing the
> problem.
>
> >When the program is run, two lines are drawn. First one,  Orange in
> >color and has a green border. Sencond line is a blue one with red
> >border. the borders are opverlapping.
>
> >My issue is that when i move mouse pointer over the part of the blue
> >line which is overlapping with the green border, the events are not
> >getting fired.
>
> I am not entirely sure I understand.  But I will take a shot.
>
> If you mean that 'the bottom component' is not getting events
> when the mouse passes over the 'top component' then I think
> that makes sense.
>
> The top component is 'consuming' the events before they
> reach the bottom component.
>
> >Kindly advice on how to overcome this problem
>
> I am not sure that you are following the correct strategy here.
>
> If I were the user about to drag either of those components, I
> would expect the 'top one' to be dragged whenever the pointer
> is within its bounds.  Why would I want the bottom one to
> get the events?

Unless, if you've tried running the code, the user is given an
impression that
the lines are indeed non-overlapping, only the rectagle borders are.
Simply put it, the drawings of the rectagle borders had not covered
that part of the blue line, since the rectangle is transparent. But
the event is still consumed by the rectangle instead of the line
underneath it, since the rectangular object is still on top of that
line.

> If need be, I might even drag the top one out of the way
> for the moment, just to get at the bottom one.
>
> I suggest instead that you draw an 'animated outline' of the
> bounds of the 'selected' line - then I think it would be fairly
> intuitive for the user.  Also, a way to 'reorder' the layering
> might be handy.
>
> What is this all for, by the way?  I can think of a number of
> interesting types of things you might do with this, but what
> is this one used for?
>
> --
> Andrew Thompsonhttp://www.athompson.info/andrew/
>
> Message posted via JavaKB.comhttp://www.javakb.com/Uwe/Forums.aspx/java-gui/200711/1

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#2759

From"A. Bolmarcich" <a..bolmarcich@THRWHITE.remove-dii-this>
Date2011-04-27 15:40 +0000
Message-ID<slrnfjmkjr.16vv.aggedor@earl-grey.cloud9.net>
In reply to#2758
  To: comp.lang.java.gui
On 2007-11-14, L I M <clgoh@student.cs.uwaterloo.ca> wrote:
[snip]
> Unless, if you've tried running the code, the user is given an
> impression that
> the lines are indeed non-overlapping, only the rectagle borders are.
> Simply put it, the drawings of the rectagle borders had not covered
> that part of the blue line, since the rectangle is transparent. But
> the event is still consumed by the rectangle instead of the line
> underneath it, since the rectangular object is still on top of that
> line.

If that is the problem, then a boolean contains(int x, int y) method
should be added to the Line class.  A return value of true indicates
that the component should receive mouse events when the mouse is at
location (x,y) of the component.

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.gui


csiph-web