Skip to content

Commit 4524ff2

Browse files
committed
Merged the default branch into the release-2.0 branch.
2 parents feb756e + dca3425 commit 4524ff2

File tree

285 files changed

+4509
-5020
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

285 files changed

+4509
-5020
lines changed

QCPlugin/CPBarPlotPlugin.m

Lines changed: 53 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -29,71 +29,71 @@ @implementation CPBarPlotPlugIn
2929

3030
+(NSDictionary *)attributes
3131
{
32-
return [NSDictionary dictionaryWithObjectsAndKeys:
33-
@"Core Plot Bar Chart", QCPlugInAttributeNameKey,
34-
@"Bar chart", QCPlugInAttributeDescriptionKey,
35-
nil];
32+
return @{
33+
QCPlugInAttributeNameKey: @"Core Plot Bar Chart",
34+
QCPlugInAttributeDescriptionKey: @"Bar chart"
35+
};
3636
}
3737

3838
+(NSDictionary *)attributesForPropertyPortWithKey:(NSString *)key
3939
{
4040
// A few additional ports for the bar plot chart type ...
4141

4242
if ( [key isEqualToString:@"inputBarWidth"] ) {
43-
return [NSDictionary dictionaryWithObjectsAndKeys:
44-
@"Bar Width", QCPortAttributeNameKey,
45-
[NSNumber numberWithFloat:1.0], QCPortAttributeDefaultValueKey,
46-
[NSNumber numberWithFloat:0.0], QCPortAttributeMinimumValueKey,
47-
nil];
43+
return @{
44+
QCPortAttributeNameKey: @"Bar Width",
45+
QCPortAttributeDefaultValueKey: @1.0,
46+
QCPortAttributeMinimumValueKey: @0.0
47+
};
4848
}
4949

5050
if ( [key isEqualToString:@"inputBarOffset"] ) {
51-
return [NSDictionary dictionaryWithObjectsAndKeys:
52-
@"Bar Offset", QCPortAttributeNameKey,
53-
[NSNumber numberWithFloat:0.5], QCPortAttributeDefaultValueKey,
54-
nil];
51+
return @{
52+
QCPortAttributeNameKey: @"Bar Offset",
53+
QCPortAttributeDefaultValueKey: @0.5
54+
};
5555
}
5656

5757
if ( [key isEqualToString:@"inputBaseValue"] ) {
58-
return [NSDictionary dictionaryWithObjectsAndKeys:
59-
@"Base Value", QCPortAttributeNameKey,
60-
[NSNumber numberWithFloat:0.0], QCPortAttributeDefaultValueKey,
61-
nil];
58+
return @{
59+
QCPortAttributeNameKey: @"Base Value",
60+
QCPortAttributeDefaultValueKey: @0.0
61+
};
6262
}
6363

6464
if ( [key isEqualToString:@"inputHorizontalBars"] ) {
65-
return [NSDictionary dictionaryWithObjectsAndKeys:
66-
@"Horizontal Bars", QCPortAttributeNameKey,
67-
[NSNumber numberWithBool:NO], QCPortAttributeDefaultValueKey,
68-
nil];
65+
return @{
66+
QCPortAttributeNameKey: @"Horizontal Bars",
67+
QCPortAttributeDefaultValueKey: @NO
68+
};
6969
}
7070

7171
if ( [key isEqualToString:@"inputXMin"] ) {
72-
return [NSDictionary dictionaryWithObjectsAndKeys:
73-
@"X Range Min", QCPortAttributeNameKey,
74-
[NSNumber numberWithFloat:0.0], QCPortAttributeDefaultValueKey,
75-
nil];
72+
return @{
73+
QCPortAttributeNameKey: @"X Range Min",
74+
QCPortAttributeDefaultValueKey: @0.0
75+
};
7676
}
7777

7878
if ( [key isEqualToString:@"inputXMax"] ) {
79-
return [NSDictionary dictionaryWithObjectsAndKeys:
80-
@"X Range Max", QCPortAttributeNameKey,
81-
[NSNumber numberWithFloat:5.0], QCPortAttributeDefaultValueKey,
82-
nil];
79+
return @{
80+
QCPortAttributeNameKey: @"X Range Max",
81+
QCPortAttributeDefaultValueKey: @5.0
82+
};
8383
}
8484

8585
if ( [key isEqualToString:@"inputYMin"] ) {
86-
return [NSDictionary dictionaryWithObjectsAndKeys:
87-
@"Y Range Min", QCPortAttributeNameKey,
88-
[NSNumber numberWithFloat:0.0], QCPortAttributeDefaultValueKey,
89-
nil];
86+
return @{
87+
QCPortAttributeNameKey: @"Y Range Min",
88+
QCPortAttributeDefaultValueKey: @0.0
89+
};
9090
}
9191

9292
if ( [key isEqualToString:@"inputYMax"] ) {
93-
return [NSDictionary dictionaryWithObjectsAndKeys:
94-
@"Y Range Max", QCPortAttributeNameKey,
95-
[NSNumber numberWithFloat:5.0], QCPortAttributeDefaultValueKey,
96-
nil];
93+
return @{
94+
QCPortAttributeNameKey: @"Y Range Max",
95+
QCPortAttributeDefaultValueKey: @5.0
96+
};
9797
}
9898

9999
return [super attributesForPropertyPortWithKey:key];
@@ -105,39 +105,35 @@ -(void)addPlotWithIndex:(NSUInteger)index
105105

106106
[self addInputPortWithType:QCPortTypeStructure
107107
forKey:[NSString stringWithFormat:@"plotNumbers%lu", (unsigned long)index]
108-
withAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
109-
[NSString stringWithFormat:@"Values %lu", (unsigned long)(index + 1)], QCPortAttributeNameKey,
110-
QCPortTypeStructure, QCPortAttributeTypeKey,
111-
nil]];
108+
withAttributes:@{ QCPortAttributeNameKey: [NSString stringWithFormat:@"Values %lu", (unsigned long)(index + 1)],
109+
QCPortAttributeTypeKey: QCPortTypeStructure }
110+
];
112111

113112
CGColorRef lineColor = [self newDefaultColorForPlot:index alpha:1.0];
114113
[self addInputPortWithType:QCPortTypeColor
115114
forKey:[NSString stringWithFormat:@"plotDataLineColor%lu", (unsigned long)index]
116-
withAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
117-
[NSString stringWithFormat:@"Plot Line Color %lu", (unsigned long)(index + 1)], QCPortAttributeNameKey,
118-
QCPortTypeColor, QCPortAttributeTypeKey,
119-
lineColor, QCPortAttributeDefaultValueKey,
120-
nil]];
115+
withAttributes:@{ QCPortAttributeNameKey: [NSString stringWithFormat:@"Plot Line Color %lu", (unsigned long)(index + 1)],
116+
QCPortAttributeTypeKey: QCPortTypeColor,
117+
QCPortAttributeDefaultValueKey: (id)lineColor }
118+
];
121119
CGColorRelease(lineColor);
122120

123121
CGColorRef fillColor = [self newDefaultColorForPlot:index alpha:0.25];
124122
[self addInputPortWithType:QCPortTypeColor
125123
forKey:[NSString stringWithFormat:@"plotFillColor%lu", (unsigned long)index]
126-
withAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
127-
[NSString stringWithFormat:@"Plot Fill Color %lu", (unsigned long)(index + 1)], QCPortAttributeNameKey,
128-
QCPortTypeColor, QCPortAttributeTypeKey,
129-
fillColor, QCPortAttributeDefaultValueKey,
130-
nil]];
124+
withAttributes:@{ QCPortAttributeNameKey: [NSString stringWithFormat:@"Plot Fill Color %lu", (unsigned long)(index + 1)],
125+
QCPortAttributeTypeKey: QCPortTypeColor,
126+
QCPortAttributeDefaultValueKey: (id)fillColor }
127+
];
131128
CGColorRelease(fillColor);
132129

133130
[self addInputPortWithType:QCPortTypeNumber
134131
forKey:[NSString stringWithFormat:@"plotDataLineWidth%lu", (unsigned long)index]
135-
withAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
136-
[NSString stringWithFormat:@"Plot Line Width %lu", (unsigned long)(index + 1)], QCPortAttributeNameKey,
137-
QCPortTypeNumber, QCPortAttributeTypeKey,
138-
[NSNumber numberWithInt:1.0], QCPortAttributeDefaultValueKey,
139-
[NSNumber numberWithFloat:0.0], QCPortAttributeMinimumValueKey,
140-
nil]];
132+
withAttributes:@{ QCPortAttributeNameKey: [NSString stringWithFormat:@"Plot Line Width %lu", (unsigned long)(index + 1)],
133+
QCPortAttributeTypeKey: QCPortTypeNumber,
134+
QCPortAttributeDefaultValueKey: @1.0,
135+
QCPortAttributeMinimumValueKey: @0.0 }
136+
];
141137

142138
// Add the new plot to the graph
143139
CPTBarPlot *barPlot = [CPTBarPlot tubularBarPlotWithColor:[CPTColor greenColor] horizontalBars:NO];

QCPlugin/CPPieChartPlugin.m

Lines changed: 48 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ @implementation CPPieChartPlugIn
2727

