You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

XDDFLayout.java 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. ==================================================================== */
  15. package org.apache.poi.xddf.usermodel.chart;
  16. import org.apache.poi.util.Beta;
  17. import org.apache.poi.util.Internal;
  18. import org.openxmlformats.schemas.drawingml.x2006.chart.CTLayout;
  19. @Beta
  20. public class XDDFLayout {
  21. private CTLayout layout;
  22. public XDDFLayout() {
  23. this(CTLayout.Factory.newInstance());
  24. }
  25. @Internal
  26. protected XDDFLayout(CTLayout layout) {
  27. this.layout = layout;
  28. }
  29. @Internal
  30. protected CTLayout getXmlObject() {
  31. return layout;
  32. }
  33. public void setExtensionList(XDDFChartExtensionList list) {
  34. if (list == null) {
  35. layout.unsetExtLst();
  36. } else {
  37. layout.setExtLst(list.getXmlObject());
  38. }
  39. }
  40. public XDDFChartExtensionList getExtensionList() {
  41. if (layout.isSetExtLst()) {
  42. return new XDDFChartExtensionList(layout.getExtLst());
  43. } else {
  44. return null;
  45. }
  46. }
  47. public void setManualLayout(XDDFManualLayout manual) {
  48. if (manual == null) {
  49. layout.unsetManualLayout();
  50. } else {
  51. layout.setManualLayout(manual.getXmlObject());
  52. }
  53. }
  54. public XDDFManualLayout getManualLayout() {
  55. if (layout.isSetManualLayout()) {
  56. return new XDDFManualLayout(layout);
  57. } else {
  58. return null;
  59. }
  60. }
  61. }