Skip to content

Commit

Permalink
Move attributes to array controller, cleanup abstract node hierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Gutknecht committed May 17, 2009
1 parent dbff008 commit b03718f
Show file tree
Hide file tree
Showing 11 changed files with 251 additions and 359 deletions.
4 changes: 4 additions & 0 deletions Casserole.xcodeproj/project.pbxproj
Expand Up @@ -30,6 +30,7 @@
776B00FC0FB6180F00F0EC94 /* KCViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 776B00FB0FB6180F00F0EC94 /* KCViewController.m */; };
776B01620FB626EE00F0EC94 /* KCValueTransformers.m in Sources */ = {isa = PBXBuildFile; fileRef = 776B01610FB626EE00F0EC94 /* KCValueTransformers.m */; };
776BFEB30FB5F59700F0EC94 /* KCRegistration.m in Sources */ = {isa = PBXBuildFile; fileRef = 776BFEB20FB5F59700F0EC94 /* KCRegistration.m */; };
777DECD70FBFA5410095EB25 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 777DECD60FBFA5410095EB25 /* QuartzCore.framework */; };
778EF94C0FB23EDD00FE49FC /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 778EF94B0FB23EDD00FE49FC /* MainWindow.xib */; };
778EFA300FB2563200FE49FC /* KCAbstractNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 778EFA2F0FB2563200FE49FC /* KCAbstractNode.m */; };
779EF7BA0FB7391D000C014B /* Casserole.icns in Resources */ = {isa = PBXBuildFile; fileRef = 779EF7B90FB7391D000C014B /* Casserole.icns */; };
Expand Down Expand Up @@ -104,6 +105,7 @@
776B01610FB626EE00F0EC94 /* KCValueTransformers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KCValueTransformers.m; sourceTree = "<group>"; };
776BFEB10FB5F59700F0EC94 /* KCRegistration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KCRegistration.h; sourceTree = "<group>"; };
776BFEB20FB5F59700F0EC94 /* KCRegistration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KCRegistration.m; sourceTree = "<group>"; };
777DECD60FBFA5410095EB25 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = /System/Library/Frameworks/QuartzCore.framework; sourceTree = "<absolute>"; };
778EF9470FB23EB200FE49FC /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainWindow.xib; sourceTree = "<group>"; };
778EFA2E0FB2563200FE49FC /* KCAbstractNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KCAbstractNode.h; sourceTree = "<group>"; };
778EFA2F0FB2563200FE49FC /* KCAbstractNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KCAbstractNode.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -143,6 +145,7 @@
files = (
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
774DD65E0FBB2140004C03A2 /* JSON.framework in Frameworks */,
777DECD70FBFA5410095EB25 /* QuartzCore.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -162,6 +165,7 @@
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
isa = PBXGroup;
children = (
777DECD60FBFA5410095EB25 /* QuartzCore.framework */,
774DD65D0FBB2140004C03A2 /* JSON.framework */,
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
);
Expand Down
144 changes: 63 additions & 81 deletions English.lproj/Node.xib
Expand Up @@ -8,7 +8,7 @@
<string key="IBDocument.HIToolboxVersion">353.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="20"/>
<integer value="1"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
Expand Down Expand Up @@ -81,17 +81,11 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{57, 511}, {561, 17}}</string>
<reference key="NSSuperview" ref="1005"/>
<object class="NSShadow" key="NSViewShadow">
<double key="NSShadowHoriz">5.000000e+00</double>
<double key="NSShadowVert">4.000000e+00</double>
<double key="NSShadowBlurRadius">2.000000e+00</double>
<reference key="NSShadowColor" ref="874428939"/>
</object>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="262186541">
<int key="NSCellFlags">68288064</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents">test1.ftnx.net</string>
<string key="NSContents">test1.example.com</string>
<reference key="NSSupport" ref="812614290"/>
<reference key="NSControlView" ref="160485015"/>
<reference key="NSBackgroundColor" ref="360712617"/>
Expand Down Expand Up @@ -547,49 +541,10 @@
<string key="NSTreeContentChildrenKey">children</string>
<string key="NSTreeContentLeafKey">isLeaf</string>
</object>
<object class="NSDictionaryController" id="730373163">
<object class="NSMutableArray" key="NSDeclaredKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>key</string>
<string>value</string>
</object>
<bool key="NSEditable">YES</bool>
<bool key="NSAvoidsEmptySelection">YES</bool>
<bool key="NSPreservesSelection">YES</bool>
<bool key="NSSelectsInsertedObjects">YES</bool>
<bool key="NSFilterRestrictsInsertion">YES</bool>
<object class="NSArray" key="NSSortDescriptors">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSSortDescriptor">
<string key="NSKey">key</string>
<bool key="NSAscending">YES</bool>
<string key="NSSelector">compare:</string>
</object>
</object>
<bool key="NSClearsFilterPredicateOnInsertion">YES</bool>
<string key="NSInitialKey">key</string>
<string key="NSInitialValue">value</string>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
<string key="label">contentArray: attributes</string>
<reference key="source" ref="917418109"/>
<reference key="destination" ref="1001"/>
<object class="NSNibBindingConnector" key="connector">
<reference key="NSSource" ref="917418109"/>
<reference key="NSDestination" ref="1001"/>
<string key="NSLabel">contentArray: attributes</string>
<string key="NSBinding">contentArray</string>
<string key="NSKeyPath">attributes</string>
<int key="NSNibBindingConnectorVersion">2</int>
</object>
</object>
<int key="connectionID">30</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">view</string>
Expand All @@ -598,22 +553,6 @@
</object>
<int key="connectionID">39</int>
</object>
<object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
<string key="label">contentDictionary: node.attributes</string>
<reference key="source" ref="730373163"/>
<reference key="destination" ref="1001"/>
<object class="NSNibBindingConnector" key="connector">
<reference key="NSSource" ref="730373163"/>
<reference key="NSDestination" ref="1001"/>
<string key="NSLabel">contentDictionary: node.attributes</string>
<string key="NSBinding">contentDictionary</string>
<string key="NSKeyPath">node.attributes</string>
<int key="NSNibBindingConnectorVersion">2</int>
</object>
</object>
<int key="connectionID">48</int>
</object>
<object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
<string key="label">value: node.attributes.recipes</string>
Expand Down Expand Up @@ -671,12 +610,60 @@
<int key="connectionID">58</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">dataSource</string>
<reference key="source" ref="911559918"/>
<object class="IBBindingConnection" key="connection">
<string key="label">contentArray: node.chefAttributes</string>
<reference key="source" ref="917418109"/>
<reference key="destination" ref="1001"/>
<object class="NSNibBindingConnector" key="connector">
<reference key="NSSource" ref="917418109"/>
<reference key="NSDestination" ref="1001"/>
<string key="NSLabel">contentArray: node.chefAttributes</string>
<string key="NSBinding">contentArray</string>
<string key="NSKeyPath">node.chefAttributes</string>
<int key="NSNibBindingConnectorVersion">2</int>
</object>
</object>
<int key="connectionID">61</int>
</object>
<object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
<string key="label">value: arrangedObjects.nodeTitle</string>
<reference key="source" ref="101702526"/>
<reference key="destination" ref="917418109"/>
<object class="NSNibBindingConnector" key="connector">
<reference key="NSSource" ref="101702526"/>
<reference key="NSDestination" ref="917418109"/>
<string key="NSLabel">value: arrangedObjects.nodeTitle</string>
<string key="NSBinding">value</string>
<string key="NSKeyPath">arrangedObjects.nodeTitle</string>
<int key="NSNibBindingConnectorVersion">2</int>
</object>
</object>
<int key="connectionID">62</int>
</object>
<object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
<string key="label">value: arrangedObjects.nodeValue</string>
<reference key="source" ref="401662536"/>
<reference key="destination" ref="917418109"/>
<object class="NSNibBindingConnector" key="connector">
<reference key="NSSource" ref="401662536"/>
<reference key="NSDestination" ref="917418109"/>
<string key="NSLabel">value: arrangedObjects.nodeValue</string>
<string key="NSBinding">value</string>
<string key="NSKeyPath">arrangedObjects.nodeValue</string>
<int key="NSNibBindingConnectorVersion">2</int>
</object>
</object>
<int key="connectionID">60</int>
<int key="connectionID">63</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">outlineView</string>
<reference key="source" ref="1001"/>
<reference key="destination" ref="726665830"/>
</object>
<int key="connectionID">77</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
Expand Down Expand Up @@ -714,11 +701,11 @@
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="409231034"/>
<reference ref="160485015"/>
<reference ref="745077583"/>
<reference ref="459659210"/>
<reference ref="61700470"/>
<reference ref="119311088"/>
<reference ref="160485015"/>
<reference ref="726665830"/>
</object>
<reference key="parent" ref="1002"/>
Expand Down Expand Up @@ -807,6 +794,11 @@
<reference key="object" ref="46096849"/>
<reference key="parent" ref="119311088"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">29</int>
<reference key="object" ref="917418109"/>
<reference key="parent" ref="1002"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">20</int>
<reference key="object" ref="726665830"/>
Expand Down Expand Up @@ -872,16 +864,6 @@
<reference key="object" ref="454620978"/>
<reference key="parent" ref="101702526"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">29</int>
<reference key="object" ref="917418109"/>
<reference key="parent" ref="1002"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">47</int>
<reference key="object" ref="730373163"/>
<reference key="parent" ref="1002"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
Expand Down Expand Up @@ -920,9 +902,9 @@
<string>3.IBPluginDependency</string>
<string>4.IBPluginDependency</string>
<string>4.IBViewIntegration.shadowBlurRadius</string>
<string>4.IBViewIntegration.shadowColor</string>
<string>4.IBViewIntegration.shadowOffsetHeight</string>
<string>4.IBViewIntegration.shadowOffsetWidth</string>
<string>47.IBPluginDependency</string>
<string>5.IBPluginDependency</string>
<string>9.IBPluginDependency</string>
</object>
Expand Down Expand Up @@ -960,11 +942,11 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<real value="2.000000e+00"/>
<reference ref="874428939"/>
<real value="4.000000e+00"/>
<real value="5.000000e+00"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
Expand All @@ -987,7 +969,7 @@
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">60</int>
<int key="maxID">87</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
Expand Down
44 changes: 28 additions & 16 deletions core/KCAbstractNode.h
Expand Up @@ -12,20 +12,18 @@
@class KCViewController;

