jlibeps-0.1+2.orig/0000775000000000000000000000000004547516600010775 5ustar jlibeps-0.1+2.orig/.classpath0000644000000000000000000000034210656334550012755 0ustar jlibeps-0.1+2.orig/build.xml0000644000000000000000000000272510662405336012620 0ustar jlibeps-0.1+2.orig/src/0000755000000000000000000000000010662373026011560 5ustar jlibeps-0.1+2.orig/src/org/0000755000000000000000000000000010662373026012347 5ustar jlibeps-0.1+2.orig/src/org/sourceforge/0000755000000000000000000000000010662373026014672 5ustar jlibeps-0.1+2.orig/src/org/sourceforge/jlibeps/0000755000000000000000000000000010662373026016322 5ustar jlibeps-0.1+2.orig/src/org/sourceforge/jlibeps/epsgraphics/0000755000000000000000000000000010662373026020632 5ustar jlibeps-0.1+2.orig/src/org/sourceforge/jlibeps/epsgraphics/EpsDocument.java0000644000000000000000000001463310662402612023724 0ustar /* * Copyright 2001-2006 Paul James Mutton, http://www.jibble.org/ * Copyright 2007 Arnaud Blouin * * This file is part of jlibeps. * * jlibeps is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * jlibeps is distributed without any warranty; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU General Public License for more details.
* */ package org.sourceforge.jlibeps.epsgraphics; import java.io.*; import java.util.Date; /** * This represents an EPS document. Several EpsGraphics2D objects may point to the same EpsDocument.
* Copyright 2001-2006 Paul James Mutton, http://www.jibble.org/
* Copyright 2007 Arnaud Blouin
* 08/09/07 * @version 0.1 */ public class EpsDocument { private float minX; private float minY; private float maxX; private float maxY; private boolean _isClipSet = false; private String _title; private StringWriter _stringWriter; private BufferedWriter _bufferedWriter = null; // We need to remember which was the last EpsGraphics2D object to use // us, as we need to replace the clipping region if another EpsGraphics2D object tries to use us. private EpsGraphics2D _lastG = null; /** * Constructs an empty EpsDevice. * @since 0.1 */ public EpsDocument(String title) { _title = title; minX = Float.POSITIVE_INFINITY; minY = Float.POSITIVE_INFINITY; maxX = Float.NEGATIVE_INFINITY; maxY = Float.NEGATIVE_INFINITY; _stringWriter = new StringWriter(); _bufferedWriter = new BufferedWriter(_stringWriter); } /** * Constructs an empty EpsDevice that writes directly to a file. Bounds must be set before use. * @since 0.1 */ public EpsDocument(String title, OutputStream outputStream, int minX, int minY, int maxX, int maxY) throws IOException { _title = title; this.minX = minX; this.minY = minY; this.maxX = maxX; this.maxY = maxY; _bufferedWriter = new BufferedWriter(new OutputStreamWriter(outputStream)); write(_bufferedWriter); } /** * Returns the title of the EPS document. * @since 0.1 */ public synchronized String getTitle() { return _title; } /** * Updates the bounds of the current EPS document. * @since 0.1 */ public synchronized void updateBounds(double x, double y) { if(x > maxX) maxX = (float)x; if(x < minX) minX = (float)x; if(y > maxY) maxY = (float)y; if(y < minY) minY = (float)y; } /** * Appends a line to the EpsDocument. A new line character is added to the end of the line when it is added. * @since 0.1 */ public synchronized void append(EpsGraphics2D g, String line) { if(_lastG == null) _lastG = g; else if(g != _lastG) { EpsGraphics2D lastG = _lastG; _lastG = g; // We are being drawn on with a different EpsGraphics2D context. // We may need to update the clip, etc from this new context. if(g.getClip() != lastG.getClip()) g.setClip(g.getClip()); if(!g.getColor().equals(lastG.getColor())) g.setColor(g.getColor()); if(!g.getBackground().equals(lastG.getBackground())) g.setBackground(g.getBackground()); // We don't need this, as this only affects the stroke and font, // which are dealt with separately later on. // if (!g.getTransform().equals(lastG.getTransform())) { // g.setTransform(g.getTransform()); // } if(!g.getPaint().equals(lastG.getPaint())) g.setPaint(g.getPaint()); if(!g.getComposite().equals(lastG.getComposite())) g.setComposite(g.getComposite()); if(!g.getComposite().equals(lastG.getComposite())) g.setComposite(g.getComposite()); if(!g.getFont().equals(lastG.getFont())) g.setFont(g.getFont()); if(!g.getStroke().equals(lastG.getStroke())) g.setStroke(g.getStroke()); } _lastG = g; try { _bufferedWriter.write(line + "\n"); }catch(IOException e) { throw new EpsException("Could not write to the output file: " + e); } } /** * Outputs the contents of the EPS document to the specified Writer, complete with headers and bounding box. * @since 0.1 */ public synchronized void write(Writer writer) throws IOException { float offsetX = -minX; float offsetY = -minY; writer.write("%!PS-Adobe-3.0 EPSF-3.0\n"); writer.write("%%Creator: jlibeps " + EpsGraphics2D.VERSION + ", https://sourceforge.net/projects/jlibeps/" + "\n"); writer.write("%%Title: " + _title + "\n"); writer.write("%%CreationDate: " + new Date() + "\n"); writer.write("%%BoundingBox: 0 0 " + ((int)Math.ceil(maxX + offsetX)) + " " + ((int)Math.ceil(maxY + offsetY)) + "\n"); writer.write("%%DocumentData: Clean7Bit\n"); writer.write("%%DocumentProcessColors: Black\n"); writer.write("%%ColorUsage: Color\n"); writer.write("%%Origin: 0 0\n"); writer.write("%%Pages: 1\n"); writer.write("%%Page: 1 1\n"); writer.write("%%EndComments\n\n"); writer.write("gsave\n"); if(_stringWriter != null) { writer.write(offsetX + " " + (offsetY) + " translate\n"); _bufferedWriter.flush(); StringBuffer buffer = _stringWriter.getBuffer(); for(int i = 0; i < buffer.length(); i++) writer.write(buffer.charAt(i)); writeFooter(writer); } else writer.write(offsetX + " " + ((maxY - minY) - offsetY) + " translate\n"); writer.flush(); } private void writeFooter(Writer writer) throws IOException { writer.write("grestore\n"); if(isClipSet()) writer.write("grestore\n"); writer.write("showpage\n"); writer.write("\n"); writer.write("%%EOF"); writer.flush(); } public synchronized void flush() throws IOException { _bufferedWriter.flush(); } public synchronized void close() throws IOException { if(_stringWriter == null) { writeFooter(_bufferedWriter); _bufferedWriter.flush(); _bufferedWriter.close(); } } public boolean isClipSet() { return _isClipSet; } public void setClipSet(boolean isClipSet) { _isClipSet = isClipSet; } } jlibeps-0.1+2.orig/src/org/sourceforge/jlibeps/epsgraphics/EpsGraphics2D.java0000644000000000000000000011457110662372352024105 0ustar /* * Copyright 2001-2006 Paul James Mutton, http://www.jibble.org/ * Copyright 2007 Arnaud Blouin * * This file is part of jlibeps. * * jlibeps is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * jlibeps is distributed without any warranty; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU General Public License for more details.
* */ package org.sourceforge.jlibeps.epsgraphics; import java.awt.*; import java.awt.font.FontRenderContext; import java.awt.font.GlyphVector; import java.awt.font.TextAttribute; import java.awt.font.TextLayout; import java.awt.geom.*; import java.awt.image.*; import java.awt.image.renderable.RenderableImage; import java.io.*; import java.text.AttributedCharacterIterator; import java.text.AttributedString; import java.text.CharacterIterator; import java.util.Hashtable; import java.util.Map; /** * EpsGraphics2D is suitable for creating high quality EPS graphics for use in * documents and papers, and can be used just like a standard Graphics2D object. *

* Many Java programs use Graphics2D to draw stuff on the screen, and while it * is easy to save the output as a png or jpeg file, it is a little harder to * export it as an EPS for including in a document or paper. *

* This class makes the whole process extremely easy, because you can use it as * if it's a Graphics2D object. The only difference is that all of the * implemented methods create EPS output, which means the diagrams you draw can * be resized without leading to any of the jagged edges you may see when * resizing pixel-based images, such as jpeg and png files. *

* Example usage: *

* *

 * Graphics2D g = new EpsGraphics2D();
 * g.setColor(Color.black);
 * 
 * // Line thickness 2.
 * g.setStroke(new BasicStroke(2.0f));
 * 
 * // Draw a line.
 * g.drawLine(10, 10, 50, 10);
 * 
 * // Fill a rectangle in blue
 * g.setColor(Color.blue);
 * g.fillRect(10, 0, 20, 20);
 * 
 * // Get the EPS output.
 * String output = g.toString();
 * 
* *

* You do not need to worry about the size of the canvas when drawing on a * EpsGraphics2D object. The bounding box of the EPS document will automatically * resize to accommodate new items that you draw. *

* Not all methods are implemented yet. Those that are not are clearly labelled. *

* Copyright 2001-2006 Paul James Mutton, http://www.jibble.org/
* Copyright 2007 Arnaud Blouin
* 08/09/07 * @version 0.1 */ public class EpsGraphics2D extends java.awt.Graphics2D { public static final String VERSION = "0.1"; public static final int BLACK_AND_WHITE = 1; public static final int GRAYSCALE = 2; public static final int RGB = 3; // Default private Color _color; private Color _backgroundColor; private Paint _paint; private Composite _composite; private BasicStroke _stroke; private Font _font; private Shape _clip; private AffineTransform _clipTransform; private AffineTransform _transform; private boolean _accurateTextMode; private int _colorDepth; private EpsDocument _document; private static FontRenderContext _fontRenderContext = new FontRenderContext(null, false, true); /** * Constructs a new EPS document that is initially empty and can be drawn on * like a Graphics2D object. The EPS document is stored in memory. * @since 0.1 */ public EpsGraphics2D() { this("Untitled"); } /** * Constructs a new EPS document that is initially empty and can be drawn on * like a Graphics2D object. The EPS document is stored in memory. * @since 0.1 */ public EpsGraphics2D(String title) { _document = new EpsDocument(title); _backgroundColor = Color.white; _clip = null; _transform = new AffineTransform(); _clipTransform = new AffineTransform(); _accurateTextMode = true; _colorDepth = EpsGraphics2D.RGB; setColor(Color.black); setPaint(Color.black); setComposite(AlphaComposite.getInstance(AlphaComposite.CLEAR)); setFont(Font.decode(null)); setStroke(new BasicStroke()); } /** * Constructs a new EPS document that is initially empty and can be drawn on * like a Graphics2D object. The EPS document is written to the file as it * goes, which reduces memory usage. The bounding box of the document is * fixed and specified at construction time by minX,minY,maxX,maxY. The file * is flushed and closed when the close() method is called. * @since 0.1 */ public EpsGraphics2D(String title, File file, int minX, int minY, int maxX, int maxY) throws IOException { this(title, new FileOutputStream(file), minX, minY, maxX, maxY); } /** * Constructs a new EPS document that is initially empty and can be drawn on * like a Graphics2D object. The EPS document is written to the output * stream as it goes, which reduces memory usage. The bounding box of the * document is fixed and specified at construction time by * minX,minY,maxX,maxY. The output stream is flushed and closed when the close() method is called. * @since 0.1 */ public EpsGraphics2D(String title, OutputStream outputStream, int minX, int minY, int maxX, int maxY) throws IOException { this(title); _document = new EpsDocument(title, outputStream, minX, minY, maxX, maxY); } /** * Constructs a new EpsGraphics2D instance that is a copy of the supplied * argument and points at the same EpsDocument. * @since 0.1 */ protected EpsGraphics2D(EpsGraphics2D g) { _document = g._document; _backgroundColor = g._backgroundColor; _clip = g._clip; _clipTransform = (AffineTransform)g._clipTransform.clone(); _transform = (AffineTransform)g._transform.clone(); _color = g._color; _paint = g._paint; _composite = g._composite; _font = g._font; _stroke = g._stroke; _accurateTextMode = g._accurateTextMode; _colorDepth = g._colorDepth; } /** * This method is called to indicate that a particular method is not * supported yet. The stack trace is printed to the standard output. * @since 0.1 */ private void methodNotSupported() { EpsException e = new EpsException("Method not currently supported by jlibeps version " + VERSION); e.printStackTrace(System.err); } // ///////////// Specialist methods /////////////////////// /** * Sets whether to use accurate text mode when rendering text in EPS. This * is enabled (true) by default. When accurate text mode is used, all text * will be rendered in EPS to appear exactly the same as it would do when * drawn with a Graphics2D context. With accurate text mode enabled, it is * not necessary for the EPS viewer to have the required font installed. *

* Turning off accurate text mode will require the EPS viewer to have the * necessary fonts installed. If you are using a lot of text, you will find * that this significantly reduces the file size of your EPS documents. * AffineTransforms can only affect the starting point of text using this * simpler text mode - all text will be horizontal. * @since 0.1 */ public void setAccurateTextMode(boolean b) { _accurateTextMode = b; if(!getAccurateTextMode()) setFont(getFont()); } /** * Returns whether accurate text mode is being used. * @since 0.1 */ public boolean getAccurateTextMode() { return _accurateTextMode; } /** * Sets the number of colours to use when drawing on the document. Can be * either EpsGraphics2D.RGB (default) or EpsGraphics2D.GREYSCALE. * @since 0.1 */ public void setColorDepth(int c) { if(c == RGB || c == GRAYSCALE || c == BLACK_AND_WHITE) _colorDepth = c; } /** * Returns the colour depth used for all drawing operations. This can be * either EpsGraphics2D.RGB (default) or EpsGraphics2D.GREYSCALE. * @since 0.1 */ public int getColorDepth() { return _colorDepth; } /** * Flushes the buffered contents of this EPS document to the underlying * OutputStream it is being written to. * @since 0.1 */ public void flush() throws IOException { _document.flush(); } /** * Closes the EPS file being output to the underlying OutputStream. The * OutputStream is automatically flushed before being closed. If you forget * to do this, the file may be incomplete. * @since 0.1 */ public void close() throws IOException { flush(); _document.close(); } /** * Appends a line to the EpsDocument. * @since 0.1 */ private void append(String line) { _document.append(this, line); } /** * Returns the point after it has been transformed by the transformation. * @since 0.1 */ private Point2D transform(float x, float y) { Point2D result = new Point2D.Float(x, y); result = _transform.transform(result, result); result.setLocation(result.getX(), -result.getY()); return result; } /** * Appends the commands required to draw a shape on the EPS document. * @since 0.1 */ private void draw(Shape s, String action) { if(s != null) { if(!_transform.isIdentity()) s = _transform.createTransformedShape(s); // Update the bounds. if(!action.equals("clip")) { Rectangle2D shapeBounds = s.getBounds2D(); Rectangle2D visibleBounds = shapeBounds; if(_clip != null) { Rectangle2D clipBounds = _clip.getBounds2D(); visibleBounds = shapeBounds.createIntersection(clipBounds); } float lineRadius = _stroke.getLineWidth() / 2; float minX = (float)visibleBounds.getMinX() - lineRadius; float minY = (float)visibleBounds.getMinY() - lineRadius; float maxX = (float)visibleBounds.getMaxX() + lineRadius; float maxY = (float)visibleBounds.getMaxY() + lineRadius; _document.updateBounds(minX, -minY); _document.updateBounds(maxX, -maxY); } append("newpath"); int type = 0; float[] coords = new float[6]; PathIterator it = s.getPathIterator(null); float x0 = 0; float y0 = 0; int count = 0; while(!it.isDone()) { type = it.currentSegment(coords); float x1 = coords[0]; float y1 = -coords[1]; float x2 = coords[2]; float y2 = -coords[3]; float x3 = coords[4]; float y3 = -coords[5]; if(type == PathIterator.SEG_CLOSE) { append("closepath"); count++; } else if(type == PathIterator.SEG_CUBICTO) { append(x1 + " " + y1 + " " + x2 + " " + y2 + " " + x3 + " " + y3 + " curveto"); count++; x0 = x3; y0 = y3; } else if(type == PathIterator.SEG_LINETO) { append(x1 + " " + y1 + " lineto"); count++; x0 = x1; y0 = y1; } else if(type == PathIterator.SEG_MOVETO) { append(x1 + " " + y1 + " moveto"); count++; x0 = x1; y0 = y1; } else if(type == PathIterator.SEG_QUADTO) { // Convert the quad curve into a cubic. float _x1 = x0 + 2 / 3f * (x1 - x0); float _y1 = y0 + 2 / 3f * (y1 - y0); float _x2 = x1 + 1 / 3f * (x2 - x1); float _y2 = y1 + 1 / 3f * (y2 - y1); float _x3 = x2; float _y3 = y2; append(_x1 + " " + _y1 + " " + _x2 + " " + _y2 + " " + _x3 + " " + _y3 + " curveto"); count++; x0 = _x3; y0 = _y3; } else if(type == PathIterator.WIND_EVEN_ODD) { // Ignore. } else if(type == PathIterator.WIND_NON_ZERO) { // Ignore. } it.next(); } append(action); append("newpath"); } } /** * Returns a hex string that always contains two characters. * @since 0.1 */ private String toHexString(int n) { String result = Integer.toString(n, 16); while(result.length() < 2) result = "0" + result; return result; } /////////////// Graphics2D methods /////////////////////// /** * Draws a 3D rectangle outline. If it is raised, light appears to come from the top left. * @since 0.1 */ public void draw3DRect(int x, int y, int width, int height, boolean raised) { Color originalColor = getColor(); Stroke originalStroke = getStroke(); setStroke(new BasicStroke(1.0f)); if(raised) setColor(originalColor.brighter()); else setColor(originalColor.darker()); drawLine(x, y, x + width, y); drawLine(x, y, x, y + height); if(raised) setColor(originalColor.darker()); else setColor(originalColor.brighter()); drawLine(x + width, y + height, x, y + height); drawLine(x + width, y + height, x + width, y); setColor(originalColor); setStroke(originalStroke); } /** * Fills a 3D rectangle. If raised, it has bright fill and light appears to come from the top left. * @since 0.1 */ public void fill3DRect(int x, int y, int width, int height, boolean raised) { Color originalColor = getColor(); if(raised) setColor(originalColor.brighter()); else setColor(originalColor.darker()); draw(new Rectangle(x, y, width, height), "fill"); setColor(originalColor); draw3DRect(x, y, width, height, raised); } /** * Draws a Shape on the EPS document. * @since 0.1 */ public void draw(Shape s) { draw(s, "stroke"); } /** * Draws an Image on the EPS document. * @since 0.1 */ public boolean drawImage(Image img, AffineTransform xform, ImageObserver obs) { AffineTransform at = getTransform(); transform(xform); boolean st = drawImage(img, 0, 0, obs); setTransform(at); return st; } /** * Draws a BufferedImage on the EPS document. * @since 0.1 */ public void drawImage(BufferedImage img, BufferedImageOp op, int x, int y) { BufferedImage img1 = op.filter(img, null); drawImage(img1, new AffineTransform(1f, 0f, 0f, 1f, x, y), null); } /** * Draws a RenderedImage on the EPS document. * @since 0.1 */ public void drawRenderedImage(RenderedImage img, AffineTransform xform) { Hashtable properties = new Hashtable(); String[] names = img.getPropertyNames(); for(int i = 0; i < names.length; i++) properties.put(names[i], img.getProperty(names[i])); ColorModel cm = img.getColorModel(); WritableRaster wr = img.copyData(null); BufferedImage img1 = new BufferedImage(cm, wr, cm.isAlphaPremultiplied(), properties); AffineTransform at = AffineTransform.getTranslateInstance(img.getMinX(), img.getMinY()); at.preConcatenate(xform); drawImage(img1, at, null); } /** * Draws a RenderableImage by invoking its createDefaultRendering method. * @since 0.1 */ public void drawRenderableImage(RenderableImage img, AffineTransform xform) { drawRenderedImage(img.createDefaultRendering(), xform); } /** * Draws a string at (x,y). * @since 0.1 */ public void drawString(String str, int x, int y) { drawString(str, (float)x, (float)y); } /** * Draws a string at (x,y). * @since 0.1 */ public void drawString(String s, float x, float y) { if(s != null && s.length() > 0) { AttributedString as = new AttributedString(s); as.addAttribute(TextAttribute.FONT, getFont()); drawString(as.getIterator(), x, y); } } /** * Draws the characters of an AttributedCharacterIterator, starting from (x,y). * @since 0.1 */ public void drawString(AttributedCharacterIterator iterator, int x, int y) { drawString(iterator, (float)x, (float)y); } /** * Draws the characters of an AttributedCharacterIterator, starting from (x,y). * @since 0.1 */ public void drawString(AttributedCharacterIterator iterator, float x, float y) { if(getAccurateTextMode()) { TextLayout layout = new TextLayout(iterator, getFontRenderContext()); Shape shape = layout.getOutline(AffineTransform.getTranslateInstance(x, y)); draw(shape, "fill"); } else { append("newpath"); Point2D location = transform(x, y); append(location.getX() + " " + location.getY() + " moveto"); StringBuffer buffer = new StringBuffer(); for(char ch = iterator.first(); ch != CharacterIterator.DONE; ch = iterator.next()) { if(ch == '(' || ch == ')') buffer.append('\\'); buffer.append(ch); } append("(" + buffer.toString() + ") show"); } } /** * Draws a GlyphVector at (x,y). * @since 0.1 */ public void drawGlyphVector(GlyphVector g, float x, float y) { Shape shape = g.getOutline(x, y); draw(shape, "fill"); } /** * Fills a Shape on the EPS document. * @since 0.1 */ public void fill(Shape s) { draw(s, "fill"); } /** * Checks whether or not the specified Shape intersects the specified Rectangle, which is in device space. * @since 0.1 */ public boolean hit(Rectangle rect, Shape s, boolean onStroke) { return s.intersects(rect); } /** * Returns the device configuration associated with this EpsGraphics2D object. * @since 0.1 */ public GraphicsConfiguration getDeviceConfiguration() { GraphicsConfiguration gc = null; GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice[] gds = ge.getScreenDevices(); for(int i = 0; i < gds.length; i++) { GraphicsDevice gd = gds[i]; GraphicsConfiguration[] gcs = gd.getConfigurations(); if(gcs.length > 0) return gcs[0]; } return gc; } /** * Sets the Composite to be used by this EpsGraphics2D. EpsGraphics2D does not make use of these. * @since 0.1 */ public void setComposite(Composite comp) { _composite = comp; } /** * Sets the Paint attribute for the EpsGraphics2D object. Only Paint objects of type Color are respected by EpsGraphics2D. * @since 0.1 */ public void setPaint(Paint paint) { _paint = paint; if(paint instanceof Color) setColor((Color)paint); } /** * Sets the stroke. Only accepts BasicStroke objects (or subclasses of BasicStroke). * @since 0.1 */ public void setStroke(Stroke s) { if(s instanceof BasicStroke) { _stroke = (BasicStroke)s; append(_stroke.getLineWidth() + " setlinewidth"); float miterLimit = _stroke.getMiterLimit(); if(miterLimit < 1.0f) miterLimit = 1; append(miterLimit + " setmiterlimit"); append(_stroke.getLineJoin() + " setlinejoin"); append(_stroke.getEndCap() + " setlinecap"); StringBuffer dashes = new StringBuffer(); dashes.append("[ "); float[] dashArray = _stroke.getDashArray(); if(dashArray != null) for(int i = 0; i < dashArray.length; i++) dashes.append((dashArray[i]) + " "); dashes.append("]"); append(dashes.toString() + " 0 setdash"); } } /** * Sets a rendering hint. These are not used by EpsGraphics2D. * @since 0.1 */ public void setRenderingHint(RenderingHints.Key hintKey, Object hintValue) { // Do nothing. } /** * Returns the value of a single preference for the rendering algorithms. * Rendering hints are not used by EpsGraphics2D. * @since 0.1 */ public Object getRenderingHint(RenderingHints.Key hintKey) { return null; } /** * Sets the rendering hints. These are ignored by EpsGraphics2D. * @since 0.1 */ public void setRenderingHints(Map hints) { // Do nothing. } /** * Adds rendering hints. These are ignored by EpsGraphics2D. * @since 0.1 */ public void addRenderingHints(Map hints) { // Do nothing. } /** * Returns the preferences for the rendering algorithms. * @since 0.1 */ public RenderingHints getRenderingHints() { return new RenderingHints(null); } /** * Translates the origin of the EpsGraphics2D context to the point (x,y) in the current coordinate system. * @since 0.1 */ public void translate(int x, int y) { translate((double)x, (double)y); } /** * Concatenates the current EpsGraphics2D Transformation with a translation transform. * @since 0.1 */ public void translate(double tx, double ty) { transform(AffineTransform.getTranslateInstance(tx, ty)); } /** * Concatenates the current EpsGraphics2D Transform with a rotation transform. */ public void rotate(double theta) { rotate(theta, 0, 0); } /** * Concatenates the current EpsGraphics2D Transform with a translated rotation transform. * @since 0.1 */ public void rotate(double theta, double x, double y) { transform(AffineTransform.getRotateInstance(theta, x, y)); } /** * Concatenates the current EpsGraphics2D Transform with a scaling transformation. * @since 0.1 */ public void scale(double sx, double sy) { transform(AffineTransform.getScaleInstance(sx, sy)); } /** * Concatenates the current EpsGraphics2D Transform with a shearing transform. * @since 0.1 */ public void shear(double shx, double shy) { transform(AffineTransform.getShearInstance(shx, shy)); } /** * Composes an AffineTransform object with the Transform in this * EpsGraphics2D according to the rule last-specified-first-applied. * @since 0.1 */ public void transform(AffineTransform Tx) { _transform.concatenate(Tx); setTransform(getTransform()); } /** * Sets the AffineTransform to be used by this EpsGraphics2D. * @since 0.1 */ public void setTransform(AffineTransform Tx) { if(Tx == null) _transform = new AffineTransform(); else _transform = new AffineTransform(Tx); // Need to update the stroke and font so they know the scale changed setStroke(getStroke()); setFont(getFont()); } /** * Gets the AffineTransform used by this EpsGraphics2D. * @since 0.1 */ public AffineTransform getTransform() { return new AffineTransform(_transform); } /** * Returns the current Paint of the EpsGraphics2D object. * @since 0.1 */ public Paint getPaint() { return _paint; } /** * returns the current Composite of the EpsGraphics2D object. * @since 0.1 */ public Composite getComposite() { return _composite; } /** * Sets the background colour to be used by the clearRect method. * @since 0.1 */ public void setBackground(Color color) { if(color == null) color = Color.black; _backgroundColor = color; } /** * Gets the background colour that is used by the clearRect method. * @since 0.1 */ public Color getBackground() { return _backgroundColor; } /** * Returns the Stroke currently used. Guaranteed to be an instance of BasicStroke. * @since 0.1 */ public Stroke getStroke() { return _stroke; } /** * Intersects the current clip with the interior of the specified Shape and * sets the clip to the resulting intersection. * @since 0.1 */ public void clip(Shape s) { if(_clip == null) setClip(s); else { Area area = new Area(_clip); area.intersect(new Area(s)); setClip(area); } } /** * Returns the FontRenderContext. * @since 0.1 */ public FontRenderContext getFontRenderContext() { return _fontRenderContext; } /////////////// Graphics methods /////////////////////// /** * Returns a new Graphics object that is identical to this EpsGraphics2D. * @since 0.1 */ public Graphics create() { return new EpsGraphics2D(this); } /** * Returns an EpsGraphics2D object based on this Graphics object, but with a * new translation and clip area. * @since 0.1 */ public Graphics create(int x, int y, int width, int height) { Graphics g = create(); g.translate(x, y); g.clipRect(0, 0, width, height); return g; } /** * Returns the current Color. This will be a default value (black) until it * is changed using the setColor method. * @since 0.1 */ public Color getColor() { return _color; } /** * Sets the Color to be used when drawing all future shapes, text, etc. * @since 0.1 */ public void setColor(Color c) { if(c == null) c = Color.black; _color = c; if(getColorDepth() == BLACK_AND_WHITE) { float value = 0; if(c.getRed() + c.getGreen() + c.getBlue() > 255 * 1.5 - 1) value = 1; append(value + " setgray"); } else if(getColorDepth() == GRAYSCALE) { float value = ((c.getRed() + c.getGreen() + c.getBlue()) / (3 * 255f)); append(value + " setgray"); } else append((c.getRed() / 255f) + " " + (c.getGreen() / 255f) + " " + (c.getBlue() / 255f) + " setrgbcolor"); } /** * Sets the paint mode of this EpsGraphics2D object to overwrite the * destination EpsDocument with the current colour. * @since 0.1 */ public void setPaintMode() { // Do nothing - paint mode is the only method supported anyway. } /** * Not implemented - performs no action. * @since 0.1 */ public void setXORMode(Color c1) { methodNotSupported(); } /** * Returns the Font currently being used. * @since 0.1 */ public Font getFont() { return _font; } /** * Sets the Font to be used in future text. * @since 0.1 */ public void setFont(Font font) { if(font == null) font = Font.decode(null); _font = font; if(!getAccurateTextMode()) append("/" + _font.getPSName() + " findfont " + _font.getSize() + " scalefont setfont"); } /** * Gets the font metrics of the current font. * @since 0.1 */ public FontMetrics getFontMetrics() { return getFontMetrics(getFont()); } /** * Gets the font metrics for the specified font. * @since 0.1 */ public FontMetrics getFontMetrics(Font f) { BufferedImage image = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB); Graphics g = image.getGraphics(); return g.getFontMetrics(f); } /** * Returns the bounding rectangle of the current clipping area. * @since 0.1 */ public Rectangle getClipBounds() { if(_clip == null) return null; return getClip().getBounds(); } /** * Intersects the current clip with the specified rectangle. * @since 0.1 */ public void clipRect(int x, int y, int width, int height) { clip(new Rectangle(x, y, width, height)); } /** * Sets the current clip to the rectangle specified by the given coordinates. * @since 0.1 */ public void setClip(int x, int y, int width, int height) { setClip(new Rectangle(x, y, width, height)); } /** * Gets the current clipping area. * @since 0.1 */ public Shape getClip() { if(_clip == null) return null; try { AffineTransform t = _transform.createInverse(); t.concatenate(_clipTransform); return t.createTransformedShape(_clip); }catch(Exception e) { throw new EpsException("Unable to get inverse of matrix: " + _transform); } } /** * Sets the current clipping area to an arbitrary clip shape. * @since 0.1 */ public void setClip(Shape clip) { if(clip != null) { if(_document.isClipSet()) { append("grestore"); append("gsave"); } else { _document.setClipSet(true); append("gsave"); } draw(clip, "clip"); _clip = clip; _clipTransform = (AffineTransform)_transform.clone(); } else { if(_document.isClipSet()) { append("grestore"); _document.setClipSet(false); } _clip = null; } } /** * Not implemented - performs no action. * @since 0.1 */ public void copyArea(int x, int y, int width, int height, int dx, int dy) { methodNotSupported(); } /** * Draws a straight line from (x1,y1) to (x2,y2). * @since 0.1 */ public void drawLine(int x1, int y1, int x2, int y2) { Shape shape = new Line2D.Float(x1, y1, x2, y2); draw(shape); } /** * Fills a rectangle with top-left corner placed at (x,y). * @since 0.1 */ public void fillRect(int x, int y, int width, int height) { Shape shape = new Rectangle(x, y, width, height); draw(shape, "fill"); } /** * Draws a rectangle with top-left corner placed at (x,y). * @since 0.1 */ public void drawRect(int x, int y, int width, int height) { Shape shape = new Rectangle(x, y, width, height); draw(shape); } /** * Clears a rectangle with top-left corner placed at (x,y) using the current background color. * @since 0.1 */ public void clearRect(int x, int y, int width, int height) { Color originalColor = getColor(); setColor(getBackground()); Shape shape = new Rectangle(x, y, width, height); draw(shape, "fill"); setColor(originalColor); } /** * Draws a rounded rectangle. * @since 0.1 */ public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) { Shape shape = new RoundRectangle2D.Float(x, y, width, height, arcWidth, arcHeight); draw(shape); } /** * Fills a rounded rectangle. * @since 0.1 */ public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) { Shape shape = new RoundRectangle2D.Float(x, y, width, height, arcWidth, arcHeight); draw(shape, "fill"); } /** * Draws an oval. * @since 0.1 */ public void drawOval(int x, int y, int width, int height) { Shape shape = new Ellipse2D.Float(x, y, width, height); draw(shape); } /** * Fills an oval. * @since 0.1 */ public void fillOval(int x, int y, int width, int height) { Shape shape = new Ellipse2D.Float(x, y, width, height); draw(shape, "fill"); } /** * Draws an arc. * @since 0.1 */ public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle) { Shape shape = new Arc2D.Float(x, y, width, height, startAngle, arcAngle, Arc2D.OPEN); draw(shape); } /** * Fills an arc. * @since 0.1 */ public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle) { Shape shape = new Arc2D.Float(x, y, width, height, startAngle, arcAngle, Arc2D.PIE); draw(shape, "fill"); } /** * Draws a polyline. * @since 0.1 */ public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints) { if(nPoints > 0) { GeneralPath path = new GeneralPath(); path.moveTo(xPoints[0], yPoints[0]); for(int i = 1; i < nPoints; i++) path.lineTo(xPoints[i], yPoints[i]); draw(path); } } /** * Draws a polygon made with the specified points. * @since 0.1 */ public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints) { Shape shape = new Polygon(xPoints, yPoints, nPoints); draw(shape); } /** * Draws a polygon. * @since 0.1 */ public void drawPolygon(Polygon p) { draw(p); } /** * Fills a polygon made with the specified points. * @since 0.1 */ public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints) { Shape shape = new Polygon(xPoints, yPoints, nPoints); draw(shape, "fill"); } /** * Fills a polygon. * @since 0.1 */ public void fillPolygon(Polygon p) { draw(p, "fill"); } /** * Draws the specified characters, starting from (x,y). * @since 0.1 */ public void drawChars(char[] data, int offset, int length, int x, int y) { String string = new String(data, offset, length); drawString(string, x, y); } /** * Draws the specified bytes, starting from (x,y). * @since 0.1 */ public void drawBytes(byte[] data, int offset, int length, int x, int y) { String string = new String(data, offset, length); drawString(string, x, y); } /** * Draws an image. * @since 0.1 */ public boolean drawImage(Image img, int x, int y, ImageObserver observer) { return drawImage(img, x, y, Color.white, observer); } /** * Draws an image. * @since 0.1 */ public boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer) { return drawImage(img, x, y, width, height, Color.white, observer); } /** * Draws an image. * @since 0.1 */ public boolean drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer) { int width = img.getWidth(null); int height = img.getHeight(null); return drawImage(img, x, y, width, height, bgcolor, observer); } /** * Draws an image. * @since 0.1 */ public boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer) { return drawImage(img, x, y, x + width, y + height, 0, 0, width, height, bgcolor, observer); } /** * Draws an image. * @since 0.1 */ public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer) { return drawImage(img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, Color.white, observer); } /** * Draws an image. * @since 0.1 */ public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer) { if(dx1 >= dx2) throw new IllegalArgumentException("dx1 >= dx2"); if(sx1 >= sx2) throw new IllegalArgumentException("sx1 >= sx2"); if(dy1 >= dy2) throw new IllegalArgumentException("dy1 >= dy2"); if(sy1 >= sy2) throw new IllegalArgumentException("sy1 >= sy2"); append("gsave"); int width = sx2 - sx1; int height = sy2 - sy1; int destWidth = dx2 - dx1; int destHeight = dy2 - dy1; int[] pixels = new int[width * height]; PixelGrabber pg = new PixelGrabber(img, sx1, sy1, sx2 - sx1, sy2 - sy1, pixels, 0, width); try { pg.grabPixels(); }catch(InterruptedException e) { return false; } AffineTransform matrix = new AffineTransform(_transform); matrix.translate(dx1, dy1); matrix.scale(destWidth / (double)width, destHeight / (double)height); double[] m = new double[6]; try { matrix = matrix.createInverse(); }catch(Exception e) { throw new EpsException("Unable to get inverse of matrix: " + matrix); } matrix.scale(1, -1); matrix.getMatrix(m); String bitsPerSample = "8"; // Not using proper imagemask function yet // if (getColorDepth() == BLACK_AND_WHITE) { // bitsPerSample = "true"; // } append(width + " " + height + " " + bitsPerSample + " [" + m[0] + " " + m[1] + " " + m[2] + " " + m[3] + " " + m[4] + " " + m[5] + "]"); // Fill the background to update the bounding box. Color oldColor = getColor(); setColor(getBackground()); fillRect(dx1, dy1, destWidth, destHeight); setColor(oldColor); if(getColorDepth() == BLACK_AND_WHITE) { // Should really use imagemask. append("{currentfile " + width + " string readhexstring pop} bind"); append("image"); } else if(getColorDepth() == GRAYSCALE) { append("{currentfile " + width + " string readhexstring pop} bind"); append("image"); } else { append("{currentfile 3 " + width + " mul string readhexstring pop} bind"); append("false 3 colorimage"); } System.err.println(getColorDepth()); StringBuffer line = new StringBuffer(); for(int y = 0; y < height; y++) { for(int x = 0; x < width; x++) { Color color = new Color(pixels[x + width * y]); if(getColorDepth() == BLACK_AND_WHITE) if(color.getRed() + color.getGreen() + color.getBlue() > 255 * 1.5 - 1) line.append("ff"); else line.append("00"); else if(getColorDepth() == GRAYSCALE) line.append(toHexString((color.getRed() + color.getGreen() + color.getBlue()) / 3)); else line.append(toHexString(color.getRed()) + toHexString(color.getGreen()) + toHexString(color.getBlue())); if(line.length() > 64) { append(line.toString()); line = new StringBuffer(); } } } if(line.length() > 0) append(line.toString()); append("grestore"); return true; } /** * Disposes of all resources used by this EpsGraphics2D object. If this is * the only remaining EpsGraphics2D instance pointing at a EpsDocument * object, then the EpsDocument object shall become eligible for garbage collection. * @since 0.1 */ public void dispose() { _document = null; } /** * Finalises the object. * @since 0.1 */ public void finalize() { super.finalize(); } /** * Returns the entire contents of the EPS document, complete with headers * and bounding box. The returned String is suitable for being written * directly to disk as an EPS file. * @since 0.1 */ public String toString() { StringWriter writer = new StringWriter(); try { _document.write(writer); _document.flush(); _document.close(); }catch(IOException e) { throw new EpsException(e.toString()); } return writer.toString(); } /** * Returns true if the specified rectangular area might intersect the current clipping area. * @since 0.1 */ public boolean hitClip(int x, int y, int width, int height) { if(_clip == null) return true; return hit(new Rectangle(x, y, width, height), _clip, true); } /** * Returns the bounding rectangle of the current clipping area. * @since 0.1 */ public Rectangle getClipBounds(Rectangle r) { if(_clip == null) return r; Rectangle rect = getClipBounds(); r.setLocation((int)rect.getX(), (int)rect.getY()); r.setSize((int)rect.getWidth(), (int)rect.getHeight()); return r; } } jlibeps-0.1+2.orig/src/org/sourceforge/jlibeps/epsgraphics/EpsException.java0000644000000000000000000000167310656642424024116 0ustar /* * Copyright 2001-2006 Paul James Mutton, http://www.jibble.org/ * Copyright 2007 Arnaud Blouin * * This file is part of jlibeps. * * jlibeps is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * jlibeps is distributed without any warranty; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU General Public License for more details.
* */ package org.sourceforge.jlibeps.epsgraphics; /** * Copyright 2001-2006 Paul James Mutton, http://www.jibble.org/
* Copyright 2007 Arnaud Blouin
* 08/09/07 * @version 0.1 */ public class EpsException extends RuntimeException { public EpsException(String message) { super(message); } } jlibeps-0.1+2.orig/.project0000644000000000000000000000055610656334550012450 0ustar jlibeps org.eclipse.jdt.core.javabuilder org.eclipse.jdt.core.javanature jlibeps-0.1+2.orig/license.txt0000644000000000000000000004365710313026074013162 0ustar GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. jlibeps-0.1+2.orig/.settings/0000755000000000000000000000000010656335006012706 5ustar jlibeps-0.1+2.orig/.settings/org.eclipse.jdt.core.prefs0000644000000000000000000000115610656642546017705 0ustar #Thu Aug 09 17:48:38 CEST 2007 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.4 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning org.eclipse.jdt.core.compiler.source=1.3