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

pack-priv Class HiddenTagView

extends EditableView
implements DocumentListener
Class Inheritance
All Implemented Interfaces
javax.swing.event.DocumentListener, java.util.EventListener
Known Direct Subclasses
javax.swing.text.html.CommentView
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.*

HiddenTagView subclasses EditableView to contain a JTextField showing the element name. When the textfield is edited the element name is reset. As this inherits from EditableView if the JTextComponent is not editable, the textfield will not be visible.
Author
Scott Violet

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv static final int
pack-priv static final int
pack-priv static final Border
pack-priv boolean
isSettingAttributes

Set to true when setting attributes.

pack-priv static final int
pack-priv static final Border
pack-priv static final int
pack-priv static final Color
pack-priv float
yAlign

Alignment along the y axis, based on the font of the textfield.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
_setTextFromModel()

This resets the text on the text component we created to match that of the AttributeSet for the Element we represent.

pack-priv void
_updateModelFromText()

This copies the text from the text component we've created to the Element's AttributeSet we represent.

public void
changedUpdate(DocumentEvent e)

Implements javax.swing.event.DocumentListener.changedUpdate.

Gives notification that an attribute or set of attributes changed.

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.

protected Component
createComponent()

Overrides javax.swing.text.ComponentView.createComponent.

Create the component that is associated with this view.

public float
getAlignment(int axis)

Overrides javax.swing.text.ComponentView.getAlignment.

Determines the desired alignment for this view along an axis.

public float
getMaximumSpan(int axis)

Overrides javax.swing.text.html.EditableView.getMaximumSpan.

Determines the maximum span for this view along an axis.

public float
getMinimumSpan(int axis)

Overrides javax.swing.text.html.EditableView.getMinimumSpan.

Determines the minimum span for this view along an axis.

public float
getPreferredSpan(int axis)

Overrides javax.swing.text.html.EditableView.getPreferredSpan.

Determines the preferred span for this view along an axis.

pack-priv String
pack-priv JTextComponent
public void
insertUpdate(DocumentEvent e)

Implements javax.swing.event.DocumentListener.insertUpdate.

Gives notification that there was an insert into the document.

pack-priv boolean
public void
removeUpdate(DocumentEvent e)

Implements javax.swing.event.DocumentListener.removeUpdate.

Gives notification that a portion of the document has been removed.

pack-priv void
pack-priv void
setTextFromModel()

This resets the text on the text component we created to match that of the AttributeSet for the Element we represent.

pack-priv void
updateModelFromText()

This copies the text from the text component we've created to the Element's AttributeSet we represent.

pack-priv void
Inherited from javax.swing.text.html.EditableView:
isVisiblepaintsetParent

Field Detail

circleDback to summary
pack-priv static final int circleD
circleRback to summary
pack-priv static final int circleR
EndBorderback to summary
pack-priv static final Border EndBorder
isSettingAttributesback to summary
pack-priv boolean isSettingAttributes

Set to true when setting attributes.

paddingback to summary
pack-priv static final int padding
StartBorderback to summary
pack-priv static final Border StartBorder
tagSizeback to summary
pack-priv static final int tagSize
UnknownTagBorderColorback to summary
pack-priv static final Color UnknownTagBorderColor
yAlignback to summary
pack-priv float yAlign

Alignment along the y axis, based on the font of the textfield.

Constructor Detail

HiddenTagViewback to summary
pack-priv HiddenTagView(Element e)

Method Detail

_setTextFromModelback to summary
pack-priv void _setTextFromModel()

This resets the text on the text component we created to match that of the AttributeSet for the Element we represent.

_updateModelFromTextback to summary
pack-priv void _updateModelFromText()

This copies the text from the text component we've created to the Element's AttributeSet we represent.

changedUpdateback to summary
public void changedUpdate(DocumentEvent e)

Implements javax.swing.event.DocumentListener.changedUpdate.

Doc from javax.swing.event.DocumentListener.changedUpdate.

Gives notification that an attribute or set of attributes changed.

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

Overrides javax.swing.text.View.changedUpdate.

Doc from javax.swing.text.View.changedUpdate.

Gives notification from the document that attributes were changed in a location that this view is responsible for. To reduce the burden to subclasses, this functionality is spread out into the following calls that subclasses can reimplement:

  1. updateChildren is called if there were any changes to the element this view is responsible for. If this view has child views that are represent the child elements, then this method should do whatever is necessary to make sure the child views correctly represent the model.
  2. forwardUpdate is called to forward the DocumentEvent to the appropriate child views.
  3. updateLayout is called to give the view a chance to either repair its layout, to reschedule layout, or do nothing.
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.

getAlignmentback to summary
public float getAlignment(int axis)

Overrides javax.swing.text.ComponentView.getAlignment.

Doc from javax.swing.text.ComponentView.getAlignment.

