42
42
* The methods here are overridden by the actual constraint solver.
43
43
* At this time, there is only one solver: Layout.
45
public abstract class Constraints
47
private static Constraints curConstraint = new Layout();
45
public abstract class Constraints {
47
private static Constraints curConstraint = new Layout();
50
50
// * Method to set a new current constraint system.
51
51
// * @param con the constraint system to become the current one.
53
53
// public static void setCurrent(Constraints con) { curConstraint = con; }
56
* Method to return the current constraint system.
57
* return the current constraint system.
59
public static Constraints getCurrent() { return curConstraint; }
62
* Method to initialize a constraint system.
66
* Method to make a request of a constraint system (not used).
67
* @param cmd the command request.
69
public void request(String cmd) {}
71
* Method to examine a cell because it has changed.
72
* @param cell the Cell to examine.
74
public void examineCell(Cell cell) {}
76
* Method to give a constraint system a chance to run.
78
public void slice() {}
81
* Method to handle the start of a batch of changes.
55
* Method to return the current constraint system.
56
* return the current constraint system.
58
public static Constraints getCurrent() {
63
* Method to initialize a constraint system.
69
* Method to make a request of a constraint system (not used).
70
* @param cmd the command request.
72
public void request(String cmd) {
76
* Method to examine a cell because it has changed.
77
* @param cell the Cell to examine.
79
public void examineCell(Cell cell) {
83
* Method to give a constraint system a chance to run.
89
* Method to handle the start of a batch of changes.
82
90
* @param initialSnapshot snapshot before job changes.
84
public void startBatch(Snapshot initialSnapshot) {}
86
* Method to handle the end of a batch of changes.
88
public abstract void endBatch(String userName);
91
* Method to announce a change to a NodeInst.
92
* @param ni the NodeInst that was changed.
93
* @param oD the old contents of the NodeInst.
95
public void modifyNodeInst(NodeInst ni, ImmutableNodeInst oD) {}
97
* Method to handle a change to an ArcInst.
98
* @param ai the ArcInst that changed.
92
public void startBatch(Snapshot initialSnapshot) {
96
* Method to handle the end of a batch of changes.
98
public abstract void endBatch(String userName);
101
* Method to announce a change to a NodeInst.
102
* @param ni the NodeInst that was changed.
103
* @param oD the old contents of the NodeInst.
105
public void modifyNodeInst(NodeInst ni, ImmutableNodeInst oD) {
109
* Method to handle a change to an ArcInst.
110
* @param ai the ArcInst that changed.
99
111
* @param oD the old contents of the ArcInst.
101
public void modifyArcInst(ArcInst ai, ImmutableArcInst oD) {}
103
* Method to handle a change to an Export.
104
* @param pp the Export that moved.
105
* @param oD the old contents of the Export.
107
public void modifyExport(Export pp, ImmutableExport oD) {}
109
* Method to announce a change to a Cell.
110
* @param cell the Cell that was changed.
111
* @param oD the old contents of the Cell.
113
public void modifyCell(Cell cell, ImmutableCell oD) {}
115
* Method to announce a move of a Cell int CellGroup.
116
* @param cell the cell that was moved.
117
* @param oCellGroup the old CellGroup of the Cell.
119
public void modifyCellGroup(Cell cell, Cell.CellGroup oCellGroup) {}
121
* Method to announce a change to a Library.
122
* @param lib the Library that was changed.
123
* @param oldD the old contents of the Library.
125
public void modifyLibrary(Library lib, ImmutableLibrary oldD) {}
128
* Method to handle the creation of a new ElectricObject.
129
* @param obj the ElectricObject that was just created.
131
public void newObject(ElectricObject obj) {}
133
* Method to handle the deletion of an ElectricObject.
134
* @param obj the ElectricObject that was just deleted.
136
public void killObject(ElectricObject obj) {}
138
* Method to handle the renaming of an ElectricObject.
139
* @param obj the ElectricObject that was renamed.
140
* @param oldName the former name of that ElectricObject.
142
public void renameObject(ElectricObject obj, Object oldName) {}
144
* Method to request that an object be redrawn.
145
* @param obj the ElectricObject to be redrawn.
147
public void redrawObject(ElectricObject obj) {}
150
* Method to announce that a Library has been read.
151
* @param lib the Library that was read.
153
public void readLibrary(Library lib) {}
155
* Method to announce that a Library is about to be erased.
156
* @param lib the Library that will be erased.
158
public void eraseLibrary(Library lib) {}
160
* Method to announce that a Library is about to be written to disk.
161
* @param lib the Library that will be saved.
163
public void writeLibrary(Library lib) {}
113
public void modifyArcInst(ArcInst ai, ImmutableArcInst oD) {
117
* Method to handle a change to an Export.
118
* @param pp the Export that moved.
119
* @param oD the old contents of the Export.
121
public void modifyExport(Export pp, ImmutableExport oD) {
125
* Method to announce a change to a Cell.
126
* @param cell the Cell that was changed.
127
* @param oD the old contents of the Cell.
129
public void modifyCell(Cell cell, ImmutableCell oD) {
133
* Method to announce a move of a Cell int CellGroup.
134
* @param cell the cell that was moved.
135
* @param oCellGroup the old CellGroup of the Cell.
137
public void modifyCellGroup(Cell cell, Cell.CellGroup oCellGroup) {
141
* Method to announce a change to a Library.
142
* @param lib the Library that was changed.
143
* @param oldD the old contents of the Library.
145
public void modifyLibrary(Library lib, ImmutableLibrary oldD) {
149
* Method to handle the creation of a new ElectricObject.
150
* @param obj the ElectricObject that was just created.
152
public void newObject(ElectricObject obj) {
156
* Method to handle the deletion of an ElectricObject.
157
* @param obj the ElectricObject that was just deleted.
159
public void killObject(ElectricObject obj) {
163
* Method to handle the renaming of an ElectricObject.
164
* @param obj the ElectricObject that was renamed.
165
* @param oldName the former name of that ElectricObject.
167
public void renameObject(ElectricObject obj, Object oldName) {
171
* Method to request that an object be redrawn.
172
* @param obj the ElectricObject to be redrawn.
174
public void redrawObject(ElectricObject obj) {
178
* Method to announce that a Library has been read.
179
* @param lib the Library that was read.
181
public void readLibrary(Library lib) {
185
* Method to announce that a Library is about to be erased.
186
* @param lib the Library that will be erased.
188
public void eraseLibrary(Library lib) {
192
* Method to announce that a Library is about to be written to disk.
193
* @param lib the Library that will be saved.
195
public void writeLibrary(Library lib) {
165
199
* Method to announce than Ids were renamed.
166
200
* @param idMapper mapper from old Ids to new Ids.
168
public void renameIds(IdMapper idMapper) {}
202
public void renameIds(IdMapper idMapper) {