[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gzz] fourth PEG cursors--humppake: Changing mouse cursor
From: |
Asko Soukka |
Subject: |
Re: [Gzz] fourth PEG cursors--humppake: Changing mouse cursor |
Date: |
Mon, 12 May 2003 16:57:05 +0300 (EEST) |
Mon, 12 May 2003, Tuomas Lukka kirjoitti:
> > * "WAIT_CURSOR" The wait cursor type.
> > */
>
> ISSUE: Do we *really* want all arguments to this method have the _CURSOR
> suffix?
I would prefer it, since then they'll be similar to constants
in awt.Cursor. If that's not a good reason enough, then we may drop the
suffix.
Benja?
> > if (cursorName == "CROSSHAIR_CURSOR")
> > cursor = new Cursor(Cursor.CROSSHAIR_CURSOR);
> > else if (cursorName == "DEFAULT_CURSOR")
> > cursor = new Cursor(Cursor.DEFAULT_CURSOR);
...
> > else throw new IllegalArgumentException("Unknown cursor:
> > "+cursorName);
> > canvas.setCursor(cursor);
> > }
> Using reflection is also possible.
Reflection? Please, explain.
> > cursorName == "SW_RESIZE_CURSOR" ||
> > cursorName == "TEXT_CURSOR" ||
> > cursorName == "W_RESIZE_CURSOR" ||
> > cursorName == "WAIT_CURSOR")
>
> That code won't work. Can't compare strings using ==.
Of course :/ -> String.equals().
Mudyc told that std::strings in C++ can be compared
using '=='. Is that correct? So, the difference is that
operators can't be overloaded in Java.
--
Asko Soukka <address@hidden>
<http://www.iki.fi/asko.soukka/>