Determines the desired alignment for this view along an axis. This is implemented to give the alignment of the embedded component.

getMaximumSpanback to summary
public float getMaximumSpan(int axis)

Overrides javax.swing.text.html.EditableView.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.html.EditableView.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.html.EditableView.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.

getRepresentedTextback to summary
pack-priv String getRepresentedText()
getTextComponentback to summary
pack-priv JTextComponent getTextComponent()
insertUpdateback to summary
public void insertUpdate(DocumentEvent e)

Implements javax.swing.event.DocumentListener.insertUpdate.

Doc from javax.swing.event.DocumentListener.insertUpdate.

Gives notification that there was an insert into the document. The range given by the DocumentEvent bounds the freshly inserted region.

isEndTagback to summary
pack-priv boolean isEndTag()
removeUpdateback to summary
public void removeUpdate(DocumentEvent e)

Implements javax.swing.event.DocumentListener.removeUpdate.

Doc from javax.swing.event.DocumentListener.removeUpdate.

Gives notification that a portion of the document has been removed. The range is given in terms of what the view last saw (that is, before updating sticky positions).

resetBorderback to summary
pack-priv void resetBorder()
setTextFromModelback to summary
pack-priv void setTextFromModel()

This resets the text on the text component we created to match that of the AttributeSet for the Element we represent.

If this is invoked on the event dispatching thread, this directly invokes _setTextFromModel, otherwise SwingUtilities.invokeLater is used to schedule execution of _setTextFromModel.

updateModelFromTextback to summary
pack-priv void updateModelFromText()

This copies the text from the text component we've created to the Element's AttributeSet we represent.

If this is invoked on the event dispatching thread, this directly invokes _updateModelFromText, otherwise SwingUtilities.invokeLater is used to schedule execution of _updateModelFromText.

updateYAlignback to summary
pack-priv void updateYAlign(Font font)
Annotations
@SuppressWarnings:deprecation
javax.swing.text.html back to summary

pack-priv Class HiddenTagView.EndTagBorder

extends Object
implements Border, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, javax.swing.border.Border
Annotations
@SuppressWarnings:serial

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Insets
getBorderInsets(Component c)

Implements javax.swing.border.Border.getBorderInsets.

Returns the insets of the border.

public boolean
isBorderOpaque()

Implements javax.swing.border.Border.isBorderOpaque.

Returns whether or not the border is opaque.

public void
paintBorder(Component c, Graphics g, int x, int y, int width, int height)

Implements javax.swing.border.Border.paintBorder.

Paints the border for the specified component with the specified position and size.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

EndTagBorderback to summary
pack-priv EndTagBorder()

Method Detail

getBorderInsetsback to summary
public Insets getBorderInsets(Component c)

Implements javax.swing.border.Border.getBorderInsets.

Doc from javax.swing.border.Border.getBorderInsets.

Returns the insets of the border.

isBorderOpaqueback to summary
public boolean isBorderOpaque()

Implements javax.swing.border.Border.isBorderOpaque.

Doc from javax.swing.border.Border.isBorderOpaque.

Returns whether or not the border is opaque. If the border is opaque, it is responsible for filling in it's own background when painting.

paintBorderback to summary
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height)

Implements javax.swing.border.Border.paintBorder.

Doc from javax.swing.border.Border.paintBorder.

Paints the border for the specified component with the specified position and size.

javax.swing.text.html back to summary

pack-priv Class HiddenTagView.StartTagBorder

extends Object
implements Border, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, javax.swing.border.Border
Annotations
@SuppressWarnings:serial

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Insets
getBorderInsets(Component c)

Implements javax.swing.border.Border.getBorderInsets.

Returns the insets of the border.

public boolean
isBorderOpaque()

Implements javax.swing.border.Border.isBorderOpaque.

Returns whether or not the border is opaque.

public void
paintBorder(Component c, Graphics g, int x, int y, int width, int height)

Implements javax.swing.border.Border.paintBorder.

Paints the border for the specified component with the specified position and size.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

StartTagBorderback to summary
pack-priv StartTagBorder()

Method Detail

getBorderInsetsback to summary
public Insets getBorderInsets(Component c)

Implements javax.swing.border.Border.getBorderInsets.

Doc from javax.swing.border.Border.getBorderInsets.

Returns the insets of the border.

isBorderOpaqueback to summary
public boolean isBorderOpaque()

Implements javax.swing.border.Border.isBorderOpaque.

Doc from javax.swing.border.Border.isBorderOpaque.

Returns whether or not the border is opaque. If the border is opaque, it is responsible for filling in it's own background when painting.

paintBorderback to summary
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height)

Implements javax.swing.border.Border.paintBorder.

Doc from javax.swing.border.Border.paintBorder.

Paints the border for the specified component with the specified position and size.