Permalink
Browse files

Updated property implementations to reduce code base

Updated property implementations to use the @synthesize syntax where
possible.
  • Loading branch information...
epreston committed Aug 29, 2011
1 parent 0873d28 commit 9816afd958268166653923eb23bd04f13f003767
@@ -22,10 +22,12 @@ - (id) initWithFrame:(CGRect)frame
return self;
}
+
+#pragma mark - Resource Management
+
- (void) dealloc
{
[super dealloc];
}
-
@end
@@ -21,10 +21,12 @@ - (id) initWithFrame:(CGRect)frame
return self;
}
+
+#pragma mark - Resource Management
+
- (void) dealloc
{
[super dealloc];
}
-
@end
@@ -120,7 +120,6 @@ - (UIBezierPath *) orthogonalConnectionsPath
CGPoint rootIntersection = CGPointMake(CGRectGetMidX(bounds), CGRectGetMidY(bounds));
-
// Align the line to get exact pixel coverage, for sharper rendering.
// basePoint = [self convertPointToBase:rootIntersection];
@@ -133,10 +133,7 @@ - (void) awakeFromNib
#pragma mark - Styling
-- (UIColor*) borderColor
-{
- return borderColor;
-}
+@synthesize borderColor;
- (void) setBorderColor:(UIColor *)color
{
@@ -147,10 +144,7 @@ - (void) setBorderColor:(UIColor *)color
}
}
-- (CGFloat) borderWidth
-{
- return borderWidth;
-}
+@synthesize borderWidth;
- (void) setBorderWidth:(CGFloat)width
{
@@ -160,10 +154,7 @@ - (void) setBorderWidth:(CGFloat)width
}
}
-- (CGFloat)cornerRadius
-{
- return cornerRadius;
-}
+@synthesize cornerRadius;
- (void) setCornerRadius:(CGFloat)radius
{
@@ -173,10 +164,7 @@ - (void) setCornerRadius:(CGFloat)radius
}
}
-- (UIColor*) fillColor
-{
- return fillColor;
-}
+@synthesize fillColor;
- (void) setFillColor:(UIColor *)color
{
@@ -190,10 +178,7 @@ - (void) setFillColor:(UIColor *)color
#pragma mark - Selection State
-- (BOOL) showingSelected
-{
- return showingSelected;
-}
+@synthesize showingSelected;
- (void) setShowingSelected:(BOOL)newShowingSelected
{
@@ -79,11 +79,7 @@
/// Returns YES if this subtree needs relayout.
-- (BOOL) needsGraphLayout;
-
-/// Marks this subtree as needing relayout.
-
-- (void) setNeedsGraphLayout;
+@property (nonatomic, assign) BOOL needsGraphLayout;
/// Recursively marks this subtree, and all of its descendants, as needing relayout.
@@ -97,19 +97,11 @@ - (PSBaseTreeGraphView *) enclosingTreeGraph
#pragma mark - Layout
-- (BOOL) needsGraphLayout
-{
- return needsGraphLayout;
-}
-
-- (void) setNeedsGraphLayout
-{
- needsGraphLayout = YES;
-}
+@synthesize needsGraphLayout;
- (void) recursiveSetNeedsGraphLayout
{
- [self setNeedsGraphLayout];
+ [self setNeedsGraphLayout:YES];
for (UIView *subview in [self subviews]) {
if ([subview isKindOfClass:[PSBaseSubtreeView class]]) {
[(PSBaseSubtreeView *)subview recursiveSetNeedsGraphLayout];
@@ -394,10 +386,7 @@ - (CGSize) layoutGraphIfNeeded
return selfTargetSize;
}
-- (BOOL) isExpanded
-{
- return expanded;
-}
+@synthesize expanded;
- (void) setExpanded:(BOOL)flag
{
@@ -90,7 +90,6 @@ typedef NSInteger PSTreeGraphOrientationStyle;
// iOS 4 and above ONLY
// UINib *cachedNodeViewNib;
-
}
@@ -85,9 +85,7 @@ - (PSBaseSubtreeView *) rootSubtreeView
#pragma mark - Node View Nib Specification
-- (NSString *)nodeViewNibName {
- return nodeViewNibName;
-}
+@synthesize nodeViewNibName;
- (void)setNodeViewNibName:(NSString *)newName {
if (nodeViewNibName != newName) {
@@ -102,9 +100,7 @@ - (void)setNodeViewNibName:(NSString *)newName {
}
}
-- (NSBundle *)nodeViewNibBundle {
- return nodeViewNibBundle;
-}
+@synthesize nodeViewNibBundle;
- (void) setNodeViewNibBundle:(NSBundle *)newBundle {
if (nodeViewNibBundle != newBundle) {
@@ -349,10 +345,7 @@ - (void) updateRootSubtreeViewPositionForSize:(CGSize)rootSubtreeViewSize
}
-- (PSTreeGraphOrientationStyle) treeGraphOrientation
-{
- return treeGraphOrientation;
-}
+@synthesize treeGraphOrientation;
- (void) setTreeGraphOrientation:(PSTreeGraphOrientationStyle)newTreeGraphOrientation
{
@@ -362,10 +355,7 @@ - (void) setTreeGraphOrientation:(PSTreeGraphOrientationStyle)newTreeGraphOrient
}
}
-- (BOOL) resizesToFillEnclosingScrollView
-{
- return resizesToFillEnclosingScrollView;
-}
+@synthesize resizesToFillEnclosingScrollView;
- (void) setResizesToFillEnclosingScrollView:(BOOL)flag
{
@@ -529,10 +519,7 @@ - (void) scrollSelectedModelNodesToVisible
#pragma mark - Data Source
-- (id <PSTreeGraphModelNode> ) modelRoot
-{
- return modelRoot;
-}
+@synthesize modelRoot;
- (void) setModelRoot:(id <PSTreeGraphModelNode> )newModelRoot
{
@@ -786,10 +773,7 @@ - (void) moveRight:(id)sender
// }
//}
-- (UIColor *) connectingLineColor
-{
- return connectingLineColor;
-}
+@synthesize connectingLineColor;
- (void) setConnectingLineColor:(UIColor *)newConnectingLineColor
{
@@ -800,10 +784,7 @@ - (void) setConnectingLineColor:(UIColor *)newConnectingLineColor
}
}
-- (CGFloat) contentMargin
-{
- return contentMargin;
-}
+@synthesize contentMargin;
- (void) setContentMargin:(CGFloat)newContentMargin
{
@@ -814,10 +795,7 @@ - (void) setContentMargin:(CGFloat)newContentMargin
}
}
-- (CGFloat) parentChildSpacing
-{
- return parentChildSpacing;
-}
+@synthesize parentChildSpacing;
- (void) setParentChildSpacing:(CGFloat)newParentChildSpacing
{
@@ -828,10 +806,7 @@ - (void) setParentChildSpacing:(CGFloat)newParentChildSpacing
}
}
-- (CGFloat) siblingSpacing
-{
- return siblingSpacing;
-}
+@synthesize siblingSpacing;
- (void) setSiblingSpacing:(CGFloat)newSiblingSpacing
{
@@ -842,10 +817,7 @@ - (void) setSiblingSpacing:(CGFloat)newSiblingSpacing
}
}
-- (PSTreeGraphConnectingLineStyle) connectingLineStyle
-{
- return connectingLineStyle;
-}
+@synthesize connectingLineStyle;
- (void) setConnectingLineStyle:(PSTreeGraphConnectingLineStyle)newConnectingLineStyle
{
@@ -855,10 +827,7 @@ - (void) setConnectingLineStyle:(PSTreeGraphConnectingLineStyle)newConnectingLin
}
}
-- (CGFloat) connectingLineWidth
-{
- return connectingLineWidth;
-}
+@synthesize connectingLineWidth;
- (void)setConnectingLineWidth:(CGFloat)newConnectingLineWidth {
if (connectingLineWidth != newConnectingLineWidth) {
@@ -867,10 +836,7 @@ - (void)setConnectingLineWidth:(CGFloat)newConnectingLineWidth {
}
}
-- (BOOL) showsSubtreeFrames
-{
- return showsSubtreeFrames;
-}
+@synthesize showsSubtreeFrames;
- (void) setShowsSubtreeFrames:(BOOL)newShowsSubtreeFrames
{
@@ -960,6 +926,8 @@ - (void) dealloc
{
// iOS 4.0 and above ONLY
// [cachedNodeViewNib release];
+
+ self.delegate = nil;
[nodeViewNibBundle release];
[nodeViewNibName release];

0 comments on commit 9816afd

Please sign in to comment.