APIdia Launch Partner
Top Description Inners Fields Constructors Methods
javax.swing.text.html

pack-priv Class FrameView

extends ComponentView
implements HyperlinkListener
Class Inheritance
All Implemented Interfaces
javax.swing.event.HyperlinkListener, java.util.EventListener
Imports
java.awt.*, java.net.*, java.io.*, javax.swing.*, javax.swing.text.*, javax.swing.event.*, sun.swing.text.html.FrameEditorPaneTag

Implements a FrameView, intended to support the HTML <FRAME> tag. Supports the frameborder, scrolling, marginwidth and marginheight attributes.
Author
Sunita Mani

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class
FrameView.FrameEditorPane

Editor pane rendering frame of HTML document It uses the same editor kits classes as outermost JEditorPane

Field Summary

Modifier and TypeField and Description
private boolean
createdComponent

Set to true when the component has been created.

pack-priv boolean
pack-priv float
pack-priv JEditorPane
pack-priv JScrollPane
pack-priv URL
pack-priv float

Constructor Summary

AccessConstructor and Description
public
FrameView(Element
the element to represent.
elem
)

Creates a new Frame.

Method Summary

Modifier and TypeMethod and Description
public void
changedUpdate(DocumentEvent
the change information from the associated document
e
,
Shape
the current allocation of the view
a
,
ViewFactory
the factory to use to rebuild if the view has children
f
)

Overrides javax.swing.text.View.changedUpdate.

Gives notification from the document that attributes were changed in a location that this view is responsible for.

protected Component
createComponent()

Overrides javax.swing.text.ComponentView.createComponent.

Create the component that is associated with this view.

private void
createScrollPane()

This method creates the JScrollPane.

pack-priv JEditorPane
public float

Returns:

the preferred span; given that we do not support resizing of frames, the maximum span returned is the same as the preferred span
getMaximumSpan
(int
may be either View.X_AXIS or View.Y_AXIS
axis
)

Overrides javax.swing.text.ComponentView.getMaximumSpan.

Determines the maximum span for this view along an axis.

public float

Returns:

the preferred span; given that we do not support resizing of frames, the minimum span returned is the same as the preferred span
getMinimumSpan
(int
may be either View.X_AXIS or View.Y_AXIS
axis
)

Overrides javax.swing.text.ComponentView.getMinimumSpan.

Determines the minimum span for this view along an axis.

pack-priv JEditorPane
getOutermostJEditorPane()

Finds the outermost FrameSetView.

public void
hyperlinkUpdate(HyperlinkEvent evt)

Implements javax.swing.event.HyperlinkListener.hyperlinkUpdate.

Notification of a change relative to a hyperlink.

private boolean
inNestedFrameSet()

Returns true if this frame is contained within a nested frameset.

private Object

Returns:

the POST data or null if no data found
movePostData
(JEditorPane targetPane, String frameName)

Move POST data from temporary storage into the target document property.

public void
paint(Graphics g, Shape allocation)

Overrides javax.swing.text.ComponentView.paint.

Also determines if the FrameView should be editable or not based on whether the JTextComponent that contains it is editable.

private void
setBorder()

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
setMargin()

If the marginwidth or marginheight attributes have been specified, then the JEditorPane's margin's are set to the new values.

public void
setParent(View
View
parent
)

Overrides javax.swing.text.ComponentView.setParent.

Sets the parent view for the FrameView.

Inherited from javax.swing.text.ComponentView:
getAlignmentgetComponentgetPreferredSpanmodelToViewviewToModel

Field Detail

createdComponentback to summary
private boolean createdComponent

Set to true when the component has been created.

editableback to summary
pack-priv boolean editable
heightback to summary
pack-priv float height
htmlPaneback to summary
pack-priv JEditorPane htmlPane
scrollerback to summary
pack-priv JScrollPane scroller
srcback to summary
pack-priv URL src
widthback to summary
pack-priv float width

Constructor Detail

FrameViewback to summary
public FrameView(Element elem)

Creates a new Frame.

Parameters
elem:Element

the element to represent.

Method Detail

changedUpdateback to summary
public void changedUpdate(DocumentEvent e, Shape a, ViewFactory f)

Overrides javax.swing.text.View.changedUpdate.

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.

Parameters
e:DocumentEvent

the change information from the associated document

a:Shape

the current allocation of the view

f:ViewFactory

the factory to use to rebuild if the view has children

createComponentback to summary
protected Component createComponent()

Overrides javax.swing.text.ComponentView.createComponent.

Doc from javax.swing.text.ComponentView.createComponent.

