scsolver::SolverDialog Class Reference

#include <dialog.hxx>

Inheritance diagram for scsolver::SolverDialog:

Inheritance graph
[legend]
Collaboration diagram for scsolver::SolverDialog:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 SolverDialog (SolverImpl *)
virtual ~SolverDialog () throw ()
virtual const
rtl::OUString 
getDialogName () const
virtual void setVisible (bool)
virtual bool doneRangeSelection () const
virtual void close ()
void initialize ()
ConstEditDialoggetConstEditDialog ()
OptionDialoggetOptionDialog ()
sal_Int16 getSelectedConstraintPos ()
Reference
< awt::XTextComponent > 
getXTextComponentFromWidget (const rtl::OUString &) const
rtl::OUString getTargetCellAddress () const
void setTargetCellAddress (const rtl::OUString &)
rtl::OUString getVarCellAddress ()
void setVarCellAddress (const rtl::OUString &)
GoalType getGoal () const
void setGoal (GoalType)
void output ()
void editConstraint (const sal_uInt32, const rtl::OUString &, const rtl::OUString &, const EqualityType)
void getConstraint (const sal_uInt32, rtl::OUString &, rtl::OUString &, EqualityType &)
std::vector
< ConstraintString
getAllConstraints () const
void removeConstraint (const sal_uInt32)
void clearConstraints ()
void setConstraint (const rtl::OUString &, const rtl::OUString &, const EqualityType)
void showMessage (const rtl::OUString &)
void showSolutionInfeasible ()
void showSolutionFound ()
void reset ()
void saveModelToDocument ()
void loadModelFromDocument ()
void updateWidgets ()

Protected Member Functions

virtual void registerListeners ()
virtual void unregisterListeners ()

Private Member Functions

void removeConstraintsFromListBox (sal_Int16=0, sal_Int16=0)
void setConstraintImpl (const rtl::OUString &, const rtl::OUString &, const EqualityType, const sal_Bool, const sal_uInt32=0)

Private Attributes

std::auto_ptr
< ConstEditDialog
m_pConstEditDialog
std::auto_ptr
< OptionDialog
m_pOptionDialog
TopWindowListenerm_pTopWindowListener
RngBtnListenerm_pTargetRngListener
RngBtnListenerm_pVarCellsRngListener
SolveBtnListenerm_pSolveListener
CloseBtnListenerm_pOKListener
SaveBtnListenerm_pSaveListener
LoadBtnListenerm_pLoadListener
ResetBtnListenerm_pResetListener
OptionBtnListenerm_pOptionListener
MaxRadioBtnListenerm_pMaxListener
ConstEditBtnListenerm_pConstAddListener
ConstEditBtnListenerm_pConstChangeListener
ConstEditBtnListenerm_pConstDeleteListener
ConstListBoxListenerm_pConstListBoxListener
SolverDlgCloseActionm_pCloseAction
std::vector
< ConstraintString
m_aConstraint


Detailed Description

Main solver dialog.

Definition at line 131 of file dialog.hxx.


Constructor & Destructor Documentation

scsolver::SolverDialog::SolverDialog ( SolverImpl p  ) 

Definition at line 374 of file dialog.cxx.

References initialize().

scsolver::SolverDialog::~SolverDialog (  )  throw () [virtual]

Definition at line 398 of file dialog.cxx.

References unregisterListeners().


Member Function Documentation

virtual const rtl::OUString scsolver::SolverDialog::getDialogName (  )  const [inline, virtual]

Must return a unique name that identifies its dialog type. Should be deprecated and its use in a nested-if or switch statement is discouraged because it is not very elegant and non-safe.

Implements scsolver::BaseDialog.

Definition at line 138 of file dialog.hxx.

References scsolver::ascii().

void scsolver::SolverDialog::setVisible ( bool  bVisible  )  [virtual]

Implements scsolver::BaseDialog.

Definition at line 536 of file dialog.cxx.

References scsolver::CalcInterface::getActiveSheet(), scsolver::SolverImpl::getCalcInterface(), getConstEditDialog(), scsolver::BaseDialog::getSolverImpl(), scsolver::ConstEditDialog::setVisible(), and scsolver::BaseDialog::setVisibleDefault().

Referenced by scsolver::RngBtnListener::actionPerformed(), close(), scsolver::ConstEditDialog::doneRangeSelection(), and scsolver::SolverImpl::execute().

