D:\NewZebra\JavaApplications\DesignPatternsProject\src\structural_patterns\pdf_facade_pattern\TextBaseProduct.java
 1 /* 
 2  * TextBaseProduct.java
 3  *
 4  * Disclaimer:
 5  * ZebraSoft.com disclaims all warrantees with regard to documents/programs, including 
 6  * all implied warranties. In no event shall ZebraSoft.com be liable for indirect or 
 7  * consequential damages or any damages whatsoever resulting from loss of use, data or 
 8  * profits arising out of the use of documents/programs.
 9  * 
10  * All content included on this site, such as text, graphics, logos, button icons, 
11  * images, audio clips, video clips, digital downloads, programs, data compilations, 
12  * and software, is the property of ZebraSoft.com or its content suppliers and 
13  * protected by United States and international copyright laws. 
14  *
15  * This site or any portion of this site may not be reproduced, duplicated, 
16  * copied, sold, resold, visited, or otherwise exploited for any commercial 
17  * purpose without express written consent of ZebraSoft.com.
18  */
19 
20 package structural_patterns.pdf_facade_pattern;
21 
22 /** 
23  *
24  * @author Sam Eldin
25  */
26 
27 
28 import java.io.*;
29 import java.text.*;
30 import java.util.*;
31 import java.lang.*;
32 import java.awt.event.*;
33 import java.awt.*;
34 import javax.swing.*;
35 
36 
37 public class TextBaseProduct implements  java.io.Serializable, Product {
38     
39     Vector      linesOfTextVecxtor  = null;
40     
41     
42     /** Creates a new instance of TextBaseProduct */
43     public TextBaseProduct() {
44     }
45     /* 
46      *
47      */
48     public int getProductType(){
49         return(PDF_Base.TEXT_OBJECT_TYPE); 
50     }
51     /*
52      *
53      */
54     public int populateTextArea(JTextArea passedJTextArea, Font passedFont){
55         
56         if(null == linesOfTextVecxtor)
57             return(-1);
58         
59         int     count;
60         int     vectorSize = linesOfTextVecxtor.size();
61         String  line = "";
62         String  newLine = "\n";
63 
64         passedJTextArea.setFont(passedFont);
65         
66         for(count =0; count < vectorSize; count++)
67         {
68               line = (String)linesOfTextVecxtor.elementAt(count);
69               passedJTextArea.append(line + newLine);
70         }        
71         passedJTextArea.append(newLine + newLine + newLine); 
72         passedJTextArea.moveCaretPosition(0);
73         return(0);
74     }
75     
76 }
77 
78