Extension SDK 10.1.2

oracle.javatools.editor.underline
Class UnderlineRegistry

java.lang.Object
  extended byoracle.javatools.editor.underline.UnderlineRegistry

public final class UnderlineRegistry
extends java.lang.Object

A UnderlineRegistry is a registry of all known underline styles used for text underlining.


Field Summary
static int DOUBLE_DOTTED_SEPARATOR
          This is similar to DOUBLE_LINE_SEPARATOR except that the separator is dotted instead of being solid.
static int DOUBLE_DOTTED_UNDERLINE
          This is similar to DOUBLE_UNDERLINE except that the separator is dotted instead of being solid.
static int DOUBLE_LINE_SEPARATOR
          This is a double-pixel thickness (solid) line separator that is positioned at the bottom of the text area (below the baseline by descent pixels.) It is intended to be used to separate regions of text in the editor view.
static int DOUBLE_UNDERLINE
          This is a double-pixel (solid) underline that is positioned at the baseline of the text.
static int LAST_UNDERLINE
          Last valid underline index.
static int PERFORATED_SEPARATOR
          This is similar to SINGLE_DOTTED_SEPARATOR with shorter dots and gaps (really subtle).
static java.lang.String PROPERTY_UNDERLINE_CHANGED
          Name of the pseudo-property that the UnderlineRegistry uses to notify listeners (views) that settings in the registry have changed.
static int SINGLE_DOTTED_SEPARATOR
          This is similar to SINGLE_LINE_SEPARATOR except that the separator is dotted instead of being solid.
static int SINGLE_DOTTED_UNDERLINE
          This is similar to SINGLE_UNDERLINE except that the separator is dotted instead of being solid.
static int SINGLE_LINE_SEPARATOR
          This is a single-pixel thickness (solid) line separator that is positioned at the bottom of the text area (below the baseline by descent pixels.) It is intended to be used to separate regions of text in the editor view.
static int SINGLE_UNDERLINE
          This is a single-pixel (solid) underline that is positioned at the baseline of the text.
static int ZIGZAG_UNDERLINE
          This is a zig-zag (squiggly) underline, similar to what Microsoft Word uses to flag spelling errors.
 
Constructor Summary
UnderlineRegistry()
          Constructs a new underline registry.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds a PropertyChangeListener to this registry to track changes to styles.
 java.lang.Object clone()
          Creates and returns a copy of this class.
 UnderlineStyle createStyle(java.lang.String styleName, java.lang.String presentationName, boolean enabled, int priority, java.awt.Color color, int shapeIndex)
          Create a new UnderlineStyle with the given name and attributes.
 java.util.Iterator getStyleIterator()
          Fetch an Iterator for all of the styles within this registry.
 UnderlineStyle lookupStyle(java.lang.String styleName)
          Fetches the style with the given name.
 void modifyStyle(java.lang.String styleName, boolean enabled, int priority, java.awt.Color color, int shapeIndex)
          Modifies this style's attributes.
 void modifyStyle(java.lang.String styleName, boolean enabled, int priority, java.awt.Color color, UnderlinePainter painter)
          Modifies this style's attributes.
 void modifyStyleColor(java.lang.String styleName, java.awt.Color color)
          Modifies the style's color attributes.
 void modifyStyleEnabled(java.lang.String styleName, boolean enabled)
          Modifies the style's enabled status.
 void modifyStylePriority(java.lang.String styleName, int priority)
          Modifies the style's priority attribute.
 void modifyStyleShape(java.lang.String styleName, int shapeIndex)
          Modifies the style's underline shape attribute.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes a PropertyChangeListener from this registry.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SINGLE_LINE_SEPARATOR

public static final int SINGLE_LINE_SEPARATOR
This is a single-pixel thickness (solid) line separator that is positioned at the bottom of the text area (below the baseline by descent pixels.) It is intended to be used to separate regions of text in the editor view.

See Also:
Constant Field Values

DOUBLE_LINE_SEPARATOR

public static final int DOUBLE_LINE_SEPARATOR
This is a double-pixel thickness (solid) line separator that is positioned at the bottom of the text area (below the baseline by descent pixels.) It is intended to be used to separate regions of text in the editor view.

See Also:
Constant Field Values

SINGLE_DOTTED_SEPARATOR

public static final int SINGLE_DOTTED_SEPARATOR
This is similar to SINGLE_LINE_SEPARATOR except that the separator is dotted instead of being solid.

See Also:
Constant Field Values

DOUBLE_DOTTED_SEPARATOR

public static final int DOUBLE_DOTTED_SEPARATOR
This is similar to DOUBLE_LINE_SEPARATOR except that the separator is dotted instead of being solid.

See Also:
Constant Field Values

PERFORATED_SEPARATOR

public static final int PERFORATED_SEPARATOR
This is similar to SINGLE_DOTTED_SEPARATOR with shorter dots and gaps (really subtle).

See Also:
Constant Field Values

SINGLE_UNDERLINE

public static final int SINGLE_UNDERLINE
This is a single-pixel (solid) underline that is positioned at the baseline of the text. It is intended to be used to underline a run of text.

