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

📄 yacasgraphicscontext.java

📁 计算机代数系统
💻 JAVA
字号:
package net.sf.yacas;import java.awt.*;class YacasGraphicsContext{  Graphics graphics;  int xtop;  int ytop;  public YacasGraphicsContext(Graphics g,int x, int y)  {    graphics = g;    xtop = x;    ytop = y;  }  public void SetColor(int red, int green, int blue)  {    graphics.setColor(new Color(red,green,blue));  }  public void DrawText(int x, int y, String text)  {    graphics.drawString(text,x+xtop,y+ytop);  }  public void DrawLine(int x0, int y0, int x1, int y1)  {    graphics.drawLine(xtop+x0,ytop+y0,xtop+x1,ytop+y1);  }  public void DrawRoundRect(int x,int y, int width, int height, int arc)  {    graphics.drawRoundRect(xtop+x,ytop+y,width,height,arc,arc);  }  public void DrawRect(int x,int y, int width, int height)  {    graphics.drawRect(xtop+x,ytop+y,width,height);  }  public void FillRoundRect(int x,int y, int width, int height,int arc)  {    graphics.fillRoundRect(xtop+x,ytop+y,width,height,arc,arc);  }  public void FillRect(int x,int y, int width, int height)  {    graphics.fillRect(xtop+x,ytop+y,width,height);  }  public int FontHeight()  {    FontMetrics fontMetrics = graphics.getFontMetrics();    return fontMetrics.getHeight();  }  public int FontDescent()  {    FontMetrics fontMetrics = graphics.getFontMetrics();    return fontMetrics.getDescent();  }  public int TextWidthInPixels(String text)  {    FontMetrics fontMetrics = graphics.getFontMetrics();    return fontMetrics.stringWidth(text);  }  public int SetFontSize(int aBold, int aSize)  {    if (aBold != 0)      graphics.setFont(new Font("Helvetica", Font.BOLD, aSize));    else      graphics.setFont(new Font("Helvetica", Font.PLAIN, aSize));    //TODO    return 1;  }};

⌨️ 快捷键说明

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