virtual bool scsolver::SolverDialog::doneRangeSelection (  )  const [inline, virtual]

This method is called when a range selection is finished. If the dialog does not contain a range selection widget pair, just leave this method empty.

Returns:
false for signaling to the calling function that the selection is invalid and should be discarded, or true if the selection is satisfactory.

Implements scsolver::BaseDialog.

Definition at line 140 of file dialog.hxx.

void scsolver::SolverDialog::close (  )  [virtual]

Implements scsolver::BaseDialog.

Definition at line 553 of file dialog.cxx.

References getConstEditDialog(), getOptionDialog(), scsolver::ConstEditDialog::reset(), setVisible(), scsolver::OptionDialog::setVisible(), and scsolver::ConstEditDialog::setVisible().

void scsolver::SolverDialog::initialize (  ) 

Definition at line 403 of file dialog.cxx.

References scsolver::BaseDialog::addButton(), scsolver::BaseDialog::addFixedLine(), scsolver::BaseDialog::addFixedText(), scsolver::BaseDialog::addListBox(), scsolver::BaseDialog::addRadioButton(), scsolver::BaseDialog::addRangeEdit(), scsolver::ascii(), scsolver::BaseDialog::getResStr(), scsolver::BaseDialog::initializeDefault(), and registerListeners().

Referenced by SolverDialog().

ConstEditDialog * scsolver::SolverDialog::getConstEditDialog (  ) 

Definition at line 561 of file dialog.cxx.

References scsolver::BaseDialog::getPosSize(), scsolver::BaseDialog::getSolverImpl(), and m_pConstEditDialog.

Referenced by scsolver::OKCancelBtnListener::actionPerformed(), scsolver::ConstEditBtnListener::actionPerformed(), close(), and setVisible().

OptionDialog * scsolver::SolverDialog::getOptionDialog (  ) 

Definition at line 572 of file dialog.cxx.

References scsolver::BaseDialog::getPosSize(), scsolver::BaseDialog::getSolverImpl(), and m_pOptionDialog.

Referenced by scsolver::OptionBtnListener::actionPerformed(), and close().

sal_Int16 scsolver::SolverDialog::getSelectedConstraintPos (  ) 

Definition at line 583 of file dialog.cxx.

References scsolver::ascii(), and scsolver::BaseDialog::getWidgetByName().

Referenced by scsolver::ConstEditBtnListener::actionPerformed(), and updateWidgets().

Reference< awt::XTextComponent > scsolver::SolverDialog::getXTextComponentFromWidget ( const rtl::OUString &  sName  )  const

Definition at line 592 of file dialog.cxx.

References scsolver::BaseDialog::getWidgetByName().

Referenced by getTargetCellAddress(), getVarCellAddress(), setTargetCellAddress(), and setVarCellAddress().

rtl::OUString scsolver::SolverDialog::getTargetCellAddress (  )  const

Definition at line 601 of file dialog.cxx.

References scsolver::ascii(), and getXTextComponentFromWidget().

Referenced by scsolver::SolveModelImpl::resolveObjectiveFuncAddress().

void scsolver::SolverDialog::setTargetCellAddress ( const rtl::OUString &  sAddr  ) 

Definition at line 608 of file dialog.cxx.

References scsolver::ascii(), and getXTextComponentFromWidget().

rtl::OUString scsolver::SolverDialog::getVarCellAddress (  ) 

Definition at line 615 of file dialog.cxx.

References scsolver::ascii(), and getXTextComponentFromWidget().

Referenced by scsolver::SolveModelImpl::resolveDecisionVarAddress().

void scsolver::SolverDialog::setVarCellAddress ( const rtl::OUString &  sAddr  ) 

Definition at line 622 of file dialog.cxx.

References scsolver::ascii(), and getXTextComponentFromWidget().

GoalType scsolver::SolverDialog::getGoal (  )  const

Definition at line 629 of file dialog.cxx.

References scsolver::ascii(), scsolver::unohelper::getPropertyValue(), scsolver::BaseDialog::getWidgetModelByName(), scsolver::numeric::GOAL_MAXIMIZE, scsolver::numeric::GOAL_MINIMIZE, and scsolver::numeric::GOAL_UNKNOWN.

Referenced by saveModelToDocument(), scsolver::SolveModelImpl::solveLp(), and scsolver::SolveModelImpl::solveNlp().

void scsolver::SolverDialog::setGoal ( GoalType  eGoal  ) 

Definition at line 645 of file dialog.cxx.

References scsolver::ascii(), scsolver::BaseDialog::getWidgetModelByName(), scsolver::numeric::GOAL_MAXIMIZE, scsolver::numeric::GOAL_MINIMIZE, scsolver::numeric::GOAL_UNKNOWN, and scsolver::unohelper::setPropertyValue().

Referenced by loadModelFromDocument(), and reset().

void scsolver::SolverDialog::output (  ) 

Definition at line 670 of file dialog.cxx.

References scsolver::ascii(), scsolver::numeric::EQUAL, scsolver::ConstraintString::Equal, scsolver::numeric::GREATER_EQUAL, scsolver::ConstraintString::Left, scsolver::numeric::LESS_EQUAL, m_aConstraint, scsolver::printOUStr(), and scsolver::ConstraintString::Right.

Referenced by editConstraint(), removeConstraint(), and setConstraint().

void scsolver::SolverDialog::editConstraint ( const   sal_uInt32,
const rtl::OUString &  sLeft,
const rtl::OUString &  sRight,
const   EqualityType 
)

Definition at line 730 of file dialog.cxx.

References scsolver::ConstraintString::Equal, scsolver::ConstraintString::Left, m_aConstraint, output(), scsolver::ConstraintString::Right, and setConstraintImpl().

Referenced by scsolver::OKCancelBtnListener::actionPerformed().

void scsolver::SolverDialog::getConstraint ( const   sal_uInt32,
rtl::OUString &  sLeft,
rtl::OUString &  sRight,
EqualityType &  eEq 
)

Definition at line 701 of file dialog.cxx.

References scsolver::ConstraintString::Equal, scsolver::ConstraintString::Left, m_aConstraint, and scsolver::ConstraintString::Right.

Referenced by scsolver::ConstEditBtnListener::actionPerformed().

vector< ConstraintString > scsolver::SolverDialog::getAllConstraints (  )  const

Definition at line 710 of file dialog.cxx.

References m_aConstraint.

Referenced by scsolver::SolveModelImpl::resolveConstraintAddress(), and saveModelToDocument().

void scsolver::SolverDialog::removeConstraint ( const   sal_uInt32  ) 

Definition at line 759 of file dialog.cxx.

References m_aConstraint, output(), and removeConstraintsFromListBox().

Referenced by scsolver::ConstEditBtnListener::actionPerformed().

void scsolver::SolverDialog::clearConstraints (  ) 

Remove all constraints.

Definition at line 784 of file dialog.cxx.

References m_aConstraint, and removeConstraintsFromListBox().

Referenced by loadModelFromDocument(), and reset().

void scsolver::SolverDialog::setConstraint ( const rtl::OUString &  sLeft,
const rtl::OUString &  sRight,
const   EqualityType 
)

Definition at line 715 of file dialog.cxx.

References scsolver::ConstraintString::Equal, scsolver::ConstraintString::Left, m_aConstraint, output(), scsolver::ConstraintString::Right, and setConstraintImpl().

Referenced by scsolver::OKCancelBtnListener::actionPerformed(), and loadModelFromDocument().

void scsolver::SolverDialog::showMessage ( const rtl::OUString &  sMsg  ) 

Definition at line 862 of file dialog.cxx.

References scsolver::BaseDialog::execute(), scsolver::BaseDialog::getPosSize(), scsolver::BaseDialog::getSolverImpl(), and scsolver::BaseDialog::setRefBoundingBox().

Referenced by scsolver::ConstEditDialog::doneRangeSelection(), showSolutionFound(), showSolutionInfeasible(), scsolver::SolveModelImpl::solveLp(), scsolver::SolverImpl::solveModel(), and scsolver::SolveModelImpl::solveNlp().

void scsolver::SolverDialog::showSolutionInfeasible (  ) 

Definition at line 869 of file dialog.cxx.

References scsolver::BaseDialog::getResStr(), and showMessage().

Referenced by scsolver::SolveModelImpl::solveLp().

void scsolver::SolverDialog::showSolutionFound (  ) 

Definition at line 874 of file dialog.cxx.

References scsolver::BaseDialog::getResStr(), and showMessage().

Referenced by scsolver::SolveModelImpl::solveLp(), and scsolver::SolveModelImpl::solveNlp().

void scsolver::SolverDialog::reset (  ) 

Definition at line 879 of file dialog.cxx.

