1 package tim.prune.tips;
4 * Class to manage the showing of tips according
5 * to the fixed TipDefinitions
7 public abstract class TipManager
9 public static final int Tip_UseAMapCache = 0;
10 public static final int Tip_LearnTimeParams = 1;
11 public static final int Tip_DownloadSrtm = 2;
12 public static final int Tip_UseSrtmFor3d = 3;
13 public static final int Tip_ManuallyCorrelateOne = 4;
14 private static final int Number_Tips = Tip_ManuallyCorrelateOne + 1;
16 /** Array of tip definitions */
17 private static TipDefinition[] TIPDEFS = new TipDefinition[Number_Tips];
19 /** Static block to initialise tip definitions */
22 TIPDEFS[Tip_UseAMapCache] = new TipDefinition("tip.useamapcache", 150);
23 TIPDEFS[Tip_LearnTimeParams] = new TipDefinition("tip.learntimeparams");
24 TIPDEFS[Tip_DownloadSrtm] = new TipDefinition("tip.downloadsrtm", 5);
25 TIPDEFS[Tip_UseSrtmFor3d] = new TipDefinition("tip.usesrtmfor3d");
26 TIPDEFS[Tip_ManuallyCorrelateOne] = new TipDefinition("tip.manuallycorrelateone");
30 * Fire a trigger for the specified tip and get the message key if tip should be shown
31 * @param inTipNumber number of tip from constants
32 * @return message key if a message should be shown, or null otherwise
34 public static String fireTipTrigger(int inTipNumber)
37 TipDefinition tip = TIPDEFS[inTipNumber];
38 if (tip.shouldShowMessage()) {
39 return tip.getMessageKey();
42 catch (ArrayIndexOutOfBoundsException obe) {} // unrecognised tip given