2828
+(NSDictionary *)attributes
2929
{
30-
return [NSDictionary dictionaryWithObjectsAndKeys:
31-
@"Core Plot Pie Chart", QCPlugInAttributeNameKey,
32-
@"Pie chart", QCPlugInAttributeDescriptionKey,
33-
nil];
30+
return @{
31+
QCPlugInAttributeNameKey: @"Core Plot Pie Chart",
32+
QCPlugInAttributeDescriptionKey: @"Pie chart"
33+
};
3434
}
3535

3636
-(double)inputXMax
@@ -62,7 +62,7 @@ -(QCPlugInViewController *)createViewController
6262

6363
+(NSArray *)sortedPropertyPortKeys
6464
{
65-
NSArray *pieChartPropertyPortKeys = [NSArray arrayWithObjects:@"inputPieRadius", @"inputSliceLabelOffset", @"inputStartAngle", @"inputSliceDirection", @"inputBorderColor", @"inputBorderWidth", nil];
65+
NSArray *pieChartPropertyPortKeys = @[@"inputPieRadius", @"inputSliceLabelOffset", @"inputStartAngle", @"inputSliceDirection", @"inputBorderColor", @"inputBorderWidth"];
6666

6767
return [[super sortedPropertyPortKeys] arrayByAddingObjectsFromArray:pieChartPropertyPortKeys];
6868
}
@@ -71,54 +71,54 @@ +(NSDictionary *)attributesForPropertyPortWithKey:(NSString *)key
7171
{
7272
// A few additional ports for the pie chart type ...
7373
if ( [key isEqualToString:@"inputPieRadius"] ) {
74-
return [NSDictionary dictionaryWithObjectsAndKeys:
75-
@"Pie Radius", QCPortAttributeNameKey,
76-
[NSNumber numberWithFloat:0.0], QCPortAttributeMinimumValueKey,
77-
[NSNumber numberWithFloat:0.75], QCPortAttributeDefaultValueKey,
78-
nil];
74+
return @{
75+
QCPortAttributeNameKey: @"Pie Radius",
76+
QCPortAttributeMinimumValueKey: @0.0,
77+
QCPortAttributeDefaultValueKey: @0.75
78+
};
7979
}
8080
else if ( [key isEqualToString:@"inputSliceLabelOffset"] ) {
81-
return [NSDictionary dictionaryWithObjectsAndKeys:
82-
@"Label Offset", QCPortAttributeNameKey,
83-
[NSNumber numberWithFloat:20.0], QCPortAttributeDefaultValueKey,
84-
nil];
81+
return @{
82+
QCPortAttributeNameKey: @"Label Offset",
83+
QCPortAttributeDefaultValueKey: @20.0
84+
};
8585
}
8686
else if ( [key isEqualToString:@"inputStartAngle"] ) {
87-
return [NSDictionary dictionaryWithObjectsAndKeys:
88-
@"Start Angle", QCPortAttributeNameKey,
89-
[NSNumber numberWithFloat:0.0], QCPortAttributeDefaultValueKey,
90-
nil];
87+
return @{
88+
QCPortAttributeNameKey: @"Start Angle",
89+
QCPortAttributeDefaultValueKey: @0.0
90+
};
9191
}
9292
else if ( [key isEqualToString:@"inputSliceDirection"] ) {
93-
return [NSDictionary dictionaryWithObjectsAndKeys:
94-
@"Slice Direction", QCPortAttributeNameKey,
95-
[NSNumber numberWithInt:1], QCPortAttributeMaximumValueKey,
96-
[NSArray arrayWithObjects:@"Clockwise", @"Counter-Clockwise", nil], QCPortAttributeMenuItemsKey,
97-
[NSNumber numberWithInt:0], QCPortAttributeDefaultValueKey,
98-
nil];
93+
return @{
94+
QCPortAttributeNameKey: @"Slice Direction",
95+
QCPortAttributeMaximumValueKey: @1,
96+
QCPortAttributeMenuItemsKey: @[@"Clockwise", @"Counter-Clockwise"],
97+
QCPortAttributeDefaultValueKey: @0
98+
};
9999
}
100100
else if ( [key isEqualToString:@"inputBorderWidth"] ) {
101-
return [NSDictionary dictionaryWithObjectsAndKeys:
102-
@"Border Width", QCPortAttributeNameKey,
103-
[NSNumber numberWithFloat:0.0], QCPortAttributeMinimumValueKey,
104-
[NSNumber numberWithFloat:1.0], QCPortAttributeDefaultValueKey,
105-
nil];
101+
return @{
102+
QCPortAttributeNameKey: @"Border Width",
103+
QCPortAttributeMinimumValueKey: @0.0,
104+
QCPortAttributeDefaultValueKey: @1.0
105+
};
106106
}
107107
else if ( [key isEqualToString:@"inputBorderColor"] ) {
108108
CGColorRef grayColor = CGColorCreateGenericGray(0.0, 1.0);
109-
NSDictionary *result = [NSDictionary dictionaryWithObjectsAndKeys:
110-
@"Border Color", QCPortAttributeNameKey,
111-
grayColor, QCPortAttributeDefaultValueKey,
112-
nil];
109+
NSDictionary *result = @{
110+
QCPortAttributeNameKey: @"Border Color",
111+
QCPortAttributeDefaultValueKey: (id)grayColor
112+
};
113113
CGColorRelease(grayColor);
114114
return result;
115115
}
116116
else if ( [key isEqualToString:@"inputLabelColor"] ) {
117117
CGColorRef grayColor = CGColorCreateGenericGray(1.0, 1.0);
118-
NSDictionary *result = [NSDictionary dictionaryWithObjectsAndKeys:
119-
@"Label Color", QCPortAttributeNameKey,
120-
grayColor, QCPortAttributeDefaultValueKey,
121-
nil];
118+
NSDictionary *result = @{
119+
QCPortAttributeNameKey: @"Label Color",
120+
QCPortAttributeDefaultValueKey: (id)grayColor
121+
};
122122
CGColorRelease(grayColor);
123123
return result;
124124
}
@@ -132,28 +132,25 @@ -(void)addPlotWithIndex:(NSUInteger)index
132132
if ( index == 0 ) {
133133
[self addInputPortWithType:QCPortTypeStructure
134134
forKey:[NSString stringWithFormat:@"plotNumbers%lu", (unsigned long)index]
135-
withAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
136-
[NSString stringWithFormat:@"Data Values %u", (unsigned)(index + 1)], QCPortAttributeNameKey,
137-
QCPortTypeStructure, QCPortAttributeTypeKey,
138-
nil]];
135+
withAttributes:@{ QCPortAttributeNameKey: [NSString stringWithFormat:@"Data Values %u", (unsigned)(index + 1)],
136+
QCPortAttributeTypeKey: QCPortTypeStructure }
137+
];
139138

