Logo Search packages:      
Sourcecode: wims version File versions  Download package

void GenericGraphApplet::addCanvasBorder (  )  [inline, protected]

This method is called by setUpMainPanel() to add a border to the canvas (since the border is typically the last thing that should be added, on top of anything else in the canvas. It processes the applet parameters "BorderWidth" and "BorderColor". If the border width is zero, no border is added. (The default width is 2.)

Definition at line 271 of file GenericGraphApplet.java.

References edu::hws::jcm::draw::DisplayCanvas::add(), canvas, getColorParam(), and getNumericParam().

Referenced by setUpMainPanel().

                                    {
      int borderWidth;
      double[] bw = getNumericParam("BorderWidth");
      if (bw == null || bw.length == 0 || bw[0] > 25)
         borderWidth = 2;
      else
         borderWidth = (int)Math.round(bw[0]);
      if (borderWidth > 0)
         canvas.add( new DrawBorder( getColorParam("BorderColor", Color.black), borderWidth  ) );
   }


Generated by  Doxygen 1.6.0   Back to index