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

pack-priv Class EditableView

extends ComponentView
Class Inheritance
Known Direct Subclasses
javax.swing.text.html.HiddenTagView
Imports
java.awt.*, java.awt.event.*, java.io.*, java.net.MalformedURLException, .URL, javax.swing.text.*, javax.swing.*, javax.swing.border.*, javax.swing.event.*, java.util.*

EditableView sets the view it contains to be visible only when the JTextComponent the view is contained in is editable. The min/pref/max size is 0 when not visible.
Author
Scott Violet

Field Summary

Modifier and TypeField and Description
private boolean
isVisible

Set to true if the component is visible.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public float
getMaximumSpan(int axis)

Overrides javax.swing.text.ComponentView.getMaximumSpan.

Determines the maximum span for this view along an axis.

public float
getMinimumSpan(int axis)

Overrides javax.swing.text.ComponentView.getMinimumSpan.

Determines the minimum span for this view along an axis.

public float
getPreferredSpan(int axis)

Overrides javax.swing.text.ComponentView.getPreferredSpan.

Determines the preferred span for this view along an axis.

public boolean

Returns:

true if the Component is visible.
isVisible
()

Overrides javax.swing.text.View.isVisible.

Returns a boolean that indicates whether the view is visible or not.

public void
paint(Graphics g, Shape allocation)

Overrides javax.swing.text.ComponentView.paint.

The real paint behavior occurs naturally from the association that the component has with its parent container (the same container hosting this view).

public void
setParent(View parent)

Overrides javax.swing.text.ComponentView.setParent.

Sets the parent for a child view.

Inherited from javax.swing.text.ComponentView:
createComponentgetAlignmentgetComponentmodelToViewviewToModel

Field Detail

isVisibleback to summary
private boolean isVisible

Set to true if the component is visible. This is based off the editability of the container.

Constructor Detail

EditableViewback to summary
pack-priv EditableView(Element e)

Method Detail

getMaximumSpanback to summary
public float getMaximumSpan(int axis)

Overrides javax.swing.text.ComponentView.getMaximumSpan.

Doc from javax.swing.text.ComponentView.getMaximumSpan.

Determines the maximum span for this view along an axis. This is implemented to return the value returned by Component.getMaximumSize along the axis of interest.

getMinimumSpanback to summary
public float getMinimumSpan(int axis)

Overrides javax.swing.text.ComponentView.getMinimumSpan.

Doc from javax.swing.text.ComponentView.getMinimumSpan.

Determines the minimum span for this view along an axis. This is implemented to return the value returned by Component.getMinimumSize along the axis of interest.

getPreferredSpanback to summary
public float getPreferredSpan(int axis)

Overrides javax.swing.text.ComponentView.getPreferredSpan.

Doc from javax.swing.text.ComponentView.getPreferredSpan.

Determines the preferred span for this view along an axis. This is implemented to return the value returned by Component.getPreferredSize along the axis of interest.

isVisibleback to summary
public boolean isVisible()

Overrides javax.swing.text.View.isVisible.

Doc from javax.swing.text.View.isVisible.

Returns a boolean that indicates whether the view is visible or not. By default all views are visible.

Returns:boolean

true if the Component is visible.

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

Overrides javax.swing.text.ComponentView.paint.

Doc from javax.swing.text.ComponentView.paint.

The real paint behavior occurs naturally from the association that the component has with its parent container (the same container hosting this view). This is implemented to do nothing.

setParentback to summary
public void setParent(View parent)

Overrides javax.swing.text.ComponentView.setParent.

Doc from javax.swing.text.ComponentView.setParent.

Sets the parent for a child view. The parent calls this on the child to tell it who its parent is, giving the view access to things like the hosting Container. The superclass behavior is executed, followed by a call to createComponent if the parent view parameter is non-null and a component has not yet been created. The embedded components parent is then set to the value returned by getContainer. If the parent view parameter is null, this view is being cleaned up, thus the component is removed from its parent.

The changing of the component hierarchy will touch the component lock, which is the one thing that is not safe from the View hierarchy. Therefore, this functionality is executed immediately if on the event thread, or is queued on the event queue if called from another thread (notification of change from an asynchronous update).