This repository has been archived by the owner on Sep 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRampSetting.m
79 lines (65 loc) · 1.54 KB
/
RampSetting.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//
// Ramp.m
// DicomToEgsphant
//
// Created by ? on 23/3/07.
// Copyright 2007 __MyCompanyName__. All rights reserved.
//
#import "RampSetting.h"
@implementation RampSetting
-(id) init
{
if (self=[super init])
{
NSArray *keys = [NSArray arrayWithObjects: @"title", nil];
NSArray *vlaues = [NSArray arrayWithObjects: @"New Ramp Setting", nil];
properties = [[NSMutableDictionary alloc] initWithObjects: vlaues forKeys: keys];
mediums = [[NSMutableArray alloc] init];
}
return self;
}
- (id) initWithCoder: (NSCoder *)coder
{
if (self=[super init])
{
[self setProperties:[coder decodeObjectForKey:@"properties"]];
[self setMediums:[coder decodeObjectForKey:@"mediums"]];
}
return self;
}
-(void) dealloc
{
[properties release];
[mediums release];
[super dealloc];
}
-(NSMutableDictionary*) properties
{
return properties;
}
-(void) setProperties:(NSDictionary*) newProperties;
{
if (properties != newProperties)
{
[properties autorelease];
properties = [[NSMutableDictionary alloc] initWithDictionary: newProperties];
}
}
-(NSMutableArray*) mediums
{
return mediums;
}
-(void) setMediums:(NSArray*) newMediums;
{
if (mediums != newMediums)
{
[mediums autorelease];
mediums = [[NSMutableArray alloc] initWithArray: newMediums];
}
}
- (void) encodeWithCoder:(NSCoder *)coder
{
[coder encodeObject:properties forKey:@"properties"];
[coder encodeObject:mediums forKey:@"mediums"];
}
@end