Package de.gsi.chart.utils
Class DragResizerUtil
- java.lang.Object
-
- de.gsi.chart.utils.DragResizerUtil
-
public class DragResizerUtil extends java.lang.ObjectResize JavaFX Node objects based on mouse dragging.Example code:
A note onRectangle rectangle = new Rectangle(50, 50); rectangle.setFill(Color.BLACK); DragResizeMod.makeResizable(rectangle, null); Pane root = new Pane(); root.getChildren().add(rectangle); primaryStage.setScene(new Scene(root, 300, 275)); primaryStage.show();OnDragResizeEventListener: You need to override OnDragResizeEventListener and- perform out of main field bounds check
- make changes to the node
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDragResizerUtil.DragDirectionstatic interfaceDragResizerUtil.OnDragResizeEventListener
-
Field Summary
Fields Modifier and Type Field Description protected static DragResizerUtil.OnDragResizeEventListenerDEFAULT_LISTENER
-
Constructor Summary
Constructors Modifier Constructor Description protectedDragResizerUtil()protectedDragResizerUtil(javafx.scene.Node node, DragResizerUtil.OnDragResizeEventListener listener)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DragResizerUtil.DragDirectioncurrentMouseState(javafx.scene.input.MouseEvent event)protected static javafx.scene.CursorgetCursorForState(DragResizerUtil.DragDirection state)protected static booleanintersect(double side, double point)protected booleanisBottomResizeZone(javafx.scene.input.MouseEvent event)protected booleanisInDragZone(javafx.scene.input.MouseEvent event)protected booleanisInResizeZone(javafx.scene.input.MouseEvent event)protected static booleanisLeftResizeZone(javafx.scene.input.MouseEvent event)protected booleanisRightResizeZone(javafx.scene.input.MouseEvent event)protected static booleanisTopResizeZone(javafx.scene.input.MouseEvent event)static voidmakeResizable(javafx.scene.Node node)static voidmakeResizable(javafx.scene.Node node, DragResizerUtil.OnDragResizeEventListener listener)protected voidmouseDragged(javafx.scene.input.MouseEvent event)protected voidmouseOver(javafx.scene.input.MouseEvent event)protected voidmousePressed(javafx.scene.input.MouseEvent event)protected voidmouseReleased(javafx.scene.input.MouseEvent event)protected voidresetNodeSize(javafx.scene.input.MouseEvent evt)protected voidsetNewInitialEventCoordinates(javafx.scene.input.MouseEvent event)
-
-
-
Field Detail
-
DEFAULT_LISTENER
protected static final DragResizerUtil.OnDragResizeEventListener DEFAULT_LISTENER
-
-
Constructor Detail
-
DragResizerUtil
protected DragResizerUtil()
-
DragResizerUtil
protected DragResizerUtil(javafx.scene.Node node, DragResizerUtil.OnDragResizeEventListener listener)
-
-
Method Detail
-
currentMouseState
protected DragResizerUtil.DragDirection currentMouseState(javafx.scene.input.MouseEvent event)
-
intersect
protected static boolean intersect(double side, double point)
-
isBottomResizeZone
protected boolean isBottomResizeZone(javafx.scene.input.MouseEvent event)
-
isInDragZone
protected boolean isInDragZone(javafx.scene.input.MouseEvent event)
-
isInResizeZone
protected boolean isInResizeZone(javafx.scene.input.MouseEvent event)
-
isLeftResizeZone
protected static boolean isLeftResizeZone(javafx.scene.input.MouseEvent event)
-
isRightResizeZone
protected boolean isRightResizeZone(javafx.scene.input.MouseEvent event)
-
isTopResizeZone
protected static boolean isTopResizeZone(javafx.scene.input.MouseEvent event)
-
resetNodeSize
protected void resetNodeSize(javafx.scene.input.MouseEvent evt)
-
setNewInitialEventCoordinates
protected void setNewInitialEventCoordinates(javafx.scene.input.MouseEvent event)
-
mouseDragged
protected void mouseDragged(javafx.scene.input.MouseEvent event)
-
mouseOver
protected void mouseOver(javafx.scene.input.MouseEvent event)
-
mousePressed
protected void mousePressed(javafx.scene.input.MouseEvent event)
-
mouseReleased
protected void mouseReleased(javafx.scene.input.MouseEvent event)
-
makeResizable
public static void makeResizable(javafx.scene.Node node)
-
makeResizable
public static void makeResizable(javafx.scene.Node node, DragResizerUtil.OnDragResizeEventListener listener)
-
getCursorForState
protected static javafx.scene.Cursor getCursorForState(DragResizerUtil.DragDirection state)
-
-