gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz/doc/pegboard/vob_colorable--humppake peg.rst


From: Asko Soukka
Subject: [Gzz-commits] gzz/doc/pegboard/vob_colorable--humppake peg.rst
Date: Tue, 11 Mar 2003 08:05:07 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Asko Soukka <address@hidden>    03/03/11 08:05:07

Modified files:
        doc/pegboard/vob_colorable--humppake: peg.rst 

Log message:
        update

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/doc/pegboard/vob_colorable--humppake/peg.rst.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: gzz/doc/pegboard/vob_colorable--humppake/peg.rst
diff -u gzz/doc/pegboard/vob_colorable--humppake/peg.rst:1.2 
gzz/doc/pegboard/vob_colorable--humppake/peg.rst:1.3
--- gzz/doc/pegboard/vob_colorable--humppake/peg.rst:1.2        Mon Mar 10 
09:50:48 2003
+++ gzz/doc/pegboard/vob_colorable--humppake/peg.rst    Tue Mar 11 08:05:07 2003
@@ -5,8 +5,8 @@
 :Authors:   Asko Soukka
 :Stakeholders: Benja Fallenstein, Tuomas Lukka 
 :Date-created: 2003-03-05
-:Last-Modified: $Date: 2003/03/10 14:50:48 $
-:Revision: $Revision: 1.2 $
+:Last-Modified: $Date: 2003/03/11 13:05:07 $
+:Revision: $Revision: 1.3 $
 :Status:   Current
 :Scope:    Trivial
 :Type:     Feature
@@ -49,16 +49,22 @@
 
   RESOLVED: Yes. The current multi-color implementation in
   ``RectBgVob`` and other background vobs have made them mutable.
-  Inheriting those multi-color features from Colorable Vob should turn them
-  back to immutable. Immutability allows storing created vob objects,
-  re-using them and finally enhancing the overall performance.
+  Inheriting those multi-color features from Colorable Vob should turn
+  them back to immutable. Immutability allows storing created vob
+  objects, re-using them and finally enhancing the overall
+  performance.
+
+  Multi-coloring stored vob prototype (which implements Colorable Vob)
+  could be cloned using method::
+  
+    Colorable cloneColored(Color[] colors);
 
 - How is Colorable Vob related to background vobs?
 
   RESOLVED: Colorable Vob won't define any background vob properties
   like background color or border. Although, background vobs should be
   immutable and use the common interface for multiple solid colors;
-  They should be inherited from ``AbstractColorableVob``.
+  They should be inherited from ``ColorableVob``.
 
 - How should Colorable Vob be assembled?
 
@@ -89,12 +95,23 @@
   RESOLVED: Since we are using the *java.util Collections API*
   the **ArrayList** implementation of List should be used.
 
+  RE-RESOLVED: For performance reasons we should use pure **Color Array**.
+  This is also reasonable, because vobs are immutable and therefore 
+  colors can't be added after creating the multi-colored vob (via
+  ``Colorable.cloneColore()``). 
+
+  It still possible to use ArrayList for building up the colors and pass
+  ``List.toArray()`` to ``Colorable.cloneColored()``.
+
 - How should the colors be set?
 
   RESOLVED: Since Colorable Vob should be immutable, colors
   could be added only by cloning a new vob. This method would prefer
   setting all the colors at once as a single List.
 
+  RE-RESOLVED: All colors should be set at once by passing 
+  a single **array** to ``Colorable.cloneColored()``.
+
 - Should SolidBgVob be inherited from Colorable Vob?
 
   RESOLVED: No. ``SolidBgVob`` is not a such background vob than other
@@ -114,7 +131,7 @@
 -------
 
 The Java classes **public interface Colorable** and **public abstract
-class AbstractColorableVob** should be created after the following
+class ColorableVob** should be created after the following
 diagram:
 
 .. UML:: abstractcolorablevob
@@ -126,20 +143,23 @@
 
     class Colorable "interface"
         methods
-           +Colorable cloneColored(List colors)
-           +List getColors()
+           +Colorable cloneColored(Color[] colors)
+           +Color[] getColors()
    
-    class AbstractColorableVob "abstract"
+    class java.lang.Cloneable "interface"
+
+    class ColorableVob "abstract"
+       realize java.lang.Cloneable
         realize Colorable
         inherit Vob
         methods
-           #ArrayList colors
+           #Color[] colors
             
     class vobs.RectBgVob
-        realize AbstractColorableVob
+        realize ColorableVob
 
     class vobs.OvalBgVob
-       realize AbstractColorableVob
+       realize ColorableVob
 
     class vobs.ColoredSectorVob
        inherit vobs.OvalBgVob
@@ -148,18 +168,26 @@
        inherit vobs.ColoredSectorVob
 
    ---
-   horizontally(50, vob_h, Colorable, Vob);
-   vertically(50, vob_v, Vob, AbstractColorableVob, vobs.RectBgVob);
+   horizontally(50, vob_h, Colorable, Vob, java.lang.Cloneable);
+   vertically(50, vob_v, Vob, ColorableVob, vobs.RectBgVob);
    horizontally(50, vobs_h, vobs.RectBgVob, vobs.OvalBgVob);
    vertically(50, sector_v, vobs.OvalBgVob, vobs.ColoredSectorVob);
    horizontally(50, sector_h, vobs.ColoredSquareSectorVob, 
vobs.ColoredSectorVob);
 
 The following background vobs should be modified to inherit
-``AbstractColorableVob``:
+``ColorableVob``:
 
  - ``gzz.vob.vobs.RectBgVob``
  - ``gzz.vob.vobs.OvalBgVob``
 
 **Cell Views** and **Node Views** will be broken (and hast to be
 fixed) after this change, since background vobs' addColor interface
-will be removed to make vobs immutable.
+will be removed to make vobs immutable. 
+
+The recommended way to fix Views is to store all needed vob prototypes
+as class attributes when instantiating the class at the first
+time. When a multi-colored version of any prototype (whose class
+implements Colorable) is needed, it will be created by passing colors
+to prototype's cloning method::
+
+    Colorable cloneColored(Color[] colors);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]