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

📄 cadsymbol.java

📁 这个文件里面包含了java设计模式的一些例子讲解
💻 JAVA
字号:
package com.javapatterns.prototype.cad;

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

public abstract class CadSymbol implements CadSymbolIF
{
  // methods for Cloneable interface

  public Object clone()
  {

    try
    {
  		return super.clone();
	}
    catch (CloneNotSupportedException e)
    {
  		// This should never happen because this class implements Cloneable
      throw new InternalError();
    }
  }
  // methods for Serializable interface, if needed
//  private void writeObject(java.io.ObjectOutputStream out) throws IOException
//  private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException;
  // identity methods
  private String name;

  public String getName()
  {
    return name;
  }

  public void setName(String name)
  {
    this.name = name;
  }

  abstract public String getType();

  // some example method needed by the cad program
  protected Dimension extents, origin;
  public Dimension getExtents ()
  {
    return extents;
  }

  public void setExtents (Dimension d)
  {
    extents = d;
  }

  public Dimension getOrigin ()
  {
  	return origin;
  }

  public void setOrigin (Dimension d)
  {
    origin = d;
  }

  abstract public void draw (Graphics g);

}

⌨️ 快捷键说明

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