~ubuntu-branches/ubuntu/natty/electric/natty

« back to all changes in this revision

Viewing changes to com/sun/electric/database/change/DatabaseChangeEvent.java

  • Committer: Bazaar Package Importer
  • Author(s): Onkar Shinde
  • Date: 2010-01-09 16:26:04 UTC
  • mfrom: (1.1.4 upstream) (3.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100109162604-1ypvmy8ijmlc6oq7
Tags: 8.10-1
* New upstream version.
* debian/control
  - Add libjava3d-java and quilt build dependencies.
  - Update standards version to 3.8.3.
  - Add libjava3d-java as recommends to binary package.
* debian/rules
  - Use quilt patch system instead of simple patchsys.
  - Add java3d related jar files to DEB_JARS.
* debian/patches/*
  - Update as per current upstream source. Convert to quilt.
* debian/ant.properties
  - Do not disable 3D plugin anymore.
  - Use new property to disable compilation of OS X related classes.
* debian/wrappers/electric
  - Add java3d related jar files to runtime classpath.
* debian/README.source
  - Change text to the appropriate one for quilt.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
 * A semantic event which indicates that Electric database changed its state.
35
35
 */
36
36
public class DatabaseChangeEvent {
 
37
 
37
38
    public final Snapshot oldSnapshot;
38
39
    public final Snapshot newSnapshot;
39
40
 
41
42
        this.oldSnapshot = oldSnapshot;
42
43
        this.newSnapshot = newSnapshot;
43
44
    }
44
 
        
 
45
 
45
46
    /**
46
47
     * Returns true if ElectricObject eObj was created, killed or modified
47
48
     * in the new database state.
48
49
     * @param eObj ElectricObject to test.
49
50
     * @return true if the ElectricObject was changed.
50
51
     */
51
 
    public boolean objectChanged(ElectricObject eObj)
52
 
    {
 
52
    public boolean objectChanged(ElectricObject eObj) {
53
53
        return true;
54
54
//        for (Iterator<Undo.Change> it = batch.getChanges(); it.hasNext(); ) {
55
55
//            Undo.Change change = (Undo.Change)it.next();
66
66
     * @return true if cell explorer tree was changed.
67
67
     */
68
68
    public boolean cellTreeChanged() {
69
 
        if (!newSnapshot.getChangedLibraries(oldSnapshot).isEmpty()) return true;
70
 
        for (CellId cellId: newSnapshot.getChangedCells(oldSnapshot)) {
 
69
        if (!newSnapshot.getChangedLibraries(oldSnapshot).isEmpty()) {
 
70
            return true;
 
71
        }
 
72
        for (CellId cellId : newSnapshot.getChangedCells(oldSnapshot)) {
71
73
            CellBackup oldBackup = oldSnapshot.getCell(cellId);
72
74
            CellBackup newBackup = newSnapshot.getCell(cellId);
73
 
            if (oldBackup == null || newBackup == null) return true;
74
 
            if (oldBackup.modified != newBackup.modified) return true;
 
75
            if (oldBackup == null || newBackup == null) {
 
76
                return true;
 
77
            }
 
78
            if (oldBackup.modified != newBackup.modified) {
 
79
                return true;
 
80
            }
75
81
            ImmutableCell oldD = oldBackup.cellRevision.d;
76
82
            ImmutableCell newD = newBackup.cellRevision.d;
77
 
            if (oldD.groupName != newD.groupName) return true;
78
 
            if (oldD.getVar(Cell.MULTIPAGE_COUNT_KEY) != newD.getVar(Cell.MULTIPAGE_COUNT_KEY)) return true;
 
83
            if (oldD.groupName != newD.groupName) {
 
84
                return true;
 
85
            }
 
86
            if (oldD.getVar(Cell.MULTIPAGE_COUNT_KEY) != newD.getVar(Cell.MULTIPAGE_COUNT_KEY)) {
 
87
                return true;
 
88
            }
79
89
        }
80
90
        return false;
81
91
//        for (Iterator<Undo.Change> it = batch.getChanges(); it.hasNext(); ) {