Mixing Basic Shapes...JavaFX

Often we required some shapes which are not in the list of Basic Shapes available in JavaFX. I mean this is true with any language. A month back, I wanted to make a tube in JavaFX and Tube has very awesome cut at the top which can't be done with basic shapes. We can easily tackle these conditions by intersecting and  subtracting the shapes. Have a look :

Now, this is very easy to make. 1 subtraction and that's it. This is just 2 ellipses and 1 Shape subtraction ! Find the code :

Shapes.fx

Even in this, we can play more and make it as real as it is desired. If you see my tube closely, you will find a green color on the top which gives a feeling that the inside color or liquid inside the tube is green in color. Rotating this tube with 90 and removing the lower base can be helped in the simulation of Pipes. With this only, I had written one small code, showing how light travel in pipes. I will post that code as well in few days.

Point is JavaFX has a strong support for basic shapes but if your desired shape doesn't resides in the list. Use ShapeIntersect and ShapeSubtract for acheiving the desired result.

If you are interest in seeing the liquid filling in this tube, please visit this article.

Comments:

Hi i created flash like demo please check this out

http://farrukh.hostrator.com/

Posted by Farrukh obaid on April 12, 2009 at 07:38 PM IST #

Nice Application !

Posted by Vaibhav Choudhary on April 13, 2009 at 02:13 AM IST #

<p>&nbsp;&nbsp; Christmas is coming, not have prepare the gifts for your friends? <a href="http://www.christianlouboutinshoesdirect.com">Christian Louboutin</a> Shoes will be the nice presents. <a href="http://www.christianlouboutinshoesdirect.com/christian-louboutin-boots-c-7.html">Christian Louboutin boots</a> is your best choice,because<a href="http://www.christianlouboutinshoesstore.com/">Christian Shoes</a> have so many beautiful kinds of producsts. Like Christian <a href="http://www.christianlouboutinshoesmart.com/index.php">Louboutin Shoes</a> for your love. Christian Louboutin Boots for your best friends, and Christian <a href="http://www.christianlouboutinshoesdirect.com/christian-louboutin-shoes-c-8.html">Louboutin Shoes</a> for your family members. So now go to the online-store for your <a href="http://www.christianlouboutinshoesdirect.com">cheap Christian Louboutin Shoes</a></p>

Posted by Christian Louboutin shoes on December 28, 2009 at 04:59 AM IST #

- <a href="http://revizyonileorganizebrnckvvtmllttrhaberimatbaacilik.wordpress.com" title="revizyon ile organize matbaacılık brnckvvtmllttrhaberi" target="_blank">revizyon ile organize matbaacılık brnckvvtmllttrhaberi</a>
- <a href="http://revizyonileorganizematbacilikbrnckvvtmllttrhaberi.wordpress.com" title="revizyon ile organize matbaacılık brnckvvtmllttrhaberi" target="_blank">revizyon ile organize matbaacılık brnckvvtmllttrhaberi</a>
- <a href="http://revizyonilematbaabrnckvvtmllttrhaberi.blogspot.com" title="revizyon ile organize matbaacılık brnckvvtmllttrhaberi" target="_blank">revizyon ile organize matbaacılık brnckvvtmllttrhaberi</a>
- <a href="http://revizyonileorganizematbaacilikbrnckvvtmllttrhaberi.manyaklari.com" title="revizyon ile organize matbaacılık brnckvvtmllttrhaberi" target="_blank">revizyon ile organize matbaacılık brnckvvtmllttrhaberi</a>
- <a href="http://www.revizyon-ile-organize-matbaacilik-brnckvvtmllttrhaberi.co.tv" target="_blank">revizyon ile organize matbaacılık brnckvvtmllttrhaberi</a>
- <a href="http://revizyonileorganizematbaacilik-brnckvvtmllttrhaberi.co.tv" target="_blank">revizyon ile organize matbaacılık brnckvvtmllttrhaberi</a>
- <a href="http://www.lidasiparis.org" title="lida" target="_blank">lida</a> <a href="http://www.diziizle.name" title="dizi, dizi izle, canlı dizi" target="_blank">dizi izle</a>

Posted by dizi on December 29, 2009 at 04:01 PM IST #

Just one question: how to add you blog into my rrs reader, thanks so much.

Posted by christian louboutin on January 03, 2010 at 12:47 AM IST #

