MouseWheelEvent2D.java
     1: //========================================================================================
     2: //  MouseWheelEvent2D.java
     3: //    en:MouseWheelEvent2D -- It is a MouseWheelEvent that has floating-point coordinates.
     4: //    ja:MouseWheelEvent2D -- 浮動小数点座標を持つMouseWheelEventです。
     5: //  Copyright (C) 2003-2017 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: //  http://stdkmd.com/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 MouseWheelEvent2D extends MouseWheelEvent {
    21:   protected float x2D;
    22:   protected float y2D;
    23:   public MouseWheelEvent2D (Component source, int id, long when, int modifiers,
    24:                             float x2D, float y2D,
    25:                             int clickCount, boolean popupTrigger,
    26:                             int scrollType, int scrollAmount, int wheelRotation) {
    27:     super (source, id, when, modifiers,
    28:            (int) Math.floor ((double) x2D), (int) Math.floor ((double) y2D),
    29:            clickCount, popupTrigger,
    30:            scrollType, scrollAmount, wheelRotation);
    31:     this.x2D = x2D;
    32:     this.y2D = y2D;
    33:   }
    34:   public float getX2D () {
    35:     return x2D;
    36:   }
    37:   public float getY2D () {
    38:     return y2D;
    39:   }
    40:   public Point2D getPoint2D () {
    41:     return new Point2D.Float (x2D, y2D);
    42:   }
    43: }  //class MouseWheelEvent2D
    44: 
    45: 
    46: