[Date Prev][Date Next][Thread Prev][Thread Next][Author Index][Date Index][Thread Index]

Re: [zzdev] Re: Flobin koko



> > Ei, MediaFlobin ei tulisi olla ZOb. Sen MediaFlobFactory (parempi nimi)
> > tulisi olla ZOb ja SEN structparamseissa voit antaa sen koon.
> 
> Yes, "of course" the MediaFlobFactory is a ZOb: it extends
> RasterCellFactory1 (I think that's what you told me to do) and calls
> super when it detects(?) that the cell doesn't contain "media".
> 
> The factory's structparams might have a default size for all pictures
> (~ "media" cells), but the cells themselves should also have size and lots
> of other parameters in the structure too, right?  That's why I was trying
> to make ZObs out of my Flobs =)...

I already answered in person but so that the list knows as well: 
the point is that we're planning a RasterCellFactory that creates a new
factory for each cell if the cell wants it. That factory would be the ZOb.
But the Flobs are created by the factory and all parameters should be set
by the factory.
 
> > Nehän on ZObeja, joten homman pitäisi toimia ihan suoraan.
> 
> Yes, the RasterFlobFactories are ZObs, but it seems to me that if you want
> to add a new RasterFlobFactory to use, then you have to go to
> ZZDefaultSpace.java, line 967:
> 
>                 if(f.equals("rcfact1")) {
>                     rff = new RasterCellFactory1(forc);
>                 } else if(f.equals("rcfact2")) {
>                     rff = new RasterCellFactory2(forc);
>                 } else
>                     throw new ZZError("Unknown flobfactory: "+f);
> 
> ..and add a new string that will be recognized in the CellViews list:
> 
>                 if(f.equals("rcfact1")) {
>                     rff = new RasterCellFactory1(forc);
>                 } else if(f.equals("rcfact2")) {
>                     rff = new RasterCellFactory2(forc);
>                 } else if(f.equals("mfact")) {
>                     rff = new MediaFlobFactory(forc);
>                 } else
>                     throw new ZZError("Unknown flobfactory: "+f);

Oooooooopppss.

Yes, these should be moved to newZOb.

> ..or did I miss something?
> 
> BTW. Why are the ZOb's structparams inherited along d.3, and not just
> cloned?

Good question. 

The point of having the ZOb mechanism is that we can write a wide variety
of objects and *THEN* figure out the best way to represent it in the
structure.

This idea actually sounds quite good, it's possible we'll do just that
(but only after 0.2.0 is released ;)

	Tuomas