MouseEvent2D.java
     1: //========================================================================================
     2: //  MouseEvent2D.java
     3: //    en:MouseEvent2D -- It is a MouseEvent that has floating-point coordinates.
     4: //    ja:MouseEvent2D -- 浮動小数点座標を持つMouseEventです。
     5: //  Copyright (C) 2003-2019 Makoto Kamada
     6: //
     7: //  This file is part of the XEiJ (X68000 Emulator in Java).
     8: //  You can use, modify and redistribute the XEiJ if the conditions are met.
     9: //  Read the XEiJ License for more details.
    10: //  https://stdkmd.net/xeij/
    11: //========================================================================================
    12: 
    13: package xeij;
    14: 
    15: import java.awt.*;  //BasicStroke,BorderLayout,BoxLayout,Color,Component,Container,Cursor,Desktop,Dimension,Font,Frame,Graphics,Graphics2D,GraphicsDevice,GraphicsEnvironment,GridLayout,Image,Insets,Paint,Point,Rectangle,RenderingHints,Robot,Shape,Stroke,TexturePaint,Toolkit
    16: import java.awt.event.*;  //ActionEvent,ActionListener,ComponentAdapter,ComponentEvent,ComponentListener,FocusAdapter,FocusEvent,FocusListener,InputEvent,KeyAdapter,KeyEvent,KeyListener,MouseAdapter,MouseEvent,MouseListener,MouseMotionAdapter,MouseWheelEvent,WindowAdapter,WindowEvent,WindowListener,WindowStateListener
    17: import java.awt.geom.*;  //AffineTransform,GeneralPath,Point2D,Rectangle2D
    18: import java.lang.*;  //Boolean,Character,Class,Comparable,Double,Exception,Float,IllegalArgumentException,Integer,Long,Math,Number,Object,Runnable,SecurityException,String,StringBuilder,System
    19: 
    20: public class MouseEvent2D extends MouseEvent {
    21:   protected float x2D;
    22:   protected float y2D;
    23:   public MouseEvent2D (Component source, int id, long when, int modifiers,
    24:                        float x2D, float y2D,
    25:                        int clickCount, boolean popupTrigger, int button) {
    26:     super (source, id, when, modifiers,
    27:            (int) Math.floor ((double) x2D), (int) Math.floor ((double) y2D),
    28:            clickCount, popupTrigger, button);
    29:     this.x2D = x2D;
    30:     this.y2D = y2D;
    31:   }
    32:   public float getX2D () {
    33:     return x2D;
    34:   }
    35:   public float getY2D () {
    36:     return y2D;
    37:   }
    38:   public Point2D getPoint2D () {
    39:     return new Point2D.Float (x2D, y2D);
    40:   }
    41: }  //class MouseEvent2D
    42: 
    43: 
    44: