Commits

Daniel Vollmer  committed a91a6d4

Replaced NSCollectionView with NSView-based NSTableView.
I'm not sure this is actually better:
- NSTableView is conceptually closer to what I am doing than NSCollectionView, yet
- no animation when using bindings (as I am atm) for inserting, zooming, removing
- some code is nicer than the stupid collectionViewItem-massaging
- need to take care of rowHeight manually
- can use NSTableViewRow for selected background shizzle
- Sigh. Dunno.

  • Participants
  • Parent commits ae9cd8e
  • Branches NSTableView

Comments (0)

Files changed (5)

File English.lproj/WowPlotDocument.xib

 <?xml version="1.0" encoding="UTF-8"?>
 <archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
 	<data>
-		<int key="IBDocument.SystemTarget">1050</int>
+		<int key="IBDocument.SystemTarget">1070</int>
 		<string key="IBDocument.SystemVersion">11A511</string>
 		<string key="IBDocument.InterfaceBuilderVersion">1617</string>
 		<string key="IBDocument.AppKitVersion">1138</string>
 		</object>
 		<array key="IBDocument.IntegratedClassDependencies">
 			<string>NSView</string>
-			<string>NSCollectionView</string>
+			<string>NSTableView</string>
 			<string>NSScrollView</string>
 			<string>NSWindowTemplate</string>
-			<string>NSCollectionViewItem</string>
 			<string>NSArrayController</string>
+			<string>NSTextFieldCell</string>
+			<string>NSCustomView</string>
+			<string>NSTableColumn</string>
 			<string>NSScroller</string>
 			<string>NSCustomObject</string>
 		</array>
 					<reference key="NSNextResponder"/>
 					<int key="NSvFlags">256</int>
 					<array class="NSMutableArray" key="NSSubviews">
-						<object class="NSScrollView" id="1024422455">
+						<object class="NSScrollView" id="361481002">
 							<reference key="NSNextResponder" ref="568628114"/>
 							<int key="NSvFlags">274</int>
 							<array class="NSMutableArray" key="NSSubviews">
-								<object class="NSClipView" id="570765199">
-									<reference key="NSNextResponder" ref="1024422455"/>
+								<object class="NSClipView" id="982099502">
+									<reference key="NSNextResponder" ref="361481002"/>
 									<int key="NSvFlags">2304</int>
 									<array class="NSMutableArray" key="NSSubviews">
-										<object class="NSCollectionView" id="546578393">
-											<reference key="NSNextResponder" ref="570765199"/>
-											<int key="NSvFlags">274</int>
-											<string key="NSFrameSize">{600, 300}</string>
-											<reference key="NSSuperview" ref="570765199"/>
+										<object class="NSTableView" id="553239131">
+											<reference key="NSNextResponder" ref="982099502"/>
+											<int key="NSvFlags">256</int>
+											<string key="NSFrameSize">{587, 287}</string>
+											<reference key="NSSuperview" ref="982099502"/>
 											<reference key="NSWindow"/>
-											<reference key="NSNextKeyView" ref="650543508"/>
-											<string key="NSMinGridSize">{0, 0}</string>
-											<string key="NSMaxGridSize">{0, 0}</string>
-											<int key="NSMaxNumberOfGridRows">0</int>
-											<int key="NSMaxNumberOfGridColumns">1</int>
-											<array key="NSBackgroundColors">
-												<object class="NSColor" id="29716557">
-													<int key="NSColorSpace">1</int>
-													<bytes key="NSRGB">MCAwIDAAA</bytes>
+											<reference key="NSNextKeyView" ref="208367549"/>
+											<string key="NSReuseIdentifierKey">_NS:1197</string>
+											<bool key="NSEnabled">YES</bool>
+											<object class="_NSCornerView" key="NSCornerView">
+												<nil key="NSNextResponder"/>
+												<int key="NSvFlags">256</int>
+												<string key="NSFrame">{{586, 0}, {16, 17}}</string>
+												<string key="NSReuseIdentifierKey">_NS:1202</string>
+											</object>
+											<array class="NSMutableArray" key="NSTableColumns">
+												<object class="NSTableColumn" id="1068720735">
+													<double key="NSWidth">584</double>
+													<double key="NSMinWidth">200</double>
+													<double key="NSMaxWidth">2147483648</double>
+													<object class="NSTableHeaderCell" key="NSHeaderCell">
+														<int key="NSCellFlags">75628096</int>
+														<int key="NSCellFlags2">2048</int>
+														<string key="NSContents">Plot</string>
+														<object class="NSFont" key="NSSupport">
+															<string key="NSName">LucidaGrande</string>
+															<double key="NSSize">11</double>
+															<int key="NSfFlags">3100</int>
+														</object>
+														<object class="NSColor" key="NSBackgroundColor">
+															<int key="NSColorSpace">3</int>
+															<bytes key="NSWhite">MC4zMzMzMzI5ODU2AA</bytes>
+														</object>
+														<object class="NSColor" key="NSTextColor">
+															<int key="NSColorSpace">6</int>
+															<string key="NSCatalogName">System</string>
+															<string key="NSColorName">headerTextColor</string>
+															<object class="NSColor" key="NSColor" id="721363114">
+																<int key="NSColorSpace">3</int>
+																<bytes key="NSWhite">MAA</bytes>
+															</object>
+														</object>
+													</object>
+													<object class="NSTextFieldCell" key="NSDataCell" id="870816329">
+														<int key="NSCellFlags">874643008</int>
+														<int key="NSCellFlags2">2048</int>
+														<string key="NSContents">Text Cell</string>
+														<object class="NSFont" key="NSSupport">
+															<string key="NSName">LucidaGrande</string>
+															<double key="NSSize">13</double>
+															<int key="NSfFlags">1044</int>
+														</object>
+														<reference key="NSControlView" ref="553239131"/>
+														<object class="NSColor" key="NSBackgroundColor">
+															<int key="NSColorSpace">6</int>
+															<string key="NSCatalogName">System</string>
+															<string key="NSColorName">controlBackgroundColor</string>
+															<object class="NSColor" key="NSColor">
+																<int key="NSColorSpace">3</int>
+																<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
+															</object>
+														</object>
+														<object class="NSColor" key="NSTextColor">
+															<int key="NSColorSpace">6</int>
+															<string key="NSCatalogName">System</string>
+															<string key="NSColorName">controlTextColor</string>
+															<reference key="NSColor" ref="721363114"/>
+														</object>
+													</object>
+													<int key="NSResizingMask">1</int>
+													<bool key="NSIsResizeable">YES</bool>
+													<reference key="NSTableView" ref="553239131"/>
 												</object>
 											</array>
-											<bool key="NSSelectable">YES</bool>
-											<int key="NSDraggingSourceMaskForLocal">-1</int>
+											<double key="NSIntercellSpacingWidth">3</double>
+											<double key="NSIntercellSpacingHeight">2</double>
+											<object class="NSColor" key="NSBackgroundColor" id="803006894">
+												<int key="NSColorSpace">1</int>
+												<bytes key="NSRGB">MCAwIDAAA</bytes>
+											</object>
+											<object class="NSColor" key="NSGridColor">
+												<int key="NSColorSpace">6</int>
+												<string key="NSCatalogName">System</string>
+												<string key="NSColorName">gridColor</string>
+												<object class="NSColor" key="NSColor">
+													<int key="NSColorSpace">3</int>
+													<bytes key="NSWhite">MC41AA</bytes>
+												</object>
+											</object>
+											<double key="NSRowHeight">96</double>
+											<int key="NSTvFlags">306184192</int>
+											<reference key="NSDelegate"/>
+											<reference key="NSDataSource"/>
+											<int key="NSColumnAutoresizingStyle">5</int>
+											<int key="NSDraggingSourceMaskForLocal">15</int>
 											<int key="NSDraggingSourceMaskForNonLocal">0</int>
