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.

HSLFMasterSheet.java 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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.hslf.usermodel;
  16. import org.apache.poi.hslf.model.textproperties.TextPropCollection;
  17. import org.apache.poi.hslf.record.SheetContainer;
  18. import org.apache.poi.hslf.record.TextHeaderAtom;
  19. import org.apache.poi.sl.usermodel.MasterSheet;
  20. import org.apache.poi.sl.usermodel.SimpleShape;
  21. import org.apache.poi.util.Removal;
  22. /**
  23. * The superclass of all master sheets - Slide masters, Notes masters, etc.
  24. */
  25. public abstract class HSLFMasterSheet extends HSLFSheet implements MasterSheet<HSLFShape,HSLFTextParagraph> {
  26. public HSLFMasterSheet(SheetContainer container, int sheetNo){
  27. super(container, sheetNo);
  28. }
  29. /**
  30. * Find the master collection for the given txtype/level/name.
  31. * This is the "workhorse" which returns the default style attributes.
  32. * If {@code name = "*"} return the current collection, otherwise if the name is not found
  33. * in the current selection of txtype/level/name, first try lower levels then try parent types,
  34. * if it wasn't found there return {@code null}.
  35. *
  36. * @param txtype the {@link TextHeaderAtom} type
  37. * @param level the indent level of the paragraph, if the level is not defined for the found
  38. * collection, the highest existing level will be used
  39. * @param name the property name,
  40. * @param isCharacter if {@code true} use character styles, otherwise use paragraph styles
  41. */
  42. public abstract TextPropCollection getPropCollection(int txtype, int level, String name, boolean isCharacter);
  43. /**
  44. * Checks if the shape is a placeholder.
  45. * (placeholders aren't normal shapes, they are visible only in the Edit Master mode)
  46. *
  47. *
  48. * @return true if the shape is a placeholder
  49. *
  50. * @deprecated use {@link SimpleShape#isPlaceholder()}
  51. */
  52. @Deprecated
  53. @Removal(version="4.1.0")
  54. public static boolean isPlaceholder(HSLFShape shape){
  55. return shape instanceof SimpleShape
  56. && ((SimpleShape<?,?>)shape).isPlaceholder();
  57. }
  58. }