Class Selection
java.lang.Object
net.mcreator.ui.views.editor.image.canvas.Selection
Class used to transfer selection data between objects
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncheckHandles
(int x, int y) void
clear()
boolean
cropCanvas
(BufferedImage canvasRender) cropLayer
(BufferedImage layer, int xOffset, int yOffset) void
drawHandles
(Graphics2D g2d) Draws the selection handles depending on the current state of the selection.int
getFirst()
int
int
getLayerMask
(Layer layer) int
getLeft()
int
getRight()
int
getTop()
Returns the editing state of the selection if no cursor was hovering over it.int
getWidth()
boolean
boolean
boolean
boolean
void
setEditing
(SelectedBorder editing) void
setEditStarted
(boolean editStarted) boolean
-
Constructor Details
-
Selection
-
Selection
-
-
Method Details
-
getEditing
-
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
-
getHandleSize
public int getHandleSize() -
getHandleStroke
-
getLeft
public int getLeft() -
getLeftPoint
-
getRight
public int getRight() -
getRightPoint
-
getTop
public int getTop() -
getTopPoint
-
getBottom
public int getBottom() -
getBottomPoint
-
getWidth
public int getWidth() -
getHeight
public int getHeight() -
hasSurface
public boolean hasSurface() -
getFirst
-
getSecond
-
setEditStarted
public void setEditStarted(boolean editStarted) -
isEditStarted
public boolean isEditStarted() -
clear
public void clear() -
getLayerMask
-
isInside
-
cropCanvas
-
cropLayer
-
drawHandles
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
-