+											<bool key="NSAllowsTypeSelect">NO</bool>
+											<int key="NSTableViewDraggingDestinationStyle">0</int>
+											<int key="NSTableViewGroupRowStyle">1</int>
 										</object>
 									</array>
-									<string key="NSFrameSize">{600, 300}</string>
-									<reference key="NSSuperview" ref="1024422455"/>
+									<string key="NSFrameSize">{587, 287}</string>
+									<reference key="NSSuperview" ref="361481002"/>
 									<reference key="NSWindow"/>
-									<reference key="NSNextKeyView" ref="546578393"/>
-									<reference key="NSDocView" ref="546578393"/>
-									<reference key="NSBGColor" ref="29716557"/>
+									<reference key="NSNextKeyView" ref="553239131"/>
+									<string key="NSReuseIdentifierKey">_NS:1195</string>
+									<reference key="NSDocView" ref="553239131"/>
+									<reference key="NSBGColor" ref="803006894"/>
 									<int key="NScvFlags">2</int>
 								</object>
-								<object class="NSScroller" id="205493477">
-									<reference key="NSNextResponder" ref="1024422455"/>
+								<object class="NSScroller" id="741886802">
+									<reference key="NSNextResponder" ref="361481002"/>
 									<int key="NSvFlags">256</int>
-									<string key="NSFrame">{{585, 0}, {15, 294}}</string>
-									<reference key="NSSuperview" ref="1024422455"/>
+									<string key="NSFrame">{{587, 0}, {15, 287}}</string>
+									<reference key="NSSuperview" ref="361481002"/>
 									<reference key="NSWindow"/>
-									<reference key="NSNextKeyView"/>
-									<reference key="NSTarget" ref="1024422455"/>
+									<reference key="NSNextKeyView" ref="538198417"/>
+									<string key="NSReuseIdentifierKey">_NS:1214</string>
+									<reference key="NSTarget" ref="361481002"/>
 									<string key="NSAction">_doScroller:</string>
-									<double key="NSCurValue">1</double>
-									<double key="NSPercent">0.89655169999999995</double>
+									<double key="NSPercent">0.99650349650349646</double>
 								</object>
-								<object class="NSScroller" id="650543508">
-									<reference key="NSNextResponder" ref="1024422455"/>
+								<object class="NSScroller" id="538198417">
+									<reference key="NSNextResponder" ref="361481002"/>
 									<int key="NSvFlags">256</int>
-									<string key="NSFrame">{{0, 285}, {594, 15}}</string>
-									<reference key="NSSuperview" ref="1024422455"/>
+									<string key="NSFrame">{{0, 287}, {587, 15}}</string>
+									<reference key="NSSuperview" ref="361481002"/>
 									<reference key="NSWindow"/>
-									<reference key="NSNextKeyView" ref="205493477"/>
+									<string key="NSReuseIdentifierKey">_NS:1216</string>
 									<int key="NSsFlags">1</int>
-									<reference key="NSTarget" ref="1024422455"/>
+									<reference key="NSTarget" ref="361481002"/>
 									<string key="NSAction">_doScroller:</string>
-									<double key="NSPercent">0.63157890000000005</double>
+									<double key="NSPercent">0.99829351535836175</double>
 								</object>
 							</array>
-							<string key="NSFrameSize">{600, 300}</string>
+							<string key="NSFrame">{{-1, -1}, {602, 302}}</string>
 							<reference key="NSSuperview" ref="568628114"/>
 							<reference key="NSWindow"/>
-							<reference key="NSNextKeyView" ref="570765199"/>
+							<reference key="NSNextKeyView" ref="982099502"/>
+							<string key="NSReuseIdentifierKey">_NS:1193</string>
 							<int key="NSsFlags">133168</int>
-							<reference key="NSVScroller" ref="205493477"/>
-							<reference key="NSHScroller" ref="650543508"/>
-							<reference key="NSContentView" ref="570765199"/>
+							<reference key="NSVScroller" ref="741886802"/>
+							<reference key="NSHScroller" ref="538198417"/>
+							<reference key="NSContentView" ref="982099502"/>
+							<bytes key="NSScrollAmts">QSAAAEEgAABCxAAAQsQAAA</bytes>
 						</object>
 					</array>
 					<string key="NSFrameSize">{600, 300}</string>
 					<reference key="NSSuperview"/>
 					<reference key="NSWindow"/>
-					<reference key="NSNextKeyView" ref="1024422455"/>
+					<reference key="NSNextKeyView" ref="361481002"/>
 				</object>
 				<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
 				<string key="NSMinSize">{400, 244}</string>
 				<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
 				<string key="NSFrameAutosaveName">WowPlotWindow</string>
+				<int key="NSWindowCollectionBehavior">128</int>
 				<bool key="NSWindowIsRestorable">YES</bool>
 			</object>
 			<object class="NSCustomObject" id="796877042">
 				<string key="NSClassName">NSApplication</string>
 			</object>
-			<object class="NSCollectionViewItem" id="73574840"/>
-			<object class="NSView" id="865477801">
-				<nil key="NSNextResponder"/>
-				<int key="NSvFlags">274</int>
-				<string key="NSFrameSize">{100, 100}</string>
-			</object>
 			<object class="NSArrayController" id="1020633350">
 				<string key="NSObjectClassName">WowPlotRoot</string>
 				<bool key="NSEditable">YES</bool>
 				</object>
 				<object class="IBConnectionRecord">
 					<object class="IBOutletConnection" key="connection">
-						<string key="label">itemPrototype</string>
-						<reference key="source" ref="546578393"/>
-						<reference key="destination" ref="73574840"/>
-					</object>
-					<int key="connectionID">100036</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBOutletConnection" key="connection">
-						<string key="label">view</string>
-						<reference key="source" ref="73574840"/>
-						<reference key="destination" ref="865477801"/>
-					</object>
-					<int key="connectionID">100037</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBOutletConnection" key="connection">
-						<string key="label">plotCollectionController</string>
+						<string key="label">_plotCollectionController</string>
 						<reference key="source" ref="512844837"/>
 						<reference key="destination" ref="1020633350"/>
 					</object>
-					<int key="connectionID">100039</int>
+					<int key="connectionID">100073</int>
 				</object>
 				<object class="IBConnectionRecord">
 					<object class="IBBindingConnection" key="connection">
 						<string key="label">content: arrangedObjects</string>
-						<reference key="source" ref="546578393"/>
+						<reference key="source" ref="553239131"/>
 						<reference key="destination" ref="1020633350"/>
-						<object class="NSNibBindingConnector" key="connector" id="999677353">
-							<reference key="NSSource" ref="546578393"/>
+						<object class="NSNibBindingConnector" key="connector">
+							<reference key="NSSource" ref="553239131"/>
 							<reference key="NSDestination" ref="1020633350"/>
 							<string key="NSLabel">content: arrangedObjects</string>
 							<string key="NSBinding">content</string>
 							<int key="NSNibBindingConnectorVersion">2</int>
 						</object>
 					</object>
