simoc / mapyrus Goto Github PK
View Code? Open in Web Editor NEWMirror of Mercurial repository http://hg.code.sf.net/p/mapyrus/code
License: GNU Lesser General Public License v2.1
Mirror of Mercurial repository http://hg.code.sf.net/p/mapyrus/code
License: GNU Lesser General Public License v2.1
I ran the following Mapyrus commands:
newpage "pdf", "test3.pdf", 210, 297
move 50, 50
eps "test3.eps", 20
Mapyrus stopped with a Java exception:
Cannot invoke "java.awt.Graphics2D.getColor()" because "this.m_graphics2D" is null
java.lang.NullPointerException: Cannot invoke "java.awt.Graphics2D.getColor()" because "this.m_graphics2D" is null
at org.mapyrus.OutputFormat.drawBoundingBoxes(OutputFormat.java:3926)
at org.mapyrus.OutputFormat.drawEPS(OutputFormat.java:4053)
at org.mapyrus.Context.drawEPS(Context.java:2142)
at org.mapyrus.ContextStack.drawEPS(ContextStack.java:687)
at org.mapyrus.Interpreter.execute(Interpreter.java:1936)
at org.mapyrus.Interpreter.executeStatement(Interpreter.java:3552)
at org.mapyrus.Interpreter.interpret(Interpreter.java:3185)
at org.mapyrus.Mapyrus.processFile(Mapyrus.java:215)
at org.mapyrus.Mapyrus.main(Mapyrus.java:719)
The documentation for the EPS command states that a grey box should be drawn on the page.
I am using the git master
branch.
Mapyrus was developed before Java generics were available. As a result, there are still many unnecessary casts in the source code. For example,
ArrayList<Integer> pageNumbers = m_PDFIncludedPages.get(i);
for (int j = 0; j < pageNumbers.size(); j++)
{
Integer pageNumber = (Integer)pageNumbers.get(j);
Remove these casts so the source code is easier to read.
https://maven.apache.org/ โ Apache Maven is a software project management and comprehension tool
Citing from https://www.baeldung.com/ant-maven-gradle
Maven relies on conventions and provides predefined commands (goals). Simply put, Maven allows us to focus on what our build should do, and gives us the framework to do it. Another positive aspect of Maven was that it provided built-in support for dependency management.
Use Java 8 try-with-resource when reading or writing files, to simplify logic and cleanup.
Eclipse identifies about 40 places where try-with-resource should be used and reports warnings like Resource 'reader' should be managed by try-with-resource TFWFile.java:47
.
Use boxing and unboxing functions in Java source code to avoid The expression of type Integer is unboxed into int
and The expression of type int is boxed into Integer
type warnings.
This avoids any possible problems with auto-boxing/unboxing.
Fix warnings when compiling Mapyrus with openjdk-11.
There are three categories of warnings:
Please publish/upload Mapyrus to Maven Central. This simplifies using Mapyrus as a dependency in other software projects. Thank you!
Eclipse reports that the following Java exceptions are declared, but never thrown:
Description Resource Path Location Type
The declared exception IOException is not actually thrown by the method readCFF(RandomAccessFile, OpenTypeFont.TableRecord) from type OpenTypeFont OpenTypeFont.java /mapyrus/src/main/java/org/mapyrus/font line 509 Java Problem
The declared exception IOException is not actually thrown by the method writePostScriptHeader(double, double, int, boolean, ArrayList<PostScriptFont>, Color) from type OutputFormat OutputFormat.java /mapyrus/src/main/java/org/mapyrus line 338 Java Problem
The declared exception IOException is not actually thrown by the method writeUnicodePDFString(PrintWriter, OpenTypeFont, String) from type OutputFormat OutputFormat.java /mapyrus/src/main/java/org/mapyrus line 4689 Java Problem
The declared exception MapyrusException is not actually thrown by the method init(InputStream, String, int) from type XBMImage XBMImage.java /mapyrus/src/main/java/org/mapyrus/image line 67 Java Problem
The declared exception MapyrusException is not actually thrown by the method isPageMaskAllZero(double, double, double, double) from type Context Context.java /mapyrus/src/main/java/org/mapyrus line 1591 Java Problem
The declared exception MapyrusException is not actually thrown by the method reproject(Projection, Projection, Point2D.Double) from type Reproject Reproject.java /mapyrus/src/main/java/org/mapyrus/function line 187 Java Problem
The declared exception MapyrusException is not actually thrown by the method writePostScriptHeader(double, double, int, boolean, ArrayList<PostScriptFont>, Color) from type OutputFormat OutputFormat.java /mapyrus/src/main/java/org/mapyrus line 338 Java Problem
Remove these exceptions.
Add @OverRide annotations to methods that are overridden, as this helps check that methods really do override a parent method.
Eclipse identifies about 100 methods where this annotation should be added.
Fix wrong or missing javadoc comments reported by mvn javadoc:javadoc
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.