From e7a7c2ba09f5e25ba3a153b5e635a0e931bfeb37 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Thu, 19 Jun 2003 22:03:14 +0000 Subject: [PATCH] Pulled icon lookup into method that can be overridden. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2669 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../com/threerings/miso/client/MisoScenePanel.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/java/com/threerings/miso/client/MisoScenePanel.java b/src/java/com/threerings/miso/client/MisoScenePanel.java index fa12edbc1..2d32b3ecb 100644 --- a/src/java/com/threerings/miso/client/MisoScenePanel.java +++ b/src/java/com/threerings/miso/client/MisoScenePanel.java @@ -1,5 +1,5 @@ // -// $Id: MisoScenePanel.java,v 1.43 2003/06/05 18:41:36 mdb Exp $ +// $Id: MisoScenePanel.java,v 1.44 2003/06/19 22:03:14 mdb Exp $ package com.threerings.miso.client; @@ -955,7 +955,7 @@ public class MisoScenePanel extends VirtualMediaPanel String tiptext = getTipText(scobj, action); if (tiptext != null) { - Icon icon = (oah == null) ? null : oah.getTipIcon(action); + Icon icon = getTipIcon(scobj, action); SceneObjectTip tip = new SceneObjectTip(tiptext, icon); _tips.put(scobj, tip); } @@ -973,6 +973,16 @@ public class MisoScenePanel extends VirtualMediaPanel return action; } + /** + * Provides an icon for this tooltip, the default looks up an object + * action handler for the action and requests the icon from it. + */ + protected Icon getTipIcon (SceneObject scobj, String action) + { + ObjectActionHandler oah = ObjectActionHandler.lookup(action); + return (oah == null) ? null : oah.getTipIcon(action); + } + /** * Dirties the specified tip. */