-					<int key="connectionID">100041</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBBindingConnection" key="connection">
-						<string key="label">selectionIndexes: selectionIndexes</string>
-						<reference key="source" ref="546578393"/>
-						<reference key="destination" ref="1020633350"/>
-						<object class="NSNibBindingConnector" key="connector">
-							<reference key="NSSource" ref="546578393"/>
-							<reference key="NSDestination" ref="1020633350"/>
-							<string key="NSLabel">selectionIndexes: selectionIndexes</string>
-							<string key="NSBinding">selectionIndexes</string>
-							<string key="NSKeyPath">selectionIndexes</string>
-							<reference key="NSPreviousConnector" ref="999677353"/>
-							<int key="NSNibBindingConnectorVersion">2</int>
-						</object>
-					</object>
-					<int key="connectionID">100043</int>
+					<int key="connectionID">100082</int>
 				</object>
 				<object class="IBConnectionRecord">
 					<object class="IBOutletConnection" key="connection">
-						<string key="label">plotCollectionView</string>
+						<string key="label">_plotView</string>
 						<reference key="source" ref="512844837"/>
-						<reference key="destination" ref="546578393"/>
+						<reference key="destination" ref="553239131"/>
 					</object>
-					<int key="connectionID">100044</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBOutletConnection" key="connection">
-						<string key="label">cvItem</string>
-						<reference key="source" ref="865477801"/>
-						<reference key="destination" ref="73574840"/>
-					</object>
-					<int key="connectionID">100045</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBOutletConnection" key="connection">
-						<string key="label">delegate</string>
-						<reference key="source" ref="546578393"/>
-						<reference key="destination" ref="512844837"/>
-					</object>
-					<int key="connectionID">100048</int>
+					<int key="connectionID">100083</int>
 				</object>
 			</array>
 			<object class="IBMutableOrderedSet" key="objectRecords">
 						<int key="objectID">6</int>
 						<reference key="object" ref="568628114"/>
 						<array class="NSMutableArray" key="children">
-							<reference ref="1024422455"/>
+							<reference ref="361481002"/>
 						</array>
 						<reference key="parent" ref="275939982"/>
 					</object>
 						<string key="objectName">Application</string>
 					</object>
 					<object class="IBObjectRecord">
-						<int key="objectID">100030</int>
-						<reference key="object" ref="1024422455"/>
+						<int key="objectID">100038</int>
+						<reference key="object" ref="1020633350"/>
+						<reference key="parent" ref="0"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">100075</int>
+						<reference key="object" ref="361481002"/>
 						<array class="NSMutableArray" key="children">
-							<reference ref="205493477"/>
-							<reference ref="650543508"/>
-							<reference ref="546578393"/>
+							<reference ref="741886802"/>
+							<reference ref="538198417"/>
+							<reference ref="553239131"/>
 						</array>
 						<reference key="parent" ref="568628114"/>
 					</object>
 					<object class="IBObjectRecord">
-						<int key="objectID">100031</int>
-						<reference key="object" ref="205493477"/>
-						<reference key="parent" ref="1024422455"/>
+						<int key="objectID">100076</int>
+						<reference key="object" ref="741886802"/>
+						<reference key="parent" ref="361481002"/>
 					</object>
 					<object class="IBObjectRecord">
-						<int key="objectID">100032</int>
-						<reference key="object" ref="650543508"/>
-						<reference key="parent" ref="1024422455"/>
+						<int key="objectID">100077</int>
+						<reference key="object" ref="538198417"/>
+						<reference key="parent" ref="361481002"/>
 					</object>
 					<object class="IBObjectRecord">
-						<int key="objectID">100033</int>
-						<reference key="object" ref="546578393"/>
-						<reference key="parent" ref="1024422455"/>
+						<int key="objectID">100078</int>
+						<reference key="object" ref="553239131"/>
+						<array class="NSMutableArray" key="children">
+							<reference ref="1068720735"/>
+						</array>
+						<reference key="parent" ref="361481002"/>
 					</object>
 					<object class="IBObjectRecord">
-						<int key="objectID">100034</int>
-						<reference key="object" ref="73574840"/>
-						<reference key="parent" ref="0"/>
+						<int key="objectID">100079</int>
+						<reference key="object" ref="1068720735"/>
+						<array class="NSMutableArray" key="children">
+							<object class="NSCustomView" id="208367549">
+								<nil key="NSNextResponder"/>
+								<int key="NSvFlags">256</int>
+								<string key="NSFrame">{{1, 1}, {584, 96}}</string>
+								<reference key="NSNextKeyView" ref="741886802"/>
+								<string key="NSReuseIdentifierKey">_NS:499</string>
+								<string key="NSClassName">WowPlotView</string>
+							</object>
+							<reference ref="870816329"/>
+						</array>
+						<reference key="parent" ref="553239131"/>
 					</object>
 					<object class="IBObjectRecord">
-						<int key="objectID">100035</int>
-						<reference key="object" ref="865477801"/>
-						<reference key="parent" ref="0"/>
+						<int key="objectID">100080</int>
+						<reference key="object" ref="208367549"/>
+						<reference key="parent" ref="1068720735"/>
 					</object>
 					<object class="IBObjectRecord">
-						<int key="objectID">100038</int>
-						<reference key="object" ref="1020633350"/>
-						<reference key="parent" ref="0"/>
+						<int key="objectID">100081</int>
+						<reference key="object" ref="870816329"/>
+						<reference key="parent" ref="1068720735"/>
 					</object>
 				</array>
 			</object>
 				<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
 				<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
 				<string key="-3.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-				<string key="100030.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-				<string key="100031.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-				<string key="100032.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-				<reference key="100033.IBCollectionViewIntegration.primaryColor" ref="29716557"/>
-				<string key="100033.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-				<string key="100034.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-				<string key="100035.CustomClassName">WowPlotView</string>
-				<string key="100035.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
 				<string key="100038.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+				<string key="100075.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+				<string key="100076.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+				<string key="100077.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+				<string key="100078.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+				<boolean value="YES" key="100078.ibExternalAutomaticallyCalculatesRowSizeFromViewHeight"/>
+				<string key="100079.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+				<boolean value="YES" key="100079.isInViewBasedMode"/>
+				<array key="100079.prototypeCellViews">
+					<reference ref="208367549"/>
+				</array>
+				<string key="100080.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+				<string key="100081.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
 				<string key="5.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
 				<string key="5.IBWindowTemplateEditedContentRect">{{42, 177}, {600, 300}}</string>
 				<string key="6.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
 			<nil key="activeLocalization"/>
 			<dictionary class="NSMutableDictionary" key="localizations"/>
 			<nil key="sourceID"/>
-			<int key="maxID">100049</int>
+			<int key="maxID">100087</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<array class="NSMutableArray" key="referencedPartialClassDescriptions">
 						</object>
 					</dictionary>
 					<dictionary class="NSMutableDictionary" key="outlets">
-						<string key="plotCollectionController">NSArrayController</string>
-						<string key="plotCollectionView">NSCollectionView</string>
+						<string key="_plotCollectionController">NSArrayController</string>
+						<string key="_plotView">NSTableView</string>
 					</dictionary>
 					<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
-						<object class="IBToOneOutletInfo" key="plotCollectionController">
-							<string key="name">plotCollectionController</string>
+						<object class="IBToOneOutletInfo" key="_plotCollectionController">
+							<string key="name">_plotCollectionController</string>
 							<string key="candidateClassName">NSArrayController</string>
 						</object>
-						<object class="IBToOneOutletInfo" key="plotCollectionView">
-							<string key="name">plotCollectionView</string>
-							<string key="candidateClassName">NSCollectionView</string>
+						<object class="IBToOneOutletInfo" key="_plotView">
+							<string key="name">_plotView</string>
+							<string key="candidateClassName">NSTableView</string>
 						</object>
 					</dictionary>
 					<object class="IBClassDescriptionSource" key="sourceIdentifier">
 							<string key="candidateClassName">NSEvent</string>
 						</object>
 					</object>
-					<object class="NSMutableDictionary" key="outlets">
-						<string key="NS.key.0">cvItem</string>
-						<string key="NS.object.0">NSCollectionViewItem</string>
-					</object>
-					<object class="NSMutableDictionary" key="toOneOutletInfosByName">
-						<string key="NS.key.0">cvItem</string>
-						<object class="IBToOneOutletInfo" key="NS.object.0">
-							<string key="name">cvItem</string>
-							<string key="candidateClassName">NSCollectionViewItem</string>
-						</object>
-					</object>
 					<object class="IBClassDescriptionSource" key="sourceIdentifier">
 						<string key="majorKey">IBProjectSource</string>
 						<string key="minorKey">./Classes/WowPlotView.h</string>
 		</object>
 		<int key="IBDocument.localizationMode">0</int>
 		<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
+		<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
+			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
+			<real value="1070" key="NS.object.0"/>
+		</object>
 		<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
 			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
 			<integer value="1050" key="NS.object.0"/>

File WowPlotDocument.h

 
 @interface WowPlotDocument : NSDocument
 {
-	NSData *compressedLogText;
-	WowCombatLog *combatLog;
-	NSMutableArray *plotItemArray;
-	IBOutlet NSArrayController *plotCollectionController;
-	IBOutlet NSCollectionView *plotCollectionView;
-	NSSize minItemSize;
-	dispatch_queue_t serialQueue;
+	NSData *_compressedLogText;
+	WowCombatLog *_combatLog;
+	NSMutableArray *_plotItemArray;
+	IBOutlet NSArrayController *_plotCollectionController;
+	IBOutlet NSTableView *_plotView;
+	NSSize _minItemSize;
+	dispatch_queue_t _serialQueue;
 }
 
 - (void)insertPlot:(WowPlotRoot *)Root atIndex:(NSUInteger)Index undoName:(NSString *)UndoName;

