Results 1 to 2 of 2
Thread: implementing shape
- 01-11-2008, 05:24 AM #1
Member
- Join Date
- Jan 2008
- Posts
- 2
- Rep Power
- 0
- 01-12-2008, 06:42 PM #2
Member
- Join Date
- Jan 2008
- Posts
- 2
- Rep Power
- 0
This is what I came up with in the end... I thought I would share.
Java 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; }
Similar Threads
-
Help with Move Shape
By romina in forum AWT / SwingReplies: 2Last Post: 12-09-2010, 03:25 AM -
Implementing an interface
By bugger in forum Advanced JavaReplies: 1Last Post: 01-09-2008, 01:35 PM -
weird looking shape JButton is it possible?
By unhurt in forum AWT / SwingReplies: 8Last Post: 11-03-2007, 09:10 AM -
tool to create shape frame
By boy22 in forum AWT / SwingReplies: 1Last Post: 08-05-2007, 04:10 AM -
How to change shape of JButton
By FaRuK in forum AWT / SwingReplies: 1Last Post: 05-19-2007, 12:56 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks