rect.java

来自「一个简单的JAVA绘图程序」· Java 代码 · 共 31 行

JAVA
31
字号
//********************************************************************
//  Rect.java     Author: Lewis and Loftus / Peter DePasquale
//
//  Refinement #2
//
//  Represents a rectangle shape io the PaintBox application.
//********************************************************************

import java.io.*;
import java.awt.*;

public class Rect extends BoundedShape
{
   //-----------------------------------------------------------------
   //  Sets up the rectangle's color, position, and size.
   //-----------------------------------------------------------------
   public Rect (Color color, Point corner, int wide, int high)
   {
      super (color, corner, wide, high);
   }

   //-----------------------------------------------------------------
   //  Draws the rectangle.
   //-----------------------------------------------------------------
   public void draw (Graphics page)
   {
      page.setColor (strokeColor);
      page.drawRect (upperLeft.x, upperLeft.y, width, height);
   }
}

⌨️ 快捷键说明

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