Class TextBlock

  • All Implemented Interfaces:
    Paintable


    public class TextBlock
    extends Object
    implements Paintable
    This renders a block of text with optional attributes.

    Here are some samples:

    new com.bric.awt.TextBlock(0, "Example Red") new com.bric.awt.TextBlock(.2, "Greenish Example") new com.bric.awt.TextBlock(.5, "Example Cyan")
    • Constructor Detail

      • TextBlock

        public TextBlock(String text)
      • TextBlock

        public TextBlock(float hue,
                         String text)
    • Method Detail

      • hashCode

        public int hashCode()
      • equals

        public boolean equals(Object obj)
      • setText

        public void setText(String text)
      • getText

        public String getText()
      • getFont

        public Font getFont()
      • setFont

        public void setFont(Font font)
      • usesFractionalMetrics

        public boolean usesFractionalMetrics()
      • isTextShadowActive

        public boolean isTextShadowActive()
      • isShadowActive

        public boolean isShadowActive()
      • setTextShadowActive

        public void setTextShadowActive(boolean active)
      • setShadowActive

        public void setShadowActive(boolean active)
      • isAntiAliased

        public boolean isAntiAliased()
      • getCurveWidth

        public int getCurveWidth()
      • setCurveWidth

        public void setCurveWidth(int curveWidth)
      • getTextInsets

        public Insets getTextInsets()
      • setTextInsets

        public void setTextInsets(Insets insets)
      • getInsets

        public Insets getInsets()
      • setInsets

        public void setInsets(Insets insets)
      • getStringBounds

        protected Rectangle2D getStringBounds()
      • revalidate

        public void revalidate()
        This defines width, height and body and may make other adjustments to prepare this TextBlock to be rendered/measured. This should be called in a synchronized block.
      • getWidth

        public int getWidth()
      • getHeight

        public int getHeight()
      • getStroke

        public Stroke getStroke()
      • getBorderPaint

        public Paint getBorderPaint()
      • getBackground

        public Paint getBackground()
      • setTextPaint

        public void setTextPaint(Paint textColor)
      • getTextPaint

        public Paint getTextPaint()
      • setStroke

        public void setStroke(Stroke stroke)
      • setBorderPaint

        public void setBorderPaint(Paint borderPaint)
      • setBackground

        public void setBackground(Paint background)
      • setBackgroundShadowColor

        public void setBackgroundShadowColor(Color color)
      • getBackgroundShadowColor

        public Color getBackgroundShadowColor()
      • createComponent

        public JComponent createComponent()