[wadalabfont-kit] / java / Outline.java  

View of /java/Outline.java

Parent Directory | Revision Log
Revision: 1.2 - (download) (as text) (annotate)
Thu Jan 4 10:23:56 2001 UTC (23 years, 10 months ago) by ktanaka
Branch: MAIN
CVS Tags: SNAP-20030702, SNAP-20030624, SNAP-20030630, SNAP-20040518, HEAD
Changes since 1.1: +50 -0 lines
MinchoRendererのへんこう瘢雹
public class Outline {
  OutlineComponent[] components;
  Outline(OutlineComponent[] components){
    this.components=components;
  }
  Outline(OutlineComponent component){
    this.components=new OutlineComponent[1];
    this.components[0]=component;
  }
  Outline append(Outline outline){
    OutlineComponent[] newComponents=new OutlineComponent[components.length+outline.components.length];
    System.arraycopy(components,0,newComponents,0,components.length);
    System.arraycopy(outline.components,0,newComponents,components.length,outline.components.length);
    return new Outline(newComponents);
  }
  Outline plus(Point p0){
    OutlineComponent[] newComponents=new OutlineComponent[components.length];
    for(int i=0;i<components.length;i++){
      newComponents[i]=components[i].plus(p0);
    }
    return new Outline(newComponents);
  }
  Outline rot(double theta){
    OutlineComponent[] newComponents=new OutlineComponent[components.length];
    for(int i=0;i<components.length;i++){
      newComponents[i]=components[i].rot(theta);
    }
    return new Outline(newComponents);
  }
  Outline times(double ratio){
    OutlineComponent[] newComponents=new OutlineComponent[components.length];
    for(int i=0;i<components.length;i++){
      newComponents[i]=components[i].times(ratio);
    }
    return new Outline(newComponents);
  }
  Outline timesY(double ratio){
    OutlineComponent[] newComponents=new OutlineComponent[components.length];
    for(int i=0;i<components.length;i++){
      newComponents[i]=components[i].timesY(ratio);
    }
    return new Outline(newComponents);
  }
  Point firstPoint(){
    return components[0].firstPoint();
  }
  Point lastPoint(){
    return components[components.length-1].lastPoint();
  }
  OutlineComponent[] getComponents(){ return components; }
  public String toString(){
    String str="Outline(";
    for(int i=0;i<components.length;i++)
      str+=components[i].toString();
    return str+")";
  }
}

ktanaka

Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help