/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Implements a FrameView, intended to support the HTML
* <FRAME> tag. Supports the frameborder, scrolling,
* marginwidth and marginheight attributes.
*
* @author Sunita Mani
*/
boolean editable;
float width;
float height;
/** Set to true when the component has been created. */
private boolean createdComponent;
/**
* Creates a new Frame.
*
* @param elem the element to represent.
*/
super(elem);
}
try {
htmlPane = new FrameEditorPane();
htmlPane.addHyperlinkListener(this);
boolean isAutoFormSubmission = true;
}
}
}
}
if (doc instanceof HTMLDocument) {
}
setMargin();
setBorder();
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e1) {
}
}
createdComponent = true;
return scroller;
}
Container c = getContainer();
while ((c != null) && ! (c instanceof JEditorPane)) {
c = c.getParent();
}
return (JEditorPane) c;
}
/**
* Sets the parent view for the FrameView.
* Also determines if the FrameView should be editable
* or not based on whether the JTextComponent that
* contains it is editable.
*
* @param parent View
*/
editable = t.isEditable();
}
}
/**
* Also determines if the FrameView should be editable
* or not based on whether the JTextComponent that
* contains it is editable. And then proceeds to call
* the superclass to do the paint().
*
* @param parent View
* @see text.ComponentView#paint
*/
}
super.paint(g, allocation);
}
/**
* If the marginwidth or marginheight attributes have been specified,
* then the JEditorPane's margin's are set to the new values.
*/
private void setMargin() {
int margin = 0;
boolean modified = false;
} else {
}
if (margin > 0) {
modified = true;
}
}
if (margin > 0) {
modified = true;
}
}
if (modified) {
}
}
/**
* If the frameborder attribute has been specified, either in the frame,
* or by the frames enclosing frameset, the JScrollPane's setBorder()
* method is invoked to achieve the desired look.
*/
private void setBorder() {
if ((frameBorder != null) &&
// make invisible borders.
}
}
/**
* This method creates the JScrollPane. The scrollbar policy is determined by
* the scrolling attribute. If not defined, the default is "auto" which
* maps to the scrollbar's being displayed as needed.
*/
private void createScrollPane() {
scrolling = "auto";
}
} else {
// scrollbars will be displayed if needed
//
scroller = new JScrollPane();
}
} else {
}
vp.setBackingStoreEnabled(true);
}
/**
* Finds the outermost FrameSetView. It then
* returns that FrameSetView's container.
*/
if (parent instanceof FrameSetView) {
}
}
if (frameSetView != null) {
}
return null;
}
/**
* Returns true if this frame is contained within
* a nested frameset.
*/
private boolean inNestedFrameSet() {
}
/**
* Notification of a change relative to a
* hyperlink. This method searches for the outermost
* JEditorPane, and then fires an HTMLFrameHyperlinkEvent
* to that frame. In addition, if the target is _parent,
* and there is not nested framesets then the target is
* reset to _top. If the target is _top, in addition to
* firing the event to the outermost JEditorPane, this
* method also invokes the setPage() method and explicitly
* replaces the current document with the destination url.
*
* @param HyperlinkEvent
*/
if (c == null) {
return;
}
if (!(evt instanceof HTMLFrameHyperlinkEvent)) {
return;
}
target = "_top";
}
if (evt instanceof FormSubmitEvent) {
try {
movePostData(c, postTarget);
} catch (IOException ex) {
// Need a way to handle exceptions
}
} else {
}
} else {
}
return;
}
try {
} catch (IOException ex) {
// Need a way to handle exceptions
// ex.printStackTrace();
}
}
if (!c.isEditable()) {
e.getEventType(),
e.getURL(),
e.getDescription(),
getElement(),
e.getInputEvent(),
target));
}
}
}
/**
* Gives notification from the document that attributes were changed
* in a location that this view is responsible for. Currently this view
* handles changes to its SRC attribute.
*
* @param e the change information from the associated document
* @param a the current allocation of the view
* @param f the factory to use to rebuild if the view has children
*
*/
try {
if (!createdComponent) {
return;
}
return;
}
if (newDoc instanceof HTMLDocument) {
}
} catch (MalformedURLException e1) {
// Need a way to handle exceptions
//e1.printStackTrace();
} catch (IOException e2) {
// Need a way to handle exceptions
//e2.printStackTrace();
}
}
/**
* Move POST data from temporary storage into the target document property.
*
* @return the POST data or null if no data found
*/
if (p != null) {
}
Document d = p.getDocument();
}
}
}
return postData;
}
/**
* Determines the minimum span for this view along an
* axis.
*
* @param axis may be either <code>View.X_AXIS</code> or
* <code>View.Y_AXIS</code>
* @return the preferred span; given that we do not
* support resizing of frames, the minimum span returned
* is the same as the preferred span
*
*/
return 5;
}
/**
* Determines the maximum span for this view along an
* axis.
*
* @param axis may be either <code>View.X_AXIS</code> or
* <code>View.Y_AXIS</code>
* @return the preferred span; given that we do not
* support resizing of frames, the maximum span returned
* is the same as the preferred span
*
*/
}
/** Editor pane rendering frame of HTML document
* It uses the same editor kits classes as outermost JEditorPane
*/
}
}
return editorKit;
}
return FrameView.this;
}
}
}