Home » Eclipse Projects » Remote Application Platform (RAP) » What apart from the "ratio" value affects division of space within a perspective?(I understand how "ratio" works but it doesn't seem to be the whole story)
What apart from the "ratio" value affects division of space within a perspective? [message #656778] |
Mon, 28 February 2011 14:59 |
Alan Chambers Messages: 6 Registered: February 2011 |
Junior Member |
|
|
I'm working on a RAP app in which we have an editor area and three other views - editor area at bottom right, a horizontal split with two views dividing the area above the split and one more to the left of the editor area below the split.
If I recreate this layout using a simple example (based on one of the RAP samples), the proportions set by the various "ratio" values all work as I understand they are supposed to.
E.g. in the following code...
public void createInitialLayout(IPageLayout layout) {
String editorArea = layout.getEditorArea();
layout.setEditorAreaVisible(true);
layout.setFixed(true);
layout.addStandaloneView(View.ID, false, IPageLayout.TOP, .4f, editorArea);
layout.addStandaloneView(View2.ID, false, IPageLayout.RIGHT, .4f, View.ID);
layout.addStandaloneView(View3.ID, false, IPageLayout.LEFT, .7f, editorArea);
}
...the top two views occupy 40% of the vertical space. Of these the left one has 40% of the horizontal space, and the right one has 60%. Below them, the bottom left view has 70% of the horizontal space, and the editor area has 30%.
However in our application, the ratios don't seem to work so predictably. With identical code (apart from the view IDs being different), the proportions are completely different. Experimenting with the ratios, if I add the first view above the editor area with a ratio of 0.9, it actually gets only about 40% of the area. Set it to 0.5 and it gets only about a quarter of the vertical space. I have a similar problem when I add a view to the left of the editor area - again, setting a ratio of 0.9 gives the view less than 50% of the space formerly occupied by the editor area.
Clearly, other factors are influencing the layout but I can't think what. It feels like the editor area thinks it needs more space than I'm allocating it and is grabbing what it wants anyway.
Where should I be looking to solve this?
I'm fairly new to RAP, so apols if this is a noobie question; I have searched the forums without finding an answer so far.
|
|
| | | |
Re: What apart from the "ratio" value affects division of space within a perspective? [message #656991 is a reply to message #656908] |
Tue, 01 March 2011 09:55 |
Alan Chambers Messages: 6 Registered: February 2011 |
Junior Member |
|
|
Paul Bilnoski wrote on Mon, 28 February 2011 18:01 |
If you add the editor area in, then add a view above it at 40%, it will indeed take 40% space and the editor area 60%. If however you then add another view above the first view at 50%, it will only take up 50% of the 40% the first view already has, resulting in 20-20-60 distribution. This is consistent with what you said that it takes up about a quarter of the vertical space.
|
Paul - your thoughts are appreciated but I think I may not have been very clear in describing what I'm trying to achieve. My first view is added above the editor area, but the next one is added to the right of that, and the third one added to the left of the editor area, so I'm not adding multiple views in the same direction. What is strange to me is that in my simple test case (code provided above) the ratios work exactly as you describe but in the almost identical application code I'm working on, it behaves differently, suggesting that something else is influencing the layout other than these ratios.
Many thanks,
Alan
[Updated on: Tue, 01 March 2011 09:57] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sat Apr 27 00:25:27 GMT 2024
Powered by FUDForum. Page generated in 0.62029 seconds
|