References scsolver::ascii(), clearConstraints(), scsolver::numeric::GOAL_UNKNOWN, setGoal(), and scsolver::setTextByWidget().

Referenced by scsolver::ResetBtnListener::actionPerformed().

void scsolver::SolverDialog::saveModelToDocument (  ) 

Definition at line 887 of file dialog.cxx.

References scsolver::ascii(), scsolver::numeric::EQUAL, getAllConstraints(), scsolver::SolverImpl::getCalcInterface(), getGoal(), scsolver::BaseDialog::getSolverImpl(), scsolver::getTextByWidget(), scsolver::numeric::GOAL_MAXIMIZE, scsolver::numeric::GOAL_MINIMIZE, scsolver::numeric::GOAL_UNKNOWN, scsolver::numeric::GREATER_EQUAL, scsolver::numeric::LESS_EQUAL, scsolver::Global::MODEL_METADATA_NAME, scsolver::CalcInterface::setDocumentProperty(), and scsolver::Global::STRING_SEPARATOR.

Referenced by scsolver::SaveBtnListener::actionPerformed().

void scsolver::SolverDialog::loadModelFromDocument (  ) 

Definition at line 945 of file dialog.cxx.

References scsolver::ascii(), clearConstraints(), scsolver::numeric::EQUAL, scsolver::SolverImpl::getCalcInterface(), scsolver::CalcInterface::getDocumentProperty(), scsolver::BaseDialog::getSolverImpl(), scsolver::numeric::GOAL_MAXIMIZE, scsolver::numeric::GOAL_MINIMIZE, scsolver::numeric::GREATER_EQUAL, scsolver::numeric::LESS_EQUAL, scsolver::Global::MODEL_METADATA_NAME, setConstraint(), setGoal(), scsolver::setTextByWidget(), scsolver::split(), and scsolver::Global::STRING_SEPARATOR.

Referenced by scsolver::LoadBtnListener::actionPerformed().

void scsolver::SolverDialog::updateWidgets (  ) 

Definition at line 996 of file dialog.cxx.

References scsolver::ascii(), scsolver::BaseDialog::enableWidget(), and getSelectedConstraintPos().

Referenced by scsolver::OKCancelBtnListener::actionPerformed(), and scsolver::ConstEditBtnListener::actionPerformed().

void scsolver::SolverDialog::registerListeners (  )  [protected, virtual]

Definition at line 463 of file dialog.cxx.

References scsolver::ascii(), scsolver::CONST_ADD, scsolver::CONST_CHANGE, scsolver::CONST_DELETE, scsolver::SolverImpl::getCalcInterface(), scsolver::BaseDialog::getSolverImpl(), scsolver::CalcInterface::getXRangeSelection(), m_pCloseAction, m_pConstAddListener, m_pConstChangeListener, m_pConstDeleteListener, m_pConstListBoxListener, m_pLoadListener, m_pMaxListener, m_pOKListener, m_pOptionListener, m_pResetListener, m_pSaveListener, m_pSolveListener, m_pTargetRngListener, m_pTopWindowListener, m_pVarCellsRngListener, scsolver::BaseDialog::registerListener(), scsolver::TopWindowListener::setActionClosing(), and scsolver::RngBtnListener::setSingleCell().

Referenced by initialize().

void scsolver::SolverDialog::unregisterListeners (  )  [protected, virtual]

Definition at line 515 of file dialog.cxx.

References scsolver::ascii(), m_pConstAddListener, m_pConstChangeListener, m_pConstDeleteListener, m_pConstListBoxListener, m_pLoadListener, m_pMaxListener, m_pOKListener, m_pOptionListener, m_pResetListener, m_pSaveListener, m_pTargetRngListener, m_pTopWindowListener, m_pVarCellsRngListener, and scsolver::BaseDialog::unregisterListener().

Referenced by ~SolverDialog().

void scsolver::SolverDialog::removeConstraintsFromListBox ( sal_Int16  nPos = 0,
sal_Int16  nCount = 0 
) [private]

Remove constraint entries from the list box.

Parameters:
nPos position of the first entry to be removed
nCount number of entires to be removed (all remaining items if nCount = 0)

Definition at line 795 of file dialog.cxx.

References scsolver::ascii(), and scsolver::BaseDialog::getWidgetByName().

Referenced by clearConstraints(), and removeConstraint().

