Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

GraphicsFullArc.java 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. /* $Id$ */
  18. package org.apache.fop.render.afp.modca.goca;
  19. import org.apache.fop.render.afp.tools.BinaryUtils;
  20. /**
  21. * A GOCA graphics arc (circle/ellipse)
  22. */
  23. public class GraphicsFullArc extends AbstractGraphicsCoord {
  24. /** the integer portion of the multiplier */
  25. private int mh;
  26. /** the fractional portion of the multiplier */
  27. private int mhr;
  28. /**
  29. * @param x the x coordinate of the center of the circle/ellipse
  30. * @param y the y coordinate of the center of the circle/ellipse
  31. * @param mh the integer portion of the multiplier
  32. * @param mhr the fractional portion of the multiplier
  33. */
  34. public GraphicsFullArc(int x, int y, int mh, int mhr) {
  35. super(x, y);
  36. this.mh = mh;
  37. this.mhr = mhr;
  38. // integer portion of multiplier
  39. data[data.length - 2] = BinaryUtils.convert(mh, 1)[0];
  40. // fractional portion of multiplier
  41. data[data.length - 1] = BinaryUtils.convert(mhr, 1)[0];
  42. }
  43. /**
  44. * {@inheritDoc}
  45. */
  46. protected byte getOrderCode() {
  47. return (byte)0xC7;
  48. }
  49. /**
  50. * {@inheritDoc}
  51. */
  52. protected int getLength() {
  53. return super.getLength() + 2;
  54. }
  55. /**
  56. * {@inheritDoc}
  57. */
  58. protected void prepareData() {
  59. super.data = super.createData();
  60. final int fromIndex = 2;
  61. super.addCoords(data, fromIndex);
  62. }
  63. /**
  64. * {@inheritDoc}
  65. */
  66. public String toString() {
  67. return super.getName()
  68. + "(centerx=" + coords[0] + ",centery=" + coords[1]
  69. + ",mh=" + mh + ",mhr=" + mhr + ")";
  70. }
  71. }