/[gzz]/gzz/gzz/vob/vobs/RectBgVob.java
ViewVC logotype

Diff of /gzz/gzz/vob/vobs/RectBgVob.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by humppake, Thu Mar 13 16:40:34 2003 UTC revision 1.10 by humppake, Thu Mar 13 18:10:42 2003 UTC
# Line 55  public static final String rcsid = "$Id$ Line 55  public static final String rcsid = "$Id$
55      /** Border drawing flag */      /** Border drawing flag */
56      protected final boolean drawBorder;      protected final boolean drawBorder;
57    
58        /** Border color */
59        protected final Color borderColor;
60    
61      /** Constructor shorthands */      /** Constructor shorthands */
62      public RectBgVob() { this(Color.white, true); }      public RectBgVob() { this(Color.white, true, null); }
63      public RectBgVob(Color bgColor) { this(bgColor, true); }      public RectBgVob(Color bgColor) { this(bgColor, true, null); }
64        public RectBgVob(Color bgColor, boolean drawBorder) { this(bgColor, drawBorder, null); }
65        
66      /** Construct RectBgVob.      /** Construct RectBgVob.
67       * @param bgColor Background color.       * @param bgColor Background color.
68       * @param drawBorder Border drawing flag.       * @param drawBorder Border drawing flag.
69         * @param borderColor Border color. If null, default fgColor is used.
70       */       */
71      public RectBgVob(Color bgColor, boolean drawBorder) {      public RectBgVob(Color bgColor, boolean drawBorder, Color borderColor) {
72          super();          super();
73          this.bgColor = bgColor;          this.bgColor = bgColor;
74          this.drawBorder = drawBorder;          this.drawBorder = drawBorder;
75            this.borderColor = borderColor;
76      }      }
77    
78      static Rectangle rect = new Rectangle();      static Rectangle rect = new Rectangle();
# Line 99  public static final String rcsid = "$Id$ Line 105  public static final String rcsid = "$Id$
105          }          }
106    
107          if(drawBorder) {          if(drawBorder) {
108              g.setColor(info1.getMixedFgColor());              if (borderColor == null) g.setColor(info1.getMixedFgColor());
109                else g.setColor(borderColor);
110              g.drawRect(mx, my, mw-1, mh-1);              g.drawRect(mx, my, mw-1, mh-1);
111              if(mh >= 14) {              if(mh >= 14) {
112                  g.drawRect(mx+1, my+1, mw-3, mh-3);                  g.drawRect(mx+1, my+1, mw-3, mh-3);
# Line 139  public static final String rcsid = "$Id$ Line 146  public static final String rcsid = "$Id$
146                      "End\n");                      "End\n");
147              }              }
148    
149                String glBorderColorString = "0 0 0";
150                if (borderColor != null)
151                    glBorderColorString = ColorUtil.colorGLString(borderColor);
152    
153              glList = GLRen.createCallListBoxCoorded(              glList = GLRen.createCallListBoxCoorded(
154                  "PushAttrib CURRENT_BIT ENABLE_BIT\n"+                  "PushAttrib CURRENT_BIT ENABLE_BIT\n"+
155                  "Disable TEXTURE_2D\n"+                  "Disable TEXTURE_2D\n"+
156    
157                  bgcall +                  bgcall +
158    
159                  "Color 0 0 0 1\n"+                  "Color "+glBorderColorString+" 1\n"+
160                  "Begin LINE_STRIP\n"+                  "Begin LINE_STRIP\n"+
161                  "Vertex 1 1\n"+                  "Vertex 1 1\n"+
162                  "Vertex 1 0\n"+                  "Vertex 1 0\n"+

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26