Oracle JEWT API Reference
Release 4.2.24.0.0
B12199-01

oracle.bali.ewt.text
Class MultiLineLabel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--oracle.bali.ewt.painter.PaintContextComponent
                          |
                          +--oracle.bali.ewt.LWComponent
                                |
                                +--oracle.bali.ewt.scrolling.ScrollableComponent
                                      |
                                      +--oracle.bali.ewt.text.MultiLineLabel
All Implemented Interfaces:
javax.accessibility.Accessible, oracle.bali.ewt.dnd.Autoscroll, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.Scrollable, java.io.Serializable

public class MultiLineLabel
extends oracle.bali.ewt.scrolling.ScrollableComponent
implements javax.accessibility.Accessible

A component that displays multiple lines of read-only text. The MultiLineLabel supports:

Note that the MultiLineLabel calculates it's preferred size, and lays out, according to the following rules:

  1. If both the preferred rows and preferred columns have been set, then the preferred size will be determined directly from them.
  2. If the preferred columns have been set, the preferred height will be calculated based on the number of rows necessary to show the entire text.
  3. If the preferred rows have been set, the preferred width will be calculated based on the number of columns necessary to show the entire text.
  4. If neither preferred rows or preferred columns are set, then the aspect ratio is used to determine the preferred width and height that will encompass the entire text. The default aspect ratio is 4.0f. Clients can disable the aspect ratio by using ASPECTRATIO_NONE.
  5. If ASPECTRATIO_NONE is used then the preferredSize of the MultiLineLabel will be always calculated dynamically based on the current width of the label. If the width is 0, then the default aspect ratio will be used.

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
static int ALIGNMENT_CENTER
          Constant to specify center alignment of MultiLineLabel.
static int ALIGNMENT_DEFAULT
          Constant to specify default alignment of MultiLineLabel.
static int ALIGNMENT_LEFT
          Constant to specify left alignment of MultiLineLabel.
static int ALIGNMENT_RIGHT
          Constant to specify right alignment of MultiLineLabel.
static float ASPECTRATIO_NONE
          Constant to specify that the MultLineLabel has no preferred aspect ratio.
static int NOT_SET
          Constant used to indicate to setPreferredRows() or setPreferredColumns() that the columns or rows should be calculated dynamically.
static java.lang.String PROPERTY_TEXT
          Constant to specify text property.
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
MultiLineLabel()
          Creates an empty MultilineLabel.
MultiLineLabel(java.lang.String text)
          Creates a MultiLineLabel displaying text wrapped on carriage returns.
MultiLineLabel(TextWrapper wrapper, java.lang.String text)
          Creates a MultiLineLabel displaying text wrapped by the wrapper TextWrapper.
 
Method Summary
 void addNotify()
          Override of ScrollableComponent.addNotify().
 javax.swing.JToolTip createToolTip()
          Override to create a MultiLineToolTip by default.
 void doLayout()
          Overrides Component.doLayout() to validate the MultiLineLabel's layout.
 javax.accessibility.AccessibleContext getAccessibleContext()
          Get the AccessibleContext of this object
 java.awt.Color getForeground()
          Override to dynamically return the color if it's defaulted.
 int getMaximumColumns()
          Returns the maximum allowable number of columns.
 int getMaximumRows()
          Returns the maximum allowable number of rows.
 java.awt.Dimension getMaximumSize()
          Override to return maximum size based on maximumColumns and maximumRows.
 int getMinimumColumns()
          Returns the minimum allowable number of columns.
 int getMinimumRows()
          Returns the minimum allowable number of rows.
 java.awt.Dimension getMinimumSize()
          Override of getMinimumSize().
 float getPreferredAspectRatio()
          Returns how much wider than tall the MultiLineLabel prefers to be.
 int getPreferredColumns()
          Returns the preferred number of columns to show, or NOT_SET if none have been set.
 int getPreferredRows()
          Returns the preferred number of rows to show, or NOT_SET if none have been set.
 java.awt.Dimension getPreferredScrollableViewportSize()
          Returns the preferred size of the viewport for a view component.
 boolean getScrollableTracksViewportWidth()
          Returns true if a viewport should always force the width of this Scrollable to match the width of the viewport.
 java.lang.String getText()
          Returns the text displayed by the MultiLineLabel.
 TextWrapper getTextWrapper()
          Returns the TextWrapper used to wrap this MultiLineLabel's text.
