Class DrawStringPanel

    • Constructor Detail

      • DrawStringPanel

        public DrawStringPanel​(String text,
                               boolean rotate)
        Creates a new panel.
        Parameters:
        text - the text.
        rotate - a flag that controls whether or not the text is rotated.
    • Method Detail

      • getPreferredSize

        public Dimension getPreferredSize()
        Returns the preferred size for the panel.
        Overrides:
        getPreferredSize in class JComponent
        Returns:
        The preferred size.
      • setAnchor

        public void setAnchor​(TextAnchor anchor)
        Sets the text anchor.
        Parameters:
        anchor - the text anchor.
      • setRotationAnchor

        public void setRotationAnchor​(TextAnchor anchor)
        Sets the rotation anchor.
        Parameters:
        anchor - the rotation anchor.
      • setAngle

        public void setAngle​(double angle)
        Sets the rotation angle.
        Parameters:
        angle - the rotation angle.
      • setFont

        public void setFont​(Font font)
        Sets the font.
        Overrides:
        setFont in class JComponent
        Parameters:
        font - the font.
      • paintComponent

        public void paintComponent​(Graphics g)
        Paints the panel.
        Overrides:
        paintComponent in class JComponent
        Parameters:
        g - the graphics device.