Package jexer

Class TImage

    • Constructor Detail

      • TImage

        public TImage​(TWidget parent,
                      int x,
                      int y,
                      int width,
                      int height,
                      java.awt.image.BufferedImage image,
                      int left,
                      int top)
        Public constructor.
        Parameters:
        parent - parent widget
        x - column relative to parent
        y - row relative to parent
        width - number of text cells for width of the image
        height - number of text cells for height of the image
        image - the image to display
        left - left column of the image. 0 is the left-most column.
        top - top row of the image. 0 is the top-most row.
      • TImage

        public TImage​(TWidget parent,
                      int x,
                      int y,
                      int width,
                      int height,
                      java.awt.image.BufferedImage image,
                      int left,
                      int top,
                      TAction clickAction)
        Public constructor.
        Parameters:
        parent - parent widget
        x - column relative to parent
        y - row relative to parent
        width - number of text cells for width of the image
        height - number of text cells for height of the image
        image - the image to display
        left - left column of the image. 0 is the left-most column.
        top - top row of the image. 0 is the top-most row.
        clickAction - function to call when mouse is pressed
    • Method Detail

      • onMouseDown

        public void onMouseDown​(TMouseEvent mouse)
        Handle mouse press events.
        Overrides:
        onMouseDown in class TWidget
        Parameters:
        mouse - mouse button press event
      • onKeypress

        public void onKeypress​(TKeypressEvent keypress)
        Handle keystrokes.
        Overrides:
        onKeypress in class TWidget
        Parameters:
        keypress - keystroke event
      • onResize

        public void onResize​(TResizeEvent event)
        Handle resize events.
        Overrides:
        onResize in class TWidget
        Parameters:
        event - resize event
      • onCommand

        public void onCommand​(TCommandEvent command)
        Handle posted command events.
        Overrides:
        onCommand in class TWidget
        Parameters:
        command - command event
      • draw

        public void draw()
        Draw the image.
        Overrides:
        draw in class TWidget
      • getTop

        public int getTop()
        Get the top corner to render.
        Returns:
        the top row
      • setTop

        public void setTop​(int top)
        Set the top corner to render.
        Parameters:
        top - the new top row
      • getLeft

        public int getLeft()
        Get the left corner to render.
        Returns:
        the left column
      • setLeft

        public void setLeft​(int left)
        Set the left corner to render.
        Parameters:
        left - the new left column
      • getRows

        public int getRows()
        Get the number of text cell rows for this image.
        Returns:
        the number of rows
      • getColumns

        public int getColumns()
        Get the number of text cell columns for this image.
        Returns:
        the number of columns
      • getImage

        public java.awt.image.BufferedImage getImage()
        Get the raw (unprocessed) image.
        Returns:
        the image
      • setImage

        public void setImage​(java.awt.image.BufferedImage image)
        Set the raw image, and reprocess to make the visible image.
        Parameters:
        image - the new image
      • getVisibleImage

        public java.awt.image.BufferedImage getVisibleImage()
        Get the visible (processed) image.
        Returns:
        the image that is currently on screen
      • getScaleType

        public TImage.Scale getScaleType()
        Get the scaling strategy.
        Returns:
        Scale.NONE, Scale.STRETCH, etc.
      • setScaleType

        public void setScaleType​(TImage.Scale scale)
        Set the scaling strategy.
        Parameters:
        scale - Scale.NONE, Scale.STRETCH, etc.
      • getScaleFactor

        public double getScaleFactor()
        Get the scale factor.
        Returns:
        the scale factor
      • setScaleFactor

        public void setScaleFactor​(double scaleFactor)
        Set the scale factor. 1.0 means no scaling.
        Parameters:
        scaleFactor - the new scale factor
      • getRotation

        public int getRotation()
        Get the rotation, as degrees.
        Returns:
        the rotation in degrees
      • setRotation

        public void setRotation​(int rotation)
        Set the rotation, as degrees clockwise.
        Parameters:
        rotation - 0, 90, 180, or 270
      • isEditMenuCut

        public boolean isEditMenuCut()
        Check if the cut menu item should be enabled.
        Specified by:
        isEditMenuCut in interface EditMenuUser
        Returns:
        true if the cut menu item should be enabled
      • isEditMenuCopy

        public boolean isEditMenuCopy()
        Check if the copy menu item should be enabled.
        Specified by:
        isEditMenuCopy in interface EditMenuUser
        Returns:
        true if the copy menu item should be enabled
      • isEditMenuPaste

        public boolean isEditMenuPaste()
        Check if the paste menu item should be enabled.
        Specified by:
        isEditMenuPaste in interface EditMenuUser
        Returns:
        true if the paste menu item should be enabled
      • isEditMenuClear

        public boolean isEditMenuClear()
        Check if the clear menu item should be enabled.
        Specified by:
        isEditMenuClear in interface EditMenuUser
        Returns:
        true if the clear menu item should be enabled