OK. So it seems like buttonPanorama should probably be protected instead of private. Alternatively, maybe you could just fix the existing TerraTabPaneSkin and submit a patch?
On Apr 6, 2011, at 8:08 AM, lello wrote: > I need to access buttonPanorama because layout() calls > > buttonPanorama.setLocation() and > buttonPanorama.setSize() > > > > Greg Brown-2 wrote: >> >> Why do you need access to the button panorama? Maybe there is another way >> to solve your problem? >> >> On Apr 6, 2011, at 6:26 AM, lello wrote: >> >>> Again my mistake. >>> The width of the corner component is perfect. >>> Now the only open question is how to avoid introducing a >>> getButtonPanorma() >>> method >>> in the TerraTabPaneSkin. (apart from copying the entire skin and then >>> modify >>> it accordingly). >>> >>> >>> >>> lello wrote: >>>> >>>> Sorry I gave a wrong information, >>>> the right arrow is not hidden, it's there. So the only problem is the >>>> size >>>> of the corner component >>>> which is almost the double of its actual component, and of course the >>>> fact >>>> that I had to add >>>> a new method to the basic skin, unless I want to copy/rewrite the entire >>>> skin. >>>> >>>> >>>> lello wrote: >>>>> >>>>> Unfortunately the problem is not so simple to solve. >>>>> >>>>> First, I have modified TerraTabPaneSkin adding a getButtonPanorama() >>>>> method, >>>>> as I need to access the buttonPanorama. >>>>> Second, following your suggestion I used the code: >>>>> >>>>> int cornerWidth = corner.getPreferredSize().width; >>>>> int buttonPanoramaWidth = width - cornerWidth; >>>>> >>>>> The final layout is a bit weird, with a very large area for the corner >>>>> component, and, >>>>> furthermore, I loose the right arrow which allows me to move along the >>>>> opened tabs >>>>> (the arrow that appears when you have completely filled the width of >>>>> the >>>>> tabPane). >>>>> >>>>> Do you think it is possible to change the design of the basic >>>>> TerraTabPaneSkin to meet the >>>>> requirement that the corner component should never be hidden? >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> Greg Brown-2 wrote: >>>>>> >>>>>>>>> First: I am trying to use the "corner" component of a tabpane to >>>>>>>>> display >>>>>>>>> a >>>>>>>>> menubutton. However I noticed that if I open a large number of >>>>>>>>> tabs, >>>>>>>>> the >>>>>>>>> corner component gets hidden by the tabs, is this a bug? >>>>>>>> >>>>>>>> Possibly. It was originally done this way by design, but that may >>>>>>>> not >>>>>>>> have >>>>>>>> been the right approach. >>>>>>>> >>>>>>> >>>>>>> Could you suggest me a simple way to modify/extend TabPaneSkin so to >>>>>>> have >>>>>>> the desired behaviour? >>>>>>> Or just the functions that I have to override. >>>>>> >>>>>> You'll have to modify TerraTabPaneSkin#layout(). The corner width is >>>>>> currently determined as follows: >>>>>> >>>>>> int buttonPanoramaWidth = Math.min(width, buttonPanoramaSize.width); >>>>>> ... >>>>>> int cornerWidth = width - buttonPanoramaWidth; >>>>>> >>>>>> You'll probably want to calculate the corner width first (by calling >>>>>> corner.getPreferredSize()) and then calculate the panorama width from >>>>>> that. >>>>>> >>>>> >>>> >>> >>> >>> -- >>> View this message in context: >>> http://apache-pivot-users.399431.n3.nabble.com/TabPane-corner-and-button-style-tp2778983p2784447.html >>> Sent from the Apache Pivot - Users mailing list archive at Nabble.com. >> > > > -- > View this message in context: > http://apache-pivot-users.399431.n3.nabble.com/TabPane-corner-and-button-style-tp2778983p2784697.html > Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
