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

« back to all changes in this revision

Viewing changes to com/sun/electric/tool/user/ui/MessagesWindow.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:
61
61
import javax.swing.JTextArea;
62
62
import javax.swing.ListSelectionModel;
63
63
import javax.swing.SwingUtilities;
 
64
import javax.swing.text.BadLocationException;
64
65
 
65
66
/**
66
67
 * a console for the Java side of Electric.  Used because the standard
73
74
public class MessagesWindow
74
75
        implements MouseListener, ClipboardOwner
75
76
{
76
 
 
77
77
        private JTextArea info;
78
78
        private Container contentFrame;
79
79
        private Container jf;
80
80
 
81
 
        // -------------------- private and protected methods ------------------------
82
81
        public MessagesWindow()
83
82
        {
84
83
                Dimension scrnSize = TopLevel.getScreenSize();
127
126
                }
128
127
        }
129
128
 
130
 
        public Component getComponent()
131
 
        {
132
 
                return jf;
133
 
        }
 
129
//      public Component getComponent()
 
130
//      {
 
131
//              return jf;
 
132
//      }
134
133
 
 
134
        /**
 
135
         * Method to tell whether the Messages Window is the current window.
 
136
         * @return true if the Messages Window is the current window.
 
137
         */
135
138
        public boolean isFocusOwner()
136
139
        {
137
140
                if (TopLevel.isMDIMode())
140
143
        }
141
144
 
142
145
        /**
143
 
         * Method to request focus on this window
 
146
         * Method to request focus on the Messages Window.
144
147
         */
145
 
        public void requestFocus() {
146
 
                if (!Job.isClientThread()) {
 
148
        public void requestFocus()
 
149
        {
 
150
                if (!Job.isClientThread())
 
151
                {
147
152
                        SwingUtilities.invokeLater(new Runnable() {
148
153
                                public void run() { requestFocusUnsafe(); }
149
154
                        });
167
172
                }
168
173
        }
169
174
 
 
175
        /**
 
176
         * Method to return the bounds of the Messages Window.
 
177
         * @return the bounds of the Messages Window.
 
178
         */
170
179
        public Rectangle getMessagesLocation()
171
180
        {
172
181
                return jf.getBounds();
173
182
        }
174
183
 
 
184
        /**
 
185
         * Method to return the number of columns in the Messages Window.
 
186
         * @return the number of columns in the Messages Window.
 
187
         */
175
188
        public int getMessagesCharWidth()
176
189
        {
177
190
                return info.getColumns();
200
213
        }
201
214
 
202
215
        /**
203
 
         * Method to erase everything in the messages window.
 
216
         * Method to add text to the Messages Window.
 
217
         * @param str the text to add.
204
218
         */
205
 
        public void clear()
206
 
        {
207
 
                info.setText("");
208
 
        }
209
 
 
210
219
        public void appendString(String str)
211
220
        {
212
221
                info.append(str);
214
223
                {
215
224
                        Rectangle r = info.modelToView(info.getDocument().getLength());
216
225
                        info.scrollRectToVisible(r);
217
 
                } catch (javax.swing.text.BadLocationException ble)
 
226
                } catch (BadLocationException ble)
218
227
                {
219
228
                }
220
229
        }
263
272
                menuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { copyText(true, false); } });
264
273
                menuItem = new JMenuItem("Clear");
265
274
                menu.add(menuItem);
266
 
                menuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { clear(); } });
 
275
                menuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { clear(true); } });
267
276
 
268
277
                menu.show((Component)e.getSource(), e.getX(), e.getY());
269
278
        }
270
279
 
271
 
        private void pasteText()
 
280
        /**
 
281
         * Method to paste text from the clipboard to the Messages Window.
 
282
         */
 
283
        public void pasteText()
272
284
        {
273
285
                info.paste();
274
286
        }
275
287
 
276
 
        private void copyText(boolean all, boolean cut)
 
288
        /**
 
289
         * Method to copy text from the Messages Window.
 
290
         * @param all true to copy ALL text in the Messages Window; false to copy only the selected text.
 
291
         * @param cut true to cut instead of copy (delete after copying).
 
292
         */
 
293
        public void copyText(boolean all, boolean cut)
277
294
        {
278
295
                if (all)
279
296
                {
293
310
                }
294
311
        }
295
312
 
 
313
        /**
 
314
         * Method to erase everything in the Messages Window.
 
315
         * @param all true to delete all text; false to delete only selected text.
 
316
         */
 
317
        public void clear(boolean all)
 
318
        {
 
319
                if (all)
 
320
                {
 
321
                        info.setText("");
 
322
                } else
 
323
                {
 
324
                        info.replaceSelection("");
 
325
                }
 
326
        }
 
327
 
 
328
        /**
 
329
         * Method to select all text in the Messages Window.
 
330
         */
 
331
        public void selectAll()
 
332
        {
 
333
                info.selectAll();
 
334
        }
 
335
 
296
336
        /************************************ MESSAGES WINDOW FONT SETTING ************************************/
297
337
 
298
338
        /**