void scsolver::SolverDialog::setConstraintImpl ( const rtl::OUString &  sLeft,
const rtl::OUString &  sRight,
const   EqualityType,
const   sal_Bool,
const   sal_uInt32 = 0 
) [private]

Set a new constraint or modify an existing one within the dialog.

Implements displaying of a new constraint or an existing constraint that has been modified. Note that this function takes care of just the view portion of the addition/modification, and it does NOT alter the internal constraint data in a model.

Definition at line 816 of file dialog.cxx.

References scsolver::ascii(), scsolver::numeric::EQUAL, scsolver::BaseDialog::getWidgetByName(), scsolver::numeric::GREATER_EQUAL, scsolver::numeric::LESS_EQUAL, and scsolver::printOUStr().

Referenced by editConstraint(), and setConstraint().


Member Data Documentation

std::auto_ptr<ConstEditDialog> scsolver::SolverDialog::m_pConstEditDialog [private]

Definition at line 193 of file dialog.hxx.

Referenced by getConstEditDialog().

std::auto_ptr<OptionDialog> scsolver::SolverDialog::m_pOptionDialog [private]

Definition at line 194 of file dialog.hxx.

Referenced by getOptionDialog().

TopWindowListener* scsolver::SolverDialog::m_pTopWindowListener [private]

Definition at line 197 of file dialog.hxx.

Referenced by registerListeners(), and unregisterListeners().

RngBtnListener* scsolver::SolverDialog::m_pTargetRngListener [private]

Definition at line 198 of file dialog.hxx.

Referenced by registerListeners(), and unregisterListeners().

RngBtnListener* scsolver::SolverDialog::m_pVarCellsRngListener [private]

Definition at line 199 of file dialog.hxx.

Referenced by registerListeners(), and unregisterListeners().

SolveBtnListener* scsolver::SolverDialog::m_pSolveListener [private]

Definition at line 200 of file dialog.hxx.

Referenced by registerListeners().

CloseBtnListener* scsolver::SolverDialog::m_pOKListener [private]

Definition at line 201 of file dialog.hxx.

Referenced by registerListeners(), and unregisterListeners().

SaveBtnListener* scsolver::SolverDialog::m_pSaveListener [private]

Definition at line 202 of file dialog.hxx.

Referenced by registerListeners(), and unregisterListeners().

LoadBtnListener* scsolver::SolverDialog::m_pLoadListener [private]

Definition at line 203 of file dialog.hxx.

Referenced by registerListeners(), and unregisterListeners().

ResetBtnListener* scsolver::SolverDialog::m_pResetListener [private]

Definition at line 204 of file dialog.hxx.

Referenced by registerListeners(), and unregisterListeners().

OptionBtnListener* scsolver::SolverDialog::m_pOptionListener [private]

Definition at line 205 of file dialog.hxx.

Referenced by registerListeners(), and unregisterListeners().

MaxRadioBtnListener* scsolver::SolverDialog::m_pMaxListener [private]

Definition at line 206 of file dialog.hxx.

Referenced by registerListeners(), and unregisterListeners().

ConstEditBtnListener* scsolver::SolverDialog::m_pConstAddListener [private]

Definition at line 207 of file dialog.hxx.

Referenced by registerListeners(), and unregisterListeners().

ConstEditBtnListener* scsolver::SolverDialog::m_pConstChangeListener [private]

Definition at line 208 of file dialog.hxx.

Referenced by registerListeners(), and unregisterListeners().

ConstEditBtnListener* scsolver::SolverDialog::m_pConstDeleteListener [private]

Definition at line 209 of file dialog.hxx.

Referenced by registerListeners(), and unregisterListeners().

ConstListBoxListener* scsolver::SolverDialog::m_pConstListBoxListener [private]

Definition at line 210 of file dialog.hxx.

Referenced by registerListeners(), and unregisterListeners().

SolverDlgCloseAction* scsolver::SolverDialog::m_pCloseAction [private]

Definition at line 211 of file dialog.hxx.

Referenced by registerListeners().

std::vector< ConstraintString > scsolver::SolverDialog::m_aConstraint [private]

Definition at line 214 of file dialog.hxx.

Referenced by clearConstraints(), editConstraint(), getAllConstraints(), getConstraint(), output(), removeConstraint(), and setConstraint().


The documentation for this class was generated from the following files:
Generated on Mon Jul 28 09:13:46 2008 for scsolver by  doxygen 1.5.3