7 |
:Date-created: 2003-03-05 |
:Date-created: 2003-03-05 |
8 |
:Last-Modified: $Date$ |
:Last-Modified: $Date$ |
9 |
:Revision: $Revision$ |
:Revision: $Revision$ |
10 |
:Status: Incomplete |
:Status: Current |
11 |
:Scope: Trivial |
:Scope: Trivial |
12 |
:Type: Feature |
:Type: Feature |
13 |
|
|
14 |
This PEG proposes creating **Abstract Background Vob** class, which |
This PEG proposes creating **Abstract Background Vob** class, which |
15 |
implies creation of **Background Vob interface** and **Colored Vob |
implies creation of **Background interface** and **Colored |
16 |
Interface**. |
Interface**. |
17 |
|
|
18 |
Background Vob is a very basic vob type, which enhances the Vob |
Background Vob is a very basic vob type, which enhances the Vob |
24 |
e.g. as parallel vertical stripes |
e.g. as parallel vertical stripes |
25 |
|
|
26 |
Background Vob implements interface for single color backround and |
Background Vob implements interface for single color backround and |
27 |
border from Background Vob Interface and handling of multiple |
border from Background Interface and handling of multiple |
28 |
background colors from Colored Vob Interface. |
background colors from Colored Interface. |
29 |
|
|
30 |
Issues |
Issues |
31 |
------ |
------ |
32 |
|
|
33 |
- How should the new interfaces and classes be named? |
- How should the new interfaces and classes be named? |
34 |
|
|
35 |
RESOLVED: **public interface BackgroundVob**, **public interface |
RESOLVED: **public interface Background**, **public interface |
36 |
ColoredVob** and **public abstract class AbstractBgVob**. In |
Colored** and **public abstract class AbstractBgVob**. In |
37 |
AbstractBgVob the word Background is truncated after the current |
AbstractBgVob the word Background is truncated after the current |
38 |
*background vob* naming practice (SolidBgVob, RectBgVob, OvalBgVob). |
*background vob* naming practice (``SolidBgVob``, ``RectBgVob``, |
39 |
|
``OvalBgVob``). |
40 |
|
|
41 |
- Where they should be located? |
- Where they should be located? |
42 |
|
|
43 |
RESOLVED: Currently in the package **``gzz.vob``** |
RESOLVED: Currently in the package **``gzz.vob``** |
44 |
(``gzz.vob.ColoredVob``, ``gzz.vob.BackgroundVob`` and |
(``gzz.vob.Colored``, ``gzz.vob.Background`` and |
45 |
``gzz.vob.AbstractBgVob``). Probably in the future they will be |
``gzz.vob.AbstractBgVob``). Probably in the future they will be |
46 |
moved into package ``org.libvob.vob``. |
moved into package ``org.libvob.vob``. |
47 |
|
|
48 |
- How should the common features of current background vobs be |
- How should the common features of current background vobs be |
49 |
splitted between Background Vob Interface and Colored Vob Interface? |
splitted between Background Interface and Colored Interface? |
50 |
|
|
51 |
RESOLVED: Methods for single color backround and border will be |
RESOLVED: Methods for single color backround and border will be |
52 |
defined in Background Vob Interface and methods of multiple |
defined in Background Interface and methods of multiple |
53 |
background colors in Colored Vob Interface. The AbstractBgVob will |
background colors in Colored Interface. The AbstractBgVob will |
54 |
contain the default implementations for them. |
contain the default implementations for them. |
55 |
|
|
56 |
- How should *solids* be renamed? |
- How should *solids* be renamed? |
60 |
should be called simply **colors**. Note that already the method |
should be called simply **colors**. Note that already the method |
61 |
adding them has been called *addColor*. |
adding them has been called *addColor*. |
62 |
|
|
63 |
- How should we store *colors*? |
- How should we store colors? |
64 |
|
|
65 |
RESOLVED: Since we are using the *java.util Collections API* |
RESOLVED: Since we are using the *java.util Collections API* |
66 |
the **ArrayList** implementation of List should be used. |
the **ArrayList** implementation of List should be used. |
67 |
|
|
68 |
- What should be the default values for **bgcolor**, **drawBorder** and |
- What should be the default values for **bgColor**, **drawBorder** and |
69 |
**colors**? |
**colors**? |
70 |
|
|
71 |
RESOLVED: Default **bgColor** will be ``java.awt.Color.white``, |
RESOLVED: Default bgColor will be **``java.awt.Color.white``**, |
72 |
**drawborder** will be **true** and **colors** will be **null**. |
drawborder will be **true** and colors will be **null**. |
73 |
These are the currently used default settings for background vobs. |
These are the currently used default settings for background vobs. |
74 |
|
|
75 |
Changes |
Changes |
76 |
------- |
------- |
77 |
|
|
78 |
The Java classes **public interface BackgroundVob**, **public interface |
The Java classes **public interface Background**, **public interface |
79 |
ColoredVob** and **public abstract class AbstractBgVob** should be |
Colored** and **public abstract class AbstractBgVob** should be |
80 |
created after the following diagram: |
created after the following diagram: |
81 |
|
|
82 |
.. UML:: backgroundvob |
.. UML:: backgroundvob |
83 |
|
|
84 |
jlinkpackage gzz.vob |
jlinkpackage gzz.vob |
85 |
|
|
86 |
class Vob |
class Vob "abstract" |
87 |
jlink |
jlink |
88 |
|
|
89 |
class BackgroundVob Interface |
class Background "interface" |
90 |
methods |
methods |
91 |
+void setBgColor(Color c) |
+void setBgColor(Color c) |
92 |
+Color getBgColor() |
+Color getBgColor() |
95 |
+void setDrawBorder(Boolean b) |
+void setDrawBorder(Boolean b) |
96 |
+Boolean getDrawBorder() |
+Boolean getDrawBorder() |
97 |
|
|
98 |
class ColoredVob Interface |
class Colored "interface" |
99 |
methods |
methods |
100 |
+void addColor(Color c) |
+void addColor(Color c) |
101 |
+List getColors() |
+List getColors() |
102 |
|
|
103 |
class AbstractBgVob Abstract |
class AbstractBgVob "abstract" |
104 |
realize ColoredVob |
realize Colored |
105 |
realize BackgroundVob |
realize Background |
106 |
inherit Vob |
inherit Vob |
107 |
methods |
methods |
108 |
#Boolean drawBorder |
#Boolean drawBorder |
125 |
inherit vobs.ColoredSectorVob |
inherit vobs.ColoredSectorVob |
126 |
|
|
127 |
--- |
--- |
128 |
horizontally(50, vob_h, ColoredVob, Vob, BackgroundVob); |
horizontally(50, vob_h, Colored, Vob, Background); |
129 |
vertically(50, vob_v, Vob, AbstractBgVob, vobs.RectBgVob); |
vertically(50, vob_v, Vob, AbstractBgVob, vobs.RectBgVob); |
130 |
horizontally(50, vobs_h, vobs.SolidBgVob, vobs.RectBgVob, vobs.OvalBgVob); |
horizontally(50, vobs_h, vobs.SolidBgVob, vobs.RectBgVob, vobs.OvalBgVob); |
131 |
vertically(50, sector_v, vobs.SolidBgVob, vobs.ColoredSectorVob); |
vertically(50, sector_v, vobs.SolidBgVob, vobs.ColoredSectorVob); |
132 |
horizontally(50, sector_h, vobs.ColoredSectorVob, vobs.ColoredSquareSectorVob); |
horizontally(50, sector_h, vobs.ColoredSectorVob, vobs.ColoredSquareSectorVob); |
133 |
|
|
134 |
The following background vobs should be modified to inherit AbstractBgVob: |
The following background vobs should be modified to inherit |
135 |
|
``AbstractBgVob``: |
136 |
|
|
137 |
- gzz.vob.vobs.RectBgVob |
- ``gzz.vob.vobs.RectBgVob`` |
138 |
- gzz.vob.vobs.SolidBgVob |
- ``gzz.vob.vobs.SolidBgVob`` |
139 |
- gzz.vob.vobs.BgVob |
- ``gzz.vob.vobs.BgVob`` |
140 |
|
|
141 |
Also **ColoredSectorVob** should be inherited from AbstractBgVob: |
Also ``gzz.vob.vobs.ColoredSectorVob`` should be inherited from |
142 |
|
AbstractBgVob. Semantically *colored sector vobs* are not meant to be |
143 |
Some of the current vobs should be changed to implement this interface |
background vobs, but they do have the same features. The difference to |
144 |
(``RectBgVob`` and ``ColoredSectorVob``). Also some other Vobs should |
background vobs will be done by dropping ``Bg`` off from their naming. |
145 |
be changed to use a new *color* Vector instead of old *nsolids* color |
|
146 |
counter and *solids* Color array. No ``CellViews`` or ``NodeViews`` |
No **Cell Views** or **Node Views** should be broken after this |
147 |
should be broken after this change, since RectBgVob's addColor |
change, since background vobs' addColor interface remains |
148 |
interface remains same. Although, at least Loom's ``NodeViews`` should |
same. Although, at least Loom's Node Views should be build using |
149 |
be build using ``BgVob`` instead of ``RectBgVob`` or any other particular |
Abstract Background Vob instead of ``RectBgVob`` or any other |
150 |
Vob. |
particular Vob. |