⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 oval.java

📁 利用java编写的paintbox小程序
💻 JAVA
字号:
/*
 * Oval.java
 *
 * Created on 2007年4月23日, 下午11:58
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package paintbox;

/**
 *
 * @author fly
 */

import java.awt.*;

public class Oval extends BoundedShape{
    
    /** Creates a new instance of Oval */
   public Oval (Color color, Point corner, int wide, int high)
   {
      super (color, corner, wide, high);
   }
   
   public void draw (Graphics page)
   {
       if(filled){
           page.setColor(fillColor);
           page.fillOval(upperLeft.x, upperLeft.y, width, height);  
       }
      page.setColor (strokeColor);
      page.drawOval (upperLeft.x, upperLeft.y, width, height);
      if(slected)
      {
          page.setColor(Color.BLACK);
          page.fillOval(upperLeft.x-3,upperLeft.y+height/2-3,6,6);
          page.fillOval(upperLeft.x+width-3,upperLeft.y+height/2-3,6,6);
          page.fillOval(upperLeft.x+width/2-3,upperLeft.y+height-3,6,6);
          page.fillOval(upperLeft.x+width/2-3,upperLeft.y-3,6,6);
      }
          
   }  
   
   public Object clone()
   {
       B b=new B();
       return b.getOval();

   }


   private class B 
  {
      public Oval oval;
      public B()
      {
          Point point=new Point(upperLeft.x, upperLeft.y);
          oval=new Oval(strokeColor,point,width, height);
          if(filled)
              oval.setFilled(fillColor);
      }
    
     public Oval getOval()
     {
         return oval;
     }
   }
    
}










⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -