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

« back to all changes in this revision

Viewing changes to com/sun/electric/tool/generator/PadGenerator.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:
23
23
 */
24
24
package com.sun.electric.tool.generator;
25
25
import com.sun.electric.database.geometry.DBMath;
 
26
import com.sun.electric.database.geometry.Dimension2D;
26
27
import com.sun.electric.database.geometry.EGraphics;
27
28
import com.sun.electric.database.geometry.EPoint;
28
29
import com.sun.electric.database.geometry.Orientation;
92
93
         * Presumes that it is being run from inside a change job.
93
94
         * @param destLib destination library.
94
95
         * @param fileName the array file name.
 
96
         * @param job the Job running this task (null if none).
95
97
         */
96
 
        public static Cell makePadFrameNoJob(Library destLib, String fileName, double alignment)
 
98
        public static Cell makePadFrameUseJob(Library destLib, String fileName, Dimension2D alignment, Job job)
97
99
        {
98
100
                PadGenerator pg = new PadGenerator(destLib, fileName, alignment);
99
 
                return pg.MakePadFrame();
 
101
                return pg.makePadFrame(job);
100
102
        }
101
103
 
102
104
        private static class MakePadFrame extends Job
104
106
                private Library destLib;
105
107
                private String fileName;
106
108
                private Cell frameCell;
107
 
                private double alignment;
 
109
                private Dimension2D alignment;
108
110
 
109
 
                private MakePadFrame(Library destLib, String fileName, double alignment)
 
111
                private MakePadFrame(Library destLib, String fileName, Dimension2D alignment)
110
112
                {
111
113
                        super("Pad Frame Generator", User.getUserTool(), Job.Type.CHANGE, null, null, Job.Priority.USER);
112
114
                        this.destLib = destLib;
117
119
 
118
120
                public boolean doIt() throws JobException
119
121
                {
120
 
                        frameCell = makePadFrameNoJob(destLib, fileName, alignment);
 
122
                        frameCell = makePadFrameUseJob(destLib, fileName, alignment, this);
121
123
                        fieldVariableChanged("frameCell");
122
124
                        return true;
123
125
                }
131
133
 
132
134
        private Library destLib;                                                // destination library
133
135
        private String fileName;                                                // name of file with pad array instructions
134
 
        private double alignment;                                               // alignment amount
 
136
        private Dimension2D alignment;                                  // alignment amount
135
137
        private String padframename;                                    // name of pad frame cell
136
138
        private String corename;                                                // core cell to stick in pad frame
137
139
        private int lineno;                                                             // line no of the pad array file we are processing
195
197
                String exportName;
196
198
        }
197
199
 
198
 
        private PadGenerator(Library destLib, String fileName, double alignment)
 
200
        private PadGenerator(Library destLib, String fileName, Dimension2D alignment)
199
201
        {
200
202
                this.destLib = destLib;
201
203
                this.fileName = fileName;
208
210
                orderedCommands = new ArrayList<Object>();
209
211
        }
210
212
 
211
 
        private Cell MakePadFrame()
 
213
        private Cell makePadFrame(Job job)
212
214
        {
213
215
                String lineRead;
214
216
 
288
290
                        }
289
291
                } catch (IOException e1) {}
290
292
 
291
 
                Cell frameCell = createPadFrames();
 
293
                Cell frameCell = createPadFrames(job);
292
294
                return frameCell;
293
295
        }
294
296
 
652
654
                System.out.println("Line " + lineno + ": " + msg);
653
655
        }
654
656
 
655
 
        private Cell createPadFrames()
 
657
        private Cell createPadFrames(Job job)
656
658
        {
657
659
                Cell frameCell = null;
658
660
                if (views.size() == 0)
659
661
                {
660
 
                        frameCell = createPadFrame(padframename, View.LAYOUT);
 
662
                        frameCell = createPadFrame(padframename, View.LAYOUT, job);
661
663
                } else
662
664
                {
663
665
                        for (View view : views)
664
666
                        {
665
667
                                if (view == View.SCHEMATIC) view = View.ICON;
666
 
                                frameCell = createPadFrame(padframename, view);
 
668
                                frameCell = createPadFrame(padframename, view, job);
667
669
                        }
668
670
                }
669
671
                return frameCell;
670
672
 
671
673
        }
672
674
 
673
 
        private Cell createPadFrame(String name, View view)
 
675
        private Cell createPadFrame(String name, View view, Job job)
674
676
        {
675
677
                angle = 0;
676
678
 
923
925
                }
924
926
 
925
927
                // auto stitch everything
926
 
                AutoStitch.runAutoStitch(framecell, null, null, null, null, true, false, false);
 
928
                AutoStitch.runAutoStitch(framecell, null, null, job, null, null, true, false, false);
927
929
 
928
930
                if (corename != null)
929
931
                {