Changeset 290
- Timestamp:
- 09/03/08 14:01:24 (16 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/agents/mail/MailSession.java
r286 r290 337 337 } 338 338 339 public synchronized void finalise() { 339 /** 340 * Closes the mail folders. 341 * @return true if the folders needed to be closed. 342 */ 343 public synchronized boolean finalise() { 344 boolean result = false; 340 345 try { 341 346 if (_transport != null && _transport.isConnected()) { 342 347 _transport.close(); 348 result = true; 343 349 } 344 350 345 351 if (_folder != null && _folder.isOpen()) { 346 352 _folder.close(false); 353 result = true; 347 354 } 348 355 349 356 if (_store != null && _store.isConnected()) { 350 357 _store.close(); 358 result = true; 351 359 } 352 360 } catch (Exception e) { 353 361 354 362 } 363 return result; 355 364 } 356 365 -
trunk/src/org/expeditee/gui/Browser.java
r282 r290 426 426 427 427 if (MailSession.getInstance() != null) { 428 MessageBay.displayMessage("Closing ExpMail..."); 429 MailSession.getInstance().finalise(); 428 if (MailSession.getInstance().finalise()) { 429 MessageBay.displayMessage("Closing ExpMail..."); 430 } 430 431 } 431 432 -
trunk/src/org/expeditee/gui/Frame.java
r286 r290 1646 1646 */ 1647 1647 public String getExportFileName() { 1648 Text tag = ItemUtils.FindTag(getItems(), "@file:"); 1649 if (tag != null) { 1650 String file = ItemUtils.StripTag(tag.getFirstLine(), "@file"); 1651 file = file.trim(); 1652 if (file.length() > 0) 1653 return file; 1654 } 1655 1656 return _frameName.getText(); 1648 return getAnnotationValue("file"); 1657 1649 } 1658 1650 -
trunk/src/org/expeditee/io/AbstractHTMLWriter.java
r289 r290 52 52 53 53 writer.write(styleName + " { font-size: " + Math.round(style.getSize()) 54 + "p t");54 + "px"); 55 55 56 56 Font font = style.getPaintFont(); … … 120 120 121 121 protected void indent() throws IOException { 122 for (int i = 0; i < _indent; i++)122 for (int i = 0; i < getIndent(); i++) 123 123 _writer.write(INDENT); 124 124 } 125 126 protected int getIndent() {127 return _indent;128 }129 125 } -
trunk/src/org/expeditee/io/DefaultTreeWriter.java
r289 r290 14 14 TreeWriter { 15 15 16 pr otectedint _indent = 0;16 private int _indent = 0; 17 17 18 18 // the list of frames currently being processed … … 177 177 } 178 178 } 179 180 protected int getIndent() { 181 return _indent; 182 } 179 183 } -
trunk/src/org/expeditee/io/HTMLBWriter.java
r226 r290 19 19 protected void writeTitle(Text toWrite, List<Item> items) 20 20 throws IOException { 21 int indent = getIndent(); 22 if(indent == 0) 23 return; 24 21 25 String heading = toWrite.getText(); 22 String tag = "h" + (getIndent() + 1);26 String tag = "h" + indent; 23 27 // indenting for tag 24 28 indent(); -
trunk/src/org/expeditee/io/PDFWriter.java
r282 r290 14 14 import com.lowagie.text.Document; 15 15 import com.lowagie.text.DocumentException; 16 import com.lowagie.text.Font; 16 17 import com.lowagie.text.FontFactory; 17 18 import com.lowagie.text.Paragraph; … … 20 21 /** 21 22 * Writes out a tree in a linear format. 23 * 22 24 * @author root 23 * 25 * 24 26 */ 25 27 public class PDFWriter extends DefaultTreeWriter { … … 27 29 private Document _pdfDocument; 28 30 31 private Font _bodyFont; 32 29 33 public PDFWriter() { 34 if (UserSettings.Style.size() > 0) { 35 Text text = UserSettings.Style.get(0); 36 _bodyFont = FontFactory.getFont(Conversion.getPdfFont(text 37 .getFamily()), text.getSize(), text.getPaintFont() 38 .getStyle(), text.getColor()); 39 } 30 40 _pdfDocument = new Document(); 31 41 } … … 42 52 _pdfDocument.addAuthor(UserSettings.Username); 43 53 _pdfDocument.addCreator("Expeditee"); 54 _pdfDocument.addTitle(start.getTitle()); 44 55 } catch (DocumentException e) { 45 56 e.printStackTrace(); … … 51 62 protected void writeTitle(Text toWrite, List<Item> items) 52 63 throws IOException { 53 _pdfDocument.addTitle(toWrite.getText()); 54 writeText(toWrite); 64 int indent = getIndent(); 65 if (indent == 0) 66 return; 67 68 if (indent < UserSettings.Style.size()) { 69 String text = toWrite.getText(); 70 toWrite = UserSettings.Style.get(indent).getTemplateForm(); 71 toWrite.setText(text); 72 } 73 74 writeText(toWrite, false); 55 75 } 56 76 … … 62 82 63 83 @Override 64 protected void writeStartLink(Item linker) throws IOException { 84 protected void writeText(Text text) throws IOException { 85 writeText(text, true); 65 86 } 66 87 67 @Override 68 protected void writeEndLink(Item linker) throws IOException { 69 } 88 protected void writeText(Text text, boolean bodyText) throws IOException { 89 try { 90 Font font = null; 91 if (bodyText) { 92 font = _bodyFont; 93 } 70 94 71 @Override72 protected void writeText(Text text) throws IOException {73 try {74 75 _pdfDocument.add(new Paragraph(text.getText(), FontFactory.getFont(76 Conversion.getPdfFont(text.getFamily()), text.getSize(),77 text.getPaintFont().getStyle(), text.getColor())));95 if (font == null) { 96 font = FontFactory.getFont(Conversion.getPdfFont(text 97 .getFamily()), text.getSize(), text.getPaintFont() 98 .getStyle(), text.getColor()); 99 } 100 101 _pdfDocument.add(new Paragraph(text.getText(), font)); 78 102 } catch (DocumentException e) { 79 103 // TODO Auto-generated catch block -
trunk/src/org/expeditee/items/Text.java
r289 r290 1255 1255 // --- Get the output of the LineBreakMeasurer and store it in a 1256 1256 while ((layout = _lineBreaker.nextLayout(width)) != null) { 1257 // for some reason lineBreaker willnot break on newline1257 // lineBreaker does not break on newline 1258 1258 // characters so they have to be check manually 1259 1259 int start = _lineOffsets.get(_lineOffsets.size() - 1);
Note:
See TracChangeset
for help on using the changeset viewer.