jdk/src/share/classes/javax/swing/text/html/FrameView.java
author darcy
Sun, 23 Mar 2014 13:49:48 -0700
changeset 23697 e556a715949f
parent 5506 202f599c92aa
permissions -rw-r--r--
8034169: Fix serial lint warnings in javax.swing Reviewed-by: alanb, prr
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
23697
e556a715949f 8034169: Fix serial lint warnings in javax.swing
darcy
parents: 5506
diff changeset
     2
 * Copyright (c) 1998, 2014, 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
package javax.swing.text.html;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
import java.awt.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.util.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.net.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.io.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import javax.swing.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import javax.swing.text.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import javax.swing.event.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import sun.swing.text.html.FrameEditorPaneTag;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * Implements a FrameView, intended to support the HTML
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * <FRAME> tag.  Supports the frameborder, scrolling,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * marginwidth and marginheight attributes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * @author    Sunita Mani
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
class FrameView extends ComponentView implements HyperlinkListener {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
    JEditorPane htmlPane;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    JScrollPane scroller;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
    boolean editable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    float width;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    float height;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
    URL src;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
    /** Set to true when the component has been created. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    private boolean createdComponent;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
     * Creates a new Frame.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
     * @param elem the element to represent.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    public FrameView(Element elem) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
        super(elem);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
    protected Component createComponent() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
        Element elem = getElement();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
        AttributeSet attributes = elem.getAttributes();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
        String srcAtt = (String)attributes.getAttribute(HTML.Attribute.SRC);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
        if ((srcAtt != null) && (!srcAtt.equals(""))) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
            try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
                URL base = ((HTMLDocument)elem.getDocument()).getBase();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
                src = new URL(base, srcAtt);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
                htmlPane = new FrameEditorPane();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
                htmlPane.addHyperlinkListener(this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
                JEditorPane host = getHostPane();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
                boolean isAutoFormSubmission = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
                if (host != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
                    htmlPane.setEditable(host.isEditable());
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
                    String charset = (String) host.getClientProperty("charset");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
                    if (charset != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
                        htmlPane.putClientProperty("charset", charset);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
                    HTMLEditorKit hostKit = (HTMLEditorKit)host.getEditorKit();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
                    if (hostKit != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
                        isAutoFormSubmission = hostKit.isAutoFormSubmission();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
                htmlPane.setPage(src);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
                HTMLEditorKit kit = (HTMLEditorKit)htmlPane.getEditorKit();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
                if (kit != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
                    kit.setAutoFormSubmission(isAutoFormSubmission);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
                Document doc = htmlPane.getDocument();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
                if (doc instanceof HTMLDocument) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
                    ((HTMLDocument)doc).setFrameDocumentState(true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
                setMargin();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
                createScrollPane();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
                setBorder();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
            } catch (MalformedURLException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
                e.printStackTrace();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
            } catch (IOException e1) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
                e1.printStackTrace();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
        createdComponent = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
        return scroller;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
    JEditorPane getHostPane() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
        Container c = getContainer();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
        while ((c != null) && ! (c instanceof JEditorPane)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
            c = c.getParent();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
        return (JEditorPane) c;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
     * Sets the parent view for the FrameView.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
     * Also determines if the FrameView should be editable
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     * or not based on whether the JTextComponent that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     * contains it is editable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     * @param parent View
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
    public void setParent(View parent) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
        if (parent != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
            JTextComponent t = (JTextComponent)parent.getContainer();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
            editable = t.isEditable();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
        super.setParent(parent);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     * Also determines if the FrameView should be editable
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * or not based on whether the JTextComponent that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     * contains it is editable. And then proceeds to call
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     * the superclass to do the paint().
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     * @param parent View
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     * @see text.ComponentView#paint
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
    public void paint(Graphics g, Shape allocation) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
        Container host = getContainer();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
        if (host != null && htmlPane != null &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
            htmlPane.isEditable() != ((JTextComponent)host).isEditable()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
            editable = ((JTextComponent)host).isEditable();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
            htmlPane.setEditable(editable);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
        super.paint(g, allocation);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     * If the marginwidth or marginheight attributes have been specified,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     * then the JEditorPane's margin's are set to the new values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
    private void setMargin() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
        int margin = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
        Insets in = htmlPane.getMargin();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
        Insets newInsets;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
        boolean modified = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
        AttributeSet attributes = getElement().getAttributes();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
        String marginStr = (String)attributes.getAttribute(HTML.Attribute.MARGINWIDTH);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
        if ( in != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
            newInsets = new Insets(in.top, in.left, in.right, in.bottom);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
            newInsets = new Insets(0,0,0,0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
        if (marginStr != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
            margin = Integer.parseInt(marginStr);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
            if (margin > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
                newInsets.left = margin;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
                newInsets.right = margin;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
                modified = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
        marginStr = (String)attributes.getAttribute(HTML.Attribute.MARGINHEIGHT);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
        if (marginStr != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
            margin = Integer.parseInt(marginStr);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
            if (margin > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
                newInsets.top = margin;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
                newInsets.bottom = margin;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
                modified = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
        if (modified) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
            htmlPane.setMargin(newInsets);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     * If the frameborder attribute has been specified, either in the frame,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
     * or by the frames enclosing frameset, the JScrollPane's setBorder()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
     * method is invoked to achieve the desired look.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
    private void setBorder() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
        AttributeSet attributes = getElement().getAttributes();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
        String frameBorder = (String)attributes.getAttribute(HTML.Attribute.FRAMEBORDER);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
        if ((frameBorder != null) &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
            (frameBorder.equals("no") || frameBorder.equals("0"))) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
            // make invisible borders.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
            scroller.setBorder(null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     * This method creates the JScrollPane.  The scrollbar policy is determined by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
     * the scrolling attribute.  If not defined, the default is "auto" which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
     * maps to the scrollbar's being displayed as needed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
    private void createScrollPane() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
        AttributeSet attributes = getElement().getAttributes();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
        String scrolling = (String)attributes.getAttribute(HTML.Attribute.SCROLLING);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
        if (scrolling == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
            scrolling = "auto";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
        if (!scrolling.equals("no")) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
            if (scrolling.equals("yes")) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
                scroller = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
                                           JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
            } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
                // scrollbars will be displayed if needed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
                //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
                scroller = new JScrollPane();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
            scroller = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_NEVER,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
                                       JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
        JViewport vp = scroller.getViewport();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
        vp.add(htmlPane);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
        vp.setBackingStoreEnabled(true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
        scroller.setMinimumSize(new Dimension(5,5));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
        scroller.setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
     * Finds the outermost FrameSetView.  It then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
     * returns that FrameSetView's container.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
    JEditorPane getOutermostJEditorPane() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
        View parent = getParent();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
        FrameSetView frameSetView = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
        while (parent != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
            if (parent instanceof FrameSetView) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
                frameSetView = (FrameSetView)parent;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
            parent = parent.getParent();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
        if (frameSetView != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
            return (JEditorPane)frameSetView.getContainer();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
        return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
     * Returns true if this frame is contained within
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
     * a nested frameset.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
    private boolean inNestedFrameSet() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
        FrameSetView parent = (FrameSetView)getParent();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
        return (parent.getParent() instanceof FrameSetView);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
     * Notification of a change relative to a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
     * hyperlink. This method searches for the outermost
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
     * JEditorPane, and then fires an HTMLFrameHyperlinkEvent
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
     * to that frame.  In addition, if the target is _parent,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
     * and there is not nested framesets then the target is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
     * reset to _top.  If the target is _top, in addition to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
     * firing the event to the outermost JEditorPane, this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
     * method also invokes the setPage() method and explicitly
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
     * replaces the current document with the destination url.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
     * @param HyperlinkEvent
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
    public void hyperlinkUpdate(HyperlinkEvent evt) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
        JEditorPane c = getOutermostJEditorPane();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
        if (c == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
            return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
        if (!(evt instanceof HTMLFrameHyperlinkEvent)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
            c.fireHyperlinkUpdate(evt);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
            return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
        HTMLFrameHyperlinkEvent e = (HTMLFrameHyperlinkEvent)evt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
        if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
            String target = e.getTarget();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
            String postTarget = target;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
            if (target.equals("_parent") && !inNestedFrameSet()){
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
                target = "_top";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
            if (evt instanceof FormSubmitEvent) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
                HTMLEditorKit kit = (HTMLEditorKit)c.getEditorKit();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
                if (kit != null && kit.isAutoFormSubmission()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
                    if (target.equals("_top")) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
                        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
                            movePostData(c, postTarget);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
                            c.setPage(e.getURL());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
                        } catch (IOException ex) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
                            // Need a way to handle exceptions
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
                        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
                    } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
                        HTMLDocument doc = (HTMLDocument)c.getDocument();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
                        doc.processHTMLFrameHyperlinkEvent(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
                } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
                    c.fireHyperlinkUpdate(evt);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
                return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
            if (target.equals("_top")) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
                try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
                    c.setPage(e.getURL());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
                } catch (IOException ex) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
                    // Need a way to handle exceptions
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
                    // ex.printStackTrace();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
            if (!c.isEditable()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
                c.fireHyperlinkUpdate(new HTMLFrameHyperlinkEvent(c,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
                                                                  e.getEventType(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
                                                                  e.getURL(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
                                                                  e.getDescription(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
                                                                  getElement(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
                                                                  e.getInputEvent(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
                                                                  target));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
     * Gives notification from the document that attributes were changed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
     * in a location that this view is responsible for.  Currently this view
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
     * handles changes to its SRC attribute.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
     * @param e the change information from the associated document
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
     * @param a the current allocation of the view
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
     * @param f the factory to use to rebuild if the view has children
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
    public void changedUpdate(DocumentEvent e, Shape a, ViewFactory f) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
        Element elem = getElement();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
        AttributeSet attributes = elem.getAttributes();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
        URL oldPage = src;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
        String srcAtt = (String)attributes.getAttribute(HTML.Attribute.SRC);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
        URL base = ((HTMLDocument)elem.getDocument()).getBase();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
            if (!createdComponent) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
                return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
            Object postData = movePostData(htmlPane, null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
            src = new URL(base, srcAtt);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
            if (oldPage.equals(src) && (src.getRef() == null) && (postData == null)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
                return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
            htmlPane.setPage(src);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
            Document newDoc = htmlPane.getDocument();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
            if (newDoc instanceof HTMLDocument) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
                ((HTMLDocument)newDoc).setFrameDocumentState(true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
        } catch (MalformedURLException e1) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
            // Need a way to handle exceptions
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
            //e1.printStackTrace();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
        } catch (IOException e2) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
            // Need a way to handle exceptions
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
            //e2.printStackTrace();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
     * Move POST data from temporary storage into the target document property.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
     * @return the POST data or null if no data found
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
    private Object movePostData(JEditorPane targetPane, String frameName) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
        Object postData = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
        JEditorPane p = getOutermostJEditorPane();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
        if (p != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
            if (frameName == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
                frameName = (String) getElement().getAttributes().getAttribute(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
                        HTML.Attribute.NAME);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
            if (frameName != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
                String propName = FormView.PostDataProperty + "." + frameName;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
                Document d = p.getDocument();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
                postData = d.getProperty(propName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
                if (postData != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
                    targetPane.getDocument().putProperty(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
                            FormView.PostDataProperty, postData);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
                    d.putProperty(propName, null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
        return postData;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
     * Determines the minimum span for this view along an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
     * axis.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
     * @param axis may be either <code>View.X_AXIS</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
     *  <code>View.Y_AXIS</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
     * @return the preferred span; given that we do not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
     * support resizing of frames, the minimum span returned
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
     * is the same as the preferred span
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
    public float getMinimumSpan(int axis) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
      return 5;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
     * Determines the maximum span for this view along an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
     * axis.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
     * @param axis may be either <code>View.X_AXIS</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
     *  <code>View.Y_AXIS</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
     * @return the preferred span; given that we do not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
     * support resizing of frames, the maximum span returned
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
     * is the same as the preferred span
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
    public float getMaximumSpan(int axis) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
        return Integer.MAX_VALUE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
    /** Editor pane rendering frame of HTML document
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
     *  It uses the same editor kits classes as outermost JEditorPane
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
     */
23697
e556a715949f 8034169: Fix serial lint warnings in javax.swing
darcy
parents: 5506
diff changeset
   461
    @SuppressWarnings("serial") // Superclass is not serializable across versions
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
    class FrameEditorPane extends JEditorPane implements FrameEditorPaneTag {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
        public EditorKit getEditorKitForContentType(String type) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
            EditorKit editorKit = super.getEditorKitForContentType(type);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
            JEditorPane outerMostJEditorPane = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
            if ((outerMostJEditorPane = getOutermostJEditorPane()) != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
                EditorKit inheritedEditorKit = outerMostJEditorPane.getEditorKitForContentType(type);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
                if (! editorKit.getClass().equals(inheritedEditorKit.getClass())) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
                    editorKit = (EditorKit) inheritedEditorKit.clone();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
                    setEditorKitForContentType(type, editorKit);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
            return editorKit;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
        FrameView getFrameView() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
            return FrameView.this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
}