Package JavaFX.shapes

Class DrawableRectangle

  • All Implemented Interfaces:
    Drawable

    public class DrawableRectangle
    extends java.lang.Object
    implements Drawable
    DrawableRectangle implements the Drawable interface. It`s used to implement the mouse related events.
    Author:
    Leonardo-Rocha, GabrielChiquetto
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private javafx.scene.paint.Color color  
      private java.lang.Double height  
      private javafx.util.Pair<java.lang.Double,​java.lang.Double> initialPressCoordinate  
      private javafx.scene.shape.Rectangle rectangle  
      private java.lang.Double width  
    • Constructor Summary

      Constructors 
      Constructor Description
      DrawableRectangle​(java.lang.Double x, java.lang.Double y, javafx.scene.paint.Color color)  
    • Method Summary

      Modifier and Type Method Description
      javafx.scene.shape.Shape getShape()  
      void onMouseDragged​(javafx.scene.input.MouseEvent event)  
      void onMouseReleased​(javafx.scene.input.MouseEvent event)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • width

        private java.lang.Double width
      • height

        private java.lang.Double height
      • initialPressCoordinate

        private javafx.util.Pair<java.lang.Double,​java.lang.Double> initialPressCoordinate
      • rectangle

        private javafx.scene.shape.Rectangle rectangle
      • color

        private javafx.scene.paint.Color color
    • Constructor Detail

      • DrawableRectangle

        public DrawableRectangle​(java.lang.Double x,
                                 java.lang.Double y,
                                 javafx.scene.paint.Color color)
    • Method Detail

      • onMouseDragged

        public void onMouseDragged​(javafx.scene.input.MouseEvent event)
        Specified by:
        onMouseDragged in interface Drawable
      • onMouseReleased

        public void onMouseReleased​(javafx.scene.input.MouseEvent event)
        Specified by:
        onMouseReleased in interface Drawable
      • getShape

        public javafx.scene.shape.Shape getShape()
        Specified by:
        getShape in interface Drawable