mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-21 23:57:30 +00:00
Fixed #1678 Shapes - Miter clip join style
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -93,3 +93,6 @@ exported1.all.bin
|
||||
/libsrc/gifreader/nbproject/private/
|
||||
/libsrc/gifreader/dist/
|
||||
/libsrc/gifreader/build/
|
||||
/libsrc/miterstroke/nbproject/private/
|
||||
/libsrc/miterstroke/build/
|
||||
/libsrc/miterstroke/dist/
|
||||
|
||||
@@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file.
|
||||
### Fixed
|
||||
- Close action on SWF inside DefineBinaryData
|
||||
- [#2093] AS3 Unnecessary use of fully qualified names for classes in same package
|
||||
- [#1678] Shapes - Miter clip join style
|
||||
|
||||
## [19.0.0] - 2023-10-01
|
||||
### Added
|
||||
|
||||
BIN
lib/miterstroke.jar
Normal file
BIN
lib/miterstroke.jar
Normal file
Binary file not shown.
347
lib/miterstroke.license.txt
Normal file
347
lib/miterstroke.license.txt
Normal file
@@ -0,0 +1,347 @@
|
||||
The GNU General Public License (GPL)
|
||||
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 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.
|
||||
|
||||
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.
|
||||
|
||||
One line to give the program's name and a brief idea of what it does.
|
||||
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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., 59
|
||||
Temple Place, Suite 330, Boston, MA 02111-1307 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.
|
||||
|
||||
signature of Ty Coon, 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.
|
||||
|
||||
|
||||
"CLASSPATH" EXCEPTION TO THE GPL
|
||||
|
||||
Certain source files distributed by Oracle America and/or its affiliates are
|
||||
subject to the following clarification and special exception to the GPL, but
|
||||
only where Oracle has expressly included in the particular source file's header
|
||||
the words "Oracle designates this particular file as subject to the "Classpath"
|
||||
exception as provided by Oracle in the LICENSE file that accompanied this code."
|
||||
|
||||
Linking this library statically or dynamically with other modules is making
|
||||
a combined work based on this library. Thus, the terms and conditions of
|
||||
the GNU General Public License cover the whole combination.
|
||||
|
||||
As a special exception, the copyright holders of this library give you
|
||||
permission to link this library with independent modules to produce an
|
||||
executable, regardless of the license terms of these independent modules,
|
||||
and to copy and distribute the resulting executable under terms of your
|
||||
choice, provided that you also meet, for each linked independent module,
|
||||
the terms and conditions of the license of that module. An independent
|
||||
module is a module which is not derived from or based on this library. If
|
||||
you modify this library, you may extend this exception to your version of
|
||||
the library, but you are not obligated to do so. If you do not wish to do
|
||||
so, delete this exception statement from your version.
|
||||
@@ -29,6 +29,7 @@ These include:
|
||||
* Reality Interactive ImageIO TGA library - `tga.jar` - TGA images reading (GFX files)
|
||||
* Flashdebugger library - `flashdebugger.jar` - Flash debugging
|
||||
* Open Imaging GIF Decoder - `gifreader.jar` - Importing GIFs
|
||||
* Miter clip - modified openjdk8 Stroker - `miterclip.jar` - Support for miter clip join style in shapes
|
||||
|
||||
## Basic library usage
|
||||
```java
|
||||
@@ -154,6 +155,7 @@ It uses modified code of these libraries:
|
||||
* [Animated GIF Writer] (Frames to GIF export) - Creative Commons Attribution 3.0 Unported
|
||||
* [Animated GIF Encoder] (Frames to GIF export)
|
||||
* [gnujpdf] (PDF export) - LGPL License
|
||||
* [openjdk8 Stroker] (Shapes - Miter clip drawing) - GPL License
|
||||
|
||||
And also links to these libraries:
|
||||
|
||||
@@ -184,4 +186,5 @@ And also links to these libraries:
|
||||
[Reality Interactive ImageIO TGA library]: https://github.com/tmyroadctfig/com.realityinteractive.imageio.tga
|
||||
[flashdebugger library]: https://github.com/jindrapetrik/flashdebugger
|
||||
[Java Native Access - JNA]: https://github.com/twall/jna
|
||||
[Open Imaging GIF Decoder]: https://github.com/DhyanB/Open-Imaging
|
||||
[Open Imaging GIF Decoder]: https://github.com/DhyanB/Open-Imaging
|
||||
[openjdk8 Stroker]: https://github.com/JetBrains/jdk8u_jdk
|
||||
BIN
libsrc/ffdec_lib/lib/miterstroke.jar
Normal file
BIN
libsrc/ffdec_lib/lib/miterstroke.jar
Normal file
Binary file not shown.
347
libsrc/ffdec_lib/lib/miterstroke.license.txt
Normal file
347
libsrc/ffdec_lib/lib/miterstroke.license.txt
Normal file
@@ -0,0 +1,347 @@
|
||||
The GNU General Public License (GPL)
|
||||
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 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.
|
||||
|
||||
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.
|
||||
|
||||
One line to give the program's name and a brief idea of what it does.
|
||||
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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., 59
|
||||
Temple Place, Suite 330, Boston, MA 02111-1307 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.
|
||||
|
||||
signature of Ty Coon, 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.
|
||||
|
||||
|
||||
"CLASSPATH" EXCEPTION TO THE GPL
|
||||
|
||||
Certain source files distributed by Oracle America and/or its affiliates are
|
||||
subject to the following clarification and special exception to the GPL, but
|
||||
only where Oracle has expressly included in the particular source file's header
|
||||
the words "Oracle designates this particular file as subject to the "Classpath"
|
||||
exception as provided by Oracle in the LICENSE file that accompanied this code."
|
||||
|
||||
Linking this library statically or dynamically with other modules is making
|
||||
a combined work based on this library. Thus, the terms and conditions of
|
||||
the GNU General Public License cover the whole combination.
|
||||
|
||||
As a special exception, the copyright holders of this library give you
|
||||
permission to link this library with independent modules to produce an
|
||||
executable, regardless of the license terms of these independent modules,
|
||||
and to copy and distribute the resulting executable under terms of your
|
||||
choice, provided that you also meet, for each linked independent module,
|
||||
the terms and conditions of the license of that module. An independent
|
||||
module is a module which is not derived from or based on this library. If
|
||||
you modify this library, you may extend this exception to your version of
|
||||
the library, but you are not obligated to do so. If you do not wish to do
|
||||
so, delete this exception statement from your version.
|
||||
@@ -242,7 +242,7 @@ auxiliary.show.customizer.message=<message>
|
||||
<java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/4">
|
||||
<compilation-unit>
|
||||
<package-root>src</package-root>
|
||||
<classpath mode="compile">../../src;lib/LZMA.jar;lib/avi.jar;lib/cmykjpeg.jar;lib/ddsreader.jar;lib/gif.jar;lib/gnujpdf.jar;lib/jlayer-1.0.2.jar;lib/jpacker.jar;lib/nellymoser.jar;lib/sfntly.jar;lib/tga.jar;lib/ttf.jar;lib/vlcj-4.7.3.jar;lib/vlcj-natives-4.7.0.jar;lib/flashdebugger.jar;lib/jna-3.5.1.jar;lib/jna-platform-3.5.1.jar;lib/gifreader.jar</classpath>
|
||||
<classpath mode="compile">../../src;lib/LZMA.jar;lib/avi.jar;lib/cmykjpeg.jar;lib/ddsreader.jar;lib/gif.jar;lib/gnujpdf.jar;lib/jlayer-1.0.2.jar;lib/jpacker.jar;lib/nellymoser.jar;lib/sfntly.jar;lib/tga.jar;lib/ttf.jar;lib/vlcj-4.7.3.jar;lib/vlcj-natives-4.7.0.jar;lib/flashdebugger.jar;lib/jna-3.5.1.jar;lib/jna-platform-3.5.1.jar;lib/gifreader.jar;lib/miterstroke.jar</classpath>
|
||||
<built-to>build</built-to>
|
||||
<built-to>reports</built-to>
|
||||
<built-to>dist</built-to>
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package com.jpexs.decompiler.flash.exporters.shape;
|
||||
|
||||
import com.jpexs.decompiler.flash.SWF;
|
||||
import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||
import com.jpexs.decompiler.flash.exporters.ImageTagBufferedImage;
|
||||
import com.jpexs.decompiler.flash.exporters.commonshape.ExportRectangle;
|
||||
import com.jpexs.decompiler.flash.exporters.commonshape.Matrix;
|
||||
@@ -29,6 +28,7 @@ import com.jpexs.decompiler.flash.types.GRADRECORD;
|
||||
import com.jpexs.decompiler.flash.types.LINESTYLE2;
|
||||
import com.jpexs.decompiler.flash.types.RGB;
|
||||
import com.jpexs.decompiler.flash.types.SHAPE;
|
||||
import com.jpexs.graphics.ExtendedBasicStroke;
|
||||
import com.jpexs.helpers.SerializableImage;
|
||||
import java.awt.AlphaComposite;
|
||||
import java.awt.BasicStroke;
|
||||
@@ -452,10 +452,11 @@ public class BitmapExporter extends ShapeExporterBase {
|
||||
}
|
||||
|
||||
if (joinStyle == BasicStroke.JOIN_MITER) {
|
||||
lineStroke = new BasicStroke((float) thickness, capStyle, joinStyle, miterLimit);
|
||||
if (Configuration.allowMiterClipLinestyle.get()) {
|
||||
//lineStroke = new BasicStroke((float) thickness, capStyle, joinStyle, miterLimit);
|
||||
/*if (Configuration.allowMiterClipLinestyle.get()) {
|
||||
lineStroke = new MiterClipBasicStroke((BasicStroke) lineStroke);
|
||||
}
|
||||
}*/
|
||||
lineStroke = new ExtendedBasicStroke((float)thickness, capStyle, ExtendedBasicStroke.JOIN_MITER_CLIP, miterLimit);
|
||||
} else {
|
||||
lineStroke = new BasicStroke((float) thickness, capStyle, joinStyle);
|
||||
}
|
||||
|
||||
73
libsrc/miterstroke/build.xml
Normal file
73
libsrc/miterstroke/build.xml
Normal file
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- You may freely edit this file. See commented blocks below for -->
|
||||
<!-- some examples of how to customize the build. -->
|
||||
<!-- (If you delete it and reopen the project it will be recreated.) -->
|
||||
<!-- By default, only the Clean and Build commands use this build script. -->
|
||||
<!-- Commands such as Run, Debug, and Test only use this build script if -->
|
||||
<!-- the Compile on Save feature is turned off for the project. -->
|
||||
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
|
||||
<!-- in the project's Project Properties dialog box.-->
|
||||
<project name="miterstroke" default="default" basedir=".">
|
||||
<description>Builds, tests, and runs the project miterstroke.</description>
|
||||
<import file="nbproject/build-impl.xml"/>
|
||||
<!--
|
||||
|
||||
There exist several targets which are by default empty and which can be
|
||||
used for execution of your tasks. These targets are usually executed
|
||||
before and after some main targets. They are:
|
||||
|
||||
-pre-init: called before initialization of project properties
|
||||
-post-init: called after initialization of project properties
|
||||
-pre-compile: called before javac compilation
|
||||
-post-compile: called after javac compilation
|
||||
-pre-compile-single: called before javac compilation of single file
|
||||
-post-compile-single: called after javac compilation of single file
|
||||
-pre-compile-test: called before javac compilation of JUnit tests
|
||||
-post-compile-test: called after javac compilation of JUnit tests
|
||||
-pre-compile-test-single: called before javac compilation of single JUnit test
|
||||
-post-compile-test-single: called after javac compilation of single JUunit test
|
||||
-pre-jar: called before JAR building
|
||||
-post-jar: called after JAR building
|
||||
-post-clean: called after cleaning build products
|
||||
|
||||
(Targets beginning with '-' are not intended to be called on their own.)
|
||||
|
||||
Example of inserting an obfuscator after compilation could look like this:
|
||||
|
||||
<target name="-post-compile">
|
||||
<obfuscate>
|
||||
<fileset dir="${build.classes.dir}"/>
|
||||
</obfuscate>
|
||||
</target>
|
||||
|
||||
For list of available properties check the imported
|
||||
nbproject/build-impl.xml file.
|
||||
|
||||
|
||||
Another way to customize the build is by overriding existing main targets.
|
||||
The targets of interest are:
|
||||
|
||||
-init-macrodef-javac: defines macro for javac compilation
|
||||
-init-macrodef-junit: defines macro for junit execution
|
||||
-init-macrodef-debug: defines macro for class debugging
|
||||
-init-macrodef-java: defines macro for class execution
|
||||
-do-jar: JAR building
|
||||
run: execution of project
|
||||
-javadoc-build: Javadoc generation
|
||||
test-report: JUnit report generation
|
||||
|
||||
An example of overriding the target for project execution could look like this:
|
||||
|
||||
<target name="run" depends="miterstroke-impl.jar">
|
||||
<exec dir="bin" executable="launcher.exe">
|
||||
<arg file="${dist.jar}"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
Notice that the overridden target depends on the jar target and not only on
|
||||
the compile target as the regular run target does. Again, for a list of available
|
||||
properties which you can use, check the target you are overriding in the
|
||||
nbproject/build-impl.xml file.
|
||||
|
||||
-->
|
||||
</project>
|
||||
347
libsrc/miterstroke/license.txt
Normal file
347
libsrc/miterstroke/license.txt
Normal file
@@ -0,0 +1,347 @@
|
||||
The GNU General Public License (GPL)
|
||||
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 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.
|
||||
|
||||
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.
|
||||
|
||||
One line to give the program's name and a brief idea of what it does.
|
||||
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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., 59
|
||||
Temple Place, Suite 330, Boston, MA 02111-1307 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.
|
||||
|
||||
signature of Ty Coon, 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.
|
||||
|
||||
|
||||
"CLASSPATH" EXCEPTION TO THE GPL
|
||||
|
||||
Certain source files distributed by Oracle America and/or its affiliates are
|
||||
subject to the following clarification and special exception to the GPL, but
|
||||
only where Oracle has expressly included in the particular source file's header
|
||||
the words "Oracle designates this particular file as subject to the "Classpath"
|
||||
exception as provided by Oracle in the LICENSE file that accompanied this code."
|
||||
|
||||
Linking this library statically or dynamically with other modules is making
|
||||
a combined work based on this library. Thus, the terms and conditions of
|
||||
the GNU General Public License cover the whole combination.
|
||||
|
||||
As a special exception, the copyright holders of this library give you
|
||||
permission to link this library with independent modules to produce an
|
||||
executable, regardless of the license terms of these independent modules,
|
||||
and to copy and distribute the resulting executable under terms of your
|
||||
choice, provided that you also meet, for each linked independent module,
|
||||
the terms and conditions of the license of that module. An independent
|
||||
module is a module which is not derived from or based on this library. If
|
||||
you modify this library, you may extend this exception to your version of
|
||||
the library, but you are not obligated to do so. If you do not wish to do
|
||||
so, delete this exception statement from your version.
|
||||
3
libsrc/miterstroke/manifest.mf
Normal file
3
libsrc/miterstroke/manifest.mf
Normal file
@@ -0,0 +1,3 @@
|
||||
Manifest-Version: 1.0
|
||||
X-COMMENT: Main-Class will be added automatically by build
|
||||
|
||||
1757
libsrc/miterstroke/nbproject/build-impl.xml
Normal file
1757
libsrc/miterstroke/nbproject/build-impl.xml
Normal file
File diff suppressed because it is too large
Load Diff
8
libsrc/miterstroke/nbproject/genfiles.properties
Normal file
8
libsrc/miterstroke/nbproject/genfiles.properties
Normal file
@@ -0,0 +1,8 @@
|
||||
build.xml.data.CRC32=2315bfe0
|
||||
build.xml.script.CRC32=44ef608f
|
||||
build.xml.stylesheet.CRC32=f85dc8f2@1.105.0.48
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=2315bfe0
|
||||
nbproject/build-impl.xml.script.CRC32=03079807
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.105.0.48
|
||||
97
libsrc/miterstroke/nbproject/project.properties
Normal file
97
libsrc/miterstroke/nbproject/project.properties
Normal file
@@ -0,0 +1,97 @@
|
||||
annotation.processing.enabled=true
|
||||
annotation.processing.enabled.in.editor=false
|
||||
annotation.processing.processors.list=
|
||||
annotation.processing.run.all.processors=true
|
||||
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
|
||||
application.title=miterstroke
|
||||
application.vendor=jindr
|
||||
build.classes.dir=${build.dir}/classes
|
||||
build.classes.excludes=**/*.java,**/*.form
|
||||
# This directory is removed when the project is cleaned:
|
||||
build.dir=build
|
||||
build.generated.dir=${build.dir}/generated
|
||||
build.generated.sources.dir=${build.dir}/generated-sources
|
||||
# Only compile against the classpath explicitly listed here:
|
||||
build.sysclasspath=ignore
|
||||
build.test.classes.dir=${build.dir}/test/classes
|
||||
build.test.results.dir=${build.dir}/test/results
|
||||
# Uncomment to specify the preferred debugger connection transport:
|
||||
#debug.transport=dt_socket
|
||||
debug.classpath=\
|
||||
${run.classpath}
|
||||
debug.modulepath=\
|
||||
${run.modulepath}
|
||||
debug.test.classpath=\
|
||||
${run.test.classpath}
|
||||
debug.test.modulepath=\
|
||||
${run.test.modulepath}
|
||||
# Files in build.classes.dir which should be excluded from distribution jar
|
||||
dist.archive.excludes=
|
||||
# This directory is removed when the project is cleaned:
|
||||
dist.dir=dist
|
||||
dist.jar=${dist.dir}/miterstroke.jar
|
||||
dist.javadoc.dir=${dist.dir}/javadoc
|
||||
dist.jlink.dir=${dist.dir}/jlink
|
||||
dist.jlink.output=${dist.jlink.dir}/miterstroke
|
||||
endorsed.classpath=
|
||||
excludes=
|
||||
file.reference.miterstroke-src=src
|
||||
includes=**
|
||||
jar.compress=false
|
||||
javac.classpath=
|
||||
# Space-separated list of extra javac options
|
||||
javac.compilerargs=
|
||||
javac.deprecation=false
|
||||
javac.external.vm=true
|
||||
javac.modulepath=
|
||||
javac.processormodulepath=
|
||||
javac.processorpath=\
|
||||
${javac.classpath}
|
||||
javac.source=1.8
|
||||
javac.target=1.8
|
||||
javac.test.classpath=\
|
||||
${javac.classpath}:\
|
||||
${build.classes.dir}
|
||||
javac.test.modulepath=\
|
||||
${javac.modulepath}
|
||||
javac.test.processorpath=\
|
||||
${javac.test.classpath}
|
||||
javadoc.additionalparam=
|
||||
javadoc.author=false
|
||||
javadoc.encoding=${source.encoding}
|
||||
javadoc.html5=false
|
||||
javadoc.noindex=false
|
||||
javadoc.nonavbar=false
|
||||
javadoc.notree=false
|
||||
javadoc.private=false
|
||||
javadoc.splitindex=true
|
||||
javadoc.use=true
|
||||
javadoc.version=false
|
||||
javadoc.windowtitle=
|
||||
# The jlink additional root modules to resolve
|
||||
jlink.additionalmodules=
|
||||
# The jlink additional command line parameters
|
||||
jlink.additionalparam=
|
||||
jlink.launcher=true
|
||||
jlink.launcher.name=miterstroke
|
||||
main.class=com.jpexs.graphics.StrokeTest
|
||||
manifest.file=manifest.mf
|
||||
meta.inf.dir=${src.dir}/META-INF
|
||||
mkdist.disabled=false
|
||||
platform.active=default_platform
|
||||
run.classpath=\
|
||||
${javac.classpath}:\
|
||||
${build.classes.dir}
|
||||
# Space-separated list of JVM arguments used when running the project.
|
||||
# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
|
||||
# To set system properties for unit tests define test-sys-prop.name=value:
|
||||
run.jvmargs=
|
||||
run.modulepath=\
|
||||
${javac.modulepath}
|
||||
run.test.classpath=\
|
||||
${javac.test.classpath}:\
|
||||
${build.test.classes.dir}
|
||||
run.test.modulepath=\
|
||||
${javac.test.modulepath}
|
||||
source.encoding=UTF-8
|
||||
src.dir=${file.reference.miterstroke-src}
|
||||
13
libsrc/miterstroke/nbproject/project.xml
Normal file
13
libsrc/miterstroke/nbproject/project.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>org.netbeans.modules.java.j2seproject</type>
|
||||
<configuration>
|
||||
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
|
||||
<name>miterstroke</name>
|
||||
<source-roots>
|
||||
<root id="src.dir"/>
|
||||
</source-roots>
|
||||
<test-roots/>
|
||||
</data>
|
||||
</configuration>
|
||||
</project>
|
||||
289
libsrc/miterstroke/src/com/jpexs/graphics/Curve.java
Normal file
289
libsrc/miterstroke/src/com/jpexs/graphics/Curve.java
Normal file
@@ -0,0 +1,289 @@
|
||||
/*
|
||||
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.jpexs.graphics;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
final class Curve {
|
||||
|
||||
float ax, ay, bx, by, cx, cy, dx, dy;
|
||||
float dax, day, dbx, dby;
|
||||
|
||||
Curve() {
|
||||
}
|
||||
|
||||
void set(float[] points, int type) {
|
||||
switch(type) {
|
||||
case 8:
|
||||
set(points[0], points[1],
|
||||
points[2], points[3],
|
||||
points[4], points[5],
|
||||
points[6], points[7]);
|
||||
break;
|
||||
case 6:
|
||||
set(points[0], points[1],
|
||||
points[2], points[3],
|
||||
points[4], points[5]);
|
||||
break;
|
||||
default:
|
||||
throw new InternalError("Curves can only be cubic or quadratic");
|
||||
}
|
||||
}
|
||||
|
||||
void set(float x1, float y1,
|
||||
float x2, float y2,
|
||||
float x3, float y3,
|
||||
float x4, float y4)
|
||||
{
|
||||
ax = 3 * (x2 - x3) + x4 - x1;
|
||||
ay = 3 * (y2 - y3) + y4 - y1;
|
||||
bx = 3 * (x1 - 2 * x2 + x3);
|
||||
by = 3 * (y1 - 2 * y2 + y3);
|
||||
cx = 3 * (x2 - x1);
|
||||
cy = 3 * (y2 - y1);
|
||||
dx = x1;
|
||||
dy = y1;
|
||||
dax = 3 * ax; day = 3 * ay;
|
||||
dbx = 2 * bx; dby = 2 * by;
|
||||
}
|
||||
|
||||
void set(float x1, float y1,
|
||||
float x2, float y2,
|
||||
float x3, float y3)
|
||||
{
|
||||
ax = ay = 0f;
|
||||
|
||||
bx = x1 - 2 * x2 + x3;
|
||||
by = y1 - 2 * y2 + y3;
|
||||
cx = 2 * (x2 - x1);
|
||||
cy = 2 * (y2 - y1);
|
||||
dx = x1;
|
||||
dy = y1;
|
||||
dax = 0; day = 0;
|
||||
dbx = 2 * bx; dby = 2 * by;
|
||||
}
|
||||
|
||||
float xat(float t) {
|
||||
return t * (t * (t * ax + bx) + cx) + dx;
|
||||
}
|
||||
float yat(float t) {
|
||||
return t * (t * (t * ay + by) + cy) + dy;
|
||||
}
|
||||
|
||||
float dxat(float t) {
|
||||
return t * (t * dax + dbx) + cx;
|
||||
}
|
||||
|
||||
float dyat(float t) {
|
||||
return t * (t * day + dby) + cy;
|
||||
}
|
||||
|
||||
int dxRoots(float[] roots, int off) {
|
||||
return Helpers.quadraticRoots(dax, dbx, cx, roots, off);
|
||||
}
|
||||
|
||||
int dyRoots(float[] roots, int off) {
|
||||
return Helpers.quadraticRoots(day, dby, cy, roots, off);
|
||||
}
|
||||
|
||||
int infPoints(float[] pts, int off) {
|
||||
// inflection point at t if -f'(t)x*f''(t)y + f'(t)y*f''(t)x == 0
|
||||
// Fortunately, this turns out to be quadratic, so there are at
|
||||
// most 2 inflection points.
|
||||
final float a = dax * dby - dbx * day;
|
||||
final float b = 2 * (cy * dax - day * cx);
|
||||
final float c = cy * dbx - cx * dby;
|
||||
|
||||
return Helpers.quadraticRoots(a, b, c, pts, off);
|
||||
}
|
||||
|
||||
// finds points where the first and second derivative are
|
||||
// perpendicular. This happens when g(t) = f'(t)*f''(t) == 0 (where
|
||||
// * is a dot product). Unfortunately, we have to solve a cubic.
|
||||
private int perpendiculardfddf(float[] pts, int off) {
|
||||
assert pts.length >= off + 4;
|
||||
|
||||
// these are the coefficients of some multiple of g(t) (not g(t),
|
||||
// because the roots of a polynomial are not changed after multiplication
|
||||
// by a constant, and this way we save a few multiplications).
|
||||
final float a = 2*(dax*dax + day*day);
|
||||
final float b = 3*(dax*dbx + day*dby);
|
||||
final float c = 2*(dax*cx + day*cy) + dbx*dbx + dby*dby;
|
||||
final float d = dbx*cx + dby*cy;
|
||||
return Helpers.cubicRootsInAB(a, b, c, d, pts, off, 0f, 1f);
|
||||
}
|
||||
|
||||
// Tries to find the roots of the function ROC(t)-w in [0, 1). It uses
|
||||
// a variant of the false position algorithm to find the roots. False
|
||||
// position requires that 2 initial values x0,x1 be given, and that the
|
||||
// function must have opposite signs at those values. To find such
|
||||
// values, we need the local extrema of the ROC function, for which we
|
||||
// need the roots of its derivative; however, it's harder to find the
|
||||
// roots of the derivative in this case than it is to find the roots
|
||||
// of the original function. So, we find all points where this curve's
|
||||
// first and second derivative are perpendicular, and we pretend these
|
||||
// are our local extrema. There are at most 3 of these, so we will check
|
||||
// at most 4 sub-intervals of (0,1). ROC has asymptotes at inflection
|
||||
// points, so roc-w can have at least 6 roots. This shouldn't be a
|
||||
// problem for what we're trying to do (draw a nice looking curve).
|
||||
int rootsOfROCMinusW(float[] roots, int off, final float w, final float err) {
|
||||
// no OOB exception, because by now off<=6, and roots.length >= 10
|
||||
assert off <= 6 && roots.length >= 10;
|
||||
int ret = off;
|
||||
int numPerpdfddf = perpendiculardfddf(roots, off);
|
||||
float t0 = 0, ft0 = ROCsq(t0) - w*w;
|
||||
roots[off + numPerpdfddf] = 1f; // always check interval end points
|
||||
numPerpdfddf++;
|
||||
for (int i = off; i < off + numPerpdfddf; i++) {
|
||||
float t1 = roots[i], ft1 = ROCsq(t1) - w*w;
|
||||
if (ft0 == 0f) {
|
||||
roots[ret++] = t0;
|
||||
} else if (ft1 * ft0 < 0f) { // have opposite signs
|
||||
// (ROC(t)^2 == w^2) == (ROC(t) == w) is true because
|
||||
// ROC(t) >= 0 for all t.
|
||||
roots[ret++] = falsePositionROCsqMinusX(t0, t1, w*w, err);
|
||||
}
|
||||
t0 = t1;
|
||||
ft0 = ft1;
|
||||
}
|
||||
|
||||
return ret - off;
|
||||
}
|
||||
|
||||
private static float eliminateInf(float x) {
|
||||
return (x == Float.POSITIVE_INFINITY ? Float.MAX_VALUE :
|
||||
(x == Float.NEGATIVE_INFINITY ? Float.MIN_VALUE : x));
|
||||
}
|
||||
|
||||
// A slight modification of the false position algorithm on wikipedia.
|
||||
// This only works for the ROCsq-x functions. It might be nice to have
|
||||
// the function as an argument, but that would be awkward in java6.
|
||||
// TODO: It is something to consider for java8 (or whenever lambda
|
||||
// expressions make it into the language), depending on how closures
|
||||
// and turn out. Same goes for the newton's method
|
||||
// algorithm in Helpers.java
|
||||
private float falsePositionROCsqMinusX(float x0, float x1,
|
||||
final float x, final float err)
|
||||
{
|
||||
final int iterLimit = 100;
|
||||
int side = 0;
|
||||
float t = x1, ft = eliminateInf(ROCsq(t) - x);
|
||||
float s = x0, fs = eliminateInf(ROCsq(s) - x);
|
||||
float r = s, fr;
|
||||
for (int i = 0; i < iterLimit && Math.abs(t - s) > err * Math.abs(t + s); i++) {
|
||||
r = (fs * t - ft * s) / (fs - ft);
|
||||
fr = ROCsq(r) - x;
|
||||
if (sameSign(fr, ft)) {
|
||||
ft = fr; t = r;
|
||||
if (side < 0) {
|
||||
fs /= (1 << (-side));
|
||||
side--;
|
||||
} else {
|
||||
side = -1;
|
||||
}
|
||||
} else if (fr * fs > 0) {
|
||||
fs = fr; s = r;
|
||||
if (side > 0) {
|
||||
ft /= (1 << side);
|
||||
side++;
|
||||
} else {
|
||||
side = 1;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
private static boolean sameSign(double x, double y) {
|
||||
// another way is to test if x*y > 0. This is bad for small x, y.
|
||||
return (x < 0 && y < 0) || (x > 0 && y > 0);
|
||||
}
|
||||
|
||||
// returns the radius of curvature squared at t of this curve
|
||||
// see http://en.wikipedia.org/wiki/Radius_of_curvature_(applications)
|
||||
private float ROCsq(final float t) {
|
||||
// dx=xat(t) and dy=yat(t). These calls have been inlined for efficiency
|
||||
final float dx = t * (t * dax + dbx) + cx;
|
||||
final float dy = t * (t * day + dby) + cy;
|
||||
final float ddx = 2 * dax * t + dbx;
|
||||
final float ddy = 2 * day * t + dby;
|
||||
final float dx2dy2 = dx*dx + dy*dy;
|
||||
final float ddx2ddy2 = ddx*ddx + ddy*ddy;
|
||||
final float ddxdxddydy = ddx*dx + ddy*dy;
|
||||
return dx2dy2*((dx2dy2*dx2dy2) / (dx2dy2 * ddx2ddy2 - ddxdxddydy*ddxdxddydy));
|
||||
}
|
||||
|
||||
// curve to be broken should be in pts
|
||||
// this will change the contents of pts but not Ts
|
||||
// TODO: There's no reason for Ts to be an array. All we need is a sequence
|
||||
// of t values at which to subdivide. An array statisfies this condition,
|
||||
// but is unnecessarily restrictive. Ts should be an Iterator<Float> instead.
|
||||
// Doing this will also make dashing easier, since we could easily make
|
||||
// LengthIterator an Iterator<Float> and feed it to this function to simplify
|
||||
// the loop in Dasher.somethingTo.
|
||||
static Iterator<Integer> breakPtsAtTs(final float[] pts, final int type,
|
||||
final float[] Ts, final int numTs)
|
||||
{
|
||||
assert pts.length >= 2*type && numTs <= Ts.length;
|
||||
return new Iterator<Integer>() {
|
||||
// these prevent object creation and destruction during autoboxing.
|
||||
// Because of this, the compiler should be able to completely
|
||||
// eliminate the boxing costs.
|
||||
final Integer i0 = 0;
|
||||
final Integer itype = type;
|
||||
int nextCurveIdx = 0;
|
||||
Integer curCurveOff = i0;
|
||||
float prevT = 0;
|
||||
|
||||
@Override public boolean hasNext() {
|
||||
return nextCurveIdx < numTs + 1;
|
||||
}
|
||||
|
||||
@Override public Integer next() {
|
||||
Integer ret;
|
||||
if (nextCurveIdx < numTs) {
|
||||
float curT = Ts[nextCurveIdx];
|
||||
float splitT = (curT - prevT) / (1 - prevT);
|
||||
Helpers.subdivideAt(splitT,
|
||||
pts, curCurveOff,
|
||||
pts, 0,
|
||||
pts, type, type);
|
||||
prevT = curT;
|
||||
ret = i0;
|
||||
curCurveOff = itype;
|
||||
} else {
|
||||
ret = curCurveOff;
|
||||
}
|
||||
nextCurveIdx++;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override public void remove() {}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,329 @@
|
||||
package com.jpexs.graphics;
|
||||
|
||||
import java.awt.Shape;
|
||||
import java.awt.Stroke;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.awt.geom.GeneralPath;
|
||||
import java.awt.geom.PathIterator;
|
||||
import java.awt.geom.Point2D;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Extended Basic Stroke which allows MITER_CLIP join style.
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class ExtendedBasicStroke implements Stroke {
|
||||
|
||||
Set<Point2D> testPoints = new HashSet<>();
|
||||
|
||||
/**
|
||||
* Indicates a mitered line join style. See the class overview for an
|
||||
* illustration.
|
||||
*/
|
||||
public static final int JOIN_MITER = 0;
|
||||
|
||||
/**
|
||||
* Indicates a rounded line join style. See the class overview for an
|
||||
* illustration.
|
||||
*/
|
||||
public static final int JOIN_ROUND = 1;
|
||||
|
||||
/**
|
||||
* Indicates a bevelled line join style. See the class overview for an
|
||||
* illustration.
|
||||
*/
|
||||
public static final int JOIN_BEVEL = 2;
|
||||
|
||||
/**
|
||||
* Indicates a mitered clipped line join style. See the class overview for an
|
||||
* illustration.
|
||||
*/
|
||||
public static final int JOIN_MITER_CLIP = 3;
|
||||
|
||||
/**
|
||||
* Indicates a flat line cap style. See the class overview for an
|
||||
* illustration.
|
||||
*/
|
||||
public static final int CAP_BUTT = 0;
|
||||
|
||||
/**
|
||||
* Indicates a rounded line cap style. See the class overview for an
|
||||
* illustration.
|
||||
*/
|
||||
public static final int CAP_ROUND = 1;
|
||||
|
||||
/**
|
||||
* Indicates a square line cap style. See the class overview for an
|
||||
* illustration.
|
||||
*/
|
||||
public static final int CAP_SQUARE = 2;
|
||||
|
||||
/**
|
||||
* The stroke width.
|
||||
*/
|
||||
private final float width;
|
||||
|
||||
/**
|
||||
* The line cap style.
|
||||
*/
|
||||
private final int cap;
|
||||
|
||||
/**
|
||||
* The line join style.
|
||||
*/
|
||||
private final int join;
|
||||
|
||||
/**
|
||||
* The miter limit.
|
||||
*/
|
||||
private final float limit;
|
||||
|
||||
/**
|
||||
* Creates a new <code>BasicStroke</code> instance with the given
|
||||
* attributes.
|
||||
*
|
||||
* @param width the line width (>= 0.0f).
|
||||
* @param cap the line cap style (one of {@link #CAP_BUTT},
|
||||
* {@link #CAP_ROUND} or {@link #CAP_SQUARE}).
|
||||
* @param join the line join style (one of {@link #JOIN_ROUND},
|
||||
* {@link #JOIN_BEVEL}, or {@link #JOIN_MITER}).
|
||||
* @param miterlimit the limit to trim the miter join. The miterlimit must
|
||||
* be greater than or equal to 1.0f.
|
||||
*
|
||||
* @throws IllegalArgumentException If one input parameter doesn't meet its
|
||||
* needs.
|
||||
*/
|
||||
public ExtendedBasicStroke(float width, int cap, int join, float miterlimit) {
|
||||
if (width < 0.0f) {
|
||||
throw new IllegalArgumentException("width " + width + " < 0");
|
||||
} else if (cap < CAP_BUTT || cap > CAP_SQUARE) {
|
||||
throw new IllegalArgumentException("cap " + cap + " out of range ["
|
||||
+ CAP_BUTT + ".." + CAP_SQUARE + "]");
|
||||
} else if (miterlimit < 1.0f && join == JOIN_MITER) {
|
||||
throw new IllegalArgumentException("miterlimit " + miterlimit
|
||||
+ " < 1.0f while join == JOIN_MITER");
|
||||
} else if (join < JOIN_MITER || join > JOIN_MITER_CLIP) {
|
||||
throw new IllegalArgumentException("join " + join + " out of range ["
|
||||
+ JOIN_MITER + ".." + JOIN_MITER_CLIP
|
||||
+ "]");
|
||||
}
|
||||
|
||||
this.width = width;
|
||||
this.cap = cap;
|
||||
this.join = join;
|
||||
limit = miterlimit;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates a new <code>BasicStroke</code> instance with the given
|
||||
* attributes. The miter limit defaults to <code>10.0</code>.
|
||||
*
|
||||
* @param width the line width (>= 0.0f).
|
||||
* @param cap the line cap style (one of {@link #CAP_BUTT},
|
||||
* {@link #CAP_ROUND} or {@link #CAP_SQUARE}).
|
||||
* @param join the line join style (one of {@link #JOIN_ROUND},
|
||||
* {@link #JOIN_BEVEL}, or {@link #JOIN_MITER}).
|
||||
*
|
||||
* @throws IllegalArgumentException If one input parameter doesn't meet its
|
||||
* needs.
|
||||
*/
|
||||
public ExtendedBasicStroke(float width, int cap, int join) {
|
||||
this(width, cap, join, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new <code>BasicStroke</code> instance with the given line
|
||||
* width. The default values are:
|
||||
* <ul>
|
||||
* <li>line cap style: {@link #CAP_SQUARE};</li>
|
||||
* <li>line join style: {@link #JOIN_MITER};</li>
|
||||
* <li>miter limit: <code>10.0f</code>.
|
||||
* </ul>
|
||||
*
|
||||
* @param width the line width (>= 0.0f).
|
||||
*
|
||||
* @throws IllegalArgumentException If <code>width</code> is negative.
|
||||
*/
|
||||
public ExtendedBasicStroke(float width) {
|
||||
this(width, CAP_SQUARE, JOIN_MITER, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new <code>BasicStroke</code> instance. The default values are:
|
||||
* <ul>
|
||||
* <li>line width: <code>1.0f</code>;</li>
|
||||
* <li>line cap style: {@link #CAP_SQUARE};</li>
|
||||
* <li>line join style: {@link #JOIN_MITER};</li>
|
||||
* <li>miter limit: <code>10.0f</code>.
|
||||
* </ul>
|
||||
*/
|
||||
public ExtendedBasicStroke() {
|
||||
this(1, CAP_SQUARE, JOIN_MITER, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a shape representing the stroked outline of the given shape. THIS
|
||||
* METHOD IS NOT YET IMPLEMENTED.
|
||||
*
|
||||
* @param s the shape.
|
||||
*/
|
||||
@Override
|
||||
public Shape createStrokedShape(Shape s) {
|
||||
GeneralPath path = new GeneralPath();
|
||||
PathConsumer2D p2d = new PathConsumer2D() {
|
||||
@Override
|
||||
public void moveTo(float x, float y) {
|
||||
path.moveTo(x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void lineTo(float x, float y) {
|
||||
path.lineTo(x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void quadTo(float x1, float y1, float x2, float y2) {
|
||||
path.quadTo(x1, y1, x2, y2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void curveTo(float x1, float y1, float x2, float y2, float x3, float y3) {
|
||||
path.curveTo(x1, y1, x2, y2, x3, y3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closePath() {
|
||||
path.closePath();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pathDone() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getNativeConsumer() {
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
Stroker stroker = new Stroker(p2d, width, cap, join, limit);
|
||||
|
||||
float[] coords = new float[6];
|
||||
|
||||
PathIterator pi = s.getPathIterator(new AffineTransform());
|
||||
while (!pi.isDone()) {
|
||||
switch (pi.currentSegment(coords)) {
|
||||
case PathIterator.SEG_MOVETO:
|
||||
stroker.moveTo(coords[0], coords[1]);
|
||||
break;
|
||||
|
||||
case PathIterator.SEG_LINETO:
|
||||
stroker.lineTo(coords[0], coords[1]);
|
||||
break;
|
||||
|
||||
case PathIterator.SEG_QUADTO:
|
||||
stroker.quadTo(coords[0], coords[1], coords[2], coords[3]);
|
||||
break;
|
||||
|
||||
case PathIterator.SEG_CUBICTO:
|
||||
stroker.curveTo(coords[0], coords[1],
|
||||
coords[2], coords[3],
|
||||
coords[4], coords[5]);
|
||||
break;
|
||||
|
||||
case PathIterator.SEG_CLOSE:
|
||||
stroker.closePath();
|
||||
break;
|
||||
}
|
||||
pi.next();
|
||||
}
|
||||
|
||||
stroker.pathDone();
|
||||
|
||||
return path;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the line width.
|
||||
*
|
||||
* @return The line width.
|
||||
*/
|
||||
public float getLineWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a code indicating the line cap style (one of {@link #CAP_BUTT},
|
||||
* {@link #CAP_ROUND}, {@link #CAP_SQUARE}).
|
||||
*
|
||||
* @return A code indicating the line cap style.
|
||||
*/
|
||||
public int getEndCap() {
|
||||
return cap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a code indicating the line join style (one of {@link #JOIN_BEVEL},
|
||||
* {@link #JOIN_MITER} or {@link #JOIN_ROUND}).
|
||||
*
|
||||
* @return A code indicating the line join style.
|
||||
*/
|
||||
public int getLineJoin() {
|
||||
return join;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the miter limit.
|
||||
*
|
||||
* @return The miter limit.
|
||||
*/
|
||||
public float getMiterLimit() {
|
||||
return limit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the hash code for this object. The hash is calculated by xoring
|
||||
* the hash, cap, join, limit, dash array and phase values (converted to
|
||||
* <code>int</code> first with <code>Float.floatToIntBits()</code> if the
|
||||
* value is a <code>float</code>).
|
||||
*
|
||||
* @return The hash code.
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = Float.floatToIntBits(width);
|
||||
hash ^= cap;
|
||||
hash ^= join;
|
||||
hash ^= Float.floatToIntBits(limit);
|
||||
|
||||
return hash;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares this <code>BasicStroke</code> for equality with an arbitrary
|
||||
* object. This method returns <code>true</code> if and only if:
|
||||
* <ul>
|
||||
* <li><code>o</code> is an instanceof <code>BasicStroke</code>;</li>
|
||||
* <li>this object has the same width, line cap style, line join style,
|
||||
* miter limit, dash array and dash phase as <code>o</code>.</li>
|
||||
* </ul>
|
||||
*
|
||||
* @param o the object (<code>null</code> permitted).
|
||||
*
|
||||
* @return <code>true</code> if this stroke is equal to <code>o</code> and
|
||||
* <code>false</code> otherwise.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (!(o instanceof ExtendedBasicStroke)) {
|
||||
return false;
|
||||
}
|
||||
ExtendedBasicStroke s = (ExtendedBasicStroke) o;
|
||||
return width == s.width && cap == s.cap && join == s.join
|
||||
&& limit == s.limit;
|
||||
}
|
||||
}
|
||||
458
libsrc/miterstroke/src/com/jpexs/graphics/Helpers.java
Normal file
458
libsrc/miterstroke/src/com/jpexs/graphics/Helpers.java
Normal file
@@ -0,0 +1,458 @@
|
||||
/*
|
||||
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.jpexs.graphics;
|
||||
|
||||
import java.util.Arrays;
|
||||
import static java.lang.Math.PI;
|
||||
import static java.lang.Math.cos;
|
||||
import static java.lang.Math.sqrt;
|
||||
import static java.lang.Math.cbrt;
|
||||
import static java.lang.Math.acos;
|
||||
|
||||
|
||||
final class Helpers {
|
||||
private Helpers() {
|
||||
throw new Error("This is a non instantiable class");
|
||||
}
|
||||
|
||||
static boolean within(final float x, final float y, final float err) {
|
||||
final float d = y - x;
|
||||
return (d <= err && d >= -err);
|
||||
}
|
||||
|
||||
static boolean within(final double x, final double y, final double err) {
|
||||
final double d = y - x;
|
||||
return (d <= err && d >= -err);
|
||||
}
|
||||
|
||||
static int quadraticRoots(final float a, final float b,
|
||||
final float c, float[] zeroes, final int off)
|
||||
{
|
||||
int ret = off;
|
||||
float t;
|
||||
if (a != 0f) {
|
||||
final float dis = b*b - 4*a*c;
|
||||
if (dis > 0) {
|
||||
final float sqrtDis = (float)Math.sqrt(dis);
|
||||
// depending on the sign of b we use a slightly different
|
||||
// algorithm than the traditional one to find one of the roots
|
||||
// so we can avoid adding numbers of different signs (which
|
||||
// might result in loss of precision).
|
||||
if (b >= 0) {
|
||||
zeroes[ret++] = (2 * c) / (-b - sqrtDis);
|
||||
zeroes[ret++] = (-b - sqrtDis) / (2 * a);
|
||||
} else {
|
||||
zeroes[ret++] = (-b + sqrtDis) / (2 * a);
|
||||
zeroes[ret++] = (2 * c) / (-b + sqrtDis);
|
||||
}
|
||||
} else if (dis == 0f) {
|
||||
t = (-b) / (2 * a);
|
||||
zeroes[ret++] = t;
|
||||
}
|
||||
} else {
|
||||
if (b != 0f) {
|
||||
t = (-c) / b;
|
||||
zeroes[ret++] = t;
|
||||
}
|
||||
}
|
||||
return ret - off;
|
||||
}
|
||||
|
||||
// find the roots of g(t) = d*t^3 + a*t^2 + b*t + c in [A,B)
|
||||
static int cubicRootsInAB(float d, float a, float b, float c,
|
||||
float[] pts, final int off,
|
||||
final float A, final float B)
|
||||
{
|
||||
if (d == 0) {
|
||||
int num = quadraticRoots(a, b, c, pts, off);
|
||||
return filterOutNotInAB(pts, off, num, A, B) - off;
|
||||
}
|
||||
// From Graphics Gems:
|
||||
// http://tog.acm.org/resources/GraphicsGems/gems/Roots3And4.c
|
||||
// (also from awt.geom.CubicCurve2D. But here we don't need as
|
||||
// much accuracy and we don't want to create arrays so we use
|
||||
// our own customized version).
|
||||
|
||||
/* normal form: x^3 + ax^2 + bx + c = 0 */
|
||||
a /= d;
|
||||
b /= d;
|
||||
c /= d;
|
||||
|
||||
// substitute x = y - A/3 to eliminate quadratic term:
|
||||
// x^3 +Px + Q = 0
|
||||
//
|
||||
// Since we actually need P/3 and Q/2 for all of the
|
||||
// calculations that follow, we will calculate
|
||||
// p = P/3
|
||||
// q = Q/2
|
||||
// instead and use those values for simplicity of the code.
|
||||
double sq_A = a * a;
|
||||
double p = 1.0/3 * (-1.0/3 * sq_A + b);
|
||||
double q = 1.0/2 * (2.0/27 * a * sq_A - 1.0/3 * a * b + c);
|
||||
|
||||
/* use Cardano's formula */
|
||||
|
||||
double cb_p = p * p * p;
|
||||
double D = q * q + cb_p;
|
||||
|
||||
int num;
|
||||
if (D < 0) {
|
||||
// see: http://en.wikipedia.org/wiki/Cubic_function#Trigonometric_.28and_hyperbolic.29_method
|
||||
final double phi = 1.0/3 * acos(-q / sqrt(-cb_p));
|
||||
final double t = 2 * sqrt(-p);
|
||||
|
||||
pts[ off+0 ] = (float)( t * cos(phi));
|
||||
pts[ off+1 ] = (float)(-t * cos(phi + PI / 3));
|
||||
pts[ off+2 ] = (float)(-t * cos(phi - PI / 3));
|
||||
num = 3;
|
||||
} else {
|
||||
final double sqrt_D = sqrt(D);
|
||||
final double u = cbrt(sqrt_D - q);
|
||||
final double v = - cbrt(sqrt_D + q);
|
||||
|
||||
pts[ off ] = (float)(u + v);
|
||||
num = 1;
|
||||
|
||||
if (within(D, 0, 1e-8)) {
|
||||
pts[off+1] = -(pts[off] / 2);
|
||||
num = 2;
|
||||
}
|
||||
}
|
||||
|
||||
final float sub = 1.0f/3 * a;
|
||||
|
||||
for (int i = 0; i < num; ++i) {
|
||||
pts[ off+i ] -= sub;
|
||||
}
|
||||
|
||||
return filterOutNotInAB(pts, off, num, A, B) - off;
|
||||
}
|
||||
|
||||
// These use a hardcoded factor of 2 for increasing sizes. Perhaps this
|
||||
// should be provided as an argument.
|
||||
static float[] widenArray(float[] in, final int cursize, final int numToAdd) {
|
||||
if (in.length >= cursize + numToAdd) {
|
||||
return in;
|
||||
}
|
||||
return Arrays.copyOf(in, 2 * (cursize + numToAdd));
|
||||
}
|
||||
|
||||
static int[] widenArray(int[] in, final int cursize, final int numToAdd) {
|
||||
if (in.length >= cursize + numToAdd) {
|
||||
return in;
|
||||
}
|
||||
return Arrays.copyOf(in, 2 * (cursize + numToAdd));
|
||||
}
|
||||
|
||||
static float evalCubic(final float a, final float b,
|
||||
final float c, final float d,
|
||||
final float t)
|
||||
{
|
||||
return t * (t * (t * a + b) + c) + d;
|
||||
}
|
||||
|
||||
static float evalQuad(final float a, final float b,
|
||||
final float c, final float t)
|
||||
{
|
||||
return t * (t * a + b) + c;
|
||||
}
|
||||
|
||||
// returns the index 1 past the last valid element remaining after filtering
|
||||
static int filterOutNotInAB(float[] nums, final int off, final int len,
|
||||
final float a, final float b)
|
||||
{
|
||||
int ret = off;
|
||||
for (int i = off; i < off + len; i++) {
|
||||
if (nums[i] >= a && nums[i] < b) {
|
||||
nums[ret++] = nums[i];
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static float polyLineLength(float[] poly, final int off, final int nCoords) {
|
||||
assert nCoords % 2 == 0 && poly.length >= off + nCoords : "";
|
||||
float acc = 0;
|
||||
for (int i = off + 2; i < off + nCoords; i += 2) {
|
||||
acc += linelen(poly[i], poly[i+1], poly[i-2], poly[i-1]);
|
||||
}
|
||||
return acc;
|
||||
}
|
||||
|
||||
static float linelen(float x1, float y1, float x2, float y2) {
|
||||
final float dx = x2 - x1;
|
||||
final float dy = y2 - y1;
|
||||
return (float)Math.sqrt(dx*dx + dy*dy);
|
||||
}
|
||||
|
||||
static void subdivide(float[] src, int srcoff, float[] left, int leftoff,
|
||||
float[] right, int rightoff, int type)
|
||||
{
|
||||
switch(type) {
|
||||
case 6:
|
||||
Helpers.subdivideQuad(src, srcoff, left, leftoff, right, rightoff);
|
||||
break;
|
||||
case 8:
|
||||
Helpers.subdivideCubic(src, srcoff, left, leftoff, right, rightoff);
|
||||
break;
|
||||
default:
|
||||
throw new InternalError("Unsupported curve type");
|
||||
}
|
||||
}
|
||||
|
||||
static void isort(float[] a, int off, int len) {
|
||||
for (int i = off + 1; i < off + len; i++) {
|
||||
float ai = a[i];
|
||||
int j = i - 1;
|
||||
for (; j >= off && a[j] > ai; j--) {
|
||||
a[j+1] = a[j];
|
||||
}
|
||||
a[j+1] = ai;
|
||||
}
|
||||
}
|
||||
|
||||
// Most of these are copied from classes in java.awt.geom because we need
|
||||
// float versions of these functions, and Line2D, CubicCurve2D,
|
||||
// QuadCurve2D don't provide them.
|
||||
/**
|
||||
* Subdivides the cubic curve specified by the coordinates
|
||||
* stored in the <code>src</code> array at indices <code>srcoff</code>
|
||||
* through (<code>srcoff</code> + 7) and stores the
|
||||
* resulting two subdivided curves into the two result arrays at the
|
||||
* corresponding indices.
|
||||
* Either or both of the <code>left</code> and <code>right</code>
|
||||
* arrays may be <code>null</code> or a reference to the same array
|
||||
* as the <code>src</code> array.
|
||||
* Note that the last point in the first subdivided curve is the
|
||||
* same as the first point in the second subdivided curve. Thus,
|
||||
* it is possible to pass the same array for <code>left</code>
|
||||
* and <code>right</code> and to use offsets, such as <code>rightoff</code>
|
||||
* equals (<code>leftoff</code> + 6), in order
|
||||
* to avoid allocating extra storage for this common point.
|
||||
* @param src the array holding the coordinates for the source curve
|
||||
* @param srcoff the offset into the array of the beginning of the
|
||||
* the 6 source coordinates
|
||||
* @param left the array for storing the coordinates for the first
|
||||
* half of the subdivided curve
|
||||
* @param leftoff the offset into the array of the beginning of the
|
||||
* the 6 left coordinates
|
||||
* @param right the array for storing the coordinates for the second
|
||||
* half of the subdivided curve
|
||||
* @param rightoff the offset into the array of the beginning of the
|
||||
* the 6 right coordinates
|
||||
* @since 1.7
|
||||
*/
|
||||
static void subdivideCubic(float src[], int srcoff,
|
||||
float left[], int leftoff,
|
||||
float right[], int rightoff)
|
||||
{
|
||||
float x1 = src[srcoff + 0];
|
||||
float y1 = src[srcoff + 1];
|
||||
float ctrlx1 = src[srcoff + 2];
|
||||
float ctrly1 = src[srcoff + 3];
|
||||
float ctrlx2 = src[srcoff + 4];
|
||||
float ctrly2 = src[srcoff + 5];
|
||||
float x2 = src[srcoff + 6];
|
||||
float y2 = src[srcoff + 7];
|
||||
if (left != null) {
|
||||
left[leftoff + 0] = x1;
|
||||
left[leftoff + 1] = y1;
|
||||
}
|
||||
if (right != null) {
|
||||
right[rightoff + 6] = x2;
|
||||
right[rightoff + 7] = y2;
|
||||
}
|
||||
x1 = (x1 + ctrlx1) / 2.0f;
|
||||
y1 = (y1 + ctrly1) / 2.0f;
|
||||
x2 = (x2 + ctrlx2) / 2.0f;
|
||||
y2 = (y2 + ctrly2) / 2.0f;
|
||||
float centerx = (ctrlx1 + ctrlx2) / 2.0f;
|
||||
float centery = (ctrly1 + ctrly2) / 2.0f;
|
||||
ctrlx1 = (x1 + centerx) / 2.0f;
|
||||
ctrly1 = (y1 + centery) / 2.0f;
|
||||
ctrlx2 = (x2 + centerx) / 2.0f;
|
||||
ctrly2 = (y2 + centery) / 2.0f;
|
||||
centerx = (ctrlx1 + ctrlx2) / 2.0f;
|
||||
centery = (ctrly1 + ctrly2) / 2.0f;
|
||||
if (left != null) {
|
||||
left[leftoff + 2] = x1;
|
||||
left[leftoff + 3] = y1;
|
||||
left[leftoff + 4] = ctrlx1;
|
||||
left[leftoff + 5] = ctrly1;
|
||||
left[leftoff + 6] = centerx;
|
||||
left[leftoff + 7] = centery;
|
||||
}
|
||||
if (right != null) {
|
||||
right[rightoff + 0] = centerx;
|
||||
right[rightoff + 1] = centery;
|
||||
right[rightoff + 2] = ctrlx2;
|
||||
right[rightoff + 3] = ctrly2;
|
||||
right[rightoff + 4] = x2;
|
||||
right[rightoff + 5] = y2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void subdivideCubicAt(float t, float src[], int srcoff,
|
||||
float left[], int leftoff,
|
||||
float right[], int rightoff)
|
||||
{
|
||||
float x1 = src[srcoff + 0];
|
||||
float y1 = src[srcoff + 1];
|
||||
float ctrlx1 = src[srcoff + 2];
|
||||
float ctrly1 = src[srcoff + 3];
|
||||
float ctrlx2 = src[srcoff + 4];
|
||||
float ctrly2 = src[srcoff + 5];
|
||||
float x2 = src[srcoff + 6];
|
||||
float y2 = src[srcoff + 7];
|
||||
if (left != null) {
|
||||
left[leftoff + 0] = x1;
|
||||
left[leftoff + 1] = y1;
|
||||
}
|
||||
if (right != null) {
|
||||
right[rightoff + 6] = x2;
|
||||
right[rightoff + 7] = y2;
|
||||
}
|
||||
x1 = x1 + t * (ctrlx1 - x1);
|
||||
y1 = y1 + t * (ctrly1 - y1);
|
||||
x2 = ctrlx2 + t * (x2 - ctrlx2);
|
||||
y2 = ctrly2 + t * (y2 - ctrly2);
|
||||
float centerx = ctrlx1 + t * (ctrlx2 - ctrlx1);
|
||||
float centery = ctrly1 + t * (ctrly2 - ctrly1);
|
||||
ctrlx1 = x1 + t * (centerx - x1);
|
||||
ctrly1 = y1 + t * (centery - y1);
|
||||
ctrlx2 = centerx + t * (x2 - centerx);
|
||||
ctrly2 = centery + t * (y2 - centery);
|
||||
centerx = ctrlx1 + t * (ctrlx2 - ctrlx1);
|
||||
centery = ctrly1 + t * (ctrly2 - ctrly1);
|
||||
if (left != null) {
|
||||
left[leftoff + 2] = x1;
|
||||
left[leftoff + 3] = y1;
|
||||
left[leftoff + 4] = ctrlx1;
|
||||
left[leftoff + 5] = ctrly1;
|
||||
left[leftoff + 6] = centerx;
|
||||
left[leftoff + 7] = centery;
|
||||
}
|
||||
if (right != null) {
|
||||
right[rightoff + 0] = centerx;
|
||||
right[rightoff + 1] = centery;
|
||||
right[rightoff + 2] = ctrlx2;
|
||||
right[rightoff + 3] = ctrly2;
|
||||
right[rightoff + 4] = x2;
|
||||
right[rightoff + 5] = y2;
|
||||
}
|
||||
}
|
||||
|
||||
static void subdivideQuad(float src[], int srcoff,
|
||||
float left[], int leftoff,
|
||||
float right[], int rightoff)
|
||||
{
|
||||
float x1 = src[srcoff + 0];
|
||||
float y1 = src[srcoff + 1];
|
||||
float ctrlx = src[srcoff + 2];
|
||||
float ctrly = src[srcoff + 3];
|
||||
float x2 = src[srcoff + 4];
|
||||
float y2 = src[srcoff + 5];
|
||||
if (left != null) {
|
||||
left[leftoff + 0] = x1;
|
||||
left[leftoff + 1] = y1;
|
||||
}
|
||||
if (right != null) {
|
||||
right[rightoff + 4] = x2;
|
||||
right[rightoff + 5] = y2;
|
||||
}
|
||||
x1 = (x1 + ctrlx) / 2.0f;
|
||||
y1 = (y1 + ctrly) / 2.0f;
|
||||
x2 = (x2 + ctrlx) / 2.0f;
|
||||
y2 = (y2 + ctrly) / 2.0f;
|
||||
ctrlx = (x1 + x2) / 2.0f;
|
||||
ctrly = (y1 + y2) / 2.0f;
|
||||
if (left != null) {
|
||||
left[leftoff + 2] = x1;
|
||||
left[leftoff + 3] = y1;
|
||||
left[leftoff + 4] = ctrlx;
|
||||
left[leftoff + 5] = ctrly;
|
||||
}
|
||||
if (right != null) {
|
||||
right[rightoff + 0] = ctrlx;
|
||||
right[rightoff + 1] = ctrly;
|
||||
right[rightoff + 2] = x2;
|
||||
right[rightoff + 3] = y2;
|
||||
}
|
||||
}
|
||||
|
||||
static void subdivideQuadAt(float t, float src[], int srcoff,
|
||||
float left[], int leftoff,
|
||||
float right[], int rightoff)
|
||||
{
|
||||
float x1 = src[srcoff + 0];
|
||||
float y1 = src[srcoff + 1];
|
||||
float ctrlx = src[srcoff + 2];
|
||||
float ctrly = src[srcoff + 3];
|
||||
float x2 = src[srcoff + 4];
|
||||
float y2 = src[srcoff + 5];
|
||||
if (left != null) {
|
||||
left[leftoff + 0] = x1;
|
||||
left[leftoff + 1] = y1;
|
||||
}
|
||||
if (right != null) {
|
||||
right[rightoff + 4] = x2;
|
||||
right[rightoff + 5] = y2;
|
||||
}
|
||||
x1 = x1 + t * (ctrlx - x1);
|
||||
y1 = y1 + t * (ctrly - y1);
|
||||
x2 = ctrlx + t * (x2 - ctrlx);
|
||||
y2 = ctrly + t * (y2 - ctrly);
|
||||
ctrlx = x1 + t * (x2 - x1);
|
||||
ctrly = y1 + t * (y2 - y1);
|
||||
if (left != null) {
|
||||
left[leftoff + 2] = x1;
|
||||
left[leftoff + 3] = y1;
|
||||
left[leftoff + 4] = ctrlx;
|
||||
left[leftoff + 5] = ctrly;
|
||||
}
|
||||
if (right != null) {
|
||||
right[rightoff + 0] = ctrlx;
|
||||
right[rightoff + 1] = ctrly;
|
||||
right[rightoff + 2] = x2;
|
||||
right[rightoff + 3] = y2;
|
||||
}
|
||||
}
|
||||
|
||||
static void subdivideAt(float t, float src[], int srcoff,
|
||||
float left[], int leftoff,
|
||||
float right[], int rightoff, int size)
|
||||
{
|
||||
switch(size) {
|
||||
case 8:
|
||||
subdivideCubicAt(t, src, srcoff, left, leftoff, right, rightoff);
|
||||
break;
|
||||
case 6:
|
||||
subdivideQuadAt(t, src, srcoff, left, leftoff, right, rightoff);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.jpexs.graphics;
|
||||
|
||||
public interface PathConsumer2D {
|
||||
/**
|
||||
* @see java.awt.geom.Path2D.Float.moveTo
|
||||
*/
|
||||
public void moveTo(float x, float y);
|
||||
|
||||
/**
|
||||
* @see java.awt.geom.Path2D.Float.lineTo
|
||||
*/
|
||||
public void lineTo(float x, float y);
|
||||
|
||||
/**
|
||||
* @see java.awt.geom.Path2D.Float.quadTo
|
||||
*/
|
||||
public void quadTo(float x1, float y1,
|
||||
float x2, float y2);
|
||||
|
||||
/**
|
||||
* @see java.awt.geom.Path2D.Float.curveTo
|
||||
*/
|
||||
public void curveTo(float x1, float y1,
|
||||
float x2, float y2,
|
||||
float x3, float y3);
|
||||
|
||||
/**
|
||||
* @see java.awt.geom.Path2D.Float.closePath
|
||||
*/
|
||||
public void closePath();
|
||||
|
||||
/**
|
||||
* Called after the last segment of the last subpath when the
|
||||
* iteration of the path segments is completely done. This
|
||||
* method serves to trigger the end of path processing in the
|
||||
* consumer that would normally be triggered when a
|
||||
* {@link java.awt.geom.PathIterator PathIterator}
|
||||
* returns {@code true} from its {@code done} method.
|
||||
*/
|
||||
public void pathDone();
|
||||
|
||||
/**
|
||||
* If a given PathConsumer performs all or most of its work
|
||||
* natively then it can return a (non-zero) pointer to a
|
||||
* native function vector that defines C functions for all
|
||||
* of the above methods.
|
||||
* The specific pointer it returns is a pointer to a
|
||||
* PathConsumerVec structure as defined in the include file
|
||||
* src/share/native/sun/java2d/pipe/PathConsumer2D.h
|
||||
* @return a native pointer to a PathConsumerVec structure.
|
||||
*/
|
||||
public long getNativeConsumer();
|
||||
}
|
||||
134
libsrc/miterstroke/src/com/jpexs/graphics/StrokeTest.java
Normal file
134
libsrc/miterstroke/src/com/jpexs/graphics/StrokeTest.java
Normal file
@@ -0,0 +1,134 @@
|
||||
package com.jpexs.graphics;
|
||||
|
||||
import java.awt.BasicStroke;
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.geom.GeneralPath;
|
||||
import java.awt.geom.Point2D;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class StrokeTest extends JFrame {
|
||||
|
||||
public StrokeTest() {
|
||||
setDefaultCloseOperation(EXIT_ON_CLOSE);
|
||||
setContentPane(new JPanel() {
|
||||
@Override
|
||||
protected void paintComponent(Graphics g) {
|
||||
super.paintComponent(g);
|
||||
|
||||
float miterLimit = 3f;//9.6f;
|
||||
Graphics2D g2d = (Graphics2D)g;
|
||||
GeneralPath p = new GeneralPath();
|
||||
ExtendedBasicStroke ebs = new ExtendedBasicStroke(30,
|
||||
ExtendedBasicStroke.CAP_BUTT,
|
||||
ExtendedBasicStroke.JOIN_MITER_CLIP,
|
||||
miterLimit);
|
||||
g2d.setStroke(ebs);
|
||||
g2d.setPaint(Color.RED);
|
||||
/*path = new GeneralPath();
|
||||
path.moveTo(10, 10);
|
||||
path.lineTo(30, 200);
|
||||
path.lineTo(50, 10);
|
||||
g2d.draw(path);
|
||||
|
||||
|
||||
path = new GeneralPath();
|
||||
path.moveTo(10, 300+200);
|
||||
path.lineTo(30, 300+10);
|
||||
path.lineTo(50, 300+200);
|
||||
g2d.draw(path);
|
||||
|
||||
path = new GeneralPath();
|
||||
path.moveTo(50, 600+200);
|
||||
path.lineTo(30, 600+10);
|
||||
path.lineTo(10, 600+200);
|
||||
g2d.draw(path);
|
||||
|
||||
path = new GeneralPath();
|
||||
path.moveTo(200, 300);
|
||||
path.lineTo(200+190, 300+20);
|
||||
path.lineTo(200, 300+40);
|
||||
g2d.draw(path);*/
|
||||
|
||||
double zoom=1;
|
||||
GeneralPath path = new GeneralPath();
|
||||
path.moveTo(5+15 * zoom, 15*zoom);
|
||||
path.lineTo(5+45*zoom, 185*zoom);
|
||||
path.lineTo(5+85*zoom, 15*zoom);
|
||||
g2d.draw(path);
|
||||
|
||||
/*p.moveTo(730.0,435.0);
|
||||
p.quadTo(730.0,582.0,523.0,702.0);
|
||||
p.quadTo(315.0,822.0,35.0,822.0);
|
||||
p.quadTo(-306.0,822.0,-535.0,589.0);
|
||||
p.quadTo(-764.0,356.0,-764.0,4.0);
|
||||
p.quadTo(-764.0,-349.0,-542.0,-585.0);
|
||||
p.quadTo(-320.0,-821.0,12.0,-821.0);
|
||||
p.quadTo(332.0,-821.0,548.0,-599.0);
|
||||
p.quadTo(764.0,-375.0,764.0,-57.0);
|
||||
p.quadTo(764.0,46.0,717.0,88.0);
|
||||
p.quadTo(669.0,130.0,535.0,130.0);
|
||||
p.lineTo(-290.0,130.0);
|
||||
p.quadTo(-275.0,257.0,-184.0,332.0);
|
||||
p.quadTo(-92.0,406.0,59.0,406.0);
|
||||
p.quadTo(190.0,406.0,349.0,331.0);
|
||||
p.quadTo(508.0,256.0,545.0,256.0);
|
||||
p.quadTo(629.0,256.0,679.0,306.0);
|
||||
p.quadTo(730.0,356.0,730.0,435.0);*/
|
||||
/*p.moveTo(220.0,-368.0);
|
||||
p.quadTo(132.0,-446.0,15.0,-446.0);
|
||||
p.quadTo(-103.0,-446.0,-186.0,-373.0);*/
|
||||
/*p.moveTo(-186.0,-373.0);//navic
|
||||
p.quadTo(-269.0,-300.0,-295.0,-172.0);
|
||||
p.lineTo(314.0,-172.0);
|
||||
//p.quadTo(314.0,-274.0,220.0,-368.0);
|
||||
p.closePath();
|
||||
g2d.setTransform(new AffineTransform());
|
||||
g2d.translate(500, 500);
|
||||
//g2d.scale(0.8, 0.8);
|
||||
g2d.draw(p);*/
|
||||
|
||||
|
||||
/*g2d.setStroke(new BasicStroke(30,
|
||||
BasicStroke.CAP_ROUND,
|
||||
BasicStroke.JOIN_MITER,
|
||||
miterLimit));
|
||||
*/
|
||||
g2d.setStroke(new BasicStroke(1));
|
||||
g2d.setColor(Color.BLACK);
|
||||
g2d.drawLine(5, 229, 200, 229);
|
||||
|
||||
/*path = new GeneralPath();
|
||||
path.moveTo(200+10, 10);
|
||||
path.lineTo(200+30, 200);
|
||||
path.lineTo(200+50, 10);
|
||||
g2d.draw(path);
|
||||
*/
|
||||
/*for(Point2D po:ebs.testPoints){
|
||||
drawPoint(g2d, po);
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
private void drawPoint(Graphics2D g, Point2D p){
|
||||
g.setColor(Color.GREEN);
|
||||
int width = 5;
|
||||
g.drawRect((int)p.getX() - width/2, (int)p.getY() - width/2, width, width);
|
||||
}
|
||||
|
||||
});
|
||||
setSize(800, 800);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
new StrokeTest().setVisible(true);
|
||||
}
|
||||
}
|
||||
1267
libsrc/miterstroke/src/com/jpexs/graphics/Stroker.java
Normal file
1267
libsrc/miterstroke/src/com/jpexs/graphics/Stroker.java
Normal file
File diff suppressed because it is too large
Load Diff
@@ -591,7 +591,7 @@ config.description.allowPlacingDefinesIntoSprites = Allows placing (moving/copyi
|
||||
config.name.allowDragAndDropInTagListTree = Allow drag and drop in tag list view
|
||||
config.description.allowDragAndDropInTagListTree = Allows moving / copying tags with drag and drop in the tree of tag list view.
|
||||
|
||||
config.name.allowMiterClipLinestyle = Allow miter clip line styles (SLOW)
|
||||
config.name.allowMiterClipLinestyle = (REMOVED) Allow miter clip line styles (SLOW)
|
||||
config.description.allowMiterClipLinestyle = Allow using custom renderer which supports miter clip line styles, but is slow.
|
||||
|
||||
advancedSettings.search = Search:
|
||||
|
||||
@@ -581,7 +581,7 @@ config.description.allowPlacingDefinesIntoSprites = Povol\u00ed umis\u0165ov\u00
|
||||
config.name.allowDragAndDropInTagListTree = Povolit drag and drop v zobrazen\u00ed seznamu tag\u016f
|
||||
config.description.allowDragAndDropInTagListTree = Povol\u00ed p\u0159esouv\u00e1n\u00ed / kop\u00edrov\u00e1n\u00ed tag\u016f pomoc\u00ed drag and drop v stromu zobrazen\u00ed seznamu tag\u016f.
|
||||
|
||||
config.name.allowMiterClipLinestyle = Povolit styl \u010d\u00e1ry miter clip (POMAL\u00c9)
|
||||
config.name.allowMiterClipLinestyle = (REMOVED) Povolit styl \u010d\u00e1ry miter clip (POMAL\u00c9)
|
||||
config.description.allowMiterClipLinestyle = Povolit animace podsprit\u016f v n\u00e1hledu timeliny.
|
||||
|
||||
advancedSettings.search = Hledat:
|
||||
|
||||
@@ -839,7 +839,7 @@ config.name.allowPlacingDefinesIntoSprites = DefineSprite i\u00e7ine tan\u0131ml
|
||||
config.description.allowPlacingDefinesIntoSprites = DefineSprite i\u00e7ine tan\u0131mlama t\u00fcr\u00fc etiketlerinin yerle\u015ftirilmesini (ta\u015f\u0131nmas\u0131n\u0131/kopyalanmas\u0131n\u0131/s\u00fcr\u00fcklenmesini) sa\u011flar.
|
||||
config.name.allowDragAndDropInTagListTree = Etiket listesi g\u00f6r\u00fcn\u00fcm\u00fcnde s\u00fcr\u00fcklemeye ve b\u0131rakmaya izin ver
|
||||
config.description.allowDragAndDropInTagListTree = Etiket listesi g\u00f6r\u00fcn\u00fcm\u00fcn\u00fcn a\u011fac\u0131nda s\u00fcr\u00fckle ve b\u0131rak ile etiketlerin ta\u015f\u0131nmas\u0131na / kopyalanmas\u0131na izin verir.
|
||||
config.name.allowMiterClipLinestyle = G\u00f6nye klipsi \u00e7izgi stillerine izin ver (YAVA\u015e)
|
||||
config.name.allowMiterClipLinestyle = (REMOVED) G\u00f6nye klipsi \u00e7izgi stillerine izin ver (YAVA\u015e)
|
||||
config.description.allowMiterClipLinestyle = G\u00f6nye klipsi \u00e7izgi stillerini destekleyen ancak yava\u015f olan \u00f6zel olu\u015fturucunun kullan\u0131lmas\u0131na izin verin.
|
||||
advancedSettings.search = Ara:
|
||||
# after 16.3.1
|
||||
|
||||
@@ -568,7 +568,7 @@ config.name.allowPlacingDefinesIntoSprites = \u5c06define\u6807\u7b7e\u653e\u516
|
||||
config.description.allowPlacingDefinesIntoSprites = \u5c06(moving/copying/dragging into)define\u6807\u7b7e\u653e\u5165DefineSprite
|
||||
config.name.allowDragAndDropInTagListTree = \u6807\u7b7e\u5217\u8868\u62d6\u653e
|
||||
config.description.allowDragAndDropInTagListTree = \u5141\u8bb8\u5728\u6807\u7b7e\u5217\u8868\u901a\u8fc7\u62d6\u653e\u79fb\u52a8/\u590d\u5236\u6807\u7b7e
|
||||
config.name.allowMiterClipLinestyle = \u659c\u5207\u5939\u7ebf\u6837\u5f0f(\u6162)
|
||||
config.name.allowMiterClipLinestyle = (REMOVED) \u659c\u5207\u5939\u7ebf\u6837\u5f0f(\u6162)
|
||||
config.description.allowMiterClipLinestyle = \u5141\u8bb8\u4f7f\u7528\u652f\u6301\u659c\u5207\u5939\u7ebf\u6837\u5f0f\u7684\u81ea\u5b9a\u4e49\u6e32\u67d3\u5668\uff0c\u4f46\u901f\u5ea6\u5f88\u6162
|
||||
advancedSettings.search = \u641c\u7d22:
|
||||
# after 16.3.1
|
||||
|
||||
Reference in New Issue
Block a user