Create the component that is associated with this view. This will be called when it has been determined that a new component is needed. This would result from a call to setParent or as a result of being notified that attributes have changed.

createScrollPaneback to summary
private void createScrollPane()

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.

Annotations
@SuppressWarnings:deprecation
getHostPaneback to summary
pack-priv JEditorPane getHostPane()
getMaximumSpanback to summary
public float getMaximumSpan(int axis)

Overrides javax.swing.text.ComponentView.getMaximumSpan.

Determines the maximum span for this view along an axis.

Parameters
axis:int

may be either View.X_AXIS or View.Y_AXIS

Returns:float

the preferred span; given that we do not support resizing of frames, the maximum span returned is the same as the preferred span

getMinimumSpanback to summary
public float getMinimumSpan(int axis)

Overrides javax.swing.text.ComponentView.getMinimumSpan.

Determines the minimum span for this view along an axis.

Parameters
axis:int

may be either View.X_AXIS or View.Y_AXIS

Returns:float

the preferred span; given that we do not support resizing of frames, the minimum span returned is the same as the preferred span

getOutermostJEditorPaneback to summary
pack-priv JEditorPane getOutermostJEditorPane()

Finds the outermost FrameSetView. It then returns that FrameSetView's container.

hyperlinkUpdateback to summary
public void hyperlinkUpdate(HyperlinkEvent evt)

Implements javax.swing.event.HyperlinkListener.hyperlinkUpdate.

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.

inNestedFrameSetback to summary
private boolean inNestedFrameSet()

Returns true if this frame is contained within a nested frameset.

movePostDataback to summary
private Object movePostData(JEditorPane targetPane, String frameName)

Move POST data from temporary storage into the target document property.

Returns:Object

the POST data or null if no data found

paintback to summary
public void paint(Graphics g, Shape allocation)

Overrides javax.swing.text.ComponentView.paint.

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().

See Also
javax.swing.text.ComponentView#paint
setBorderback to summary
private void setBorder()

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.

setMarginback to summary
private void setMargin()

If the marginwidth or marginheight attributes have been specified, then the JEditorPane's margin's are set to the new values.

setParentback to summary
public void setParent(View parent)

Overrides javax.swing.text.ComponentView.setParent.

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.

Parameters
parent:View

View

javax.swing.text.html back to summary

pack-priv Class FrameView.FrameEditorPane

extends JEditorPane
implements FrameEditorPaneTag
Class Inheritance
All Implemented Interfaces
sun.swing.text.html.FrameEditorPaneTag
Annotations
@SuppressWarnings:serial

Editor pane rendering frame of HTML document It uses the same editor kits classes as outermost JEditorPane

Field Summary

Inherited from javax.swing.JEditorPane:
HONOR_DISPLAY_PROPERTIESW3C_LENGTH_UNITS

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public EditorKit
getEditorKitForContentType(String type)

Overrides javax.swing.JEditorPane.getEditorKitForContentType.

Fetches the editor kit to use for the given type of content.

pack-priv FrameView
Inherited from javax.swing.JEditorPane:
addHyperlinkListenercreateDefaultEditorKitcreateEditorKitForContentTypefireHyperlinkUpdategetAccessibleContextgetContentTypegetEditorKitgetEditorKitClassNameForContentTypegetHyperlinkListenersgetPagegetPreferredSizegetScrollableTracksViewportHeightgetScrollableTracksViewportWidthgetStreamgetTextgetUIClassIDparamStringreadregisterEditorKitForContentTyperegisterEditorKitForContentTyperemoveHyperlinkListenerreplaceSelectionscrollToReferencesetContentTypesetEditorKitsetEditorKitForContentTypesetPagesetPagesetText

Constructor Detail

FrameEditorPaneback to summary
pack-priv FrameEditorPane()

Method Detail

getEditorKitForContentTypeback to summary
public EditorKit getEditorKitForContentType(String type)

Overrides javax.swing.JEditorPane.getEditorKitForContentType.

Doc from javax.swing.JEditorPane.getEditorKitForContentType.

Fetches the editor kit to use for the given type of content. This is called when a type is requested that doesn't match the currently installed type. If the component doesn't have an EditorKit registered for the given type, it will try to create an EditorKit from the default EditorKit registry. If that fails, a PlainEditorKit is used on the assumption that all text documents can be represented as plain text.

This method can be reimplemented to use some other kind of type registry. This can be reimplemented to use the Java Activation Framework, for example.

getFrameViewback to summary
pack-priv FrameView getFrameView()