1 3 package org.faceless.pdf; 4 5 import java.util.*; 6 import java.awt.Color ; 7 8 54 public class PDFBookmark extends PeeredObject 55 { 56 private final org.faceless.pdf2.PDFBookmark bookmark; 57 58 Object getPeer() 59 { 60 return bookmark; 61 } 62 63 PDFBookmark(org.faceless.pdf2.PDFBookmark bookmark) 64 { 65 this.bookmark=bookmark; 66 } 67 68 74 public PDFBookmark(String name, PDFAction action) 75 { 76 this(name,action,false); 77 } 78 79 87 public PDFBookmark(String name, PDFAction action, boolean open) 88 { 89 bookmark = new org.faceless.pdf2.PDFBookmark(name, action==null ? null : action.action, open); 90 } 91 92 98 public List getBookmarks() 99 { 100 return new ListPeer(bookmark.getBookmarks()); 101 } 102 103 109 public void setColor(Color c) 110 { 111 bookmark.setColor(c); 112 } 113 114 121 public void setStyle(boolean italic, boolean bold) 122 { 123 bookmark.setStyle(italic, bold); 124 } 125 126 131 public void setAction(PDFAction action) 132 { 133 bookmark.setAction(action==null ? null : action.action); 134 } 135 136 141 public PDFAction getAction() 142 { 143 return (PDFAction)PeeredObject.getPeer(bookmark.getAction()); 144 } 145 146 152 public void setName(String name) 153 { 154 bookmark.setName(name); 155 } 156 157 162 public String getName() 163 { 164 return bookmark.getName(); 165 } 166 167 public String toString() 168 { 169 String s = "<bookmark name=\""+getName()+"\""; 170 if (getAction()!=null) { 171 s+=" action=\""+getAction()+"\""; 172 } 173 return s+"/>"; 174 } 175 } 176 | Popular Tags |