// // MPT_CERT3_Weights.m // // Created by Andrew Salamon on 9/25/06. // Copyright 2006 __MyCompanyName__. All rights reserved. // #import "MPT_CERT3_Weights.h" @interface MPT_CERT3_Weights(PrivateMethods) - (void)loadTooltips; @end @implementation MPT_CERT3_Weights - (id)initWithBundle:(NSBundle *)_bundle { if( self = [super initWithBundle:_bundle] ) { tooltips = NULL; } return self; } - (void)dealloc { [tooltips release]; [super dealloc]; } - (NSString *)pluginID { NSString *ident = [super pluginID]; if( [ident length] > 0 ) return ident; return @"edu.ucsd.mplab.plugins.CERT3_Weights"; } - (NSString *)localizedName { return NSLocalizedStringFromTableInBundle(@"CERT 3 Weights", nil, [NSBundle bundleForClass:[self class]], @""); } - (NSString *)internalName { return @"CERT3_Weights"; } - (NSString *)step { return MPT_PluginStep_SVM; } - (NSString *)weightsDirectory { return [[[NSBundle bundleForClass:[self class]] resourcePath] stringByAppendingPathComponent:@"Weights"]; } - (void)setView:(MPT_AUView *)newView forLabel:(NSString *)label { [super setView:newView forLabel:label]; if( !tooltips ) [self loadTooltips]; NSString *tip = [tooltips objectForKey:label]; if( tip ) [newView setToolTip:tip]; } - (void)loadTooltips { NSString *tooltipFile = [[NSBundle bundleForClass:[self class]] pathForResource:@"tooltips" ofType:@"plist"]; if( [tooltipFile length] > 0 ) { NSArray *tooltipArray = [NSArray arrayWithContentsOfFile:tooltipFile]; if( ([tooltipArray count] > 0) && ([tooltipArray count] == [labels count]) ) { [tooltips release]; tooltips = [[NSDictionary alloc] initWithObjects:tooltipArray forKeys:labels]; } } } @end