Class FxPixGridMatrixPanel

  • All Implemented Interfaces:
    Styleable, EventTarget, org.refcodes.graphical.PixGridPanel, org.refcodes.graphical.VisibleAccessor, org.refcodes.graphical.VisibleAccessor.VisibleMutator, org.refcodes.graphical.VisibleAccessor.VisibleProperty, org.refcodes.mixin.Clearable
    Direct Known Subclasses:
    FxPixGridBannerPanel

    public class FxPixGridMatrixPanel
    extends Pane
    implements org.refcodes.graphical.PixGridPanel
    • Field Detail

      • _rgbPixmapBuilder

        protected org.refcodes.graphical.RgbPixmap.RgbPixmapBuilder _rgbPixmapBuilder
      • _inactivePixelColor

        protected Color _inactivePixelColor
    • Constructor Detail

      • FxPixGridMatrixPanel

        public FxPixGridMatrixPanel​(int aMatrixWidth,
                                    int aMatrixHeight,
                                    Color aBackgroundColor,
                                    int aPixelWidth,
                                    int aPixelHeight,
                                    org.refcodes.graphical.PixelShape aPixelShape,
                                    float aPixelBorderWidth,
                                    Color aPixelBorderColor,
                                    Color aInactivePixelColor,
                                    int aTopBorder,
                                    int aBottomBorder,
                                    int aLeftBorder,
                                    int aRightBorder,
                                    int aHorizontalSpace,
                                    float aPixelWidthToHorizontalSpaceRatio,
                                    boolean isForceHorizontalSpace,
                                    int aVerticalSpace,
                                    float aPixelHeightToVerticalSpaceRatio,
                                    boolean isForceVerticalSpace)
        Instantiates a new FxPixGridMatrixPanel.
        Parameters:
        aMatrixWidth - the a matrix width
        aMatrixHeight - the a matrix height
        aBackgroundColor - the a background color
        aPixelWidth - the a pixel width
        aPixelHeight - the a pixel height
        aPixelShape - the a pixel shape
        aPixelBorderWidth - the a pixel border width
        aPixelBorderColor - the a pixel border color
        aInactivePixelColor - the a inactive pixel color
        aTopBorder - the a top border
        aBottomBorder - the a bottom border
        aLeftBorder - the a left border
        aRightBorder - the a right border
        aHorizontalSpace - the a horizontal space
        aPixelWidthToHorizontalSpaceRatio - the a pixel width to horizontal space ratio
        isForceHorizontalSpace - the is force horizontal space
        aVerticalSpace - the a vertical space
        aPixelHeightToVerticalSpaceRatio - the a pixel height to vertical space ratio
        isForceVerticalSpace - the is force vertical space
      • FxPixGridMatrixPanel

        public FxPixGridMatrixPanel​(int aMatrixWidth,
                                    int aMatrixHeight,
                                    String aBackgroundColor,
                                    int aPixelWidth,
                                    int aPixelHeight,
                                    org.refcodes.graphical.PixelShape aPixelShape,
                                    float aPixelBorderWidth,
                                    String aPixelBorderColor,
                                    String aInactivePixelColor,
                                    int aTopBorder,
                                    int aBottomBorder,
                                    int aLeftBorder,
                                    int aRightBorder,
                                    int aHorizontalSpace,
                                    float aPixelWidthToHorizontalSpaceRatio,
                                    boolean isForceHorizontalSpace,
                                    int aVerticalSpace,
                                    float aPixelHeightToVerticalSpaceRatio,
                                    boolean isForceVerticalSpace)
        Instantiates a new FxPixGridMatrixPanel.
        Parameters:
        aMatrixWidth - the a matrix width
        aMatrixHeight - the a matrix height
        aBackgroundColor - the a background color
        aPixelWidth - the a pixel width
        aPixelHeight - the a pixel height
        aPixelShape - the a pixel shape
        aPixelBorderWidth - the a pixel border width
        aPixelBorderColor - the a pixel border color
        aInactivePixelColor - the a inactive pixel color
        aTopBorder - the a top border
        aBottomBorder - the a bottom border
        aLeftBorder - the a left border
        aRightBorder - the a right border
        aHorizontalSpace - the a horizontal space
        aPixelWidthToHorizontalSpaceRatio - the a pixel width to horizontal space ratio
        isForceHorizontalSpace - the is force horizontal space
        aVerticalSpace - the a vertical space
        aPixelHeightToVerticalSpaceRatio - the a pixel height to vertical space ratio
        isForceVerticalSpace - the is force vertical space
      • FxPixGridMatrixPanel

        public FxPixGridMatrixPanel​(int aMatrixWidth,
                                    int aMatrixHeight,
                                    Color aBackgroundColor,
                                    int aPixelWidth,
                                    int aPixelHeight,
                                    org.refcodes.graphical.PixelShape aPixelShape,
                                    float aPixelBorderWidth,
                                    Color aPixelBorderColor,
                                    Color aInactivePixelColor,
                                    int aTopBorder,
                                    int aBottomBorder,
                                    int aLeftBorder,
                                    int aRightBorder,
                                    int aHorizontalSpace,
                                    float aPixelWidthToHorizontalSpaceRatio,
                                    boolean isForceHorizontalSpace,
                                    int aVerticalSpace,
                                    float aPixelHeightToVerticalSpaceRatio,
                                    boolean isForceVerticalSpace)
        Instantiates a new FxPixGridMatrixPanel.
        Parameters:
        aMatrixWidth - the a matrix width
        aMatrixHeight - the a matrix height
        aBackgroundColor - the a background color
        aPixelWidth - the a pixel width
        aPixelHeight - the a pixel height
        aPixelShape - the a pixel shape
        aPixelBorderWidth - the a pixel border width
        aPixelBorderColor - the a pixel border color
        aInactivePixelColor - the a inactive pixel color
        aTopBorder - the a top border
        aBottomBorder - the a bottom border
        aLeftBorder - the a left border
        aRightBorder - the a right border
        aHorizontalSpace - the a horizontal space
        aPixelWidthToHorizontalSpaceRatio - the a pixel width to horizontal space ratio
        isForceHorizontalSpace - the is force horizontal space
        aVerticalSpace - the a vertical space
        aPixelHeightToVerticalSpaceRatio - the a pixel height to vertical space ratio
        isForceVerticalSpace - the is force vertical space
    • Method Detail

      • getTopBorder

        public int getTopBorder()
        Specified by:
        getTopBorder in interface org.refcodes.graphical.PixGridPanel
      • getBottomBorder

        public int getBottomBorder()
        Specified by:
        getBottomBorder in interface org.refcodes.graphical.PixGridPanel
      • getLeftBorder

        public int getLeftBorder()
        Specified by:
        getLeftBorder in interface org.refcodes.graphical.PixGridPanel
      • getRightBorder

        public int getRightBorder()
        Specified by:
        getRightBorder in interface org.refcodes.graphical.PixGridPanel
      • getHorizontalSpace

        public int getHorizontalSpace()
        Specified by:
        getHorizontalSpace in interface org.refcodes.graphical.PixGridPanel
      • getVerticalSpace

        public int getVerticalSpace()
        Specified by:
        getVerticalSpace in interface org.refcodes.graphical.PixGridPanel
      • getPixelWidth

        public int getPixelWidth()
        Specified by:
        getPixelWidth in interface org.refcodes.graphical.PixGridPanel
      • getPixelHeight

        public int getPixelHeight()
        Specified by:
        getPixelHeight in interface org.refcodes.graphical.PixGridPanel
      • getMatrixDrawingWidth

        public int getMatrixDrawingWidth​(boolean isWithBorder,
                                         boolean isWithPixelSpace,
                                         boolean isWithPixelWidth)
        Specified by:
        getMatrixDrawingWidth in interface org.refcodes.graphical.PixGridPanel
      • getMatrixDrawingHeight

        public int getMatrixDrawingHeight​(boolean isWithBorder,
                                          boolean isWithPixelSpace,
                                          boolean isWithPixelHeight)
        Specified by:
        getMatrixDrawingHeight in interface org.refcodes.graphical.PixGridPanel
      • getRgbPixmap

        public org.refcodes.graphical.RgbPixmap.RgbPixmapBuilder getRgbPixmap()
        Specified by:
        getRgbPixmap in interface org.refcodes.graphical.PixGridPanel
      • getPixmapOffsetX

        public int getPixmapOffsetX()
        Specified by:
        getPixmapOffsetX in interface org.refcodes.graphical.PixGridPanel
      • getPixmapOffsetY

        public int getPixmapOffsetY()
        Specified by:
        getPixmapOffsetY in interface org.refcodes.graphical.PixGridPanel
      • isHorizontalWrapEnabled

        public boolean isHorizontalWrapEnabled()
        Specified by:
        isHorizontalWrapEnabled in interface org.refcodes.graphical.PixGridPanel
      • isVerticalWrapEnabled

        public boolean isVerticalWrapEnabled()
        Specified by:
        isVerticalWrapEnabled in interface org.refcodes.graphical.PixGridPanel
      • getMatrixWidth

        public int getMatrixWidth()
        Specified by:
        getMatrixWidth in interface org.refcodes.graphical.PixGridPanel
      • getMatrixHeight

        public int getMatrixHeight()
        Specified by:
        getMatrixHeight in interface org.refcodes.graphical.PixGridPanel
      • getMatrixSize

        public org.refcodes.graphical.Dimension getMatrixSize()
        Specified by:
        getMatrixSize in interface org.refcodes.graphical.PixGridPanel
      • getInactivePixelColor

        public org.refcodes.graphical.RgbColor getInactivePixelColor()
        Specified by:
        getInactivePixelColor in interface org.refcodes.graphical.PixGridPanel
      • clear

        public void clear()
        Specified by:
        clear in interface org.refcodes.mixin.Clearable
      • getPixelShape

        public org.refcodes.graphical.PixelShape getPixelShape()
        Specified by:
        getPixelShape in interface org.refcodes.graphical.PixGridPanel
      • addBlankArea

        public boolean addBlankArea​(int aXPosition,
                                    int aYPosition,
                                    int aWidth,
                                    int aHeight)
        Specified by:
        addBlankArea in interface org.refcodes.graphical.PixGridPanel
      • addBlankArea

        public boolean addBlankArea​(org.refcodes.graphical.Rectangle aRectangle)
        Specified by:
        addBlankArea in interface org.refcodes.graphical.PixGridPanel
      • removeBlankArea

        public boolean removeBlankArea​(org.refcodes.graphical.Rectangle aRectangle)
        Specified by:
        removeBlankArea in interface org.refcodes.graphical.PixGridPanel
      • clearBlankAreas

        public void clearBlankAreas()
        Specified by:
        clearBlankAreas in interface org.refcodes.graphical.PixGridPanel
      • getPixmapSnapshot

        public org.refcodes.graphical.RgbPixmap.RgbPixmapBuilder getPixmapSnapshot()
        Specified by:
        getPixmapSnapshot in interface org.refcodes.graphical.PixGridPanel
      • setPixmapOffset

        public void setPixmapOffset​(int aPosX,
                                    int aPosY)
        Specified by:
        setPixmapOffset in interface org.refcodes.graphical.PixGridPanel
      • setColorAt

        public void setColorAt​(Color aColor,
                               int aPosX,
                               int aPosY)
        Paints the Color at the given position.
        Parameters:
        aColor - the Color for the pixel at the given position.
        aPosX - the x position
        aPosY - the y position
      • setPixelAtAt

        public void setPixelAtAt​(org.refcodes.graphical.RgbPixel aPixel,
                                 int aPosX,
                                 int aPosY)
        Specified by:
        setPixelAtAt in interface org.refcodes.graphical.PixGridPanel
      • repaint

        public void repaint()
        Specified by:
        repaint in interface org.refcodes.graphical.PixGridPanel
      • toFxColor

        protected static Color toFxColor​(org.refcodes.graphical.RgbPixel aPixel)
      • toFxColor

        protected static Color toFxColor​(Color aAwtColor)
      • toFxColor

        protected static Color toFxColor​(String aWebColor)
      • toRgbPixel

        protected static org.refcodes.graphical.RgbPixel toRgbPixel​(Color aFxColor)