001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041: package org.netbeans.modules.soa.ui.util;
042:
043: import java.awt.Component;
044: import java.awt.Dimension;
045: import java.awt.Insets;
046: import java.awt.Graphics;
047: import java.awt.GridBagConstraints;
048: import java.awt.GridBagLayout;
049: import java.awt.event.ComponentAdapter;
050: import java.awt.event.ComponentEvent;
051: import java.awt.event.KeyEvent;
052: import java.awt.event.WindowAdapter;
053: import java.awt.event.WindowEvent;
054: import java.util.Stack;
055:
056: import javax.swing.Action;
057: import javax.swing.AbstractAction;
058: import javax.swing.AbstractButton;
059: import javax.swing.Icon;
060: import javax.swing.ImageIcon;
061: import javax.swing.JButton;
062: import javax.swing.JCheckBox;
063: import javax.swing.JComboBox;
064: import javax.swing.JComponent;
065: import javax.swing.JDialog;
066: import javax.swing.JLabel;
067: import javax.swing.JPanel;
068: import javax.swing.JRadioButton;
069: import javax.swing.JSeparator;
070: import javax.swing.JTextArea;
071: import javax.swing.JToggleButton;
072: import javax.swing.SwingUtilities;
073: import javax.swing.border.Border;
074: import javax.swing.border.EmptyBorder;
075:
076: import org.openide.DialogDescriptor;
077: import org.openide.DialogDisplayer;
078: import org.openide.NotifyDescriptor;
079: import org.openide.awt.Mnemonics;
080: import org.openide.loaders.DataObject;
081: import org.openide.nodes.Node;
082: import org.openide.windows.TopComponent;
083: import org.openide.util.NbBundle;
084:
085: /**
086: * @author Vladimir Yaroslavskiy
087: * @version 2005.12.14
088: */
089: public final class UI {
090:
091: private UI() {
092: }
093:
094: public static boolean isAlt(int modifiers) {
095: return isModifier(modifiers, KeyEvent.ALT_MASK);
096: }
097:
098: public static boolean isShift(int modifiers) {
099: return isModifier(modifiers, KeyEvent.SHIFT_MASK);
100: }
101:
102: public static boolean isCtrl(int modifiers) {
103: return isModifier(modifiers, KeyEvent.CTRL_MASK)
104: || isModifier(modifiers, KeyEvent.META_MASK);
105: }
106:
107: private static boolean isModifier(int modifiers, int mask) {
108: return (modifiers & mask) != 0;
109: }
110:
111: public static JLabel createLabel(String message) {
112: JLabel label = new JLabel();
113: Mnemonics.setLocalizedText(label, message);
114: return label;
115: }
116:
117: public static JRadioButton createRadioButton(String text,
118: String toolTip) {
119: JRadioButton button = new JRadioButton();
120: Mnemonics.setLocalizedText(button, text);
121: button.setText(cutMnemonicAndAmpersand(text));
122: button.setToolTipText(toolTip);
123: return button;
124: }
125:
126: public static JButton createButton(Action action) {
127: return (JButton) createAbstractButton(new JButton(), action);
128: }
129:
130: public static JCheckBox createCheckBox(Action action) {
131: return (JCheckBox) createAbstractButton(new JCheckBox(), action);
132: }
133:
134: public static JToggleButton createToggleButton(Action action) {
135: return (JToggleButton) createAbstractButton(
136: new JToggleButton(), action);
137: }
138:
139: public static void setItems(JComboBox comboBox, Object[] items) {
140: Object selected = comboBox.getSelectedItem();
141: comboBox.removeAllItems();
142:
143: for (int i = 0; i < items.length; i++) {
144: comboBox.insertItemAt(items[i], i);
145: }
146: if (items.length > 0) {
147: comboBox.setSelectedIndex(0);
148: }
149: if (selected != null) {
150: comboBox.setSelectedItem(selected);
151: }
152: }
153:
154: public static JPanel createSeparator(String message) {
155: JPanel panel = new JPanel(new GridBagLayout());
156: GridBagConstraints c = new GridBagConstraints();
157: c.anchor = GridBagConstraints.WEST;
158:
159: c.insets = new Insets(SMALL_INSET, 0, SMALL_INSET, 0);
160: panel.add(createLabel(message), c);
161:
162: c.weightx = 1.0;
163: c.fill = GridBagConstraints.HORIZONTAL;
164: c.insets = new Insets(SMALL_INSET, SMALL_INSET, SMALL_INSET, 0);
165: panel.add(new JSeparator(), c);
166:
167: return panel;
168: }
169:
170: private static AbstractButton createAbstractButton(
171: AbstractButton button, Action action) {
172: button.setAction(action);
173: mnemonicAndToolTip(button, (String) action
174: .getValue(Action.SHORT_DESCRIPTION));
175: return button;
176: }
177:
178: private static void mnemonicAndToolTip(AbstractButton button,
179: String toolTip) {
180: String text = button.getText();
181:
182: if (text == null) {
183: Mnemonics.setLocalizedText(button, toolTip);
184: button.setText(null);
185: } else {
186: Mnemonics.setLocalizedText(button, text);
187: button.setText(cutMnemonicAndAmpersand(text));
188: }
189: button.setToolTipText(cutMnemonicAndAmpersand(toolTip));
190: }
191:
192: private static String cutMnemonicAndAmpersand(String value) {
193: if (value == null) {
194: return null;
195: }
196: int k = value.lastIndexOf(" // "); // NOI18N
197:
198: if (k != -1) {
199: value = value.substring(0, k);
200: }
201: k = value.indexOf("&"); // NOI18N
202:
203: if (k == -1) {
204: return value;
205: }
206: return value.substring(0, k) + value.substring(k + 1);
207: }
208:
209: public static JTextArea createTextArea(int columns, String message) {
210: JTextArea text = new JTextArea(message);
211: text.setBackground(null);
212: text.setEditable(false);
213: text.setColumns(columns);
214: text.setLineWrap(true);
215: text.setWrapStyleWord(true);
216: return text;
217: }
218:
219: public static void a11y(Component component, String a11y) {
220: a11y(component, a11y, a11y);
221: }
222:
223: public static void a11y(Component component, String a11yN,
224: String a11yD) {
225: if (a11yN != null) {
226: component.getAccessibleContext().setAccessibleName(a11yN);
227: }
228: if (a11yD != null) {
229: component.getAccessibleContext().setAccessibleDescription(
230: a11yD);
231: }
232: }
233:
234: public static String i18n(Class clazz, String key) {
235: if (key == null) {
236: return null;
237: }
238: return NbBundle.getMessage(clazz, key);
239: }
240:
241: public static String i18n(Class clazz, String key, String param) {
242: if (key == null) {
243: return null;
244: }
245: return NbBundle.getMessage(clazz, key, param);
246: }
247:
248: public static String i18n(Class clazz, String key, String param1,
249: String param2) {
250: if (key == null) {
251: return null;
252: }
253: return NbBundle.getMessage(clazz, key, param1, param2);
254: }
255:
256: public static String i18n(Class clazz, String key, String param1,
257: String param2, String param3) {
258: if (key == null) {
259: return null;
260: }
261: return NbBundle.getMessage(clazz, key, param1, param2, param3);
262: }
263:
264: public static boolean printWarning(String message) {
265: NotifyDescriptor confirm = new NotifyDescriptor.Confirmation(
266: message, NotifyDescriptor.YES_NO_OPTION,
267: NotifyDescriptor.WARNING_MESSAGE);
268: DialogDisplayer.getDefault().notify(confirm);
269:
270: return confirm.getValue() == NotifyDescriptor.YES_OPTION;
271: }
272:
273: public static boolean printConfirmation(String message) {
274: return NotifyDescriptor.YES_OPTION.equals(DialogDisplayer
275: .getDefault().notify(
276: new NotifyDescriptor.Confirmation(message,
277: NotifyDescriptor.YES_NO_OPTION)));
278: }
279:
280: public static void printInformation(String message) {
281: print(message, NotifyDescriptor.INFORMATION_MESSAGE);
282: }
283:
284: public static void printError(String message) {
285: print(message, NotifyDescriptor.ERROR_MESSAGE);
286: }
287:
288: private static void print(String message, int type) {
289: DialogDisplayer.getDefault().notify(
290: new NotifyDescriptor.Message(message, type));
291: }
292:
293: public static ImageIcon icon(Class clazz, String name) {
294: if (name == null) {
295: return null;
296: }
297: return new ImageIcon(clazz
298: .getResource("image/" + name + ".gif")); // NOI18N
299: }
300:
301: public static Node getSelectedNode() {
302: Node[] nodes = getSelectedNodes();
303:
304: if (nodes == null) {
305: return null;
306: }
307: return nodes[0];
308: }
309:
310: public static Node[] getSelectedNodes() {
311: //out();
312: TopComponent top = getActivateTopComponent();
313: //out("top: " + top);
314: if (top == null) {
315: return null;
316: }
317: Node[] nodes = top.getActivatedNodes();
318: //out("nodes: " + nodes);
319:
320: if (nodes == null || nodes.length == 0) {
321: return null;
322: }
323: return nodes;
324: }
325:
326: public static TopComponent getActivateTopComponent() {
327: return TopComponent.getRegistry().getActivated();
328: }
329:
330: public static void setWidth(JComponent component, int width) {
331: setDimension(component, new Dimension(width, component
332: .getPreferredSize().height));
333: }
334:
335: public static void setHeight(JComponent component, int height) {
336: setDimension(component, new Dimension(component
337: .getPreferredSize().width, height));
338: }
339:
340: private static void setDimension(JComponent component,
341: Dimension dimension) {
342: component.setMinimumSize(dimension);
343: component.setPreferredSize(dimension);
344: }
345:
346: public static int getInt(String value) {
347: try {
348: return Integer.parseInt(value);
349: } catch (NumberFormatException e) {
350: return -1;
351: }
352: }
353:
354: public static int round(double value) {
355: return (int) Math.ceil(value);
356: }
357:
358: public static String replace(String source, String searchFor,
359: String replaceWith) {
360: if (source == null) {
361: return null;
362: }
363: if (searchFor == null || searchFor.length() == 0) {
364: return null;
365: }
366: int k = 0;
367: int found = source.indexOf(searchFor, k);
368: StringBuffer buffer = new StringBuffer();
369:
370: while (true) {
371: if (found == -1) {
372: break;
373: }
374: buffer.append(source.substring(k, found));
375: buffer.append(replaceWith);
376:
377: k = found + searchFor.length();
378: found = source.indexOf(searchFor, k);
379: }
380: if (k > 0) {
381: buffer.append(source.substring(k));
382: return buffer.toString();
383: } else {
384: return source;
385: }
386: }
387:
388: public static DataObject getDataObject(Node node) {
389: if (node == null) {
390: return null;
391: }
392: return (DataObject) node.getLookup().lookup(DataObject.class);
393: }
394:
395: public static void setImageSize(JButton button) {
396: final Dimension IMAGE_BUTTON_SIZE = new Dimension(24, 24);
397: button.setMaximumSize(IMAGE_BUTTON_SIZE);
398: button.setMinimumSize(IMAGE_BUTTON_SIZE);
399: button.setPreferredSize(IMAGE_BUTTON_SIZE);
400: }
401:
402: public static JComponent getResizable(JPanel panel) {
403: JPanel p = new JPanel(new GridBagLayout());
404: GridBagConstraints c = new GridBagConstraints();
405:
406: c.weightx = 1.0;
407: c.weighty = 1.0;
408: c.insets = new Insets(TINY_INSET, MEDIUM_INSET, 0, MEDIUM_INSET);
409: c.anchor = GridBagConstraints.NORTHWEST;
410: c.fill = GridBagConstraints.HORIZONTAL;
411: p.add(panel, c);
412:
413: return p;
414: }
415:
416: public static void startTimeln() {
417: tim();
418: startTime();
419: }
420:
421: public static void startTime() {
422: ourTimes.push(System.currentTimeMillis());
423: }
424:
425: public static void endTime(Object object) {
426: long currentTime = System.currentTimeMillis();
427: tim(object + ": " + ((currentTime - ourTimes.pop()) / MILLIS)
428: + " sec."); // NOI18N
429: }
430:
431: public static void tim() {
432: if (ENABLE_TIM) {
433: System.out.println();
434: }
435: }
436:
437: public static void tim(Object object) {
438: if (ENABLE_TIM) {
439: System.out.println("*** " + object); // NOI18N
440: }
441: }
442:
443: public static void log() {
444: if (ENABLE_LOG) {
445: System.out.println();
446: }
447: }
448:
449: public static void log(Object object) {
450: if (ENABLE_LOG) {
451: System.out.println("*** " + object); // NOI18N
452: }
453: }
454:
455: public static void out() {
456: if (ENABLE_OUT) {
457: System.out.println();
458: }
459: }
460:
461: public static void out(Object object) {
462: if (ENABLE_OUT) {
463: System.out.println("*** " + object); // NOI18N
464: }
465: }
466:
467: // -------------------------------------------------------------
468: public abstract static class IconAction extends AbstractAction {
469:
470: protected IconAction(String name, String toolTip, Icon icon) {
471: super (name, icon);
472: putValue(SHORT_DESCRIPTION, toolTip);
473: }
474: }
475:
476: // ---------------------------------------------------------------
477: public abstract static class ButtonAction extends AbstractAction {
478:
479: public ButtonAction(String text, String toolTip) {
480: this (text, null, toolTip);
481: }
482:
483: public ButtonAction(Icon icon, String toolTip) {
484: this (null, icon, toolTip);
485: }
486:
487: public ButtonAction(String text) {
488: this (text, null, text);
489: }
490:
491: private ButtonAction(String text, Icon icon, String toolTip) {
492: super (text, icon);
493: putValue(SHORT_DESCRIPTION, toolTip);
494: }
495: }
496:
497: // --------------------------------------------------------
498: public abstract static class Dialog extends WindowAdapter {
499:
500: protected void opened() {
501: }
502:
503: protected void resized() {
504: }
505:
506: protected void updated() {
507: }
508:
509: protected abstract DialogDescriptor createDescriptor();
510:
511: public void show() {
512: show(true);
513: }
514:
515: public void showAndWait() {
516: show(false);
517: }
518:
519: private void show(boolean inSwingThread) {
520: if (myDialog == null) {
521: myDialog = DialogDisplayer.getDefault().createDialog(
522: createDescriptor());
523: myDialog.addWindowListener(this );
524: setCorner();
525: myDialog.addComponentListener(new ComponentAdapter() {
526: public void componentResized(ComponentEvent event) {
527: resized();
528: }
529: });
530: } else {
531: opened();
532: }
533: updated();
534:
535: if (inSwingThread) {
536: SwingUtilities.invokeLater(new Runnable() {
537: public void run() {
538: myDialog.pack();
539: myDialog.setVisible(true);
540: }
541: });
542: } else {
543: myDialog.pack();
544: myDialog.setVisible(true);
545: }
546: }
547:
548: public Component getUIComponent() {
549: return myDialog;
550: }
551:
552: @Override
553: public void windowOpened(WindowEvent event) {
554: opened();
555: }
556:
557: protected final String i18n(String key) {
558: return UI.i18n(getClass(), key);
559: }
560:
561: protected final String i18n(String key, String param) {
562: return UI.i18n(getClass(), key, param);
563: }
564:
565: private void setCorner() {
566: if (myDialog instanceof JDialog) {
567: ((JDialog) myDialog).getRootPane().setBorder(
568: CORNER_BORDER);
569: }
570: }
571:
572: private java.awt.Dialog myDialog;
573: }
574:
575: // ----------------------------------------------------------
576: private static final class CornerBorder extends EmptyBorder {
577:
578: public CornerBorder() {
579: super (0, SMALL_INSET, SMALL_INSET, SMALL_INSET);
580: }
581:
582: @Override
583: public void paintBorder(Component c, Graphics g, int x, int y,
584: int w, int h) {
585: CORNER.paintIcon(c, g, w - CORNER.getIconWidth(), h
586: - CORNER.getIconHeight());
587: }
588:
589: private static final Icon CORNER = new ImageIcon(new byte[] {
590: (byte) 0x47, (byte) 0x49, (byte) 0x46, (byte) 0x38,
591: (byte) 0x39, (byte) 0x61, (byte) 0x0c, (byte) 0x00,
592: (byte) 0x0c, (byte) 0x00, (byte) 0xf7, (byte) 0x00,
593: (byte) 0x00, (byte) 0x83, (byte) 0x83, (byte) 0x83,
594: (byte) 0xd3, (byte) 0xd3, (byte) 0xc8, (byte) 0xfd,
595: (byte) 0xfd, (byte) 0xfd, (byte) 0x01, (byte) 0x01,
596: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
597: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
598: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
599: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
600: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
601: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
602: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
603: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
604: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
605: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
606: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
607: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
608: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
609: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
610: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
611: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
612: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
613: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
614: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
615: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
616: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
617: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
618: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
619: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
620: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
621: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
622: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
623: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
624: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
625: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
626: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
627: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
628: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
629: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
630: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
631: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
632: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
633: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
634: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
635: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
636: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
637: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
638: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
639: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
640: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
641: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
642: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
643: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
644: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
645: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
646: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
647: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
648: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
649: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
650: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
651: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
652: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
653: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
654: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
655: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
656: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
657: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
658: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
659: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
660: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
661: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
662: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
663: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
664: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
665: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
666: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
667: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
668: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
669: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
670: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
671: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
672: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
673: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
674: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
675: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
676: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
677: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
678: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
679: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
680: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
681: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
682: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
683: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
684: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
685: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
686: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
687: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
688: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
689: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
690: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
691: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
692: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
693: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
694: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
695: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
696: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
697: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
698: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
699: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
700: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
701: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
702: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
703: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
704: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
705: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
706: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
707: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
708: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
709: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
710: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
711: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
712: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
713: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
714: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
715: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
716: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
717: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
718: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
719: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
720: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
721: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
722: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
723: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
724: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
725: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
726: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
727: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
728: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
729: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
730: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
731: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
732: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
733: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
734: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
735: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
736: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
737: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
738: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
739: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
740: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
741: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
742: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
743: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
744: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
745: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
746: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
747: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
748: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
749: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
750: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
751: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
752: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
753: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
754: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
755: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
756: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
757: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
758: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
759: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
760: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
761: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
762: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
763: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
764: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
765: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
766: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
767: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
768: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
769: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
770: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
771: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
772: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
773: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
774: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
775: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
776: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
777: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
778: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
779: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
780: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
781: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
782: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
783: (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
784: (byte) 0x01, (byte) 0x01, (byte) 0x00, (byte) 0x00,
785: (byte) 0x00, (byte) 0x21, (byte) 0xf9, (byte) 0x04,
786: (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0xff,
787: (byte) 0x00, (byte) 0x2c, (byte) 0x00, (byte) 0x00,
788: (byte) 0x00, (byte) 0x00, (byte) 0x0c, (byte) 0x00,
789: (byte) 0x0c, (byte) 0x00, (byte) 0x40, (byte) 0x08,
790: (byte) 0x34, (byte) 0x00, (byte) 0xff, (byte) 0x09,
791: (byte) 0x1c, (byte) 0x48, (byte) 0xf0, (byte) 0x9f,
792: (byte) 0x80, (byte) 0x81, (byte) 0x02, (byte) 0x00,
793: (byte) 0x00, (byte) 0x30, (byte) 0xa8, (byte) 0xd0,
794: (byte) 0x60, (byte) 0x41, (byte) 0x81, (byte) 0x09,
795: (byte) 0x17, (byte) 0x1e, (byte) 0x7c, (byte) 0x08,
796: (byte) 0xb1, (byte) 0x21, (byte) 0xc1, (byte) 0x88,
797: (byte) 0x0c, (byte) 0x25, (byte) 0x36, (byte) 0xc4,
798: (byte) 0x88, (byte) 0x91, (byte) 0x62, (byte) 0x45,
799: (byte) 0x8f, (byte) 0x1d, (byte) 0x0b, (byte) 0x72,
800: (byte) 0x5c, (byte) 0x88, (byte) 0x70, (byte) 0xa3,
801: (byte) 0xc5, (byte) 0x8c, (byte) 0x28, (byte) 0x13,
802: (byte) 0x8e, (byte) 0xd4, (byte) 0xb8, (byte) 0x30,
803: (byte) 0x20, (byte) 0x00, (byte) 0x3b });
804: }
805:
806: private static Stack<Long> ourTimes = new Stack<Long>();
807:
808: public static final int TINY_INSET = 2;
809: public static final int SMALL_INSET = 7;
810: public static final int MEDIUM_INSET = 11;
811:
812: private static final double MILLIS = 1000.0;
813:
814: public static final String UH = System.getProperty("user.home"); // NOI18N
815: public static final String LS = System
816: .getProperty("line.separator"); // NOI18N
817: public static final String FS = System
818: .getProperty("file.separator"); // NOI18N
819:
820: private static final Border CORNER_BORDER = new CornerBorder();
821:
822: private static final boolean ENABLE_LOG = System
823: .getProperty("org.netbeans.modules.log") != null; // NOI18N
824:
825: private static final boolean ENABLE_OUT = System
826: .getProperty("org.netbeans.modules.out") != null; // NOI18N
827:
828: private static final boolean ENABLE_TIM = System
829: .getProperty("org.netbeans.modules.tim") != null; // NOI18N
830: }
|