Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Calculating size-accordance between Main Panel & Child Panel.

Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ever-helping ranchers,
I've got a doubt on calculating window-size-ratio's accordance between panels.
I want to know generally how will they implement this or any useful links or tutorials on this.

I will try to picturise the scenario before you!

Consider there are two Windows Main Window & Child Window
Both of these windows extends Panel class

We need to calculate window-size ratio's between these Main Panel & Child Panel!
Follow me!

Main Panels features
1) These main panel is used to represent some time-duration say 10 min or 20 min. It is represented numerically .
But at any point of time the main panel will display 10 time-durations. If we scroll also, it will display 10 time-durations.
2) It has a vertical & horizontal scroll bar to scroll through these time-durations.
3) These main panel implements adjustmentlistener

Child Panel features
1) These child panel represents the main window components i.e. time-duration in rectangular bars.
2) It also has another broader white-color rectangle, which is used to move over these bars whose height we need to calculate. (rectheight)
Generally the 10 time-durations at any time in main panel, should be represented in Child Panel by covering those bars with these white-color rectangle.

Here p.x --> Point.x
p.y ---> Point.y

So now comes the crux of my question.
My child panel has a reference to the main panel, through which it can call the main panel's adjustment-listener's methods.
1) When we vertically scroll the time-duration in Main Window , (say at that time 5-15 time-duration representation) , the corresponding 10 time-durations in ChildPanel (which are represented in bars) should get highlighted in white-color rectangle(which moves over all the bars).

2) Also when I'm moving my white-color-rectangle over the bars in child panel, the corresponding time-duration only should get highlighted(should come in main window) in main panel.

For this size-accordance should be calculated between main panel & child panel right?
How that can be done!

I want to know generally how will they do this or atleast some idea or links is suffice!

My Best Regards!

ramya narayanan
Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any replies?
Posts: 22004
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Patience Is A Virtue.
Joel Salatin has signs on his property that say "Trespassers will be Impressed!" Impressive tiny ad:
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic