Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

javax.swing.border
Class TitledBorder.Measurements  view TitledBorder.Measurements download TitledBorder.Measurements.java

java.lang.Object
  extended byjavax.swing.border.TitledBorder.Measurements
Enclosing class:
TitledBorder

private static class TitledBorder.Measurements
extends java.lang.Object

A private helper class for holding the result of measuring the distances of a TitledBorder. While it would be possible to cache these objects, it does not seem to be worth the effort. Note that invalidating the cache would be tricky, especially since there is no notification mechanism that would inform the cache when border has changed, so it would return different insets.


Field Summary
(package private)  Border border
          The border that constitutes the interior border underneath the title text.
(package private)  java.awt.Insets borderInsets
          The width of the interior border, as returned by border.getBorderInsets().
(package private)  java.awt.Font font
          The font used for displaying the title text.
(package private)  java.awt.Insets innerSpacing
          The distance between the interior border and the nested Component for which this TitledBorder is a border.
(package private)  int lineHeight
          The number of pixels between the base line and the height where a strike-through would be drawn.
(package private)  java.awt.Insets outerSpacing
          The distance between the TitledBorder and the interior border.
(package private)  int textAscent
          The number of pixels between the base line and the top of the text box.
(package private)  int textDescent
          The number of pixels between the base line and the bottom of the text box.
(package private)  int textWidth
          The width of the trimmed title text in pixels.
(package private)  java.lang.String trimmedText
          The title text after removing leading and trailing white space characters.
 
Constructor Summary
private TitledBorder.Measurements()
           
 
Method Summary
 java.awt.Insets getContentInsets(java.awt.Insets i)
          Determines the insets of the nested component when it has a TitledBorder as its border.
 java.awt.Dimension getMinimumSize()
          Calculates the minimum size needed for displaying the border and its title.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

font

java.awt.Font font
The font used for displaying the title text. Note that it can well be that the TitledBorder’s font is null, which means that the font is to be retrieved from the current LookAndFeel. In this case, this font field will contain the result of the retrieval. Therefore, it is safe to assume that this font field will never have a null value.


textAscent

int textAscent
The number of pixels between the base line and the top of the text box.


textDescent

int textDescent
The number of pixels between the base line and the bottom of the text box.


lineHeight

int lineHeight
The number of pixels between the base line and the height where a strike-through would be drawn.


trimmedText

java.lang.String trimmedText
The title text after removing leading and trailing white space characters. If the title consists only of white space, the value of trimmedText will be null.


textWidth

int textWidth
The width of the trimmed title text in pixels.


border

Border border
The border that constitutes the interior border underneath the title text.


outerSpacing

java.awt.Insets outerSpacing
The distance between the TitledBorder and the interior border.


borderInsets

java.awt.Insets borderInsets
The width of the interior border, as returned by border.getBorderInsets().


innerSpacing

java.awt.Insets innerSpacing
The distance between the interior border and the nested Component for which this TitledBorder is a border.

Constructor Detail

TitledBorder.Measurements

private TitledBorder.Measurements()
Method Detail

getContentInsets

public java.awt.Insets getContentInsets(java.awt.Insets i)
Determines the insets of the nested component when it has a TitledBorder as its border. Used by TitledBorder.getBorderInsets(Component, Insets) 55 .


getMinimumSize

public java.awt.Dimension getMinimumSize()
Calculates the minimum size needed for displaying the border and its title. Used by TitledBorder.getMinimumSize(Component) 55 .