protected  int getVMaximum()
          Protected method used to configure the vertical scroll manager range.
protected  int getVOffsetOfValue(int value)
          Protected method used to get the vertical scroll value for a canvas offset.
protected  int getVValueOfOffset(int y)
          Protected method used to get the vertical offset for a scroll manager value.
 boolean isForceWrapping()
          Returns whether the the MultiLineLabel forces the words to fit in its width if line wrapping policy is true.
 boolean isFullyJustified()
          Returns whether the MultiLineLabel is being displayed with full justification.
 boolean isHScrollable()
          Override ScrollableComponent.isHScrollable to return true, since MultiLineLabels support horizontal scrolling.
 boolean isVerticalShrinking()
          Returns whether the MultiLineLabel vertically shrinks when the width of the label increases.
 boolean isVScrollable()
          Override ScrollableComponent.isVScrollable to return true, since MultiLineLabels support vertical scrolling.
protected  java.awt.Dimension layoutCanvas()
          Implementation of Scrollable interface getContentSize().
protected  void paintCanvasInterior(java.awt.Graphics g)
          Override of LWComponent.paintInterior().
 void setFont(java.awt.Font newFont)
          Override of Component.setFont().
 void setForceWrapping(boolean forceFit)
          Sets whether the MultiLineLabel should force the words to fit in its width if line wrapping policy is true.
 void setForeground(java.awt.Color c)
          Override to mark the foreground color as no longer defaulted.
 void setFullJustification(boolean useFullJustification)
          Sets whether the text displayed in the MultiLineLabel is fully justified.
 void setLocale(java.util.Locale newLocale)
          Override of setLocale().
 void setMaximumColumns(int columns)
          Sets the maximum number of columns allowable.
 void setMaximumRows(int rows)
          Sets the maximum number of rows allowable.
 void setMaximumSize(java.awt.Dimension maximumSize)
          Override to reset maximum columns and maximum rows to NOT_SET.
 void setMinimumColumns(int columns)
          Sets the minimum numberof columns allowable.
 void setMinimumRows(int rows)
          Sets the minimum number of rows allowable.
 void setMinimumSize(java.awt.Dimension minimumSize)
          Override to reset minimum columns and minimum rows to NOT_SET.
 void setPreferredAspectRatio(float preferredAspectRation)
          Sets how much wider than tall the MultiLineLabel prefers to be.
 void setPreferredColumns(int columns)
          Sets the preferred number of columns to show; columns may be the NOT_SET value indicating that the preferred width should be calculated dynamically based on other factors.
 void setPreferredRows(int rows)
          Sets the preferred number of rows to show; rows may be the NOT_SET value indicating that the preferred height should be calculated dynamically based on other factors.
 void setText(java.lang.String label)
          Sets the text to be displayed by the MultiLineLabel.
 void setTextWrapper(TextWrapper newWrapper)
          Sets the TextWrapper to use when wrapping text.
 void setVerticalShrinking(boolean shrink)
          Sets whether the MultiLineLabel should vertically shrink when the width of the label is increased.
 void updateUI()
          Notification that the LookAndFeel has changed.
 
Methods inherited from class oracle.bali.ewt.scrolling.ScrollableComponent
autoscroll, clipCanvasToParents, convertCanvasToOuter, convertInnerToOuterSize, convertInnerToOuterSize, convertInteriorToOuter, convertOuterToCanvas, convertOuterToInterior, getAutoscrollInsets, getCanvasBounds, getCanvasGraphics, getCanvasHeight, getCanvasOrigin, getCanvasOriginX, getCanvasOriginY, getCanvasSize, getCanvasWidth, getDocumentSize, getHMaximum, getHOffsetOfValue, getHValueOfOffset, getInnerBounds, getInnerHeight, getInnerOrigin, getInnerSize, getInnerWidth, getPreferredSize, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableUnitIncrement, getScrollParent, getViewport, invalidateCanvas, layout, makeCanvasGraphics, paintComponent, paintImmediateCanvas, printPage, removeNotify, repaintCanvas, setCanvasBounds, setCanvasOrigin, setCanvasSize, setPreferredSize
 
Methods inherited from class oracle.bali.ewt.LWComponent
clipToParents, freezeRepaints, getActualAlignment, getActualReadingDirection, getAlignment, getBorderInsets, getFill, getPageBounds, getPrintPaintContext, isFocusTraversable, paintChildren, paintImmediateInterior, paintImmediateInterior, paintImmediately, paintOverChildren, processEvent, processEventImpl, repaint, repaintInterior, repaintInterior, setAlignment, setFill, unfreezeRepaints
 
Methods inherited from class oracle.bali.ewt.painter.PaintContextComponent
getBorderContext, getPaintContext, getPaintData, getPaintState, getUIDefaults, setUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getNextFocusableComponent, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getUIClassID, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setInputMap, setInputVerifier, setNextFocusableComponent, setOpaque, setRequestFocusEnabled, setToolTipText, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NOT_SET

public static final int NOT_SET
Constant used to indicate to setPreferredRows() or setPreferredColumns() that the columns or rows should be calculated dynamically.

ALIGNMENT_DEFAULT

public static final int ALIGNMENT_DEFAULT
Constant to specify default alignment of MultiLineLabel.

ALIGNMENT_LEFT

public static final int ALIGNMENT_LEFT
Constant to specify left alignment of MultiLineLabel.

ALIGNMENT_RIGHT

public static final int ALIGNMENT_RIGHT
Constant to specify right alignment of MultiLineLabel.

ALIGNMENT_CENTER

public static final int ALIGNMENT_CENTER
Constant to specify center alignment of MultiLineLabel.

PROPERTY_TEXT

public static final java.lang.String PROPERTY_TEXT
Constant to specify text property.

ASPECTRATIO_NONE

public static final float ASPECTRATIO_NONE
Constant to specify that the MultLineLabel has no preferred aspect ratio.
See Also:
getPreferredAspectRatio(), setPreferredAspectRatio(float), setVerticalShrinking(boolean)
Constructor Detail

MultiLineLabel

public MultiLineLabel()
Creates an empty MultilineLabel.

MultiLineLabel

public MultiLineLabel(java.lang.String text)
Creates a MultiLineLabel displaying text wrapped on carriage returns.

Parameters:
text - The text to disply in the MultiLineLabel

MultiLineLabel

public MultiLineLabel(TextWrapper wrapper,
                      java.lang.String text)
Creates a MultiLineLabel displaying text wrapped by the wrapper TextWrapper.

Parameters:
wrapper - The textWrapper to use to wrap the MultiLineLabel's text.
text - The text to disply in the MultiLineLabel

See Also:
TextWrapper
Method Detail

setText

public void setText(java.lang.String label)
Sets the text to be displayed by the MultiLineLabel. The text will be wrapped by the MultiLineLabel's current textWrapper at the MultiLineLabel's current width.

Fires PROPERTY_TEXT ("text") property change event.

Parameters:
label - The text to display in the MultiLineLabel

See Also:
getText()

getText

public java.lang.String getText()
Returns the text displayed by the MultiLineLabel.

See Also:
setText(java.lang.String)

setTextWrapper

public void setTextWrapper(TextWrapper newWrapper)
Sets the TextWrapper to use when wrapping text.

Parameters:
newWrapper - The TextWrapper to use to wrap this MultiLineLabel

See Also:
getTextWrapper(), TextWrapper

getTextWrapper

public TextWrapper getTextWrapper()
Returns the TextWrapper used to wrap this MultiLineLabel's text.

See Also:
setTextWrapper(oracle.bali.ewt.text.TextWrapper)

getMaximumColumns

public int getMaximumColumns()
Returns the maximum allowable number of columns. If setMaximumSize() has been called, or the maximum number of columns was never set, this will return NOT_SET. This maximumColumns will be used only for calculating the maximumSize of the MultiLineLabel. Note that only very few layoutManagers like BoxLayout respects the component's maximumSize.
See Also:
setMaximumColumns(int), getMaximumRows(), setMaximumRows(int)

setMaximumColumns

public void setMaximumColumns(int columns)
Sets the maximum number of columns allowable. This maximumColumns will be used only for calculating the maximumSize of the MultiLineLabel. Note that only very few layoutManagers like BoxLayout respects the component's maximumSize.
See Also:
getMaximumColumns(), getMaximumRows(), setMaximumRows(int)

getMaximumRows

public int getMaximumRows()
Returns the maximum allowable number of rows. If setMaximumSize() has been called, or the maximum number of rows was never set, this will return NOT_SET. This maximumRows will be used only for calculating the maximumSize of the MultiLineLabel. Note that only very few layoutManagers like BoxLayout respects the component's maximumSize.
See Also:
setMaximumRows(int), getMaximumColumns(), setMaximumColumns(int)

setMaximumRows

public void setMaximumRows(int rows)
Sets the maximum number of rows allowable. This maximumRows will be used only for calculating the maximumSize of the MultiLineLabel. Note that only very few layoutManagers like BoxLayout respects the component's maximumSize.
See Also:
getMaximumRows(), getMaximumColumns(), setMaximumColumns(int)

getMaximumSize

public java.awt.Dimension getMaximumSize()
Override to return maximum size based on maximumColumns and maximumRows.
Overrides:
getMaximumSize in class javax.swing.JComponent

setMaximumSize

public void setMaximumSize(java.awt.Dimension maximumSize)
Override to reset maximum columns and maximum rows to NOT_SET.
Overrides:
setMaximumSize in class javax.swing.JComponent

getMinimumColumns

public int getMinimumColumns()
Returns the minimum allowable number of columns. The default minimum is NOT_SET. This minimumColumns will be used only for calculating the minimumSize of the MultiLineLabel. Note that only very few layoutManagers like BoxLayout and GridBagLayout respects the component's minimumSize.
See Also:
setMinimumColumns(int), getMinimumRows(), setMinimumRows(int)

setMinimumColumns

public void setMinimumColumns(int columns)
Sets the minimum numberof columns allowable. This minimumColumns will be used only for calculating the minimumSize of the MultiLineLabel. Note that only very few layoutManagers like BoxLayout and GridBagLayout respects the component's minimumSize.
See Also:
getMinimumColumns(), getMinimumRows(), setMinimumRows(int)

setMinimumSize

public void setMinimumSize(java.awt.Dimension minimumSize)
Override to reset minimum columns and minimum rows to NOT_SET.
Overrides:
setMinimumSize in class javax.swing.JComponent

getMinimumRows

public int getMinimumRows()
Returns the minimum allowable number of rows. The default minimum is NOT_SET. If setMinimumSize() has been called, this will return NOT_SET. This minimumRows will be used only for calculating the minimumSize of the MultiLineLabel. Note that only very few layoutManagers like BoxLayout and GridBagLayout respects the component's minimumSize.
See Also:
setMinimumRows(int), getMinimumColumns(), setMinimumColumns(int)

setMinimumRows

public void setMinimumRows(int rows)
Sets the minimum number of rows allowable. If clients explicitly call setMinimumSize() after this call, then the minimum rows will be changed to NOT_SET and the minimum size call will take precedence. This minimumRows will be used only for calculating the minimumSize of the MultiLineLabel. Note that only very few layoutManagers like BoxLayout and GridBagLayout respects the component's minimumSize.
See Also:
getMinimumRows(), getMinimumColumns(), setMinimumColumns(int)

setPreferredColumns

public void setPreferredColumns(int columns)
Sets the preferred number of columns to show; columns may be the NOT_SET value indicating that the preferred width should be calculated dynamically based on other factors.
See Also:
getPreferredColumns(), getPreferredRows(), setPreferredRows(int), setVerticalShrinking(boolean)

getPreferredColumns

public int getPreferredColumns()
Returns the preferred number of columns to show, or NOT_SET if none have been set.
See Also:
setPreferredColumns(int), getPreferredRows(), setPreferredRows(int)

setPreferredRows

public void setPreferredRows(int rows)
Sets the preferred number of rows to show; rows may be the NOT_SET value indicating that the preferred height should be calculated dynamically based on other factors.
See Also:
getPreferredRows(), setPreferredColumns(int), getPreferredColumns(), setVerticalShrinking(boolean)

getPreferredRows

public int getPreferredRows()
Returns the preferred number of rows to show, or NOT_SET if none have been set.
See Also:
setPreferredRows(int), setPreferredColumns(int), getPreferredColumns()

setFullJustification

public void setFullJustification(boolean useFullJustification)
Sets whether the text displayed in the MultiLineLabel is fully justified. Note that full justification is independent of the MultiLineLabel's justification, since lines terminated by carriage returns are never fully justified. Instead, they are displayed using the MultiLineLabel's alignment.

Parameters:
useFullJustification - Whether the MuliLineLabel should be displayed with full justification.

See Also:
isFullyJustified()

isFullyJustified

public boolean isFullyJustified()
Returns whether the MultiLineLabel is being displayed with full justification.

See Also:
setFullJustification(boolean)

setPreferredAspectRatio

public void setPreferredAspectRatio(float preferredAspectRation)
Sets how much wider than tall the MultiLineLabel prefers to be. This is only used if getPreferredRows() and getPreferredColumns() are both NOT_SET. The default value is 4.0f.

Parameters:
preferredAspectRation - The ratio of width to height that the MultiLineLabel should strive for when returning its preferred size.

If ASPECTRATIO_NONE, then the preferredSize will be calculated based on the current width of the MultiLineLabel. If the current width is 0 (for example, if the label is yet to be laid out) then the default aspect ratio of 4.0f will be used. This is useful when using the MultiLineLabel in constrained layout managers, such as NORTH in a Borderlayout.

See Also:
getPreferredAspectRatio(), ScrollableComponent.getPreferredSize(), setVerticalShrinking(boolean)

getPreferredAspectRatio

public float getPreferredAspectRatio()
Returns how much wider than tall the MultiLineLabel prefers to be. If ASPECTRATIO_NONE is returned, the MultiLineLabel has no preference. The default value is 4.0f.

See Also:
setPreferredAspectRatio(float)

setVerticalShrinking

public void setVerticalShrinking(boolean shrink)
Sets whether the MultiLineLabel should vertically shrink when the width of the label is increased. By default verticalShrinking is true.
If true, then the height shrinks and the text rewraps accordingly. If false, then there won't be any vertical shrinking and rewrapping.
If ASPECTRATIO_NONE is used to calculate the preferredSize of the label, then this method has no effect.
See Also:
isVerticalShrinking()

isVerticalShrinking

public boolean isVerticalShrinking()
Returns whether the MultiLineLabel vertically shrinks when the width of the label increases. By default verticalShrinking is true.
See Also:
setVerticalShrinking(boolean)

setForceWrapping

public void setForceWrapping(boolean forceFit)
Sets whether the MultiLineLabel should force the words to fit in its width if line wrapping policy is true. By default it is false.
See Also:
isForceWrapping()

isForceWrapping

public boolean isForceWrapping()
Returns whether the the MultiLineLabel forces the words to fit in its width if line wrapping policy is true. By default it is false.
See Also:
setForceWrapping(boolean)

getForeground

public java.awt.Color getForeground()
Override to dynamically return the color if it's defaulted.
Overrides:
getForeground in class java.awt.Component

setForeground

public void setForeground(java.awt.Color c)
Override to mark the foreground color as no longer defaulted.
Overrides:
setForeground in class javax.swing.JComponent

setFont

public void setFont(java.awt.Font newFont)
Override of Component.setFont().

MultiLineLabel overrides Component setFont() in order to force relayout of the MultiLineLabel whenever the font changes. Subclasses that override this methods must call super.setFont(font).

Overrides:
setFont in class javax.swing.JComponent

setLocale

public void setLocale(java.util.Locale newLocale)
Override of setLocale().

MultiLineLabel overrides setLocale to catch when the locale changes, since this could potentially result in a relayout due to changes in how different locales wrap text.

Overrides:
setLocale in class java.awt.Component

createToolTip

public javax.swing.JToolTip createToolTip()
Override to create a MultiLineToolTip by default.
Overrides:
createToolTip in class javax.swing.JComponent

updateUI

public void updateUI()
Notification that the LookAndFeel has changed.
Overrides:
updateUI in class oracle.bali.ewt.LWComponent

doLayout

public void doLayout()
Overrides Component.doLayout() to validate the MultiLineLabel's layout.
Overrides:
doLayout in class java.awt.Container

isHScrollable

public boolean isHScrollable()
Override ScrollableComponent.isHScrollable to return true, since MultiLineLabels support horizontal scrolling.

Overrides:
isHScrollable in class oracle.bali.ewt.scrolling.ScrollableComponent
See Also:
ScrollableComponent.isHScrollable()

isVScrollable

public boolean isVScrollable()
Override ScrollableComponent.isVScrollable to return true, since MultiLineLabels support vertical scrolling.

Overrides:
isVScrollable in class oracle.bali.ewt.scrolling.ScrollableComponent
See Also:
ScrollableComponent.isVScrollable()

getVMaximum

protected int getVMaximum()
Protected method used to configure the vertical scroll manager range.

Since MultiLineLabels scroll vertically by lines, we return the number of lines in the MultiLineLabel for this.

Overrides:
getVMaximum in class oracle.bali.ewt.scrolling.ScrollableComponent

getVOffsetOfValue

protected int getVOffsetOfValue(int value)
Protected method used to get the vertical scroll value for a canvas offset.

Since the MultiLineLabel scrolls by lines vertically, we need to convert the line index into a pixel value.

Overrides:
getVOffsetOfValue in class oracle.bali.ewt.scrolling.ScrollableComponent
Parameters:
The - vertical canvas offset in pixels, typically a negative value.

See Also:
getVValueOfOffset(int)

getVValueOfOffset

protected int getVValueOfOffset(int y)
Protected method used to get the vertical offset for a scroll manager value.

Since the MultiLineLabel scrolls by lines vertically, we need to convert the pixel value passed to us to the line in the MultiLineLabel it refers to.

Overrides:
getVValueOfOffset in class oracle.bali.ewt.scrolling.ScrollableComponent
Parameters:
The - vertical value that needs to be converted

layoutCanvas

protected java.awt.Dimension layoutCanvas()
Implementation of Scrollable interface getContentSize().

Returns the size of the MultiLineLabel's content area.

Overrides:
layoutCanvas in class oracle.bali.ewt.scrolling.ScrollableComponent

addNotify

public void addNotify()
Override of ScrollableComponent.addNotify().

MultiLineLabel overrides ScrollableComponent.addNotify() to do some initialization work. Clients that need to override this method must call super.addNotify() so that the MultiLineLabel will get initialized properly.

Overrides:
addNotify in class oracle.bali.ewt.scrolling.ScrollableComponent

paintCanvasInterior

protected void paintCanvasInterior(java.awt.Graphics g)
Override of LWComponent.paintInterior().

MultiLineLabel overrides paintCanvasInterior to actually display the MultiLineLabel. paintCanvasInterior is responsible for the following when rendering the MultiLineLabel's text: Displaying left, right, and center alignment Displaying full justification Displaying the minimum number of lines for the visible portion of a scrolled MultiLineLabel

Note that we do not attempt to optimize horizontal scrolling by logically clipping to the horizontal bounds of the drawRect.

Overrides:
paintCanvasInterior in class oracle.bali.ewt.scrolling.ScrollableComponent
Parameters:
g - The graphics object to draw this MultiLineLabel with
drawRect - The rectangle to redraw. The drawRect is specified in outer coordinates.

getPreferredScrollableViewportSize

public java.awt.Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for a view component.
Overrides:
getPreferredScrollableViewportSize in class oracle.bali.ewt.scrolling.ScrollableComponent

getScrollableTracksViewportWidth

public boolean getScrollableTracksViewportWidth()
Returns true if a viewport should always force the width of this Scrollable to match the width of the viewport. This is implemented to return true if the line wrapping policy is true, and false if lines are not being wrapped.
Overrides:
getScrollableTracksViewportWidth in class oracle.bali.ewt.scrolling.ScrollableComponent
Returns:
true if a viewport should force the Scrollables width to match its own.

getMinimumSize

public java.awt.Dimension getMinimumSize()
Override of getMinimumSize(). If isMinimumSizeSet() is false and if minimumRows = minimumColumns = NOT_SET, then preferredSize will be returned.
Overrides:
getMinimumSize in class javax.swing.JComponent

getAccessibleContext

public javax.accessibility.AccessibleContext getAccessibleContext()
Get the AccessibleContext of this object
Specified by:
getAccessibleContext in interface javax.accessibility.Accessible
Overrides:
getAccessibleContext in class javax.swing.JComponent
Returns:
the AccessibleContext of this object

Oracle JEWT 4.2.24

Copyright © [xxxx],2003, Oracle. All Rights Reserved.