1 /*
2 * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
875 * <li>followed by
876 * a byte indicating the winding rule
877 * ({@link #WIND_EVEN_ODD WIND_EVEN_ODD} or
878 * {@link #WIND_NON_ZERO WIND_NON_ZERO})
879 * <li>followed by
880 * {@code NP} (or unlimited if {@code NP < 0}) sets of values consisting of
881 * a single byte indicating a path segment type
882 * followed by one or more pairs of float or double
883 * values representing the coordinates of the path segment
884 * <li>followed by
885 * a byte indicating the end of the path (SERIAL_PATH_END).
886 * </ol>
887 * <p>
888 * The following byte value constants are used in the serialized form
889 * of {@code Path2D} objects:
890 *
891 * <table class="striped">
892 * <caption>Constants</caption>
893 * <thead>
894 * <tr>
895 * <th>Constant Name</th>
896 * <th>Byte Value</th>
897 * <th>Followed by</th>
898 * <th>Description</th>
899 * </tr>
900 * </thead>
901 * <tbody>
902 * <tr>
903 * <td>{@code SERIAL_STORAGE_FLT_ARRAY}</td>
904 * <td>0x30</td>
905 * <td></td>
906 * <td>A hint that the original {@code Path2D} object stored
907 * the coordinates in a Java array of floats.</td>
908 * </tr>
909 * <tr>
910 * <td>{@code SERIAL_STORAGE_DBL_ARRAY}</td>
911 * <td>0x31</td>
912 * <td></td>
913 * <td>A hint that the original {@code Path2D} object stored
914 * the coordinates in a Java array of doubles.</td>
915 * </tr>
916 * <tr>
917 * <td>{@code SERIAL_SEG_FLT_MOVETO}</td>
918 * <td>0x40</td>
919 * <td>2 floats</td>
920 * <td>A {@link #moveTo moveTo} path segment follows.</td>
921 * </tr>
922 * <tr>
923 * <td>{@code SERIAL_SEG_FLT_LINETO}</td>
924 * <td>0x41</td>
925 * <td>2 floats</td>
926 * <td>A {@link #lineTo lineTo} path segment follows.</td>
927 * </tr>
928 * <tr>
929 * <td>{@code SERIAL_SEG_FLT_QUADTO}</td>
930 * <td>0x42</td>
931 * <td>4 floats</td>
932 * <td>A {@link #quadTo quadTo} path segment follows.</td>
933 * </tr>
934 * <tr>
935 * <td>{@code SERIAL_SEG_FLT_CUBICTO}</td>
936 * <td>0x43</td>
937 * <td>6 floats</td>
938 * <td>A {@link #curveTo curveTo} path segment follows.</td>
939 * </tr>
940 * <tr>
941 * <td>{@code SERIAL_SEG_DBL_MOVETO}</td>
942 * <td>0x50</td>
943 * <td>2 doubles</td>
944 * <td>A {@link #moveTo moveTo} path segment follows.</td>
945 * </tr>
946 * <tr>
947 * <td>{@code SERIAL_SEG_DBL_LINETO}</td>
948 * <td>0x51</td>
949 * <td>2 doubles</td>
950 * <td>A {@link #lineTo lineTo} path segment follows.</td>
951 * </tr>
952 * <tr>
953 * <td>{@code SERIAL_SEG_DBL_QUADTO}</td>
954 * <td>0x52</td>
955 * <td>4 doubles</td>
956 * <td>A {@link #curveTo curveTo} path segment follows.</td>
957 * </tr>
958 * <tr>
959 * <td>{@code SERIAL_SEG_DBL_CUBICTO}</td>
960 * <td>0x53</td>
961 * <td>6 doubles</td>
962 * <td>A {@link #curveTo curveTo} path segment follows.</td>
963 * </tr>
964 * <tr>
965 * <td>{@code SERIAL_SEG_CLOSE}</td>
966 * <td>0x60</td>
967 * <td></td>
968 * <td>A {@link #closePath closePath} path segment.</td>
969 * </tr>
970 * <tr>
971 * <td>{@code SERIAL_PATH_END}</td>
972 * <td>0x61</td>
973 * <td></td>
974 * <td>There are no more path segments following.</td>
975 * </tbody>
976 * </table>
977 *
978 * @since 1.6
979 */
980 private void writeObject(java.io.ObjectOutputStream s)
981 throws java.io.IOException
982 {
983 super.writeObject(s, false);
984 }
985
986 /**
987 * Reads the default serializable fields from the
988 * {@code ObjectInputStream} followed by an explicit
989 * serialization of the path segments stored in this
990 * path.
991 * <p>
1649 * representing an x,y pair)
1650 * <li>followed by
1651 * a byte indicating the winding rule
1652 * ({@link #WIND_EVEN_ODD WIND_EVEN_ODD} or
1653 * {@link #WIND_NON_ZERO WIND_NON_ZERO})
1654 * <li>followed by
1655 * {@code NP} (or unlimited if {@code NP < 0}) sets of values consisting of
1656 * a single byte indicating a path segment type
1657 * followed by one or more pairs of float or double
1658 * values representing the coordinates of the path segment
1659 * <li>followed by
1660 * a byte indicating the end of the path (SERIAL_PATH_END).
1661 * </ol>
1662 * <p>
1663 * The following byte value constants are used in the serialized form
1664 * of {@code Path2D} objects:
1665 * <table class="striped">
1666 * <caption>Constants</caption>
1667 * <thead>
1668 * <tr>
1669 * <th>Constant Name</th>
1670 * <th>Byte Value</th>
1671 * <th>Followed by</th>
1672 * <th>Description</th>
1673 * </tr>
1674 * </thead>
1675 * <tbody>
1676 * <tr>
1677 * <td>{@code SERIAL_STORAGE_FLT_ARRAY}</td>
1678 * <td>0x30</td>
1679 * <td></td>
1680 * <td>A hint that the original {@code Path2D} object stored
1681 * the coordinates in a Java array of floats.</td>
1682 * </tr>
1683 * <tr>
1684 * <td>{@code SERIAL_STORAGE_DBL_ARRAY}</td>
1685 * <td>0x31</td>
1686 * <td></td>
1687 * <td>A hint that the original {@code Path2D} object stored
1688 * the coordinates in a Java array of doubles.</td>
1689 * </tr>
1690 * <tr>
1691 * <td>{@code SERIAL_SEG_FLT_MOVETO}</td>
1692 * <td>0x40</td>
1693 * <td>2 floats</td>
1694 * <td>A {@link #moveTo moveTo} path segment follows.</td>
1695 * </tr>
1696 * <tr>
1697 * <td>{@code SERIAL_SEG_FLT_LINETO}</td>
1698 * <td>0x41</td>
1699 * <td>2 floats</td>
1700 * <td>A {@link #lineTo lineTo} path segment follows.</td>
1701 * </tr>
1702 * <tr>
1703 * <td>{@code SERIAL_SEG_FLT_QUADTO}</td>
1704 * <td>0x42</td>
1705 * <td>4 floats</td>
1706 * <td>A {@link #quadTo quadTo} path segment follows.</td>
1707 * </tr>
1708 * <tr>
1709 * <td>{@code SERIAL_SEG_FLT_CUBICTO}</td>
1710 * <td>0x43</td>
1711 * <td>6 floats</td>
1712 * <td>A {@link #curveTo curveTo} path segment follows.</td>
1713 * </tr>
1714 * <tr>
1715 * <td>{@code SERIAL_SEG_DBL_MOVETO}</td>
1716 * <td>0x50</td>
1717 * <td>2 doubles</td>
1718 * <td>A {@link #moveTo moveTo} path segment follows.</td>
1719 * </tr>
1720 * <tr>
1721 * <td>{@code SERIAL_SEG_DBL_LINETO}</td>
1722 * <td>0x51</td>
1723 * <td>2 doubles</td>
1724 * <td>A {@link #lineTo lineTo} path segment follows.</td>
1725 * </tr>
1726 * <tr>
1727 * <td>{@code SERIAL_SEG_DBL_QUADTO}</td>
1728 * <td>0x52</td>
1729 * <td>4 doubles</td>
1730 * <td>A {@link #curveTo curveTo} path segment follows.</td>
1731 * </tr>
1732 * <tr>
1733 * <td>{@code SERIAL_SEG_DBL_CUBICTO}</td>
1734 * <td>0x53</td>
1735 * <td>6 doubles</td>
1736 * <td>A {@link #curveTo curveTo} path segment follows.</td>
1737 * </tr>
1738 * <tr>
1739 * <td>{@code SERIAL_SEG_CLOSE}</td>
1740 * <td>0x60</td>
1741 * <td></td>
1742 * <td>A {@link #closePath closePath} path segment.</td>
1743 * </tr>
1744 * <tr>
1745 * <td>{@code SERIAL_PATH_END}</td>
1746 * <td>0x61</td>
1747 * <td></td>
1748 * <td>There are no more path segments following.</td>
1749 * </tbody>
1750 * </table>
1751 *
1752 * @since 1.6
1753 */
1754 private void writeObject(java.io.ObjectOutputStream s)
1755 throws java.io.IOException
1756 {
1757 super.writeObject(s, true);
1758 }
1759
1760 /**
1761 * Reads the default serializable fields from the
1762 * {@code ObjectInputStream} followed by an explicit
1763 * serialization of the path segments stored in this
1764 * path.
1765 * <p>
|
1 /*
2 * Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
875 * <li>followed by
876 * a byte indicating the winding rule
877 * ({@link #WIND_EVEN_ODD WIND_EVEN_ODD} or
878 * {@link #WIND_NON_ZERO WIND_NON_ZERO})
879 * <li>followed by
880 * {@code NP} (or unlimited if {@code NP < 0}) sets of values consisting of
881 * a single byte indicating a path segment type
882 * followed by one or more pairs of float or double
883 * values representing the coordinates of the path segment
884 * <li>followed by
885 * a byte indicating the end of the path (SERIAL_PATH_END).
886 * </ol>
887 * <p>
888 * The following byte value constants are used in the serialized form
889 * of {@code Path2D} objects:
890 *
891 * <table class="striped">
892 * <caption>Constants</caption>
893 * <thead>
894 * <tr>
895 * <th scope="col">Constant Name</th>
896 * <th scope="col">Byte Value</th>
897 * <th scope="col">Followed by</th>
898 * <th scope="col">Description</th>
899 * </tr>
900 * </thead>
901 * <tbody>
902 * <tr>
903 * <th scope="row">{@code SERIAL_STORAGE_FLT_ARRAY}</th>
904 * <td>0x30</td>
905 * <td></td>
906 * <td>A hint that the original {@code Path2D} object stored
907 * the coordinates in a Java array of floats.</td>
908 * </tr>
909 * <tr>
910 * <th scope="row">{@code SERIAL_STORAGE_DBL_ARRAY}</th>
911 * <td>0x31</td>
912 * <td></td>
913 * <td>A hint that the original {@code Path2D} object stored
914 * the coordinates in a Java array of doubles.</td>
915 * </tr>
916 * <tr>
917 * <th scope="row">{@code SERIAL_SEG_FLT_MOVETO}</th>
918 * <td>0x40</td>
919 * <td>2 floats</td>
920 * <td>A {@link #moveTo moveTo} path segment follows.</td>
921 * </tr>
922 * <tr>
923 * <th scope="row">{@code SERIAL_SEG_FLT_LINETO}</th>
924 * <td>0x41</td>
925 * <td>2 floats</td>
926 * <td>A {@link #lineTo lineTo} path segment follows.</td>
927 * </tr>
928 * <tr>
929 * <th scope="row">{@code SERIAL_SEG_FLT_QUADTO}</th>
930 * <td>0x42</td>
931 * <td>4 floats</td>
932 * <td>A {@link #quadTo quadTo} path segment follows.</td>
933 * </tr>
934 * <tr>
935 * <th scope="row">{@code SERIAL_SEG_FLT_CUBICTO}</th>
936 * <td>0x43</td>
937 * <td>6 floats</td>
938 * <td>A {@link #curveTo curveTo} path segment follows.</td>
939 * </tr>
940 * <tr>
941 * <th scope="row">{@code SERIAL_SEG_DBL_MOVETO}</th>
942 * <td>0x50</td>
943 * <td>2 doubles</td>
944 * <td>A {@link #moveTo moveTo} path segment follows.</td>
945 * </tr>
946 * <tr>
947 * <th scope="row">{@code SERIAL_SEG_DBL_LINETO}</th>
948 * <td>0x51</td>
949 * <td>2 doubles</td>
950 * <td>A {@link #lineTo lineTo} path segment follows.</td>
951 * </tr>
952 * <tr>
953 * <th scope="row">{@code SERIAL_SEG_DBL_QUADTO}</th>
954 * <td>0x52</td>
955 * <td>4 doubles</td>
956 * <td>A {@link #curveTo curveTo} path segment follows.</td>
957 * </tr>
958 * <tr>
959 * <th scope="row">{@code SERIAL_SEG_DBL_CUBICTO}</th>
960 * <td>0x53</td>
961 * <td>6 doubles</td>
962 * <td>A {@link #curveTo curveTo} path segment follows.</td>
963 * </tr>
964 * <tr>
965 * <th scope="row">{@code SERIAL_SEG_CLOSE}</th>
966 * <td>0x60</td>
967 * <td></td>
968 * <td>A {@link #closePath closePath} path segment.</td>
969 * </tr>
970 * <tr>
971 * <th scope="row">{@code SERIAL_PATH_END}</th>
972 * <td>0x61</td>
973 * <td></td>
974 * <td>There are no more path segments following.</td>
975 * </tbody>
976 * </table>
977 *
978 * @since 1.6
979 */
980 private void writeObject(java.io.ObjectOutputStream s)
981 throws java.io.IOException
982 {
983 super.writeObject(s, false);
984 }
985
986 /**
987 * Reads the default serializable fields from the
988 * {@code ObjectInputStream} followed by an explicit
989 * serialization of the path segments stored in this
990 * path.
991 * <p>
1649 * representing an x,y pair)
1650 * <li>followed by
1651 * a byte indicating the winding rule
1652 * ({@link #WIND_EVEN_ODD WIND_EVEN_ODD} or
1653 * {@link #WIND_NON_ZERO WIND_NON_ZERO})
1654 * <li>followed by
1655 * {@code NP} (or unlimited if {@code NP < 0}) sets of values consisting of
1656 * a single byte indicating a path segment type
1657 * followed by one or more pairs of float or double
1658 * values representing the coordinates of the path segment
1659 * <li>followed by
1660 * a byte indicating the end of the path (SERIAL_PATH_END).
1661 * </ol>
1662 * <p>
1663 * The following byte value constants are used in the serialized form
1664 * of {@code Path2D} objects:
1665 * <table class="striped">
1666 * <caption>Constants</caption>
1667 * <thead>
1668 * <tr>
1669 * <th scope="col">Constant Name</th>
1670 * <th scope="col">Byte Value</th>
1671 * <th scope="col">Followed by</th>
1672 * <th scope="col">Description</th>
1673 * </tr>
1674 * </thead>
1675 * <tbody>
1676 * <tr>
1677 * <th scope="row">{@code SERIAL_STORAGE_FLT_ARRAY}</th>
1678 * <td>0x30</td>
1679 * <td></td>
1680 * <td>A hint that the original {@code Path2D} object stored
1681 * the coordinates in a Java array of floats.</td>
1682 * </tr>
1683 * <tr>
1684 * <th scope="row">{@code SERIAL_STORAGE_DBL_ARRAY}</th>
1685 * <td>0x31</td>
1686 * <td></td>
1687 * <td>A hint that the original {@code Path2D} object stored
1688 * the coordinates in a Java array of doubles.</td>
1689 * </tr>
1690 * <tr>
1691 * <th scope="row">{@code SERIAL_SEG_FLT_MOVETO}</th>
1692 * <td>0x40</td>
1693 * <td>2 floats</td>
1694 * <td>A {@link #moveTo moveTo} path segment follows.</td>
1695 * </tr>
1696 * <tr>
1697 * <th scope="row">{@code SERIAL_SEG_FLT_LINETO}</th>
1698 * <td>0x41</td>
1699 * <td>2 floats</td>
1700 * <td>A {@link #lineTo lineTo} path segment follows.</td>
1701 * </tr>
1702 * <tr>
1703 * <th scope="row">{@code SERIAL_SEG_FLT_QUADTO}</th>
1704 * <td>0x42</td>
1705 * <td>4 floats</td>
1706 * <td>A {@link #quadTo quadTo} path segment follows.</td>
1707 * </tr>
1708 * <tr>
1709 * <th scope="row">{@code SERIAL_SEG_FLT_CUBICTO}</th>
1710 * <td>0x43</td>
1711 * <td>6 floats</td>
1712 * <td>A {@link #curveTo curveTo} path segment follows.</td>
1713 * </tr>
1714 * <tr>
1715 * <th scope="row">{@code SERIAL_SEG_DBL_MOVETO}</th>
1716 * <td>0x50</td>
1717 * <td>2 doubles</td>
1718 * <td>A {@link #moveTo moveTo} path segment follows.</td>
1719 * </tr>
1720 * <tr>
1721 * <th scope="row">{@code SERIAL_SEG_DBL_LINETO}</th>
1722 * <td>0x51</td>
1723 * <td>2 doubles</td>
1724 * <td>A {@link #lineTo lineTo} path segment follows.</td>
1725 * </tr>
1726 * <tr>
1727 * <th scope="row">{@code SERIAL_SEG_DBL_QUADTO}</th>
1728 * <td>0x52</td>
1729 * <td>4 doubles</td>
1730 * <td>A {@link #curveTo curveTo} path segment follows.</td>
1731 * </tr>
1732 * <tr>
1733 * <th scope="row">{@code SERIAL_SEG_DBL_CUBICTO}</th>
1734 * <td>0x53</td>
1735 * <td>6 doubles</td>
1736 * <td>A {@link #curveTo curveTo} path segment follows.</td>
1737 * </tr>
1738 * <tr>
1739 * <th scope="row">{@code SERIAL_SEG_CLOSE}</th>
1740 * <td>0x60</td>
1741 * <td></td>
1742 * <td>A {@link #closePath closePath} path segment.</td>
1743 * </tr>
1744 * <tr>
1745 * <th scope="row">{@code SERIAL_PATH_END}</th>
1746 * <td>0x61</td>
1747 * <td></td>
1748 * <td>There are no more path segments following.</td>
1749 * </tbody>
1750 * </table>
1751 *
1752 * @since 1.6
1753 */
1754 private void writeObject(java.io.ObjectOutputStream s)
1755 throws java.io.IOException
1756 {
1757 super.writeObject(s, true);
1758 }
1759
1760 /**
1761 * Reads the default serializable fields from the
1762 * {@code ObjectInputStream} followed by an explicit
1763 * serialization of the path segments stored in this
1764 * path.
1765 * <p>
|