See Also:
Constant Field Values

DOUBLE_UNDERLINE

public static final int DOUBLE_UNDERLINE
This is a double-pixel (solid) underline that is positioned at the baseline of the text. It is intended to be used to underline a run of text.

See Also:
Constant Field Values

SINGLE_DOTTED_UNDERLINE

public static final int SINGLE_DOTTED_UNDERLINE
This is similar to SINGLE_UNDERLINE except that the separator is dotted instead of being solid.

See Also:
Constant Field Values

DOUBLE_DOTTED_UNDERLINE

public static final int DOUBLE_DOTTED_UNDERLINE
This is similar to DOUBLE_UNDERLINE except that the separator is dotted instead of being solid.

See Also:
Constant Field Values

ZIGZAG_UNDERLINE

public static final int ZIGZAG_UNDERLINE
This is a zig-zag (squiggly) underline, similar to what Microsoft Word uses to flag spelling errors.

See Also:
Constant Field Values

LAST_UNDERLINE

public static final int LAST_UNDERLINE
Last valid underline index.

See Also:
Constant Field Values

PROPERTY_UNDERLINE_CHANGED

public static final java.lang.String PROPERTY_UNDERLINE_CHANGED
Name of the pseudo-property that the UnderlineRegistry uses to notify listeners (views) that settings in the registry have changed.

See Also:
Constant Field Values
Constructor Detail

UnderlineRegistry

public UnderlineRegistry()
Constructs a new underline registry.

Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener to this registry to track changes to styles.

Parameters:
listener - the listener to be added

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a PropertyChangeListener from this registry.

Parameters:
listener - the listener to be removed

getStyleIterator

public java.util.Iterator getStyleIterator()
Fetch an Iterator for all of the styles within this registry. Note that some of these styles may not be completely initialized - clients that use this style list for the purposes of display a list of available styles should call lookupStyle() on each style to ensure that the given style has been initialized properly.

Returns:
an iterator for all styles

clone

public java.lang.Object clone()
Creates and returns a copy of this class. This will return a completely independent UnderlineRegistry with a copy of its own styles separate from this one.

Returns:
a copy of this UnderlineRegistry

createStyle

public UnderlineStyle createStyle(java.lang.String styleName,
                                  java.lang.String presentationName,
                                  boolean enabled,
                                  int priority,
                                  java.awt.Color color,
                                  int shapeIndex)
Create a new UnderlineStyle with the given name and attributes. Note that if the specified underline shape is invalid, it will automatically be substituted with SINGLE_UNDERLINE.

Parameters:
styleName - the name of the style
presentationName - the presentation or public name of the style that can be used for UI purposes
enabled - whether the underline is enabled by default
priority - the priority of the underline
color - the color of the underline
shapeIndex - the pre-defined underline shape to use

lookupStyle

public UnderlineStyle lookupStyle(java.lang.String styleName)
Fetches the style with the given name.

Returns:
the style with the given name, or null if it is not found

modifyStyleEnabled

public void modifyStyleEnabled(java.lang.String styleName,
                               boolean enabled)
Modifies the style's enabled status.

Parameters:
styleName - the name of the style to modify
enabled - the enabled status of the style

modifyStylePriority

public void modifyStylePriority(java.lang.String styleName,
                                int priority)
Modifies the style's priority attribute.

Parameters:
styleName - the name of the style to modify
priority - the new priority to use

modifyStyleColor

public void modifyStyleColor(java.lang.String styleName,
                             java.awt.Color color)
Modifies the style's color attributes.

Parameters:
styleName - the name of the style to modify
color - the underline color to use

modifyStyleShape

public void modifyStyleShape(java.lang.String styleName,
                             int shapeIndex)
Modifies the style's underline shape attribute. Note that if the specified underline shape is invalid, it will automatically be substituted with SINGLE_UNDERLINE.

Parameters:
styleName - the name of the style to modify
shapeIndex - the pre-defined underline shape to use

modifyStyle

public void modifyStyle(java.lang.String styleName,
                        boolean enabled,
                        int priority,
                        java.awt.Color color,
                        int shapeIndex)
Modifies this style's attributes. If the style has not yet been created or initialized, these settings will be stored and applied when the style is actually created by the owner of the style. Note that if the specified underline shape is invalid, it will automatically be substituted with SINGLE_UNDERLINE.

Parameters:
styleName - the name of the style to modify
enabled - whether the underline is enabled by default
priority - the priority of the underline
color - the color of the underline
shapeIndex - the pre-defined underline shape to use

modifyStyle

public void modifyStyle(java.lang.String styleName,
                        boolean enabled,
                        int priority,
                        java.awt.Color color,
                        UnderlinePainter painter)
Modifies this style's attributes. If the style has not yet been created or initialized, these settings will be stored and applied when the style is actually created by the owner of the style.

Parameters:
styleName - the name of the style to modify
enabled - whether the underline is enabled by default
priority - the priority of the underline
color - the color of the underline
painter - the UnderlinePainter to use

Extension SDK

 

Copyright © 1997, 2004, Oracle. All rights reserved.