/** * SunSphereButton displays and manages the user controls.<p> * * Copyright &copy; 1996 Martin Minow. All Rights Reserved.<p> * World map copyright &copy; 1992-97 Apple Computer Inc. All Rights Reserved. * Used by permission.<p> * * Permission to use, copy, modify, and redistribute this software and its * documentation for personal, non-commercial use is hereby granted provided that * this copyright notice and appropriate documentation appears in all copies. This * software may not be distributed for fee or as part of commercial, "shareware," * and/or not-for-profit endevors including, but not limited to, CD-ROM collections, * online databases, and subscription services without specific license.<p> * * @author <a href="mailto:minow@pobox.com">Martin Minow</a> * @version 1.2 * Set tabs every 8 characters. */package org.minow.applets.sunsphere;import java.awt.*;import java.awt.event.*;import java.util.*;public class SunSphereSpinButton extends SunSphereButton{    public static final String	spinLabel	= "Spin";    public static final String 	stopLabel	= "Stop";        /*     * Don't change the width or height without revising the image polygons.     */    private static final int	buttonWidth	    = 27;   /* Button dimension by  */    private static final int	buttonHeight	    = 21;   /* examining the image  */    private static final int	infoButtonWidth	    = 17;   /* Skinny Info button   */    private static final int	spinButtonIcon[]    =	{   0x0000, 0x0C00, 0x1E00, 0x3F00, 0x7F80, 0xFFC0, 0x1E0F, 0x1E0F, /* Spin */	    0x1E0F, 0x1E0F, 0x1FBF, 0x0FFE, 0x0FFE, 0x07FC, 0x01F0, 0x0000	};    private static final int	stopButtonIcon[]    =	{   0x0FF0, 0x1FF8, 0x3FFC, 0x7FFE, 0xFFFF, 0xC8B3, 0xBD55, 0xDD55, /* Stop */	    0xED53, 0xED57, 0x9DB7, 0xFFFF, 0x7FFE, 0x3FFC, 0x1FF8, 0x0FF0	};    private boolean spinning;        public SunSphereSpinButton()    {    	super(spinLabel, spinButtonIcon, buttonWidth, buttonHeight, defaultButtonColor);    	spinning	= false;    }    public void setSpinning(    	    boolean		spinning    	)    {    	this.spinning		= spinning;    	if (spinning) {    	    setLabel(stopLabel);    	    setButtonIcon(stopButtonIcon);    	    setButtonColor(Color.red);    	}    	else {    	    setLabel(spinLabel);    	    setButtonIcon(spinButtonIcon);    	    setButtonColor(defaultButtonColor);	}    }    public boolean isSpinning()    {    	return (spinning);    }}