Class SwingTextBox

java.lang.Object
org.graphstream.ui.swing.renderer.shape.swing.SwingTextBox

public class SwingTextBox extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    SwingTextBox(Font font, Color textColor, Color bgColor, boolean rounded, double padx, double pady)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.graphstream.ui.swing.renderer.shape.swing.TextBox
    apply(String fontName, org.graphstream.ui.graphicGraph.stylesheet.StyleConstants.TextStyle style, int fontSize, Color textColor, Color bgColor, boolean rounded, double padx, double pady)
     
    static org.graphstream.ui.swing.renderer.shape.swing.TextBox
    apply(org.graphstream.ui.view.camera.DefaultCamera2D camera, org.graphstream.ui.graphicGraph.stylesheet.Style style)
     
    double
     
    double
     
    double
     
     
    double
     
    void
    render(Backend backend, double xLeft, double yBottom)
    Renders the text at the given coordinates.
    void
    setText(String text, Backend backend)
    Changes the text and compute its bounds.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • maxWidth

      public int maxWidth
  • Constructor Details

    • SwingTextBox

      public SwingTextBox(Font font, Color textColor, Color bgColor, boolean rounded, double padx, double pady)
  • Method Details

    • setText

      public void setText(String text, Backend backend)
      Changes the text and compute its bounds. This method tries to avoid recomputing bounds if the text does not really changed.
    • getText

      public String getText()
    • getWidth

      public double getWidth()
    • getHeight

      public double getHeight()
    • getDescent

      public double getDescent()
    • getAscent

      public double getAscent()
    • render

      public void render(Backend backend, double xLeft, double yBottom)
      Renders the text at the given coordinates.
    • apply

      public static org.graphstream.ui.swing.renderer.shape.swing.TextBox apply(org.graphstream.ui.view.camera.DefaultCamera2D camera, org.graphstream.ui.graphicGraph.stylesheet.Style style)
    • apply

      public static org.graphstream.ui.swing.renderer.shape.swing.TextBox apply(String fontName, org.graphstream.ui.graphicGraph.stylesheet.StyleConstants.TextStyle style, int fontSize, Color textColor, Color bgColor, boolean rounded, double padx, double pady)