@interface KCAbstractNode : NSObject {
KCAbstractNode *_parent;
NSString *_nodeTitle;
NSString *_nodeValue;
NSMutableArray *_children;
KCChefConnection *_connection;
BOOL _isLeaf;
KCAbstractNode *parent;
NSString *nodeTitle;
NSString *nodeValue;
NSMutableArray *children;
BOOL isLeaf;
}

@property(copy) NSString *nodeValue;
@property(copy) NSString *nodeTitle;
@property(copy) NSMutableArray *children;
@property(assign) KCAbstractNode *parent;
@property(assign) BOOL isLeaf;
@property(assign) KCChefConnection *connection;
@property(copy) NSString *nodeValue;
@property(copy) NSString *nodeTitle;
@property(copy) NSMutableArray *children;
@property(assign) KCAbstractNode *parent;
@property(assign) BOOL isLeaf;

-(void)addObject:(id)o;

Expand All @@ -35,13 +33,27 @@

@end

@interface KCNodesProxy : KCAbstractNode
@interface KCAttributeNode : KCAbstractNode {
NSString *nodeType;
}
@property(assign) NSString *nodeType;
@end

@interface KCViewControllerNode : KCAbstractNode {
KCViewController *viewController;
@interface KCChefNode : KCAbstractNode {
KCChefConnection *connection;
}

@property(assign) KCChefConnection *connection;

@end

@interface KCNodesProxy : KCChefNode
@end

@interface KCViewControllerNode : KCChefNode {
KCViewController *viewController;
}

@property(assign) KCViewController *viewController;
@property(assign) KCViewController *viewController;

@end

0 comments on commit b03718f

Please sign in to comment.