/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER * Copyright 2009 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. * * This file is available and licensed under the following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * * Neither the name of Sun Microsystems nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package graphics; import javafx.scene.Group; import javafx.scene.paint.Color; import javafx.scene.paint.LinearGradient; import javafx.scene.paint.Stop; import javafx.scene.Scene; import javafx.scene.shape.Circle; import javafx.scene.shape.Polygon; import javafx.scene.shape.Rectangle; import javafx.stage.Stage; /** * @author mquill */ Stage { title: "Play Button" scene: Scene { height: 350 width: 250 fill: Color.WHITE content: [ Group { content: [ //Begin Rectangle 1: top part of lower gradient area Rectangle { x: 48, y: 100, width: 150, height: 70 fill: LinearGradient { startX: 0.0, startY: 1.0, endX: 0.0, endY: 0.0, proportional: true stops: [ Stop { offset: 0.0 color: Color.web("#99ddff") }, Stop { offset: 1.0 color: Color.web("#337799") } ] //stops } //fill }//Rectangle1 //Begin Rectangle 2: bottom part of lower gradient area Rectangle { x: 48, y: 168, width: 150, height: 25 fill: LinearGradient { startX: 0.0, startY: 1.0, endX: 0.0, endY: 0.0, proportional: true stops: [ Stop { offset: 0.0 color: Color.web("#337799") }, Stop { offset: 1.0 color: Color.web("#99ddff") } ] //stops } //fill }//Rectangle2 // Begin Rectangle 3: upper gradient area Rectangle { x: 48, y: 45, width: 150, height: 60 arcWidth: 0, arcHeight: 0, stroke: Color.GREEN fill: LinearGradient { startX: 0.0, startY: 1.0, endX: 0.0, endY: 0.0, proportional: true stops: [ Stop { offset: 0.0 color: Color.web("#aaeeff") }, Stop { offset: 1.0 color: Color.web("#66aacc") } ] //stops } //fill } //Rectangle3 //Begin Rectangle 4: stroked outline Rectangle { x: 48, y: 45, width: 150, height: 150 arcWidth: 15, arcHeight: 15, stroke: Color.web("#337799") fill: null strokeWidth: 5 } //Rectangle 4 Circle { centerX: 122 centerY: 122 radius: 38 fill: LinearGradient { startX: 0.0, startY: 1.0, endX: 0.0, endY: 0.0, proportional: true stops: [ Stop { offset: 0.0 color: Color.web("#66aacc") }, Stop { offset: 1.0 color: Color.web("#99ddff") } ] //stops } //fill stroke: Color.web("#66aacc") strokeWidth: 2.0 } // Polygon1: lower triangle Polygon { points: [ 142.0, 126.0, 113.0, 108.0, 111.0, 143.0 ] fill: Color.web("#337799") }//Polygon1 //Polygon2: upper triangle Polygon { points: [ 142.0, 123.0, 110.0, 105.0, 110.0, 140.0 ] fill: Color.web("#ffffff") }//Polygon2 ] //Content } //Group ] //Content } //Scene } //Stage