Révision 1136

tmp/org.txm.partition.core/src/org/txm/partition/core/functions/PartitionDimensions.java (revision 1136)
90 90
	protected boolean _compute() throws Exception {
91 91
		// parts
92 92
		this.parts = this.getPartition().getParts();
93
		for (Part part : parts) {
94
			part.compute();
95
		}
93
//		for (Part part : parts) { // no more needed since TXMResult.compute is deep computing
94
//			part.compute();
95
//		}
96 96
		
97 97
		// parts sorted by size 
98 98
		List<Part> sortedParts = new ArrayList<Part>(this.parts);
tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java (revision 1136)
682 682
	 */
683 683
	public void setDirty() {
684 684
		this.dirty = true;
685
		for (TXMResult c : getChildren()) {
686
			c.setDirty();
687
		}
685 688
	}
686 689

  
687 690

  
......
1676 1679
	 * @throws Exception
1677 1680
	 */
1678 1681
	public boolean compute(IProgressMonitor monitor) throws Exception {
1679
		return this.compute(monitor, false);
1682
		return this.compute(monitor, true);
1680 1683
	}
1681 1684

  
1682 1685

  
......
1774 1777
			this.dirty = false; // the computing was successful, the result is no more dirty
1775 1778
			this.hasBeenComputedOnce = true; 
1776 1779
			Log.finest("TXMResult.compute(): " + this.getClass().getSimpleName() + ": computing of result type " + this.getClass() + " done.");
1777
		}
1778
		
1779
		// Children cascade computing
1780
		if (deepComputing && !skipComputing) {
1781

  
1782
			Log.finest("TXMResult.compute(): " + this.getClass().getSimpleName() + ": cascade computing of " + this.children.size() + " children.");
1783

  
1780
			
1784 1781
			for (int i = 0; i < this.children.size(); i++) {
1785
				// FIXME: may be better to add a member needFullRecomputing in TXMResult?
1786 1782
				this.getChild(i).setDirty(); // force recomputing even if some parameters of the result itself have not changed
1787
				//this.getChild(i).setHasBeenComputedOnce(false); // force recomputing even if some parameters of the result itself have not changed
1788
				this.getChild(i).compute(monitor, deepComputing, updateLastParameters);
1789 1783
			}
1784
			
1785
			// Children cascade computing
1786
			if (deepComputing) {
1787

  
1788
				Log.finest("TXMResult.compute(): " + this.getClass().getSimpleName() + ": cascade computing of " + this.children.size() + " children.");
1789

  
1790
				for (TXMResult child : getChildren()) {
1791
					// FIXME: may be better to add a member needFullRecomputing in TXMResult?
1792
//					this.getChild(i).setDirty(); // force recomputing even if some parameters of the result itself have not changed
1793
					//this.getChild(i).setHasBeenComputedOnce(false); // force recomputing even if some parameters of the result itself have not changed
1794
					if (child.hasBeenComputedOnce()) {
1795
						child.compute(monitor, deepComputing, updateLastParameters);
1796
					}
1797
				}
1798
			}
1790 1799
		}
1800
			
1791 1801

  
1792 1802
		return true;
1793 1803
	}
......
1995 2005

  
1996 2006
	/**
1997 2007
	 * Gets a boolean state defining if the result has already been computed at least once or not.
2008
	 * 
2009
	 * true if the result has already been lazy LOADED...........
1998 2010
	 * @return
1999 2011
	 */
2000 2012
	public boolean hasBeenComputedOnce() {
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java (revision 1136)
498 498
		
499 499
		boolean dirty = false;
500 500
		
501
		if (this.getResult() != null) {
502
			// if the result has never been computed, the editor is not dirty ->  no * shown
503
			dirty = this.getResult().isDirty() && this.getResult().hasBeenComputedOnce();
504
		}
501
//		if (this.getResult() != null) { //TODO see what to do with dirty results in TXMEditor
502
//			// if the result has never been computed, the editor is not dirty ->  no * shown
503
//			//dirty = this.getResult().isDirty() && this.getResult().hasBeenComputedOnce();
504
//		}
505 505
		
506 506
		
507 507
		for (TXMEditorExtension<T> b : extensions) {

Formats disponibles : Unified diff