140139
[self addInputPortWithType:QCPortTypeStructure
141140
forKey:[NSString stringWithFormat:@"plotLabels%lu", (unsigned long)index]
142-
withAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
143-
[NSString stringWithFormat:@"Data Labels %lu", (unsigned long)(index + 1)], QCPortAttributeNameKey,
144-
QCPortTypeStructure, QCPortAttributeTypeKey,
145-
nil]];
141+
withAttributes:@{ QCPortAttributeNameKey: [NSString stringWithFormat:@"Data Labels %lu", (unsigned long)(index + 1)],
142+
QCPortAttributeTypeKey: QCPortTypeStructure }
143+
];
146144

147145
// TODO: add support for used defined fill colors. As of now we use a single color
148146
// multiplied against the 'default' pie chart colors
149147
CGColorRef grayColor = CGColorCreateGenericGray(1.0, 1.0);
150148
[self addInputPortWithType:QCPortTypeColor
151149
forKey:[NSString stringWithFormat:@"plotFillColor%lu", (unsigned long)index]
152-
withAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
153-
[NSString stringWithFormat:@"Primary Fill Color %lu", (unsigned long)(index + 1)], QCPortAttributeNameKey,
154-
QCPortTypeColor, QCPortAttributeTypeKey,
155-
grayColor, QCPortAttributeDefaultValueKey,
156-
nil]];
150+
withAttributes:@{ QCPortAttributeNameKey: [NSString stringWithFormat:@"Primary Fill Color %lu", (unsigned long)(index + 1)],
151+
QCPortAttributeTypeKey: QCPortTypeColor,
152+
QCPortAttributeDefaultValueKey: (id)grayColor }
153+
];
157154
CGColorRelease(grayColor);
158155

159156
// Add the new plot to the graph
@@ -261,7 +258,7 @@ -(CPTFill *)sliceFillForPieChart:(CPTPieChart *)pieChart recordIndex:(NSUInteger
261258

262259
CGColorRelease(fillColor);
263260

264-
return [[(CPTFill *)[CPTFill alloc] initWithColor : fillCPColor] autorelease];
261+
return [[[CPTFill alloc] initWithColor:fillCPColor] autorelease];
265262
}
266263

267264
-(CPTTextLayer *)sliceLabelForPieChart:(CPTPieChart *)pieChart recordIndex:(NSUInteger)index

0 commit comments

Comments
 (0)