Package jltk

Class ColoredPen


  • public class ColoredPen
    extends Pen
    Beschreiben Sie hier die Klasse Coloredpen.
    Version:
    08.06.2022
    Author:
    ms
    • Field Detail

      • fillEnabled

        protected boolean fillEnabled
      • fillColor

        protected javafx.scene.paint.Paint fillColor
    • Constructor Detail

      • ColoredPen

        public ColoredPen()
        Creates a new colored pen on the last created. Because of this, you first have to create a window and the a pen.
      • ColoredPen

        public ColoredPen​(Window pWindow)
        Creates a new colored pen on the specified window.
        Parameters:
        pWindow - The window for this pen.
    • Method Detail

      • drawRect

        public void drawRect​(double pWidth,
                             double pHeight)
        The colored pen draws a rectangle with the specified width and height. If fill is enabled (see enableFill()), the rectangle is filled with the fill color of this pen. The position of the pen is the upper left corner. The rectangle is also drawn when then pen is up.
        Overrides:
        drawRect in class Pen
        Parameters:
        pWidth - The width of the rectangle
        pHeight - The height of the rectangle
        See Also:
        enableFill(), #setFillColor()
      • drawCircle

        public void drawCircle​(double pRadius)
        The colored pen draws a circle with the specified width and height. If fill is enabled (see enableFill()), the circle is filled with the fill color of this pen. The position of the pen is the center of the circle. The circle is also drawn when then pen is up.
        Overrides:
        drawCircle in class Pen
        Parameters:
        pRadius - The radius of the circle
        See Also:
        enableFill(), #setFillColor()
      • enableFill

        public void enableFill()
        Enable fill mode for this pen
      • disableFill

        public void disableFill()
        Disable fill mode for this pen
      • isFillEnabled

        public boolean isFillEnabled()
        Return true, if the filling is enabled for this pen.
        See Also:
        enableFill(), disableFill()
      • setLineColor

        public void setLineColor​(javafx.scene.paint.Color pColor)
        The line color of the pen will be changed to specified color
        Parameters:
        pColor - the new line color
      • setLineColor

        public void setLineColor​(double pRed,
                                 double pGreen,
                                 double pBlue)
        The line color of the component will be changed to specified rgb-color
        Parameters:
        pRed - the red proportion (must be between 0 and 1)
        pGreen - the green proportion (must be between 0 and 1)
        pBlue - the blue proportion (must be between 0 and 1)
      • setLineColor

        public void setLineColor​(String pColor)
        The line color of the pen will be changed. As parameter you can use the color name from the javafx.scene.paint.Color field https://docs.oracle.com/javase/8/javafx/api/javafx/scene/paint/Color.html#field.summary For example setLineColor("ALICEBLUE") or setLineColor("blue").
        Parameters:
        pColor - the new line color
      • getLineColor

        public javafx.scene.paint.Color getLineColor()
        Return the current line color as Color object.
        Returns:
        The current line color.
      • setFillColor

        public void setFillColor​(double pRed,
                                 double pGreen,
                                 double pBlue)
        The fillcolor of the component will be changed to specified rgb-color
        Parameters:
        pRed - the red proportion (must be between 0 and 1)
        pGreen - the green proportion (must be between 0 and 1)
        pBlue - the blue proportion (must be between 0 and 1)
      • setFillColor

        public void setFillColor​(String pColor)
        The fill color of the pen will be changed to the specified color. As parameter you can use the color name from the javafx.scene.paint.Color field https://docs.oracle.com/javase/8/javafx/api/javafx/scene/paint/Color.html#field.summary For example setFillColor("ALICEBLUE") or setFillColor("blue").
        Parameters:
        pColor - the new fill color
      • getFillColor

        public javafx.scene.paint.Color getFillColor()
        Return the current fill color as Color object.
        Returns:
        The current fill color.
      • setFillColor

        public void setFillColor​(javafx.scene.paint.Color pColor)
        The fill color of the component will be changed to the specified color
        Parameters:
        pColor - the new fill color
      • setTransparency

        public void setTransparency​(double pValue)
      • getTransparency

        public double getTransparency()