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
This commit is contained in:
Michael Bayne
2003-06-19 22:03:14 +00:00
parent 3d8e053a7f
commit e7a7c2ba09
@@ -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; package com.threerings.miso.client;
@@ -955,7 +955,7 @@ public class MisoScenePanel extends VirtualMediaPanel
String tiptext = getTipText(scobj, action); String tiptext = getTipText(scobj, action);
if (tiptext != null) { if (tiptext != null) {
Icon icon = (oah == null) ? null : oah.getTipIcon(action); Icon icon = getTipIcon(scobj, action);
SceneObjectTip tip = new SceneObjectTip(tiptext, icon); SceneObjectTip tip = new SceneObjectTip(tiptext, icon);
_tips.put(scobj, tip); _tips.put(scobj, tip);
} }
@@ -973,6 +973,16 @@ public class MisoScenePanel extends VirtualMediaPanel
return action; 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. * Dirties the specified tip.
*/ */