File WowPlotDocument.m

     self = [super init];
     if (self)
 	{
-		minItemSize = NSMakeSize(128, 64);
-		serialQueue = dispatch_queue_create("de.maven.WowPlot.serialQueue", NULL);
+		_minItemSize = NSMakeSize(128, 64);
+		_serialQueue = dispatch_queue_create("de.maven.WowPlot.serialQueue", NULL);
 	}
     return self;
 }
 
 - (void)dealloc
 {
-//	[plotCollectionController setContent:nil];
-//	[plotCollectionController release];
-	[plotItemArray release];
-	[combatLog release];
-	[compressedLogText release];
-	dispatch_release(serialQueue);
+//	[_plotCollectionController setContent:nil];
+//	[_plotCollectionController release];
+    [[NSNotificationCenter defaultCenter] removeObserver:self];
+	[_plotItemArray release];
+	[_combatLog release];
+	[_compressedLogText release];
+	dispatch_release(_serialQueue);
 	[super dealloc];
 }
 
 {
 	[[[self undoManager] prepareWithInvocationTarget:self] deletePlot:Root atIndex:Index undoName:UndoName];
 	[[self undoManager] setActionName:UndoName];
-	[plotCollectionController insertObject:Root atArrangedObjectIndex:Index];
+	[_plotCollectionController insertObject:Root atArrangedObjectIndex:Index];
 }
 
 - (void)deletePlot:(WowPlotRoot *)Root atIndex:(NSUInteger)Index undoName:(NSString *)UndoName
 {
 	[[[self undoManager] prepareWithInvocationTarget:self] insertPlot:Root atIndex:Index undoName:UndoName];
 	[[self undoManager] setActionName:UndoName];
-	[plotCollectionController removeObject:Root];
+	[_plotCollectionController removeObject:Root];
 }
 
 - (void)deleteStackChildren:(WowPlotStack *)Stack wereSplitBy:(NSString *)Property undoName:(NSString *)UndoName
 
 - (void)replaceRootAtIndex:(NSUInteger)Index withRoot:(WowPlotRoot *)NewRoot undoName:(NSString *)UndoName
 {
-	WowPlotRoot *oldRoot = [[plotCollectionController arrangedObjects] objectAtIndex:Index];
+	WowPlotRoot *oldRoot = [[_plotCollectionController arrangedObjects] objectAtIndex:Index];
 
 	[[[self undoManager] prepareWithInvocationTarget:self] replaceRootAtIndex:Index withRoot:oldRoot undoName:UndoName];
 	[[self undoManager] setActionName:UndoName];
-	[plotCollectionController removeObjectAtArrangedObjectIndex:Index];
-	[plotCollectionController insertObject:NewRoot atArrangedObjectIndex:Index];
+	[_plotCollectionController removeObjectAtArrangedObjectIndex:Index];
+	[_plotCollectionController insertObject:NewRoot atArrangedObjectIndex:Index];
 }
 
 - (IBAction)stretchTimelineMenu:(NSMenuItem *)menuItem
 {
-	NSSize minSize = [plotCollectionView minItemSize];
-	
-	if (minSize.width < NSWidth([plotCollectionView bounds]))
-		minSize.width = NSWidth([plotCollectionView bounds]);	
-	minSize.width = round(minSize.width * 1.75);
-	[plotCollectionView setMinItemSize:minSize];
+    NSTableColumn *column = [[_plotView tableColumns] lastObject];
+    CGFloat width = [column width];
+
+	width = round(width * 1.75);
+    [column setWidth:width];
 }
 
 - (IBAction)shrinkTimelineMenu:(NSMenuItem *)menuItem
 {
-	NSSize minSize = [plotCollectionView minItemSize];
-	
-	if (minSize.width > 0.0)
-	{
-		minSize.width = round(minSize.width / 1.75);
-		if (minSize.width <= NSWidth([[plotCollectionView superview] frame]))
-			minSize.width = minItemSize.width;
-		[plotCollectionView setMinItemSize:minSize];
-	}
+    NSTableColumn *column = [[_plotView tableColumns] lastObject];
+    CGFloat paddingNeeded = [_plotView intercellSpacing].width;
+    CGFloat width = [column width];
+    
+	width = round(width / 1.75);
+    
+	if (width - paddingNeeded <= NSWidth([[_plotView superview] frame]))
+		width = NSWidth([[_plotView superview] frame]) - paddingNeeded;
+    [column setWidth:width];
 }
 
 - (IBAction)increaseScaleMenu:(NSMenuItem *)menuItem
 {
-	WowPlotRoot *root = [[plotCollectionController selectedObjects] lastObject];
+	WowPlotRoot *root = [[_plotCollectionController selectedObjects] lastObject];
 	
 //	[[[self undoManager] prepareWithInvocationTarget:root] setScaleFactor:root.scaleFactor];
 //	[[self undoManager] setActionName:@"Increase Scale"];
 
 - (IBAction)decreaseScaleMenu:(NSMenuItem *)menuItem
 {
-	WowPlotRoot *root = [[plotCollectionController selectedObjects] lastObject];
+	WowPlotRoot *root = [[_plotCollectionController selectedObjects] lastObject];
 	
 //	[[[self undoManager] prepareWithInvocationTarget:root] setScaleFactor:root.scaleFactor];
 //	[[self undoManager] setActionName:@"Decrease Scale"];
 
 - (IBAction)hideShowMobMarkersMenu:(NSMenuItem *)menuItem
 {
-	WowPlotRoot *root = [[plotCollectionController selectedObjects] lastObject];
+	WowPlotRoot *root = [[_plotCollectionController selectedObjects] lastObject];
 	
 	root.showMobMarkers = [menuItem tag];
 }
 
 - (IBAction)hideShowAnnotationsMenu:(NSMenuItem *)menuItem
 {
-	WowPlotRoot *root = [[plotCollectionController selectedObjects] lastObject];
+	WowPlotRoot *root = [[_plotCollectionController selectedObjects] lastObject];
 	
 	root.showAnnotationMarkers = [menuItem tag];
 }
 
 - (IBAction)deletePlotMenu:(NSMenuItem *)menuItem
 {
-	WowPlotRoot *root = [[plotCollectionController selectedObjects] lastObject];
-	NSUInteger index = [plotCollectionController selectionIndex];
+	WowPlotRoot *root = [[_plotCollectionController selectedObjects] lastObject];
+	NSUInteger index = [_plotCollectionController selectionIndex];
 	
 	[self deletePlot:root atIndex:index undoName:[menuItem title]];
 }
 
 - (IBAction)replacePlotForStackMenu:(id)sender
 {
-	WowPlotRoot *root = [[plotCollectionController selectedObjects] lastObject];
+	WowPlotRoot *root = [[_plotCollectionController selectedObjects] lastObject];
 	WowPlotStack *selectedStack = root.selectedStack;
 	
 	if (selectedStack && selectedStack != root)
 	{
 		WowPlotRoot *selectedCopy = [[[WowPlotRoot alloc] initWithPlotStack:selectedStack] autorelease];
-		NSUInteger index = [plotCollectionController selectionIndex];
+		NSUInteger index = [_plotCollectionController selectionIndex];
 		
 		[self replaceRootAtIndex:index withRoot:selectedCopy undoName:@"Replace Plot With Stack"];
 	}
 
 - (IBAction)addPlotForStackMenu:(id)sender
 {
-	WowPlotRoot *root = [[plotCollectionController selectedObjects] lastObject];
+	WowPlotRoot *root = [[_plotCollectionController selectedObjects] lastObject];
 	WowPlotStack *selectedStack = root.selectedStack;
 	
 	if (selectedStack)
 	{
 		WowPlotRoot *newRoot = [[[WowPlotRoot alloc] initWithPlotStack:selectedStack] autorelease];
-		NSUInteger newIndex = [[plotCollectionController arrangedObjects] count];
+		NSUInteger newIndex = [[_plotCollectionController arrangedObjects] count];
 		
 		[self insertPlot:newRoot atIndex:newIndex undoName:@"Add Plot for Stack"];
 	}
 
 - (IBAction)recombineStackMenu:(id)sender
 {
-	WowPlotRoot *root = [[plotCollectionController selectedObjects] lastObject];
+	WowPlotRoot *root = [[_plotCollectionController selectedObjects] lastObject];
 	WowPlotStack *selectedStack = root.selectedStack;
 	WowPlotStack *parent = selectedStack.parent;
 	
 
 - (IBAction)addCustomPlot:(NSMenuItem *)menuItem
 {
-	WowPlotRoot *root = [[plotCollectionController selectedObjects] lastObject];
+	WowPlotRoot *root = [[_plotCollectionController selectedObjects] lastObject];
 	WowPlotStack *selectedStack = root.selectedStack;
 	NSPredicate *pred = selectedStack ? selectedStack.aggregatePredicate : nil;
 	// FIXME
 												   withMarkers:nil
 							] autorelease];
 	
-	[newRoot setChunkedEntries:combatLog.chunkedEntries];
-	NSUInteger newIndex = [[plotCollectionController arrangedObjects] count];
+	[newRoot setChunkedEntries:_combatLog.chunkedEntries];
+	NSUInteger newIndex = [[_plotCollectionController arrangedObjects] count];
 	[self insertPlot:newRoot atIndex:newIndex undoName:@"Add Custom Plot"];
 //	NSLog(@"New plot for %@", Predicate);
 }
 		NSString *undoName = (NSString *)context;
 		BOOL oldSelectionPolicy;
 		
-		oldSelectionPolicy = [plotCollectionController selectsInsertedObjects];
-		[plotCollectionController setSelectsInsertedObjects:NO];
+		oldSelectionPolicy = [_plotCollectionController selectsInsertedObjects];
+		[_plotCollectionController setSelectsInsertedObjects:NO];
 		for (WowPlotStack *child in stack.children)
 		{
 			WowPlotRoot *newRoot = [[[WowPlotRoot alloc] initWithPlotStack:child] autorelease];
-			NSUInteger newIndex = [[plotCollectionController arrangedObjects] count];
+			NSUInteger newIndex = [[_plotCollectionController arrangedObjects] count];
 			
 			[self insertPlot:newRoot atIndex:newIndex undoName:@"Add Plot for Stack"];
 		}
 		[[self undoManager] setGroupsByEvent:YES];
 		[undoName release];
 		[stack removeObserver:self forKeyPath:@"children"];
-		[plotCollectionController setSelectsInsertedObjects:oldSelectionPolicy];
+		[_plotCollectionController setSelectsInsertedObjects:oldSelectionPolicy];
 	}
 //	else
 //		[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
 		selectedStack = [menuItem representedObject];
 	else
 	{
-		WowPlotRoot *root = [[plotCollectionController selectedObjects] lastObject];
+		WowPlotRoot *root = [[_plotCollectionController selectedObjects] lastObject];
 		
 		selectedStack = root.selectedStack;
 	}
 
 - (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)anItem
 {
-	WowPlotRoot *root = [[plotCollectionController selectedObjects] lastObject];
+	WowPlotRoot *root = [[_plotCollectionController selectedObjects] lastObject];
 	SEL action = [anItem action];
 	
 	if (action == @selector(deletePlotMenu:))
-		return [plotCollectionController canRemove];
+		return [_plotCollectionController canRemove];
 	else if (action == @selector(addPlotForStackMenu:))
 		return root.selectedStack != nil;
 	else if (action == @selector(replacePlotForStackMenu:))
 
 - (IBAction)scrollPageUp:(id)sender
 {
-	NSScrollView *scrollView = [plotCollectionView enclosingScrollView];
+	NSScrollView *scrollView = [_plotView enclosingScrollView];
 	NSPoint newOrigin = [[scrollView contentView] bounds].origin;
 	
 	newOrigin.x -= NSWidth([[scrollView contentView] bounds]) - [scrollView verticalPageScroll];
-	[plotCollectionView scrollPoint:newOrigin];
+	[_plotView scrollPoint:newOrigin];
 }
 
 - (IBAction)scrollPageDown:(id)sender
 {
-	NSScrollView *scrollView = [plotCollectionView enclosingScrollView];
+	NSScrollView *scrollView = [_plotView enclosingScrollView];
 	NSPoint newOrigin = [[scrollView contentView] bounds].origin;
 	
 	newOrigin.x += NSWidth([[scrollView contentView] bounds]) - [scrollView verticalPageScroll];
-	[plotCollectionView scrollPoint:newOrigin];
+	[_plotView scrollPoint:newOrigin];
 }
 
 - (IBAction)scrollToBeginningOfDocument:(id)sender
 {
-	NSScrollView *scrollView = [plotCollectionView enclosingScrollView];
+	NSScrollView *scrollView = [_plotView enclosingScrollView];
 	NSPoint newOrigin = [[scrollView contentView] bounds].origin;
 	
 	newOrigin.x = 0.0;
-	[plotCollectionView scrollPoint:newOrigin];
+	[_plotView scrollPoint:newOrigin];
 }
 
 - (IBAction)scrollToEndOfDocument:(id)sender
 {
-	NSScrollView *scrollView = [plotCollectionView enclosingScrollView];
+	NSScrollView *scrollView = [_plotView enclosingScrollView];
 	NSPoint newOrigin = [[scrollView contentView] bounds].origin;
 	
-	newOrigin.x = NSMaxX([plotCollectionView frame]) - NSWidth([[scrollView contentView] bounds]);
-	[plotCollectionView scrollPoint:newOrigin];
+	newOrigin.x = NSMaxX([_plotView frame]) - NSWidth([[scrollView contentView] bounds]);
+	[_plotView scrollPoint:newOrigin];
 }
 
 - (NSString *)windowNibName
     return @"WowPlotDocument";
 }
 
+- (void)handleResizeNotification:(NSNotification *)notification
+{
+    NSUInteger num = [_plotItemArray count];
+    
+    if (num > 0)
+    {
+        CGFloat rowHeight = floor([[_plotView enclosingScrollView] contentSize].height / num) - [_plotView intercellSpacing].height;
+        if (rowHeight < 16.0)
+            rowHeight = 16.0;
+        [_plotView setRowHeight:rowHeight];
+    }
+}
+
 - (void)startFilteringForItems:(NSArray *)Items withChunks:(NSArray *)Chunks
 {
 	[[NSProcessInfo processInfo] disableSuddenTermination];
 	dispatch_async(concurrentQueue, ^{
 		dispatch_group_wait(group, DISPATCH_TIME_FOREVER);
 		dispatch_async(dispatch_get_main_queue(), ^{
-			[plotCollectionController setContent:plotItemArray];
+			[_plotCollectionController setContent:_plotItemArray];
+            [self handleResizeNotification:nil];
 			[[NSProcessInfo processInfo] enableSuddenTermination];
 		});
 	});
 											withPredicate:[NSPredicate predicateWithFormat:@"suffixString == \"HEAL\" && (source.isPlayer == YES || source.owner.isPlayer == YES)"]
 												 forValue:@"amount"
 												withColor:[NSColor colorWithCalibratedRed:0.6 green:0.6 blue:1.0 alpha:1.0]
-											  withMarkers:[WowPlotMarker playerDeathMarkersFromChunkedEntries:combatLog.chunkedEntries]
+											  withMarkers:[WowPlotMarker playerDeathMarkersFromChunkedEntries:_combatLog.chunkedEntries]
 						] autorelease],
 					  [[[WowPlotRoot alloc] initWithTitle:@"DPS In"
 										  andBucketLength:CHUNK_SIZE
     [super windowControllerDidLoadNib:aController];
 	
     // Add any code here that needs to be executed once the windowController has loaded the document's window.
-	[plotCollectionView setMinItemSize:minItemSize];
-	[self startFilteringForItems:plotItemArray withChunks:combatLog.chunkedEntries];
-//	[plotCollectionController retain];
+//	[_plotView setMinItemSize:_minItemSize];
+	[self startFilteringForItems:_plotItemArray withChunks:_combatLog.chunkedEntries];
+//    [_plotView setPostsFrameChangedNotifications:YES];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleResizeNotification:) name:NSViewFrameDidChangeNotification object:[_plotView enclosingScrollView]];
+//	[_plotCollectionController retain];
 }
 
 - (BOOL)revertToContentsOfURL:(NSURL *)absoluteURL ofType:(NSString *)typeName error:(NSError **)outError
 {
-	[plotCollectionController setContent:nil];
-	[plotItemArray removeAllObjects];
-	[plotCollectionView setMinItemSize:minItemSize];
+	[_plotCollectionController setContent:nil];
+	[_plotItemArray removeAllObjects];
+//	[_plotView setMinItemSize:_minItemSize];
 	// we keep the compressed log around, because it must be the same
 	if ([super revertToContentsOfURL:absoluteURL ofType:typeName error:outError])
 	{
-		[self startFilteringForItems:plotItemArray withChunks:combatLog.chunkedEntries];
+		[self startFilteringForItems:_plotItemArray withChunks:_combatLog.chunkedEntries];
 		return YES;
 	}
 	return NO;
 
 	if ([workspace type:typeName conformsToType:kUTTypeWowplotDocument])
 	{
-		NSFileWrapper *compressedLogTextWrapper = [[NSFileWrapper alloc] initRegularFileWithContents:compressedLogText];
-		NSFileWrapper *plotStateWrapper = [[NSFileWrapper alloc] initRegularFileWithContents:[NSKeyedArchiver archivedDataWithRootObject:plotItemArray]];
+		NSFileWrapper *compressedLogTextWrapper = [[NSFileWrapper alloc] initRegularFileWithContents:_compressedLogText];
+		NSFileWrapper *plotStateWrapper = [[NSFileWrapper alloc] initRegularFileWithContents:[NSKeyedArchiver archivedDataWithRootObject:_plotItemArray]];
 		NSDictionary *files = [[NSDictionary alloc] initWithObjectsAndKeys:compressedLogTextWrapper, @"WowCombatLog.txt.gz", plotStateWrapper, @"plotState", nil];
 		[compressedLogTextWrapper release];
 		[plotStateWrapper release];
     NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
 	BOOL success = NO;
 	
-	if (!combatLog)
+	if (!_combatLog)
 	{
 		NSString *combatLogString = nil;
 		
 			NSFileWrapper *compressedLogTextWrapper = [[fileWrapper fileWrappers] objectForKey:@"WowCombatLog.txt.gz"];
 			NSFileWrapper *plotStateWrapper = [[fileWrapper fileWrappers] objectForKey:@"plotState"];
 			
-			compressedLogText = [[compressedLogTextWrapper regularFileContents] retain];
-			plotItemArray = [[NSKeyedUnarchiver unarchiveObjectWithData:[plotStateWrapper regularFileContents]] retain];
+			_compressedLogText = [[compressedLogTextWrapper regularFileContents] retain];
+			_plotItemArray = [[NSKeyedUnarchiver unarchiveObjectWithData:[plotStateWrapper regularFileContents]] retain];
 			
-			combatLogString = [[NSString alloc] initWithData:[compressedLogText gzipInflate] encoding:NSUTF8StringEncoding];
+			combatLogString = [[NSString alloc] initWithData:[_compressedLogText gzipInflate] encoding:NSUTF8StringEncoding];
 		}
 		else if ([workspace type:typeName conformsToType:kUTTypeWowCombatLog])
 		{
 			NSData* stringData = [[fileWrapper regularFileContents] retain];
 			
-			if (!compressedLogText)
-				dispatch_async(serialQueue, ^{
-					compressedLogText = [[stringData gzipDeflate] retain]; // can happen concurrently with parsing
+			if (!_compressedLogText)
+				dispatch_async(_serialQueue, ^{
+					_compressedLogText = [[stringData gzipDeflate] retain]; // can happen concurrently with parsing
 				});
-			if (!combatLog)
+			if (!_combatLog)
 				combatLogString = [[NSString alloc] initWithData:stringData encoding:NSUTF8StringEncoding];
 			[stringData release];
 		}
 		{
 			@try
 			{
-				combatLog = [[WowCombatLog alloc] initWithLogContents:combatLogString];
+				_combatLog = [[WowCombatLog alloc] initWithLogContents:combatLogString];
 				success = YES;
 			}
 			@catch (NSException *exception)
 
 	if (success)
 	{
-		if (!plotItemArray)
-			plotItemArray = [[NSMutableArray alloc] init];
-		if ([plotItemArray count] == 0)
-			[plotItemArray addObjectsFromArray:[self defaultPlotsForCombatLog]];
+		if (!_plotItemArray)
+			_plotItemArray = [[NSMutableArray alloc] init];
+		if ([_plotItemArray count] == 0)
+			[_plotItemArray addObjectsFromArray:[self defaultPlotsForCombatLog]];
 	}
-	dispatch_sync(serialQueue, ^{}); // and wait until the compression is done
+	dispatch_sync(_serialQueue, ^{}); // and wait until the compression is done
 	return success;
 }
 
-@synthesize combatLog, plotItemArray;
+@synthesize combatLog = _combatLog, plotItemArray = _plotItemArray;
 
 @end

File WowPlotView.h

 #import "WowPlotRoot.h"
 
 @interface WowPlotView : NSView {
-	IBOutlet NSCollectionViewItem *cvItem; // this is only available in awakeFromNib, but good enough to set up bindings
-	WowPlotRoot *plotRoot;
-//	CGFloat bias;
-	CGFloat scale;
-	NSUInteger level;
-	BOOL isSelected; // as in selected by our collectionview
+//	IBOutlet NSCollectionViewItem *cvItem; // this is only available in awakeFromNib, but good enough to set up bindings
+	WowPlotRoot *_plotRoot;
+    id _objectValue;
+//	CGFloat _bias;
+	CGFloat _scale;
+    NSSize _lastSize;
+	NSUInteger _level;
 }
 
 - (void)keyDown:(NSEvent *)theEvent;
 - (IBAction)mouseDown:(NSEvent *)Event; // for handling selection
 - (NSMenu *)menuForEvent:(NSEvent *)Event;
 
+@property(retain, nonatomic) id objectValue;
 @property(retain, readwrite, nonatomic) WowPlotRoot *plotRoot;
 //@property(assign, readwrite, nonatomic) CGFloat bias;
-@property(assign, readwrite, nonatomic) BOOL isSelected;
 @end

File WowPlotView.m

 
 @implementation WowPlotView
 
+@synthesize objectValue = _objectValue;
+
 - (id)initWitFrame:(NSRect)frameRect
 {
     self = [super initWithFrame:frameRect];
     if (self)
-	{		
-        // Initialization code here.
-		[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateLevelAndScale) name:NSViewFrameDidChangeNotification object:self];
-		[self setPostsBoundsChangedNotifications:YES];
+	{
     }
     return self;
 }
     self = [super initWithCoder:Decoder];
     if (self)
 	{		
-        // Initialization code here.
-		[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateLevelAndScale) name:NSViewFrameDidChangeNotification object:self];
-		[self setPostsBoundsChangedNotifications:YES];
     }
     return self;
 }
 
 - (void)awakeFromNib
 {
-	[self bind:@"plotRoot" toObject:cvItem withKeyPath:@"representedObject" options:nil];
-	[self bind:@"isSelected" toObject:cvItem withKeyPath:@"selected" options:nil];
+    [self bind:@"plotRoot" toObject:self withKeyPath:@"objectValue" options:nil];
 }
 
 - (void)dealloc
 {
-	[[NSNotificationCenter defaultCenter] removeObserver:self];
 	self.plotRoot = nil; // removes observers
 	[super dealloc];
 }
 - (void)updateLevelAndScale
 {
 	CGFloat bias = 0.0, scaleFactor = 0.0;
-	
-	if (plotRoot)
+    
+	if (_plotRoot)
 	{
-		bias = plotRoot.bias;
-		scaleFactor = plotRoot.scaleFactor;
+		bias = _plotRoot.bias;
+		scaleFactor = _plotRoot.scaleFactor;
 	}
-	level = [plotRoot levelForSize:[self frame].size.width withBias:bias];
-	scale = (scaleFactor * [self frame].size.height) / [plotRoot maxValueForLevel:level + 1];
+	_level = [_plotRoot levelForSize:NSWidth([self bounds]) withBias:bias];
+	_scale = (scaleFactor * NSHeight([self bounds])) / [_plotRoot maxValueForLevel:_level + 1];
 }
 
+//- (BOOL)isOpaque
+//{
+//	return YES;
+//}
 
 - (BOOL)acceptsFirstResponder
 {
 
 - (void)insertTab:(id)sender
 {
-	WowPlotStack *newSelection = plotRoot.selectedStack ? [plotRoot.selectedStack prevStack] : [plotRoot lastLeaf];
+	WowPlotStack *newSelection = _plotRoot.selectedStack ? [_plotRoot.selectedStack prevStack] : [_plotRoot lastLeaf];
 	
-	plotRoot.selectedStack = newSelection;
+	_plotRoot.selectedStack = newSelection;
 }
 
 - (void)insertBacktab:(id)sender
 {
-	WowPlotStack *newSelection = plotRoot.selectedStack ? [plotRoot.selectedStack nextStack] : [plotRoot firstLeaf];
+	WowPlotStack *newSelection = _plotRoot.selectedStack ? [_plotRoot.selectedStack nextStack] : [_plotRoot firstLeaf];
 	
-	plotRoot.selectedStack = newSelection;
+	_plotRoot.selectedStack = newSelection;
 }
 
 - (IBAction)mouseDown:(NSEvent *)Event
 	
 	// convert the mouse-down location into the view coords
 	clickLocation = [self convertPoint:[Event locationInWindow]	fromView:nil];
-	stack = [plotRoot stackForPoint:clickLocation inFrame:[self frame] withLevel:level withScale:scale];
-	plotRoot.selectedStack = stack;
+	stack = [_plotRoot stackForPoint:clickLocation inFrame:[self frame] withLevel:_level withScale:_scale];
+	_plotRoot.selectedStack = stack;
 	[super mouseDown:Event];
 	if (stack && [Event clickCount] > 1)
 	{
 	
 	// convert the mouse-down location into the view coords
 	clickLocation = [self convertPoint:[Event locationInWindow]	fromView:nil];
-	stack = [plotRoot stackForPoint:clickLocation inFrame:[self frame] withLevel:level withScale:scale];
-	plotRoot.selectedStack = stack;
+	stack = [_plotRoot stackForPoint:clickLocation inFrame:[self frame] withLevel:_level withScale:_scale];
+	_plotRoot.selectedStack = stack;
 	return [self splitByMenuForStack:stack];
 }
 
 - (NSString *)stringForItem:(WowPlotStack *)Item
 {
 	NSString *itemDescription = [Item description];
-	NSUInteger maxY = (NSHeight([self frame]) / scale) + 0.5;
+	NSUInteger maxY = (NSHeight([self frame]) / _scale) + 0.5;
 	
-	return itemDescription ? [NSString stringWithFormat:@"%@, %@ {max = %u}", [plotRoot title], itemDescription, maxY] : [NSString stringWithFormat:@"%@ {max = %lu}", [plotRoot title], (unsigned long)maxY];
+	return itemDescription ? [NSString stringWithFormat:@"%@, %@ {max = %u}", [_plotRoot title], itemDescription, maxY] : [NSString stringWithFormat:@"%@ {max = %lu}", [_plotRoot title], (unsigned long)maxY];
 }
 
 #define OvalRect 2.5
 {
 	NSRange activeMarkers[MAX_MARKERS];
 	NSUInteger numActiveMarkers = 0;
-	double timeScale = (double)NSWidth(Frame) / plotRoot.range.length; // want decent accuracy here
+	double timeScale = (double)NSWidth(Frame) / _plotRoot.range.length; // want decent accuracy here
 	NSRange drawRange = NSMakeRange(Rect.origin.x / timeScale, Rect.size.width / timeScale + 0.5);
 	NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:[[NSColor whiteColor] colorWithAlphaComponent:0.75], NSForegroundColorAttributeName,
 								[NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSMiniControlSize]], NSFontAttributeName, nil];
 	if (NSIntersectsRect(Rect, bgRect))
 	{
 		NSBezierPath *bg = [NSBezierPath bezierPathWithRoundedRect:bgRect xRadius:OvalRect yRadius:OvalRect];
-		NSColor *color = [[plotRoot.color shadowWithLevel:0.5] colorWithAlphaComponent:0.75];
+		NSColor *color = [[_plotRoot.color shadowWithLevel:0.5] colorWithAlphaComponent:0.75];
 		
 		[color setFill];
 		[bg fill];
 
 - (void)drawRect:(NSRect)Rect
 {
-	NSArray *list = [plotRoot constructDrawListForRect:Rect inFrame:[self frame] withLevel:level withScale:scale];
+    NSSize boundsSize = [self bounds].size;
+    
+    if (!NSEqualSizes(boundsSize, _lastSize))
+    {
+        _lastSize = boundsSize;
+        [self updateLevelAndScale];
+    }
+	NSArray *list = [_plotRoot constructDrawListForRect:Rect inFrame:[self frame] withLevel:_level withScale:_scale];
 	
-	if (isSelected)
-		[[[NSColor darkGrayColor] shadowWithLevel:0.8] setFill];
-	else
-		[[NSColor blackColor] setFill];
-	NSRectFill(Rect);
+//    NSLog(@"draw for rect: %@", NSStringFromRect(Rect));
 	for (WowPlotStackDrawListEntry *entry in [list reverseObjectEnumerator])
 	{
 		WowPlotStack *stack = entry.stack;
 		
 		if (NSIntersectsRect(Rect, [path bounds]))
 		{
-			[[stack.color highlightWithLevel:(stack == plotRoot.selectedStack) ? 0.5 : 0.0] setFill];
+			[[stack.color highlightWithLevel:(stack == _plotRoot.selectedStack) ? 0.5 : 0.0] setFill];
 			[path fill];
 		}
 	}
 	
-	if (plotRoot.markers)
-		[self drawMarkers:plotRoot.markers inRect:Rect inFrame:[self frame]];
-	[self drawBoxedString:[self stringForItem:(plotRoot.selectedStack ? plotRoot.selectedStack : plotRoot)] inRect:Rect inFrame:[self frame] withVisibleRect:[self visibleRect]];
+	if (_plotRoot.markers)
+		[self drawMarkers:_plotRoot.markers inRect:Rect inFrame:[self frame]];
+	[self drawBoxedString:[self stringForItem:(_plotRoot.selectedStack ? _plotRoot.selectedStack : _plotRoot)] inRect:Rect inFrame:[self frame] withVisibleRect:[self visibleRect]];
 }
 
 #undef OvalRect
 
 - (WowPlotRoot *)plotRoot
 {
-	return plotRoot;
+	return _plotRoot;
 }
 
 - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
 
 - (void)setPlotRoot:(WowPlotRoot *)Root
 {
-	if (Root != plotRoot)
+	if (Root != _plotRoot)
 	{
-		[plotRoot removeObserver:self forKeyPath:@"showMobMarkers"];
-		[plotRoot removeObserver:self forKeyPath:@"showAnnotationMarkers"];
-		[plotRoot removeObserver:self forKeyPath:@"selectedStack"];
-		[plotRoot removeObserver:self forKeyPath:@"scaleFactor"];
-		[plotRoot removeObserver:self forKeyPath:@"bias"];
-		[plotRoot release];
-		plotRoot = [Root retain];
-		[plotRoot addObserver:self forKeyPath:@"showMobMarkers" options:0 context:NULL];
-		[plotRoot addObserver:self forKeyPath:@"showAnnotationMarkers" options:0 context:NULL];
-		[plotRoot addObserver:self forKeyPath:@"selectedStack" options:0 context:NULL];
-		[plotRoot addObserver:self forKeyPath:@"scaleFactor" options:0 context:NULL];
-		[plotRoot addObserver:self forKeyPath:@"bias" options:0 context:NULL];
+		[_plotRoot removeObserver:self forKeyPath:@"showMobMarkers"];
+		[_plotRoot removeObserver:self forKeyPath:@"showAnnotationMarkers"];
+		[_plotRoot removeObserver:self forKeyPath:@"selectedStack"];
+		[_plotRoot removeObserver:self forKeyPath:@"scaleFactor"];
+		[_plotRoot removeObserver:self forKeyPath:@"bias"];
+		[_plotRoot release];
+		_plotRoot = [Root retain];
+		[_plotRoot addObserver:self forKeyPath:@"showMobMarkers" options:0 context:NULL];
+		[_plotRoot addObserver:self forKeyPath:@"showAnnotationMarkers" options:0 context:NULL];
+		[_plotRoot addObserver:self forKeyPath:@"selectedStack" options:0 context:NULL];
+		[_plotRoot addObserver:self forKeyPath:@"scaleFactor" options:0 context:NULL];
+		[_plotRoot addObserver:self forKeyPath:@"bias" options:0 context:NULL];
 		[self updateLevelAndScale];
 		[self setNeedsDisplay:YES];
 	}
 }
 
-- (BOOL)isSelected {
-	return isSelected;
-}
-
-- (void)setIsSelected:(BOOL)newSelected
-{
-	if (newSelected != isSelected)
-	{
-		isSelected = newSelected;
-		[self setNeedsDisplay:YES];
-		if (isSelected)
-			[[self window] makeFirstResponder:self]; // so we can respond to the tab keys
-	}
-}
-
-- (BOOL)isOpaque {
-	return YES;
-}
-
 @end