More Mac hackery.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1109 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -1,8 +1,10 @@
|
|||||||
//
|
//
|
||||||
// $Id: RunAnywhere.java,v 1.1 2003/05/02 23:47:39 mdb Exp $
|
// $Id: RunAnywhere.java,v 1.2 2003/05/03 00:06:23 mdb Exp $
|
||||||
|
|
||||||
package com.samskivert.util;
|
package com.samskivert.util;
|
||||||
|
|
||||||
|
import java.awt.event.InputEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <cite>Write once, run anywhere.</cite> Well, at least that's what it
|
* <cite>Write once, run anywhere.</cite> Well, at least that's what it
|
||||||
* said in the brochures. For those less than fresh days, you might need
|
* said in the brochures. For those less than fresh days, you might need
|
||||||
@@ -28,6 +30,17 @@ public class RunAnywhere
|
|||||||
return _isMacOS;
|
return _isMacOS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the timestamp associated with the supplied event except on
|
||||||
|
* the Macintosh where it returns {@link System#currentTimeMillis}
|
||||||
|
* because {@link InputEvent#getWhen} returns completely incorrect
|
||||||
|
* values. Hopefully this method will become unnecessary soon.
|
||||||
|
*/
|
||||||
|
public static long getWhen (InputEvent event)
|
||||||
|
{
|
||||||
|
return isMacOS() ? System.currentTimeMillis() : event.getWhen();
|
||||||
|
}
|
||||||
|
|
||||||
/** Flag indicating that we're on Windows; initialized when this class
|
/** Flag indicating that we're on Windows; initialized when this class
|
||||||
* is first loaded. */
|
* is first loaded. */
|
||||||
protected static boolean _isWindows;
|
protected static boolean _isWindows;
|
||||||
|
|||||||
Reference in New Issue
Block a user