uk.ac.starlink.table.gui

## Class CustomLabelUI

- java.lang.Object
- - javax.swing.plaf.ComponentUI
  - - javax.swing.plaf.LabelUI
    - - javax.swing.plaf.basic.BasicLabelUI
      - - uk.ac.starlink.table.gui.CustomLabelUI

- All Implemented Interfaces:
    java.beans.PropertyChangeListener, java.util.EventListener

      public class CustomLabelUI
      extends javax.swing.plaf.basic.BasicLabelUI

  An implementation of the (Basic)LabelUI for overriding JLabel formatting in the cells of JTables. This is used to change the location of the ellipsis when a string is rendered in a cell that cannot fit. By default, the ellipsis is always at the end of the string, but this class instead places the ellipsis in the middle of the string.
  Since:
    03 Feb 2026
  See Also:
    `BasicLabelUI`

- - ### Field Summary

    - ### Fields inherited from class javax.swing.plaf.basic.BasicLabelUI

      `labelUI`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CustomLabelUI()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static CustomLabelUI` | `createUI(javax.swing.JComponent c)` Implicit constructor, called by Swing with a particular component in order to have something for drawing labels to the screen.
    `java.lang.String` | `getText()` Returns the text displayed in the label.
    `protected java.lang.String` | `layoutCL(javax.swing.JLabel label, java.awt.FontMetrics fontMetrics, java.lang.String text, javax.swing.Icon icon, java.awt.Rectangle viewR, java.awt.Rectangle iconR, java.awt.Rectangle textR)`

    - ### Methods inherited from class javax.swing.plaf.basic.BasicLabelUI

      `getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, installComponents, installDefaults, installKeyboardActions, installListeners, installUI, paint, paintDisabledText, paintEnabledText, propertyChange, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUI`

    - ### Methods inherited from class javax.swing.plaf.ComponentUI

      `contains, getAccessibleChild, getAccessibleChildrenCount, update`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CustomLabelUI

          public CustomLabelUI()

  - ### Method Detail

    - #### createUI

          public static CustomLabelUI createUI(javax.swing.JComponent c)

      Implicit constructor, called by Swing with a particular component in order to have something for drawing labels to the screen.

    - #### getText

          public java.lang.String getText()

      Returns the text displayed in the label.
      Returns:
        String

    - #### layoutCL

          protected java.lang.String layoutCL(javax.swing.JLabel label,
                                              java.awt.FontMetrics fontMetrics,
                                              java.lang.String text,
                                              javax.swing.Icon icon,
                                              java.awt.Rectangle viewR,
                                              java.awt.Rectangle iconR,
                                              java.awt.Rectangle textR)

      Overrides:
        `layoutCL` in class `javax.swing.plaf.basic.BasicLabelUI`