<a href="http://www.christianlouboutinshoesdirect.com">cheap christian louboutin</a> on sale <a href="http://www.christianlouboutinshoesdirect.com/christian-louboutin-esoteri-120-ankle-boots-bicolored-leather-p-226.html">discount christian louboutin</a> on sale discount christian louboutin on sale cheap <a href="http://www.christianlouboutinshoesdirect.com/christian-louboutin-very-prive-platform-pumps-p-98.html">christian louboutin sale</a> cheap christian louboutin sale discount <a href="http://www.christianlouboutinshoesdirect.com">christian louboutin</a> sale discount <a href="http://www.christianlouboutinshoesdirect.com/christian-louboutin-cest-moi-boots-hot-pink-suede-p-186.html">christian shoes</a> sale discount christian louboutin Shoes christian louboutin Shoes <a href="http://www.christianlouboutinshoesdirect.com/christian-louboutin-black-patent-leather-simple-pumps-p-25.html">christian louboutin Shoes</a> on sale christian louboutin Shoes on sale discount christian louboutin Shoes sale discount christian <a href="http://www.christianlouboutinshoesdirect.com/christian-louboutin-treopli-black-fully-stock-p-223.html">louboutin</a> Shoes sale <a href="http://www.christianlouboutinshoesdirect.com/christian-louboutin-catenita-platform-slingbacks-p-19.html">Christian Louboutin Sandals</a> on sale Christian Louboutin Sandals on sale Thanks of your infomation i have read it is very help full for me.

Posted by Christian Louboutin shoes on January 04, 2010 at 09:40 AM IST #

I would really like to keep reading your blogs. Cant wait for the next post. Good blogs are hard to find!thank you,and I also like the <a href="http://www.christianlouboutinshoesdirect.com">christian louboutin shoes</a>,and it has a new style and good quality.</p>

Posted by christian louboutin on January 07, 2010 at 05:05 AM IST #

This is great news. Best of luck for the future and keep up the good work.

Posted by China Wholesale on January 09, 2010 at 04:45 AM IST #

<p>Heat can’t distract from pure fabulosity… Love those shoes.When do they go on sale again? and please tell me they will be in size 11… The big foot girls also love choosing <a href="http://www.christianlouboutinshoesstore.com/">christian louboutin</a> too! Because they are so fit you----girls,they will be your best choice!
<p><b><i></i></b>

Posted by Christian Louboutin shoes on January 19, 2010 at 09:52 AM IST #

I agree and will bookmark this page and be back to follow you more.

Posted by hickory nc furniture on January 23, 2010 at 09:01 PM IST #

http://www.christianlouboutinshoesdirect.com

Posted by Christian Louboutin shoes on January 25, 2010 at 09:12 AM IST #

http://www.christianlouboutinshoesdirect.com

Posted by Christian Louboutin shoes on January 25, 2010 at 10:08 AM IST #

<a href ="http://revizyonileorganizematbaacilikbrnckvvtmllttrhaberi.bloggum.com/" title ="revizyon ile organize matbaacılık brnckvvtmllttrhaberi" rel="muse">revizyon ile organize matbaacılık brnckvvtmllttrhaberi</a>
<a href ="http://revizyonileorganizematbaabrnckvvtmllttrhaberi.wordpress.com/" title ="revizyon ile organize matbaacılık brnckvvtmllttrhaberi" rel="muse">revizyon ile organize matbaacılık brnckvvtmllttrhaberi</a>
<a href ="http://www.birincikuvvetmillettrhaberi.co.tv/" title ="revizyon ile organize matbaacılık brnckvvtmllttrhaberi" rel="muse">revizyon ile organize matbaacılık brnckvvtmllttrhaberi</a>

Posted by s3o on January 30, 2010 at 04:44 PM IST #

Respond to this comment at <a href ="http://revizyonileorganizematbaacilikbrnckvvtmllttrhaberi.bloggum.com/" title ="revizyon ile organize matbaacılık brnckvvtmllttrhaberi" rel="muse">revizyon ile organize matbaacılık brnckvvtmllttrhaberi</a>
<a href ="http://revizyonileorganizematbaabrnckvvtmllttrhaberi.wordpress.com/" title ="revizyon ile organize matbaacılık brnckvvtmllttrhaberi" rel="muse">revizyon ile organize matbaacılık brnckvvtmllttrhaberi</a>
<a href ="http://www.birincikuvvetmillettrhaberi.co.tv/" title ="revizyon ile organize matbaacılık brnckvvtmllttrhaberi" rel="muse">revizyon ile organize matbaacılık brnckvvtmllttrhaberi</a>thank for everything

Posted by s3o on January 31, 2010 at 10:34 AM IST #

No matter when, people pursue beauty is not going to change. Heart of beauty in everyone.

Posted by usd on April 26, 2010 at 05:40 AM IST #

Post a Comment:
Comments are closed for this entry.
About

Hi, I am Vaibhav Choudhary working in Sun. This blog is all about simple concept of Java and JavaFX.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today