Download Enhanced Heap Visualization with GCspy

Transcript
Enhancements
43
contains a SpaceSummaryView component which is reponsible for visualizing the space
summary. This component uses a PropertyListView which in turn relies on JList
for rendering the list. Class JList follows the MVC pattern described earlier in Section 5.3. The SpaceSummaryView provides a SpaceSummaryListModel as model for
JList. This model creates an instance of PropertyItem for each list row. Such an
instance holds the name displayed on the left side, whether the item represents a heading,
the value to display on the right side, as well as whether and how a horizontal bar
should be rendered. The PropertyListView on the other hand provides an instance of
PropertyItemRenderer to its JList to render list items. The JList calls the renderer
with PropertyItem instances from the model. The renderer then updates a private
PropertyItemComponent instance to reflect the values from the PropertyItem and
returns it to JList for drawing. PropertyItemComponent in turn uses the DiagramBar
component to render the horizontal bar.
gcspy::vis
SpaceManager
SpaceSummary
space
streamChooser
selectedStreams
space
summaryView
javax::swing
update()
copyToClipboard()
JList
summaryView
SpaceSummaryView
PropertyListView
update()
setModel(m)
SpaceSummaryListModel
setModel(m)
setCellRenderer(r)
setFixedCellWidth(w)
setFixedCellHeight(h)
clearSelection()
getSelectedIndex()
space
«realize»
«realize»
«create»
PropertyItem
name
isHeading
value
hasPercentage
percentage
color
PropertyItemRenderer
«use»
«interface»
ListCellRenderer
getListCellRenderer(list,value,index,...)
PropertyItemComponent
paintComponent(g)
DiagramBar
value
paintComponent(g)
«interface»
ListModel
getSize()
getElementAt(index)
addDataListener(l)
removeDataListener(l)
Figure 5.11: Classes of the new summary view
The mechanism for displaying properties is slightly more complex because there is only
one property view that the multiple space views share.