This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have David & Dawn Griffiths on-line!
See this thread for details.
Win a copy of Head First Android this week in the Android 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Calculating size-accordance between Main Panel & Child Panel.

 
Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
Why?
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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any replies?
 
Sheriff
Posts: 22509
122
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Patience Is A Virtue.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic