<commit_before>//
// $Id: Label.java,v 1.5 2002/03/03 07:03:20 mdb Exp $

package com.samskivert.swing;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.Shape;

import java.awt.font.TextLayout;
import java.awt.font.FontRenderContext;
import java.awt.font.LineBreakMeasurer;
import java.awt.font.TextAttribute;

import java.awt.geom.AffineTransform;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;

import java.text.AttributedString;
import java.text.AttributedCharacterIterator;

import java.util.ArrayList;
import java.util.HashMap;

import javax.swing.SwingConstants;

import com.samskivert.Log;

/**
 * The label is a multipurpose text display mechanism that can display
 * small amounts of text wrapped to fit into a variety of constrained
 * spaces. It can be requested to conform to a particular width or height
 * and will expand into the other dimension in order to accomodate the
 * text at hand. It is not a component, but is intended for use by
 * components and other more heavyweight entities.
 */
public class Label implements SwingConstants
{
    /**
     * Constructs a blank label.
     */
    public Label ()
    {
        setText("");
    }

    /**
     * Constructs a label with the supplied text.
     */
    public Label (String text)
    {
        setText(text);
    }

    /**
     * Sets the text to be displayed by this label. This should be
     * followed eventually by a call to {@link #layout} and ultimately
     * {@link #render} to render the text. Simply setting the text does
     * not cause any layout to occur.<commit_msg>Added getText().<commit_after>//
// $Id: Label.java,v 1.6 2002/03/11 22:07:00 shaper Exp $

package com.samskivert.swing;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.Shape;

import java.awt.font.TextLayout;
import java.awt.font.FontRenderContext;
import java.awt.font.LineBreakMeasurer;
import java.awt.font.TextAttribute;

import java.awt.geom.AffineTransform;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;

import java.text.AttributedString;
import java.text.AttributedCharacterIterator;

import java.util.ArrayList;
import java.util.HashMap;

import javax.swing.SwingConstants;

import com.samskivert.Log;

/**
 * The label is a multipurpose text display mechanism that can display
 * small amounts of text wrapped to fit into a variety of constrained
 * spaces. It can be requested to conform to a particular width or height
 * and will expand into the other dimension in order to accomodate the
 * text at hand. It is not a component, but is intended for use by
 * components and other more heavyweight entities.
 */
public class Label implements SwingConstants
{
    /**
     * Constructs a blank label.
     */
    public Label ()
    {
        setText("");
    }

    /**
     * Constructs a label with the supplied text.
     */
    public Label (String text)
    {
        setText(text);
    }

    /**
     * Returns the text displayed by this label.
     */
    public String getText ()
    {
        return _text;
    }

    /**
     * Sets the text to be displayed by this label. This should be
     * followed eventually by a call to {@link #layout} and ultimately
     * {@link #render} to render the text. Simply setting the text does
     * not cause any layout to occur.
{'fraction_non_alphanumeric': 0.08905109489051095, 'fraction_numerical': 0.011094890510948904, 'mean_word_length': 3.1729598051157124, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '255409', 'n_tokens_mistral': 1032, 'n_tokens_neox': 998, 'n_words': 366}