Lines 32-37
Link Here
|
32 |
|
32 |
|
33 |
import javax.xml.transform.Source; |
33 |
import javax.xml.transform.Source; |
34 |
|
34 |
|
|
|
35 |
import org.apache.xmlgraphics.java2d.ps.PSGraphics2D; |
35 |
import org.apache.xmlgraphics.ps.dsc.ResourceTracker; |
36 |
import org.apache.xmlgraphics.ps.dsc.ResourceTracker; |
36 |
|
37 |
|
37 |
/** |
38 |
/** |
Lines 41-46
Link Here
|
41 |
*/ |
42 |
*/ |
42 |
public class PSGenerator { |
43 |
public class PSGenerator { |
43 |
|
44 |
|
|
|
45 |
/** |
46 |
* Default postscript language level |
47 |
*/ |
44 |
public static final int DEFAULT_LANGUAGE_LEVEL = 3; |
48 |
public static final int DEFAULT_LANGUAGE_LEVEL = 3; |
45 |
|
49 |
|
46 |
/** |
50 |
/** |
Lines 495-516
Link Here
|
495 |
writeln(pattern + " setdash"); |
499 |
writeln(pattern + " setdash"); |
496 |
} |
500 |
} |
497 |
} |
501 |
} |
498 |
|
502 |
|
499 |
/** |
503 |
/** |
500 |
* Establishes the specified color (RGB). |
504 |
* Establishes the specified color (RGB). |
501 |
* @param col the color as defined by the setrgbcolor command. |
505 |
* @param col the color as defined by the setrgbcolor command. |
502 |
* @exception IOException In case of an I/O problem |
506 |
* @exception IOException In case of an I/O problem |
|
|
507 |
* @deprecated use useColor method instead |
503 |
*/ |
508 |
*/ |
504 |
public void useRGBColor(Color col) throws IOException { |
509 |
public void useRGBColor(Color col) throws IOException { |
505 |
if (col == null) { |
510 |
useColor(col); |
506 |
col = PSState.DEFAULT_RGB_COLOR; |
511 |
} |
507 |
} |
512 |
|
|
|
513 |
/** |
514 |
* Establishes the specified color. |
515 |
* @param col the color. |
516 |
* @exception IOException In case of an I/O problem |
517 |
*/ |
518 |
public void useColor(Color col) throws IOException { |
508 |
if (getCurrentState().useColor(col)) { |
519 |
if (getCurrentState().useColor(col)) { |
509 |
float[] comps = col.getColorComponents(null); |
520 |
final boolean textAsShapes = false; |
510 |
writeln(formatDouble(comps[0]) |
521 |
PSGraphics2D graphics = new PSGraphics2D(textAsShapes, this); |
511 |
+ " " + formatDouble(comps[1]) |
522 |
graphics.establishColor(col); |
512 |
+ " " + formatDouble(comps[2]) |
|
|
513 |
+ " setrgbcolor"); |
514 |
} |
523 |
} |
515 |
} |
524 |
} |
516 |
|
525 |
|