1 51 52 package com.lowagie.text.rtf; 53 54 import com.lowagie.text.HeaderFooter; 55 import com.lowagie.text.Phrase; 56 57 58 71 public class RtfHeaderFooters extends HeaderFooter { 72 73 public final static int ALL_PAGES = 0; 74 75 public final static int LEFT_PAGES = 1; 76 77 public final static int RIGHT_PAGES = 2; 78 79 public final static int FIRST_PAGE = 3; 80 81 83 84 private HeaderFooter allPages = null; 85 86 private HeaderFooter leftPages = null; 87 88 private HeaderFooter rightPages = null; 89 90 private HeaderFooter firstPage = null; 91 92 95 public RtfHeaderFooters() { 96 super( new Phrase(""), false ); 97 } 98 99 104 public RtfHeaderFooters( Phrase before, Phrase after ) { 105 super( before, after ); 106 } 107 108 113 public RtfHeaderFooters( Phrase before, boolean numbered ) { 114 super( before, numbered ); 115 } 116 117 122 public void set( int type, HeaderFooter hf ) { 123 switch (type) { 124 case ALL_PAGES: 125 allPages = hf; 126 break; 127 case LEFT_PAGES: 128 leftPages = hf; 129 break; 130 case RIGHT_PAGES: 131 rightPages = hf; 132 break; 133 case FIRST_PAGE: 134 firstPage = hf; 135 break; 136 default: 137 throw new IllegalStateException ( "unknown type " + type ); 138 } 139 } 140 141 146 public HeaderFooter get( int type ) { 147 switch (type) { 148 case ALL_PAGES: 149 return allPages; 150 case LEFT_PAGES: 151 return leftPages; 152 case RIGHT_PAGES: 153 return rightPages; 154 case FIRST_PAGE: 155 return firstPage; 156 default: 157 throw new IllegalStateException ( "unknown type " + type ); 158 } 159 } 160 } 161 | Popular Tags |