jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTextUI.java
author darcy
Mon, 10 Mar 2014 13:54:25 -0700
changeset 23632 cd7a34d12e8c
parent 23010 6dadb192ad81
permissions -rw-r--r--
8033908: Fix serial lint warnings in com.sun.java.swing.plaf Reviewed-by: serb, alanb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
23010
6dadb192ad81 8029235: Update copyright year to match last edit in jdk8 jdk repository for 2013
lana
parents: 21278
diff changeset
     2
 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package com.sun.java.swing.plaf.windows;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.awt.Color;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.awt.Graphics;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.awt.Rectangle;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.awt.Shape;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import javax.swing.plaf.basic.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import javax.swing.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import javax.swing.plaf.TextUI;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import javax.swing.plaf.UIResource;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import javax.swing.text.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * Windows text rendering.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * <strong>Warning:</strong>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * Serialized objects of this class will not be compatible with
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * future Swing releases.  The current serialization support is appropriate
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * for short term storage or RMI between applications running the same
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * version of Swing.  A future release of Swing will provide support for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * long term persistence.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
public abstract class WindowsTextUI extends BasicTextUI {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
     * Creates the object to use for a caret.  By default an
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
     * instance of WindowsCaret is created.  This method
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
     * can be redefined to provide something else that implements
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
     * the InputPosition interface or a subclass of DefaultCaret.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
     * @return the caret object
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
    protected Caret createCaret() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
        return new WindowsCaret();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
    /* public */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    static LayeredHighlighter.LayerPainter WindowsPainter = new WindowsHighlightPainter(null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    /* public */
23632
cd7a34d12e8c 8033908: Fix serial lint warnings in com.sun.java.swing.plaf
darcy
parents: 23010
diff changeset
    65
    @SuppressWarnings("serial") // Superclass is not serializable across versions
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
    static class WindowsCaret extends DefaultCaret
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
                     implements UIResource {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
         * Gets the painter for the Highlighter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
         * @return the painter
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
        protected Highlighter.HighlightPainter getSelectionPainter() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
            return WindowsTextUI.WindowsPainter;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    /* public */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    static class WindowsHighlightPainter extends
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
                     DefaultHighlighter.DefaultHighlightPainter {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
        WindowsHighlightPainter(Color c) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
            super(c);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
        // --- HighlightPainter methods ---------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
         * Paints a highlight.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
         * @param g the graphics context
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
         * @param offs0 the starting model offset >= 0
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
         * @param offs1 the ending model offset >= offs1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
         * @param bounds the bounding box for the highlight
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
         * @param c the editor
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
        public void paint(Graphics g, int offs0, int offs1, Shape bounds, JTextComponent c) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
            Rectangle alloc = bounds.getBounds();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
            try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
                // --- determine locations ---
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
                TextUI mapper = c.getUI();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
                Rectangle p0 = mapper.modelToView(c, offs0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
                Rectangle p1 = mapper.modelToView(c, offs1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
                // --- render ---
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
                Color color = getColor();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
                if (color == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
                    g.setColor(c.getSelectionColor());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
                else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
                    g.setColor(color);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
                boolean firstIsDot = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
                boolean secondIsDot = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
                if (c.isEditable()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
                    int dot = c.getCaretPosition();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
                    firstIsDot = (offs0 == dot);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
                    secondIsDot = (offs1 == dot);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
                if (p0.y == p1.y) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
                    // same line, render a rectangle
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
                    Rectangle r = p0.union(p1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
                    if (r.width > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
                        if (firstIsDot) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
                            r.x++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
                            r.width--;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
                        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
                        else if (secondIsDot) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
                            r.width--;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
                        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
                    g.fillRect(r.x, r.y, r.width, r.height);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
                } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
                    // different lines
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
                    int p0ToMarginWidth = alloc.x + alloc.width - p0.x;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
                    if (firstIsDot && p0ToMarginWidth > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
                        p0.x++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
                        p0ToMarginWidth--;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
                    g.fillRect(p0.x, p0.y, p0ToMarginWidth, p0.height);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
                    if ((p0.y + p0.height) != p1.y) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
                        g.fillRect(alloc.x, p0.y + p0.height, alloc.width,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
                                   p1.y - (p0.y + p0.height));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
                    if (secondIsDot && p1.x > alloc.x) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
                        p1.x--;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
                    g.fillRect(alloc.x, p1.y, (p1.x - alloc.x), p1.height);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
            } catch (BadLocationException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
                // can't render
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
        // --- LayerPainter methods ----------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
         * Paints a portion of a highlight.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
         * @param g the graphics context
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
         * @param offs0 the starting model offset >= 0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
         * @param offs1 the ending model offset >= offs1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
         * @param bounds the bounding box of the view, which is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
         *        necessarily the region to paint.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
         * @param c the editor
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
         * @param view View painting for
21278
ef8a3a2a72f2 8022746: List of spelling errors in API doc
malenkov
parents: 5506
diff changeset
   166
         * @return region drawing occurred in
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
        public Shape paintLayer(Graphics g, int offs0, int offs1,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
                                Shape bounds, JTextComponent c, View view) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
            Color color = getColor();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
            if (color == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
                g.setColor(c.getSelectionColor());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
            else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
                g.setColor(color);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
            boolean firstIsDot = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
            boolean secondIsDot = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
            if (c.isEditable()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
                int dot = c.getCaretPosition();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
                firstIsDot = (offs0 == dot);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
                secondIsDot = (offs1 == dot);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
            if (offs0 == view.getStartOffset() &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
                offs1 == view.getEndOffset()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
                // Contained in view, can just use bounds.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
                Rectangle alloc;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
                if (bounds instanceof Rectangle) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
                    alloc = (Rectangle)bounds;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
                else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
                    alloc = bounds.getBounds();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
                if (firstIsDot && alloc.width > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
                    g.fillRect(alloc.x + 1, alloc.y, alloc.width - 1,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
                               alloc.height);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
                else if (secondIsDot && alloc.width > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
                    g.fillRect(alloc.x, alloc.y, alloc.width - 1,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
                               alloc.height);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
                else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
                    g.fillRect(alloc.x, alloc.y, alloc.width, alloc.height);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
                return alloc;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
            else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
                // Should only render part of View.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
                try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
                    // --- determine locations ---
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
                    Shape shape = view.modelToView(offs0, Position.Bias.Forward,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
                                                   offs1,Position.Bias.Backward,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
                                                   bounds);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
                    Rectangle r = (shape instanceof Rectangle) ?
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
                                  (Rectangle)shape : shape.getBounds();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
                    if (firstIsDot && r.width > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
                        g.fillRect(r.x + 1, r.y, r.width - 1, r.height);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
                    else if (secondIsDot && r.width > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
                        g.fillRect(r.x, r.y, r.width - 1, r.height);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
                    else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
                        g.fillRect(r.x, r.y, r.width, r.height);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
                    return r;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
                } catch (BadLocationException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
                    // can't render
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
            // Only if exception
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
            return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
}