~ubuntu-branches/ubuntu/jaunty/electric/jaunty

« back to all changes in this revision

Viewing changes to com/sun/electric/tool/user/UserInterfaceMain.java

  • Committer: Bazaar Package Importer
  • Author(s): Onkar Shinde
  • Date: 2009-01-08 02:05:08 UTC
  • mfrom: (1.1.2 upstream) (3.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20090108020508-0h3li7zt9mu5gf0i
Tags: 8.08-1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
import com.sun.electric.database.Snapshot;
27
27
import com.sun.electric.database.change.DatabaseChangeEvent;
28
28
import com.sun.electric.database.change.DatabaseChangeListener;
 
29
import com.sun.electric.database.geometry.Dimension2D;
29
30
import com.sun.electric.database.hierarchy.Cell;
30
31
import com.sun.electric.database.hierarchy.EDatabase;
31
32
import com.sun.electric.database.hierarchy.Library;
260
261
                }
261
262
    }
262
263
 
263
 
        public void repaintAllEditWindows() { EditWindow.repaintAllContents(); }
 
264
        public void repaintAllWindows() { WindowFrame.repaintAllWindows(); }
264
265
 
265
 
    public void loadComponentMenuForTechnology()
266
 
    {
267
 
        WindowFrame wf = WindowFrame.getCurrentWindowFrame(false);
268
 
        if (wf != null) wf.loadComponentMenuForTechnology();
269
 
    }
 
266
//    public void loadComponentMenuForTechnology()
 
267
//    {
 
268
//        WindowFrame wf = WindowFrame.getCurrentWindowFrame(false);
 
269
//        if (wf != null) wf.loadComponentMenuForTechnology();
 
270
//    }
270
271
 
271
272
        public void alignToGrid(Point2D pt) { EditWindow.gridAlign(pt); }
272
273
 
273
 
        public double getGridAlignment() { return User.getAlignmentToGrid(); }
 
274
        public Dimension2D getGridAlignment() { return User.getAlignmentToGrid(); }
274
275
 
275
276
        public int getDefaultTextSize() { return EditWindow.getDefaultFontSize(); }
276
277
 
344
345
                    }
345
346
 
346
347
                    // make sure it is shown
347
 
                    boolean found = false;
348
 
                    for(Iterator<WindowFrame> it2 = WindowFrame.getWindows(); it2.hasNext(); )
349
 
                    {
350
 
                        WindowFrame wf = it2.next();
351
 
                        WindowContent content = wf.getContent();
352
 
                        if (!(content instanceof EditWindow)) continue;
353
 
                        wnd = (EditWindow)content;
354
 
                        if (wnd.getCell() == cell)
355
 
                        {
356
 
                            if (((eh.getVarContext() != null) && eh.getVarContext().equals(wnd.getVarContext())) ||
357
 
                                    (eh.getVarContext() == null)) {
358
 
                                // already displayed.  should force window "wf" to front? yes
359
 
                                wf.getFrame().toFront();
360
 
                                found = true;
361
 
                                break;
362
 
                            }
363
 
                        }
364
 
                    }
365
 
                    if (!found)
366
 
                    {
367
 
                        // make a new window for the cell
368
 
                        WindowFrame wf = WindowFrame.createEditWindow(cell);
369
 
                        wnd = (EditWindow)wf.getContent();
370
 
                        wnd.setCell(eh.getCell(database), eh.getVarContext(), null);
371
 
                    }
 
348
                    wnd = EditWindow.showEditWindowForCell(cell, eh.getVarContext());
372
349
                    if (highlighter == null) {
373
350
                        highlighter = wnd.getHighlighter();
374
351
                        highlighter.clear();
380
357
                eh.addToHighlighter(highlighter, database);
381
358
            }
382
359
 
 
360
            // Something found to highlight
383
361
            if (highlighter != null)
384
362
            {
385
363
                highlighter.ensureHighlightingSeen();
393
371
                    wnd.focusOnHighlighted();
394
372
                }
395
373
            }
 
374
            else
 
375
            {
 
376
                Cell logCell = log.getCell();
 
377
                // Checking also that the cell hasn't been removed yet
 
378
                if (logCell != null && logCell.isLinked())
 
379
                {
 
380
                    // in case of errors or warnings with only cell information
 
381
                    // This would bring the EditWindow to the front.
 
382
                    EditWindow.showEditWindowForCell(logCell, null);
 
383
                }
 
384
            }
396
385
        }
397
386
 
398
387
        // return the error message
511
500
        String fileName = OpenFile.chooseInputFile(FileType.PREFS, "Saved Preferences");
512
501
        if (fileName == null) return;
513
502
 
514
 
        Pref.importPrefs(fileName);
 
503
        Pref.importPrefs(fileName, EDatabase.clientDatabase().getTechPool());
515
504
    }
516
505
 
517
506
    /**