Revision 19196 trunk/prototypes/mobile/desktop/extensions/extExportMobile/src/es/prodevelop/gvsig/exportMobile/layerexporters/ExporterSubTask.java

View differences:

ExporterSubTask.java
13 13
import es.prodevelop.gvsig.exportMobile.xml.XmlProjectTags;
14 14

  
15 15
/**
16
 * 
17
 * This class mother has to be the ancestor of every class
18
 * executable in an ExportProcess 
19
 * 
16 20
 * @author jcarras
17 21
 *
18 22
 */
......
27 31
	private int currentStep = 0;
28 32
	private boolean isCancelled = false;
29 33
	
30
	private ExporterSubTask(){
31
		
32
	}
33
	
34 34
	public abstract void run();
35 35
	
36
	/**
37
	 * Constructor
38
	 * 
39
	 * @param parentProcess
40
	 * @param layer
41
	 * @param rect
42
	 * @param xml
43
	 */
36 44
	public ExporterSubTask(AbstractMonitorableTask parentProcess, FLayer layer, Rectangle2D rect, XmlBuilder xml){
37 45
		this.inLayer=layer;
38 46
		this.rect=rect;
......
40 48
		this.xml=xml;
41 49
	}
42 50

  
51
	/**
52
	 * Indicates to the ExportProcess that the task is going on
53
	 * reportStep has to be called exactly getFinalStep() times
54
	 */
43 55
	public void reportStep(){
44 56
		currentStep++;
45 57
		parent.reportStep();
46 58
	}
47 59

  
60
	/**
61
	 * It reports numSteps Steps
62
	 * @param numSteps
63
	 */
48 64
	public void reportSteps(int numSteps){
49 65
		for (int i=0; i<numSteps; i++)
50 66
			reportStep();
51 67
	}
52 68
	
69
	/**
70
	 * Changes the status text of the task 
71
	 * @param statusMessage
72
	 */
53 73
	public void setStatusMessage(String statusMessage){
54 74
		parent.setStatusMessage(statusMessage);
55 75
	}
56 76
	
77
	/**
78
	 * Changes the note of the task
79
	 * (It is showed on progress dialog)
80
	 * 
81
	 * @param note
82
	 */
57 83
	public void setNote(String note){
58 84
		parent.setNote(note);
59 85
	}
60 86

  
87
	/**
88
	 * Any class extending ExporterSubClass has to implement this method
89
	 * to comunicate the number of steps it will report
90
	 * @return
91
	 */
61 92
	public abstract int getFinalStep();
62 93

  
63
	
94
	/**
95
	 * If the proposed file exists, this method returns one not existing
96
	 * file similar to the proposed one
97
	 * 
98
	 * @param proposedFile
99
	 * @return
100
	 */
64 101
	public File getFreeFile(File proposedFile){
65 102
		if (!proposedFile.exists())
66 103
			return proposedFile;
......
79 116
		return null;
80 117
	}
81 118
	
119
	/**
120
	 * Starts the XML with the layer heading
121
	 */
82 122
	protected void initXML(){
83 123
		//<Layer>		
84 124
		xml.openTag(XmlProjectTags.LAYER);
85 125
		xmlInited=true;
86 126
	}
127
	
128
	/**
129
	 * Add the layer footer to the XML
130
	 */
87 131
	protected void closeXML(){
88 132
		if (isXmlInited())
89 133
			xml.closeTag();

Also available in: Unified diff