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

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

This method is called by mainPanel() to set up the display canvas and add it to the main panel. The canvas already exists in the member variable canvas when this method is called. This method adds only a set of axes to the canvas, sets the mainController to report errors using the canvas, and adds the canvas to the CENTER of the main panel. This method processes applet parameters "UsePanner", "CanvasColor", "UseMouseZoom", and "UseOffscreenCanvas". Typically, this method will be overridden in subclasses to add more Drawable items to the canvas. In this case, super.setUpCanvas() should be called first.

Reimplemented in EpsilonDelta.

Definition at line 219 of file GenericGraphApplet.java.

References edu::hws::jcm::draw::DisplayCanvas::add(), canvas, getColorParam(), getParameter(), mainController, mainPanel, makeAxes(), edu::hws::jcm::draw::Grid::setColor(), edu::hws::jcm::awt::Controller::setErrorReporter(), edu::hws::jcm::draw::DisplayCanvas::setHandleMouseZooms(), and edu::hws::jcm::draw::DisplayCanvas::setUseOffscreenCanvas().

Referenced by setUpMainPanel().

      Color color;
      color = getColorParam("CanvasColor");
      if (color != null)
      if (! "no".equalsIgnoreCase(getParameter("UsePanner", "no")) )
         canvas.add(new Panner());
      if ( ! "no".equalsIgnoreCase(getParameter("UseGrid", "no")) ) {
         Grid g = new Grid();
         color = getColorParam("GridColor");
         if (color != null)
      if ( ! "no".equalsIgnoreCase(getParameter("UseMouseZoom", "no")) )
      if ( "yes".equalsIgnoreCase(getParameter("UseOffscreenCanvas", "yes")) )
      mainPanel.add(canvas, BorderLayout.CENTER);

Generated by  Doxygen 1.6.0   Back to index