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

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

This method checks the applet parameter "UseFunctionInput". If the value is anything but "no", then a panel is created that contains an ExpressionInput (stored in the member variable functionInput) and possibly a ComputeButton and lable for the input box. This panel is a JCMPanel using BorderLayout. In is stored in the member variable inputPanel and is added to the SOUTH position of the mainPanel. The method also processes applet parameters "Function", "UseComputeButton", "ComputeButtonName", and "FunctionLabel". The ComputeButton, if it exists, is stored in the member variable computeButton. Note that nothing at all is done by this method if the value of the applet parameter "UseFunctionInput" is no.

Reimplemented in EpsilonDelta.

Definition at line 292 of file GenericGraphApplet.java.

References computeButton, functionInput, getColorParam(), edu::hws::jcm::awt::JCMPanel::getController(), edu::hws::jcm::data::Constant::getName(), getParameter(), inputPanel, mainPanel, parser, edu::hws::jcm::awt::ExpressionInput::setOnUserAction(), and xVar.

Referenced by setUpMainPanel().

                                     {
      if ( "yes".equalsIgnoreCase(getParameter("UseFunctionInput", "yes")) ) {
         String func = getParameter("Function");
         String varName = xVar.getName();
         if (func == null)
            func = "abs(" + varName + " ) ^ " + varName;
         functionInput = new ExpressionInput(func,parser);
         inputPanel = new JCMPanel();
         inputPanel.setBackground( getColorParam("PanelBackground", Color.lightGray) );
         inputPanel.add(functionInput, BorderLayout.CENTER);
         if ( "yes".equalsIgnoreCase(getParameter("UseComputeButton", "yes")) ) {
            String cname = getParameter("ComputeButtonName", "New Function");
            computeButton = new Button(cname);
            inputPanel.add(computeButton, BorderLayout.EAST); 
            computeButton.addActionListener(this);
         }
         String flabel = getParameter("FunctionLabel");
         if (flabel == null)
            flabel = " f(" + varName + ") = ";
         if ( ! "none".equalsIgnoreCase(flabel) )
            inputPanel.add(new Label(flabel), BorderLayout.WEST);
         mainPanel.add(inputPanel, BorderLayout.SOUTH);
         functionInput.setOnUserAction(mainPanel.getController());
      }
   }


Generated by  Doxygen 1.6.0   Back to index