Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-11-2008, 06:24 AM
Member
 
Join Date: Jan 2008
Posts: 2
sidkdbl07 is on a distinguished road
implementing shape
I want to create a SatelliteShape class that makes a shape that looks like


Are there any good tutorials on how to write the public PathIterator getPathIterator(AffineTransform pAt) method or any of the other methods?

Any hints would be great!!
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 01-12-2008, 07:42 PM
Member
 
Join Date: Jan 2008
Posts: 2
sidkdbl07 is on a distinguished road
This is what I came up with in the end... I thought I would share.

Code:
public static GeneralPath getSatelliteShape() { GeneralPath wingLeft = new GeneralPath(); wingLeft.moveTo(-22.5f,0f); wingLeft.lineTo(-22.5f,7.5f); wingLeft.lineTo(-6.6f, 7.5f); wingLeft.curveTo(-6.6f, 7.5f, -15f, 0f, -6.6f, -7.5f); wingLeft.lineTo(-22.5f, -7.5f); wingLeft.closePath(); GeneralPath crossLeft = new GeneralPath(); crossLeft.moveTo(-22.5f,0f); crossLeft.lineTo(-10f,0f); crossLeft.moveTo(-15f,7.5f); crossLeft.lineTo(-15f,-7.5f); GeneralPath circle = new GeneralPath(new Ellipse2D.Float(-10f,-10f,20f,20f)); GeneralPath wingRight = new GeneralPath(); wingRight.moveTo(22.5f,7.5f); wingRight.lineTo(22.5f,-7.5f); wingRight.lineTo(6.6f,-7.5f); wingRight.curveTo(6.6f, -7.5f, 15f, 0f, 6.6f, 7.5f); wingRight.closePath(); GeneralPath crossRight = new GeneralPath(); crossRight.moveTo(10f, 0f); crossRight.lineTo(22.5f, 0f); crossRight.moveTo(15f, 7.5f); crossRight.lineTo(15f, -7.5f); GeneralPath satellite = new GeneralPath(); satellite.append(wingLeft, false); satellite.append(crossLeft, false); satellite.append(circle, false); satellite.append(wingRight, false); satellite.append(crossRight, false); return satellite; }
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Implementing an interface bugger Advanced Java 1 01-09-2008 02:35 PM
weird looking shape JButton is it possible? unhurt AWT / Swing 8 11-03-2007 10:10 AM
Help with Move Shape romina AWT / Swing 1 08-07-2007 06:27 AM
tool to create shape frame boy22 AWT / Swing 1 08-05-2007 05:10 AM
How to change shape of JButton FaRuK AWT / Swing 1 05-19-2007 01:56 PM


All times are GMT +3. The time now is 07:18 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org