EPSGraphics.java
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, AIST, the University of Tokyo and General Robotix Inc.
3  * All rights reserved. This program is made available under the terms of the
4  * Eclipse Public License v1.0 which accompanies this distribution, and is
5  * available at http://www.eclipse.org/legal/epl-v10.html
6  * Contributors:
7  * General Robotix Inc.
8  * National Institute of Advanced Industrial Science and Technology (AIST)
9  */
10 package com.generalrobotix.ui.view.graph;
11 
12 import java.awt.*;
13 import java.io.*;
14 import java.util.*;
15 import java.awt.image.ImageObserver;
16 import java.text.AttributedCharacterIterator;
17 
24 public class EPSGraphics extends Graphics {
25 
26  // -----------------------------------------------------------------
27  // 定数
28  // ヘッダ等
29  private static final String HEADER = "%!PS-Adobe-3.0 EPSF-3.0";
30  private static final String BOUNDING_BOX = "%%BoundingBox:";
31  private static final String DEF = "/";
32  private static final String BIND_DEF = " bind def";
33  private static final String EOF = "%%EOF";
34  // 色オペレータ
35  private static final String SET_COLOR_WHITE = "setColorWhite";
36  private static final String SET_COLOR_LIGHTGRAY = "setColorLightGray";
37  private static final String SET_COLOR_GRAY = "setColorGray";
38  private static final String SET_COLOR_DARKGRAY = "setColorDarkGray";
39  private static final String SET_COLOR_BLACK = "setColorBlack";
40  private static final String SET_COLOR_OTHERS = "setColorOthers";
41  private static final String SET_COLOR_GREEN = "setColorGreen";
42  private static final String SET_COLOR_YELLOW = "setColorYellow";
43  private static final String SET_COLOR_PINK = "setColorPink";
44  private static final String SET_COLOR_CYAN = "setColorCyan";
45  private static final String SET_COLOR_MAGENTA = "setColorMagenta";
46  private static final String SET_COLOR_RED = "setColorRed";
47  private static final String SET_COLOR_ORANGE = "setColorOrange";
48  private static final String SET_COLOR_BLUE = "setColorBlue";
49  // 色オペレータ定義(白黒用)
50  private static final String DEF_COLOR_WHITE
51  = DEF + SET_COLOR_WHITE + " {0.3 setlinewidth 0 setgray [] 0 setdash}" + BIND_DEF;
52  private static final String DEF_COLOR_LIGHTGRAY
53  = DEF + SET_COLOR_LIGHTGRAY + " {0.3 setlinewidth 0.2 setgray [] 0 setdash}" + BIND_DEF;
54  private static final String DEF_COLOR_GRAY
55  = DEF + SET_COLOR_GRAY + " {0.3 setlinewidth 0.5 setgray [] 0 setdash}" + BIND_DEF;
56  private static final String DEF_COLOR_DARKGRAY
57  = DEF + SET_COLOR_DARKGRAY + " {0.3 setlinewidth 0.7 setgray [] 0 setdash}" + BIND_DEF;
58  private static final String DEF_COLOR_BLACK
59  = DEF + SET_COLOR_BLACK + " {0.3 setlinewidth 1 setgray [] 0 setdash}" + BIND_DEF;
60  private static final String DEF_COLOR_OTHERS
61  = DEF + SET_COLOR_OTHERS + " {0.3 setlinewidth 0 setgray [] 0 setdash}" + BIND_DEF;
62  private static final String DEF_COLOR_GREEN
63  = DEF + SET_COLOR_GREEN + " {0.3 setlinewidth 0 setgray [] 0 setdash}" + BIND_DEF;
64  private static final String DEF_COLOR_YELLOW
65  = DEF + SET_COLOR_YELLOW + " {0.3 setlinewidth 0.4 setgray [] 0 setdash}" + BIND_DEF;
66  private static final String DEF_COLOR_PINK
67  = DEF + SET_COLOR_PINK + " {0.3 setlinewidth 0.7 setgray [] 0 setdash}" + BIND_DEF;
68  private static final String DEF_COLOR_CYAN
69  = DEF + SET_COLOR_CYAN + " {0.6 setlinewidth 0.7 setgray [] 0 setdash}" + BIND_DEF;
70  private static final String DEF_COLOR_MAGENTA
71  = DEF + SET_COLOR_MAGENTA + " {0.9 setlinewidth 0 setgray [] 0 setdash}" + BIND_DEF;
72  private static final String DEF_COLOR_RED
73  = DEF + SET_COLOR_RED + " {0.9 setlinewidth 0.7 setgray [] 0 setdash}" + BIND_DEF;
74  private static final String DEF_COLOR_ORANGE
75  = DEF + SET_COLOR_ORANGE + " {0.9 setlinewidth 0 setgray [6 2 2 2] 0 setdash}" + BIND_DEF;
76  private static final String DEF_COLOR_BLUE
77  = DEF + SET_COLOR_BLUE + " {0.9 setlinewidth 0.7 setgray [6 2 2 2] 0 setdash}" + BIND_DEF;
78 
79  // 描画オペレータ
80  private static final String DRAW_LINE = "drawLine";
81  private static final String SET_FONT = "setFont";
82  private static final String DRAW_STRING = "drawString";
83  private static final String SET_CLIP = "setClip";
84  private static final String SET_CLIP_NULL = "setClipNull";
85  private static final String NEWPATH = "N";
86  private static final String MOVETO = "M";
87  private static final String LINETO = "L";
88  private static final String STROKE = "S";
89  // 描画オペレータ定義
90  private static final String DEF_DRAW_LINE
91  = DEF + DRAW_LINE + " {newpath moveto lineto stroke}" + BIND_DEF;
92  private static final String DEF_SET_FONT
93  = DEF + SET_FONT + " {exch findfont exch scalefont setfont}" + BIND_DEF;
94  private static final String DEF_DRAW_STRING
95  = DEF + DRAW_STRING + " {moveto show}" + BIND_DEF;
96  private static final String DEF_SET_CLIP
98  + " {gsave newpath 3 index 3 index moveto dup 0 exch"
99  + " rlineto exch 0 rlineto 0 exch sub 0 exch"
100  + " rlineto pop pop closepath clip}"
101  + BIND_DEF;
102  private static final String DEF_SET_CLIP_NULL
103  = DEF + SET_CLIP_NULL + " {grestore}" + BIND_DEF;
104  private static final String DEF_NEWPATH = DEF + NEWPATH + " {newpath}" + BIND_DEF;
105  private static final String DEF_MOVETO = DEF + MOVETO + " {moveto}" + BIND_DEF;
106  private static final String DEF_LINETO = DEF + LINETO + " {lineto}" + BIND_DEF;
107  private static final String DEF_STROKE = DEF + STROKE + " {stroke}" + BIND_DEF;
108  // 紙サイズ
109  private static final int PAGE_HEIGHT = 792;
110  //private static final int PAGE_WIDTH = 612;
111 
112  // -----------------------------------------------------------------
113  // インスタンス変数
114  private PrintWriter pw; // プリントライタ
115  private ArrayList<Color> colorList_; // 色一覧
116  private ArrayList<String> colorOps_; // 色オペレータ一覧
117  private double scale_; // スケール
118  private boolean inPath_; // パス継続中フラグ
119  private int prevX_; // 前回X座標
120  private int prevY_; // 前回Y座標
121  private int xOfs_; // X座標オフセット
122  private int yOfs_; // Y座標オフセット
123 
124  // -----------------------------------------------------------------
125  // コンストラクタ
136  public EPSGraphics(
137  Writer writer,
138  int top,
139  int left,
140  int width,
141  int height,
142  boolean color
143  ) {
144  super();
145  // 色設定
146  colorList_ = new ArrayList<Color>();
147  colorList_.add(Color.white);
148  colorList_.add(Color.lightGray);
149  colorList_.add(Color.gray);
150  colorList_.add(Color.darkGray);
151  colorList_.add(Color.black);
152  colorList_.add(Color.green);
153  colorList_.add(Color.yellow);
154  colorList_.add(Color.pink);
155  colorList_.add(Color.cyan);
156  colorList_.add(Color.magenta);
157  colorList_.add(Color.red);
158  colorList_.add(Color.orange);
159  colorList_.add(Color.blue);
160  colorOps_ = new ArrayList<String>();
174  // その他の設定
175  scale_ = 1; // スケールクリア
176  inPath_ = false; // パス継続中でない
177  xOfs_ = 0; // Xオフセットクリア
178  yOfs_ = 0; // Yオフセットクリア
179  // ヘッダ出力
180  pw = new PrintWriter(writer); // プリントライタオープン
181  _writeHeader(top, left, width, height, color); // ヘッダ出力
182  }
183 
184  // -----------------------------------------------------------------
185  // メソッド
191  public void setXOffset(int xofs) {
192  xOfs_ = xofs;
193  }
194 
200  public void setYOffset(int yofs) {
201  yOfs_ = yofs;
202  }
203 
209  public void setScale(double scale) {
210  _stroke();
211  scale_ = scale;
212  }
213 
219  public void setLineWidth(double width) {
220  _stroke();
221  pw.println("" + width + " setlinewidth");
222  }
223 
228  public void finishOutput() {
229  _stroke(); // パスを描画
230  pw.println(EOF); // EOFマーク出力
231  pw.close(); // プリントライタクローズ
232  }
233 
234  // -----------------------------------------------------------------
235  // Graphicsのメソッドオーバーライド
241  public void setColor(Color c) {
242  _stroke();
243  int ind = colorList_.indexOf(c);
244  String col;
245  if (ind >= 0) {
246  col = (String)colorOps_.get(ind);
247  } else {
248  col = SET_COLOR_OTHERS;
249  }
250  pw.println(col);
251  }
252 
261  public void fillRect(int x, int y, int width, int height) {
262  // 無処理
263  }
264 
273  public void drawLine(int x1, int y1, int x2, int y2) {
274  StringBuffer sb;
275  if (inPath_) { // パス継続中?
276  if (prevX_ == x1 && prevY_ == y1) { // 始点が前回の終点と一致?
277  // x2 y2 lineto
278  sb = new StringBuffer();
279  sb.append(x2 / scale_ + xOfs_);
280  sb.append(' '); sb.append(PAGE_HEIGHT - y2 / scale_ - yOfs_);
281  sb.append(' '); sb.append(LINETO);
282  pw.println(sb.toString());
283  } else { // 始点が前回の終点と異なる?
284  // stroke
285  // newpath
286  // x1 y1 moveto
287  // x2 y2 lineto
288  sb = new StringBuffer(STROKE);
289  sb.append(' '); sb.append(NEWPATH);
290  sb.append(' '); sb.append(x1 / scale_ + xOfs_);
291  sb.append(' '); sb.append(PAGE_HEIGHT - y1 / scale_ - yOfs_);
292  sb.append(' '); sb.append(MOVETO);
293  sb.append('\n'); sb.append(x2 / scale_ + xOfs_);
294  sb.append(' '); sb.append(PAGE_HEIGHT - y2 / scale_ - yOfs_);
295  sb.append(' '); sb.append(LINETO);
296  pw.println(sb.toString());
297  }
298  } else { // パス継続中でない?
299  // newpath
300  // x1 y1 moveto
301  // x2 y2 lineto
302  sb = new StringBuffer(NEWPATH);
303  sb.append(' '); sb.append(x1 / scale_ + xOfs_);
304  sb.append(' '); sb.append(PAGE_HEIGHT - y1 / scale_ - yOfs_);
305  sb.append(' '); sb.append(MOVETO);
306  sb.append('\n'); sb.append(x2 / scale_ + xOfs_);
307  sb.append(' '); sb.append(PAGE_HEIGHT - y2 / scale_ - yOfs_);
308  sb.append(' '); sb.append(LINETO);
309  pw.println(sb.toString());
310  inPath_ = true;
311  }
312  prevX_ = x2; prevY_ = y2; // 終点を更新
313 
314  /* ★この実装は無駄が多いので取りやめ
315  StringBuffer sb = new StringBuffer();
316  sb.append(x1 / scale_ + xOfs_);
317  sb.append(' '); sb.append(PAGE_HEIGHT - y1 / scale_ - yOfs_);
318  sb.append(' '); sb.append(x2 / scale_ + xOfs_);
319  sb.append(' '); sb.append(PAGE_HEIGHT - y2 / scale_ - yOfs_);
320  sb.append(' '); sb.append(DRAW_LINE);
321  pw.println(sb.toString());
322  */
323  }
324 
330  public void setFont(Font font) {
331  _stroke(); // 引きかけの線を引く
332  StringBuffer sb = new StringBuffer("/");
333 
334  // フォント決定
335  //sb.append(font.getPSName()); <--- ★本来はこれで良いはずだが...
336  String fname = font.getName();
337  String psf;
338  if (fname.equals("dialog")) {
339  psf = "Helvetica";
340  } else if (fname.equals("monospaced")) {
341  psf = "Courier";
342  } else {
343  psf = "Times-Roman";
344  }
345  sb.append(psf);
346 
347  sb.append(' '); sb.append(font.getSize());
348  sb.append(' '); sb.append(SET_FONT);
349  pw.println(sb.toString());
350  }
351 
359  public void drawString(String str, int x, int y) {
360  _stroke(); // 引きかけの線を引く
361  StringBuffer sb = new StringBuffer("(");
362  int len = str.length();
363  for (int i = 0; i < len; i++) {
364  char c = str.charAt(i);
365  if (c == '(' || c == ')') {
366  sb.append('\\');
367  }
368  sb.append(c);
369  }
370  sb.append(") "); sb.append(x / scale_ + xOfs_);
371  sb.append(' '); sb.append(PAGE_HEIGHT - y / scale_ - yOfs_);
372  sb.append(' '); sb.append(DRAW_STRING);
373  pw.println(sb.toString());
374  }
375 
381  public void setClip(Shape clip) {
382  _stroke(); // 引きかけの線を引く
383  if (clip == null) { // クリップ解除?
384  pw.println(SET_CLIP_NULL); // クリップ解除
385  }
386  }
387 
396  public void setClip(int x, int y, int width, int height) {
397  _stroke(); // 引きかけの線を引く
398  StringBuffer sb = new StringBuffer();
399  sb.append(x / scale_ + xOfs_);
400  sb.append(' '); sb.append(PAGE_HEIGHT - (y + height) / scale_ - yOfs_);
401  sb.append(' '); sb.append(width / scale_);
402  sb.append(' '); sb.append(height / scale_);
403  sb.append(' '); sb.append(SET_CLIP);
404  pw.println(sb.toString()); // クリップ
405  }
406 
412  public void setXORMode(Color c) {
413  // 無処理
414  }
415 
420  public void setPaintMode() {
421  // 無処理
422  }
423 
424  // -----------------------------------------------------------------
425  // Graphicsのメソッドオーバーライド(未使用部)
426  public Graphics create() {
427  return null;
428  }
429  public void translate(int x, int y) { }
430  public Color getColor() {
431  return null;
432  }
433  public Font getFont() {
434  return null;
435  }
436  public FontMetrics getFontMetrics(Font f) {
437  return null;
438  }
439  public Rectangle getClipBounds() {
440  return null;
441  }
442  public void clipRect(int x, int y, int width, int height) { }
443  public Shape getClip() {
444  return null;
445  }
446  public void copyArea(
447  int x, int y, int width, int height, int dx, int dy
448  ) { }
449  public void clearRect(int x, int y, int width, int height) { }
450  public void drawRoundRect(
451  int x, int y, int width, int height, int arcWidth, int arcHeight
452  ) { }
453  public void fillRoundRect(
454  int x, int y, int width, int height, int arcWidth, int arcHeight
455  ) { }
456  public void drawOval(int x, int y, int width, int height) { }
457  public void fillOval(int x, int y, int width, int height) { }
458  public void drawArc(
459  int x, int y, int width, int height, int startAngle, int arcAngle
460  ) { }
461  public void fillArc(
462  int x, int y, int width, int height, int startAngle, int arcAngle
463  ) { }
464  public void drawPolyline(int xPoints[], int yPoints[], int nPoints) { }
465  public void drawPolygon(int xPoints[], int yPoints[], int nPoints) { }
466  public void fillPolygon(int xPoints[], int yPoints[], int nPoints) { }
467  public void drawString(
468  AttributedCharacterIterator iterator, int x, int y
469  ) { }
470  public boolean drawImage(
471  Image img, int x, int y, ImageObserver observer
472  ) {
473  return false;
474  }
475  public boolean drawImage(
476  Image img, int x, int y, int width, int height, ImageObserver observer
477  ) {
478  return false;
479  }
480  public boolean drawImage(
481  Image img, int x, int y, Color bgcolor, ImageObserver observer
482  ) {
483  return false;
484  }
485  public boolean drawImage(
486  Image img, int x, int y, int width, int height,
487  Color bgcolor, ImageObserver observer
488  ) {
489  return false;
490  }
491  public boolean drawImage(
492  Image img, int dx1, int dy1, int dx2, int dy2,
493  int sx1, int sy1, int sx2, int sy2, ImageObserver observer
494  ) {
495  return false;
496  }
497  public boolean drawImage(
498  Image img, int dx1, int dy1, int dx2, int dy2,
499  int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer
500  ) {
501  return false;
502  }
503  public void dispose() { }
504 
505 
506  // -----------------------------------------------------------------
507  // プライベートメソッド
517  private void _writeHeader(
518  int top,
519  int left,
520  int width,
521  int height,
522  boolean color
523  ) {
524  // BoundingBox計算
525  int bl = left;
526  int bb = PAGE_HEIGHT - (top + height);
527  int br = left + width;
528  int bt = PAGE_HEIGHT - top;
529 
530  // Header
531  pw.println(HEADER);
532  StringBuffer sb = new StringBuffer(BOUNDING_BOX);
533  sb.append(' '); sb.append(bl);
534  sb.append(' '); sb.append(bb);
535  sb.append(' '); sb.append(br);
536  sb.append(' '); sb.append(bt);
537  pw.println(sb.toString());
538  pw.println();
539 
540  // 色オペレータ宣言
541  pw.println("% Color definition");
542  if (color) {
543  for (int i = 0; i < colorList_.size(); i++) {
544  Color col = (Color)colorList_.get(i);
545  StringBuffer sbuf = new StringBuffer(DEF);
546  sbuf.append((String)colorOps_.get(i));
547  sbuf.append(" {0.3 setlinewidth 0 setgray [] 0 setdash ");
548  sbuf.append((255 - col.getRed()) / 255.0f);
549  sbuf.append(' ');
550  sbuf.append((255 - col.getGreen()) / 255.0f);
551  sbuf.append(' ');
552  sbuf.append((255 - col.getBlue()) / 255.0f);
553  sbuf.append(" setrgbcolor}");
554  sbuf.append(BIND_DEF);
555  pw.println(sbuf.toString());
556  }
557  pw.println(DEF_COLOR_OTHERS);
558  } else {
559  pw.println(DEF_COLOR_WHITE);
560  pw.println(DEF_COLOR_LIGHTGRAY);
561  pw.println(DEF_COLOR_GRAY);
562  pw.println(DEF_COLOR_DARKGRAY);
563  pw.println(DEF_COLOR_BLACK);
564  pw.println(DEF_COLOR_OTHERS);
565  pw.println(DEF_COLOR_GREEN);
566  pw.println(DEF_COLOR_YELLOW);
567  pw.println(DEF_COLOR_PINK);
568  pw.println(DEF_COLOR_CYAN);
569  pw.println(DEF_COLOR_MAGENTA);
570  pw.println(DEF_COLOR_RED);
571  pw.println(DEF_COLOR_ORANGE);
572  pw.println(DEF_COLOR_BLUE);
573  }
574  pw.println();
575 
576  // 描画オペレータ宣言
577  pw.println("% Method definition");
578  pw.println(DEF_DRAW_LINE);
579  pw.println(DEF_SET_FONT);
580  pw.println(DEF_DRAW_STRING);
581  pw.println(DEF_SET_CLIP);
582  pw.println(DEF_SET_CLIP_NULL);
583  pw.println(DEF_NEWPATH);
584  pw.println(DEF_MOVETO);
585  pw.println(DEF_LINETO);
586  pw.println(DEF_STROKE);
587  pw.println();
588 
589  // ヘッダ終了
590  pw.println("% end of header");
591  pw.println();
592 
593  // ★デバグ用(バウンディングボックス描画)
594  pw.println("newpath");
595  pw.println("" + bl + " " + bb + " moveto");
596  pw.println("" + br + " " + bb + " lineto");
597  pw.println("" + br + " " + bt + " lineto");
598  pw.println("" + bl + " " + bt + " lineto");
599  pw.println("closepath");
600  pw.println("stroke");
601  }
602 
607  private void _stroke() {
608  if (inPath_) { // パス継続中?
609  pw.println(STROKE); // ストローク
610  inPath_ = false; // パス終了
611  }
612  }
613 }
com.generalrobotix.ui.view.graph.EPSGraphics.setYOffset
void setYOffset(int yofs)
Definition: EPSGraphics.java:200
com.generalrobotix.ui.view.graph.EPSGraphics.SET_COLOR_BLACK
static final String SET_COLOR_BLACK
Definition: EPSGraphics.java:39
com.generalrobotix.ui.view.graph.EPSGraphics.SET_COLOR_OTHERS
static final String SET_COLOR_OTHERS
Definition: EPSGraphics.java:40
width
png_infop png_uint_32 * width
Definition: png.h:2306
i
png_uint_32 i
Definition: png.h:2732
com.generalrobotix.ui.view.graph.EPSGraphics.setFont
void setFont(Font font)
Definition: EPSGraphics.java:330
com.generalrobotix.ui.view.graph.EPSGraphics.SET_FONT
static final String SET_FONT
Definition: EPSGraphics.java:81
com.generalrobotix.ui.view.graph.EPSGraphics
Definition: EPSGraphics.java:24
com.generalrobotix.ui.view.graph.EPSGraphics.SET_COLOR_WHITE
static final String SET_COLOR_WHITE
Definition: EPSGraphics.java:35
com.generalrobotix.ui.view.graph.EPSGraphics.drawImage
boolean drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer)
Definition: EPSGraphics.java:480
com.generalrobotix.ui.view.graph.EPSGraphics.SET_COLOR_GREEN
static final String SET_COLOR_GREEN
Definition: EPSGraphics.java:41
com.generalrobotix.ui.view.graph.EPSGraphics.copyArea
void copyArea(int x, int y, int width, int height, int dx, int dy)
Definition: EPSGraphics.java:446
com.generalrobotix.ui.view.graph.EPSGraphics.drawImage
boolean drawImage(Image img, int x, int y, ImageObserver observer)
Definition: EPSGraphics.java:470
com.generalrobotix.ui.view.graph.EPSGraphics.pw
PrintWriter pw
Definition: EPSGraphics.java:114
com.generalrobotix.ui.view.graph.EPSGraphics.finishOutput
void finishOutput()
Definition: EPSGraphics.java:228
com.generalrobotix.ui.view.graph.EPSGraphics.fillArc
void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle)
Definition: EPSGraphics.java:461
com.generalrobotix.ui.view.graph.EPSGraphics.fillOval
void fillOval(int x, int y, int width, int height)
Definition: EPSGraphics.java:457
com.generalrobotix.ui.view.graph.EPSGraphics.DEF_COLOR_PINK
static final String DEF_COLOR_PINK
Definition: EPSGraphics.java:67
com.generalrobotix.ui.view.graph.EPSGraphics.SET_CLIP
static final String SET_CLIP
Definition: EPSGraphics.java:83
com.generalrobotix.ui.view.graph.EPSGraphics.DEF_SET_CLIP_NULL
static final String DEF_SET_CLIP_NULL
Definition: EPSGraphics.java:103
com.generalrobotix.ui.view.graph.EPSGraphics.STROKE
static final String STROKE
Definition: EPSGraphics.java:88
com.generalrobotix.ui.view.graph.EPSGraphics.DEF
static final String DEF
Definition: EPSGraphics.java:31
com.generalrobotix.ui.view.graph.EPSGraphics.getClipBounds
Rectangle getClipBounds()
Definition: EPSGraphics.java:439
com.generalrobotix.ui.view.graph.EPSGraphics.drawLine
void drawLine(int x1, int y1, int x2, int y2)
Definition: EPSGraphics.java:273
com.generalrobotix.ui.view.graph.EPSGraphics.LINETO
static final String LINETO
Definition: EPSGraphics.java:87
com.generalrobotix.ui.view.graph.EPSGraphics.NEWPATH
static final String NEWPATH
Definition: EPSGraphics.java:85
com.generalrobotix.ui.view.graph.EPSGraphics.setClip
void setClip(Shape clip)
Definition: EPSGraphics.java:381
swingTest.f
f
Definition: swingTest.py:6
com.generalrobotix.ui.view.graph.EPSGraphics.drawImage
boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer)
Definition: EPSGraphics.java:485
com.generalrobotix.ui.view.graph.EPSGraphics.getFont
Font getFont()
Definition: EPSGraphics.java:433
com.generalrobotix.ui.view.graph.EPSGraphics.HEADER
static final String HEADER
Definition: EPSGraphics.java:29
com.generalrobotix.ui.view.graph.EPSGraphics.drawImage
boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer)
Definition: EPSGraphics.java:497
com.generalrobotix.ui.view.graph.EPSGraphics.DRAW_LINE
static final String DRAW_LINE
Definition: EPSGraphics.java:80
com.generalrobotix.ui.view.graph.EPSGraphics.DEF_COLOR_DARKGRAY
static final String DEF_COLOR_DARKGRAY
Definition: EPSGraphics.java:57
com.generalrobotix.ui.view.graph.EPSGraphics.getFontMetrics
FontMetrics getFontMetrics(Font f)
Definition: EPSGraphics.java:436
com.generalrobotix.ui.view.graph.EPSGraphics.dispose
void dispose()
Definition: EPSGraphics.java:503
com.generalrobotix.ui.view.graph.EPSGraphics.DEF_COLOR_BLUE
static final String DEF_COLOR_BLUE
Definition: EPSGraphics.java:77
com.generalrobotix.ui.view.graph.EPSGraphics.drawImage
boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer)
Definition: EPSGraphics.java:475
com.generalrobotix.ui.view.graph.EPSGraphics.drawOval
void drawOval(int x, int y, int width, int height)
Definition: EPSGraphics.java:456
com.generalrobotix.ui.view.graph.EPSGraphics.SET_COLOR_CYAN
static final String SET_COLOR_CYAN
Definition: EPSGraphics.java:44
com.generalrobotix.ui.view.graph.EPSGraphics.prevX_
int prevX_
Definition: EPSGraphics.java:119
com.generalrobotix.ui.view.graph.EPSGraphics.xOfs_
int xOfs_
Definition: EPSGraphics.java:121
com.generalrobotix.ui.view.graph.EPSGraphics.DEF_STROKE
static final String DEF_STROKE
Definition: EPSGraphics.java:107
com.generalrobotix.ui.view.graph.EPSGraphics.SET_COLOR_GRAY
static final String SET_COLOR_GRAY
Definition: EPSGraphics.java:37
com.generalrobotix.ui.view.graph.EPSGraphics.setColor
void setColor(Color c)
Definition: EPSGraphics.java:241
com.generalrobotix.ui.view.graph.EPSGraphics.DEF_COLOR_ORANGE
static final String DEF_COLOR_ORANGE
Definition: EPSGraphics.java:75
com.generalrobotix.ui.view.graph.EPSGraphics.colorOps_
ArrayList< String > colorOps_
Definition: EPSGraphics.java:116
com.generalrobotix.ui.view.graph.EPSGraphics.DEF_SET_FONT
static final String DEF_SET_FONT
Definition: EPSGraphics.java:93
com.generalrobotix.ui.view.graph.EPSGraphics.SET_COLOR_YELLOW
static final String SET_COLOR_YELLOW
Definition: EPSGraphics.java:42
com.generalrobotix.ui.view.graph.EPSGraphics.DEF_COLOR_OTHERS
static final String DEF_COLOR_OTHERS
Definition: EPSGraphics.java:61
com.generalrobotix.ui.view.graph.EPSGraphics.DRAW_STRING
static final String DRAW_STRING
Definition: EPSGraphics.java:82
com.generalrobotix.ui.view.graph.EPSGraphics.setPaintMode
void setPaintMode()
Definition: EPSGraphics.java:420
com.generalrobotix.ui.view.graph.EPSGraphics._stroke
void _stroke()
Definition: EPSGraphics.java:607
com.generalrobotix.ui.view.graph.EPSGraphics.SET_COLOR_MAGENTA
static final String SET_COLOR_MAGENTA
Definition: EPSGraphics.java:45
com.generalrobotix.ui.view.graph.EPSGraphics.EOF
static final String EOF
Definition: EPSGraphics.java:33
com.generalrobotix.ui.view.graph.EPSGraphics.fillPolygon
void fillPolygon(int xPoints[], int yPoints[], int nPoints)
Definition: EPSGraphics.java:466
com.generalrobotix.ui.view.graph.EPSGraphics.getColor
Color getColor()
Definition: EPSGraphics.java:430
com.generalrobotix.ui.view.graph.EPSGraphics.drawPolyline
void drawPolyline(int xPoints[], int yPoints[], int nPoints)
Definition: EPSGraphics.java:464
com.generalrobotix.ui.view.graph.EPSGraphics.setLineWidth
void setLineWidth(double width)
Definition: EPSGraphics.java:219
com.generalrobotix.ui.view.graph.EPSGraphics.create
Graphics create()
Definition: EPSGraphics.java:426
com.generalrobotix.ui.view.graph.EPSGraphics.DEF_MOVETO
static final String DEF_MOVETO
Definition: EPSGraphics.java:105
com.generalrobotix.ui.view.graph.EPSGraphics.clearRect
void clearRect(int x, int y, int width, int height)
Definition: EPSGraphics.java:449
com.generalrobotix.ui.view.graph.EPSGraphics.fillRoundRect
void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
Definition: EPSGraphics.java:453
com.generalrobotix.ui.view.graph.EPSGraphics.setClip
void setClip(int x, int y, int width, int height)
Definition: EPSGraphics.java:396
com.generalrobotix.ui.view.graph.EPSGraphics.BIND_DEF
static final String BIND_DEF
Definition: EPSGraphics.java:32
com.generalrobotix.ui.view.graph.EPSGraphics.prevY_
int prevY_
Definition: EPSGraphics.java:120
com.generalrobotix.ui.view.graph.EPSGraphics.BOUNDING_BOX
static final String BOUNDING_BOX
Definition: EPSGraphics.java:30
com.generalrobotix.ui.view.graph.EPSGraphics.drawRoundRect
void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
Definition: EPSGraphics.java:450
com.generalrobotix.ui.view.graph.EPSGraphics.getClip
Shape getClip()
Definition: EPSGraphics.java:443
com.generalrobotix.ui.view.graph.EPSGraphics.SET_COLOR_DARKGRAY
static final String SET_COLOR_DARKGRAY
Definition: EPSGraphics.java:38
com.generalrobotix.ui.view.graph.EPSGraphics.setXOffset
void setXOffset(int xofs)
Definition: EPSGraphics.java:191
com.generalrobotix.ui.view.graph.EPSGraphics.DEF_DRAW_LINE
static final String DEF_DRAW_LINE
Definition: EPSGraphics.java:91
com.generalrobotix.ui.view.graph.EPSGraphics.DEF_COLOR_WHITE
static final String DEF_COLOR_WHITE
Definition: EPSGraphics.java:51
com.generalrobotix.ui.view.graph.EPSGraphics.setScale
void setScale(double scale)
Definition: EPSGraphics.java:209
com.generalrobotix.ui.view.graph.EPSGraphics.SET_COLOR_BLUE
static final String SET_COLOR_BLUE
Definition: EPSGraphics.java:48
com.generalrobotix.ui.view.graph.EPSGraphics.fillRect
void fillRect(int x, int y, int width, int height)
Definition: EPSGraphics.java:261
com.generalrobotix.ui.view.graph.EPSGraphics.SET_COLOR_PINK
static final String SET_COLOR_PINK
Definition: EPSGraphics.java:43
com.generalrobotix.ui.view.graph.EPSGraphics.DEF_COLOR_CYAN
static final String DEF_COLOR_CYAN
Definition: EPSGraphics.java:69
com.generalrobotix.ui.view.graph.EPSGraphics.DEF_DRAW_STRING
static final String DEF_DRAW_STRING
Definition: EPSGraphics.java:95
com.generalrobotix.ui.view.graph.EPSGraphics.SET_COLOR_RED
static final String SET_COLOR_RED
Definition: EPSGraphics.java:46
com.generalrobotix.ui.view.graph.EPSGraphics.drawImage
boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer)
Definition: EPSGraphics.java:491
com.generalrobotix.ui.view.graph.EPSGraphics.DEF_COLOR_BLACK
static final String DEF_COLOR_BLACK
Definition: EPSGraphics.java:59
autoplay.c
int c
Definition: autoplay.py:16
com.generalrobotix.ui.view.graph.EPSGraphics.setXORMode
void setXORMode(Color c)
Definition: EPSGraphics.java:412
com.generalrobotix.ui.view.graph.EPSGraphics.SET_CLIP_NULL
static final String SET_CLIP_NULL
Definition: EPSGraphics.java:84
com.generalrobotix.ui.view.graph.EPSGraphics.DEF_COLOR_LIGHTGRAY
static final String DEF_COLOR_LIGHTGRAY
Definition: EPSGraphics.java:53
com.generalrobotix.ui.view.graph.EPSGraphics.DEF_COLOR_MAGENTA
static final String DEF_COLOR_MAGENTA
Definition: EPSGraphics.java:71
com.generalrobotix.ui.view.graph.EPSGraphics.DEF_COLOR_RED
static final String DEF_COLOR_RED
Definition: EPSGraphics.java:73
com.generalrobotix.ui.view.graph.EPSGraphics._writeHeader
void _writeHeader(int top, int left, int width, int height, boolean color)
Definition: EPSGraphics.java:517
com.generalrobotix.ui.view.graph.EPSGraphics.drawString
void drawString(AttributedCharacterIterator iterator, int x, int y)
Definition: EPSGraphics.java:467
com.generalrobotix.ui.view.graph.EPSGraphics.DEF_COLOR_GREEN
static final String DEF_COLOR_GREEN
Definition: EPSGraphics.java:63
com.generalrobotix.ui.view.graph.EPSGraphics.PAGE_HEIGHT
static final int PAGE_HEIGHT
Definition: EPSGraphics.java:109
com.generalrobotix.ui.view.graph.EPSGraphics.DEF_COLOR_YELLOW
static final String DEF_COLOR_YELLOW
Definition: EPSGraphics.java:65
height
png_infop png_uint_32 png_uint_32 * height
Definition: png.h:2306
com.generalrobotix.ui.view.graph.EPSGraphics.clipRect
void clipRect(int x, int y, int width, int height)
Definition: EPSGraphics.java:442
com.generalrobotix.ui.view.graph.EPSGraphics.DEF_LINETO
static final String DEF_LINETO
Definition: EPSGraphics.java:106
com.generalrobotix.ui.view.graph.EPSGraphics.yOfs_
int yOfs_
Definition: EPSGraphics.java:122
com.generalrobotix.ui.view.graph.EPSGraphics.MOVETO
static final String MOVETO
Definition: EPSGraphics.java:86
com.generalrobotix.ui.view.graph.EPSGraphics.drawString
void drawString(String str, int x, int y)
Definition: EPSGraphics.java:359
com.generalrobotix.ui.view.graph.EPSGraphics.inPath_
boolean inPath_
Definition: EPSGraphics.java:118
com.generalrobotix.ui.view.graph.EPSGraphics.drawArc
void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)
Definition: EPSGraphics.java:458
com.generalrobotix.ui.view.graph.EPSGraphics.DEF_NEWPATH
static final String DEF_NEWPATH
Definition: EPSGraphics.java:104
com.generalrobotix.ui.view.graph.EPSGraphics.DEF_COLOR_GRAY
static final String DEF_COLOR_GRAY
Definition: EPSGraphics.java:55
com.generalrobotix.ui.view.graph.EPSGraphics.SET_COLOR_ORANGE
static final String SET_COLOR_ORANGE
Definition: EPSGraphics.java:47
com.generalrobotix.ui.view.graph.EPSGraphics.colorList_
ArrayList< Color > colorList_
Definition: EPSGraphics.java:115
com.generalrobotix.ui.view.graph.EPSGraphics.DEF_SET_CLIP
static final String DEF_SET_CLIP
Definition: EPSGraphics.java:97
com.generalrobotix.ui.view.graph.EPSGraphics.translate
void translate(int x, int y)
Definition: EPSGraphics.java:429
com.generalrobotix.ui.view.graph.EPSGraphics.scale_
double scale_
Definition: EPSGraphics.java:117
com.generalrobotix.ui.view.graph.EPSGraphics.SET_COLOR_LIGHTGRAY
static final String SET_COLOR_LIGHTGRAY
Definition: EPSGraphics.java:36
com.generalrobotix.ui.view.graph.EPSGraphics.EPSGraphics
EPSGraphics(Writer writer, int top, int left, int width, int height, boolean color)
Definition: EPSGraphics.java:136
com.generalrobotix.ui.view.graph.EPSGraphics.drawPolygon
void drawPolygon(int xPoints[], int yPoints[], int nPoints)
Definition: EPSGraphics.java:465


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Wed Sep 7 2022 02:51:02