Thanks Dennis,
Maybe you can help me get my terminology a little straighter. I THINK I was intending to use composition rather than inheritance. The only person with
Java experience I know locally has a strong bias for the former over the latter.
If I was using inheritance, then SeriesPlot (which is a JPanel that has a plot) could be extended to make HumiditySeriesPlot and I could override the writeDataset method so that it looked for a parent of class HumidityPlot. HumidityPlot would create a JPanel of class HumiditySeriesPlot. Likewise, I could extend SeriesPlot to make TemperatureSeriesPlot.
I believe that I was using composition to construct HumidityPlot. It is also a JPanel that contains three other JPanels, one of which is an instance of SeriesPlot. It gets information from the other panels to tell SeriesPlot precisely what to plot. I was thinking the other way around, allowing the SeriesPlot class to make use of either the HumidityPlot or TemperaturePlot's writeDataset method by defining an interface for SeriesPlot to use.
So using the terminology of inheritance, HumiditySeriesPlot is a child of SeriesPlot, and can use its methods. But SeriesPlot is not a child of HumidityPlot, so cannot use its methods (except indirectly by having a pointer to the HumidityPlot instance).
The way I had things arranged, for SeriesPlot, which is one of three panels in HumidityPlot, to use a function in HumidityPlot (the function pulls stuff from the other panels), was to use the getParent() method because SeriesPlot is a panel added to the HumidityPlot panel, but not because of an inheritance relationship.
The complication in my case, is the popup is not from HumidityPlot, which would simplify things a lot. Instead, the request was to add an additional item to SeriesPlot's existing popup, but which needs information unknown to SeriesPlot, unlike the any of the existing items on that popup which can be handled by SeriesPlot alone. But I don't write the requirements, so I have to make it work.
Have I said this all correctly?