How to prevent west and East elements from overlapping center in BorderLayout - layout

I'm trying to create a layout in this sketch
I want to have a vertical slider in the center, one SpanLabel on the left and another on the right.
I've tried using BorderLayout, but the SpanLabels overlap the slider if their texts are long. Is there a Layout that I could use to achieve a similar style or something I could do to fix BorderLayout?
CenterAbsolute and CenterCenter don't help in fixing this.

I'd use a TableLayout with percentages for each column to achieve this sort of layout.
BorderLayout assumes the preferred size of the elements on the sides/top/bottom isn't too big to cover everything so it's a bit problematic in some use cases.

Related

Codename one - scrollable layout restrictions

I have done my own version of the PropertyCross Demo (provided in their demo section).
The problem I currently face is the size of the "Recent Search" area. While I have a non-scrollable container, I can easily define the preferred height. As the Box Layout adheres to the preferred size, all is well, with the little issue of not being able to scroll it and see more than one result:
recentSearchContainer = new Container(new BoxLayout(BoxLayout.Y_AXIS)); recentSearchContainer.setPreferredH((int)(this.getContentP‌​ane().getHeight() * 0.1f));
Once I set the container to scrollable, the preferred height gets overwritten and takes up as much space as it needs, taking too much space from the BorderLayout Center piece above it.
How to manipulate the preferred size of scrollable components?
You don't manipulate the preferred size. Scrollables take up more space so if you need them to take up a specific amount of space you need to use the right type of layout which in this case might not be border layout...
Border layout gives NORTH/SOUTH elements their preferred height which might not be what you want. You might want a grid layout which will divide the height 50/50. You might want a table layout where you can define the height in percentages etc.
For those who are interested, here is the solution:
Setup a table layout with a single column and as many rows as you need (similar to box layout y axis or border layout which only north, center and south).
Set the table layout to non-scrollable so it defaults to 100% of your screen.
add the components with height % of the screen they should take up.
those components can be scrollable and will still stick to the height constraint!
// inside a form object, setup the layout
TableLayout tl = new TableLayout(3, 1);
tl.setGrowHorizontally(true);
setScrollable(false);
setLayout(tl);
...
// and add stuff to it
add(tl.createConstraint().heightPercentage(15), labelDesc);
add(tl.createConstraint().heightPercentage(50), compGroup);
add(tl.createConstraint().heightPercentage(35), recentSearchContainer);
Works like a charm!

d3.js. How to organize bubbles along the line without overlaps?

I want to make such kind of bubble chart:
But only i can do is here - http://jsfiddle.net/zeleniy/h646uopc/6/.
jsfiddle code mock
How i can move them apart to escape overlapping. I understand that in some cases bubbles will be shifted along the x axis because of chart height limit. But in any case i do not know how to do it? And i am not sure that want to use force layout to scatter bubbles. I want do draw it at once.
Finally i do it - http://zeleniy.me/stretched-bubble-chart.html.
You should use force layout with specific gravity implementation. Read this article for details - http://vallandingham.me/building_a_bubble_cloud.html

Can I show the whole vertex point on the edge of the grid?

XYPlot vertex points positioned towards the edge of the grid gets cut off and only show the half of the point inside the grid. Can I make it so the whole point is shown?
You just need to add some padding to the grid like this:
plot.getGraphWidget().setGridPaddingLeft(PixelUtils.dpToPix(5));
you'll probably also want to do the same on the right to keep things symmetrical.

android wipe animation when button bar slide up

I'm trying to create slidingup animation in android application to change between two view of layout.
I've tried from this tutorial
but the second screen didn't come like what I want.
I want the second layout to come like a wipe animation, like the following picture at the bottom
Refer this:
https://android.googlesource.com/platform/frameworks/base/+/ab51002847ea3dcdc0ba14eb330ab9ec292a9789/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
In the above code, focus on the animateCollapsePanels method
I was able to implement a similar transition by using a clipping Path. Because I didn't want my transition to rule out the use of Layouts in the clipped view, I implemented the clipping at the Layout level following this answer: Custom Layout that rounds the corners of its content
The clipping is no anti-aliased and you would need to do use instead PorterDuff and XferMode based solutions otherwise, but for a linear wipe animation like you're describing, clipping in the layout will achieve what you want. Basically you're doing a linear reveal whereas the accepted answer I linked does a circular clip.

How can I change thickness on elycharts pie chart?

I'm trying to make a menu for a website, and the client has provided me the final view of the menu: three circles, one in another, divided into segments. And each segment is a link, which will load content with AJAX.
So, I'm playing with Elycharts, and managed to make the three circles and divide them into segments. The main difference between the current version and the desired result is that the three circles must be different in thickness ... but can't find a way to control this ...
What is the way to achieve this? Thanks in advance ;)
I managed to do it with d3.js, much simpler ... and generates simpler code too ;)

Resources