java.lang.Object
net.mcreator.ui.views.editor.image.canvas.Selection

public class Selection extends Object
Class used to transfer selection data between objects
  • Constructor Details

    • Selection

      public Selection(Canvas canvas)
    • Selection

      public Selection(Canvas canvas, int xFirst, int yFirst, int xSecond, int ySecond)
  • Method Details

    • getEditing

      public SelectedBorder getEditing()
    • getVisibilityState

      public SelectedBorder getVisibilityState()
      Returns the editing state of the selection if no cursor was hovering over it. This way we have a way to store the selection visibility state without another variable.
      Returns:
      editing visibility state of the selection
    • setEditing

      public void setEditing(SelectedBorder editing)
    • getHandleSize

      public int getHandleSize()
    • getHandleStroke

      public Stroke getHandleStroke()
    • getLeft

      public int getLeft()
    • getLeftPoint

      public Point getLeftPoint()
    • getRight

      public int getRight()
    • getRightPoint

      public Point getRightPoint()
    • getTop

      public int getTop()
    • getTopPoint

      public Point getTopPoint()
    • getBottom

      public int getBottom()
    • getBottomPoint

      public Point getBottomPoint()
    • getWidth

      public int getWidth()
    • getHeight

      public int getHeight()
    • hasSurface

      public boolean hasSurface()
    • getFirst

      public Point getFirst()
    • getSecond

      public Point getSecond()
    • setEditStarted

      public void setEditStarted(boolean editStarted)
    • isEditStarted

      public boolean isEditStarted()
    • clear

      public void clear()
    • getLayerMask

      public Shape getLayerMask(Layer layer)
    • isInside

      public boolean isInside(Shape shape, int x, int y)
    • cropCanvas

      public BufferedImage cropCanvas(BufferedImage canvasRender)
    • cropLayer

      public BufferedImage cropLayer(BufferedImage layer, int xOffset, int yOffset)
    • drawHandles

      public void drawHandles(Graphics2D g2d)
      Draws the selection handles depending on the current state of the selection.
      Parameters:
      g2d - Graphics2D object to draw on
    • verticalHandlesVisible

      public boolean verticalHandlesVisible()
    • horizontalHandlesVisible

      public boolean horizontalHandlesVisible()
    • cornersVisible

      public boolean cornersVisible()
    • checkHandles

      public SelectedBorder checkHandles(int x, int y)