# HG changeset patch # User wneuper # Date 1109173502 -3600 # Node ID 630e014f478be4a1e93b56264b4cc4e6726b4b87 # Parent f9316e5b54094d1bfc8c103d675bb1ba30a6b49f java-050223b-Dialog-formatted in order to prepare later diffs diff -r f9316e5b5409 -r 630e014f478b src/java/isac/gui/WindowApplication.java --- a/src/java/isac/gui/WindowApplication.java Wed Feb 23 14:19:00 2005 +0100 +++ b/src/java/isac/gui/WindowApplication.java Wed Feb 23 16:45:02 2005 +0100 @@ -160,7 +160,7 @@ sdialog = InformationProcessor.getSDialog(); loginScreen.dispose(); this.show(); - //openNewWorksheet(DialogGuide.STARTFROM_EMPTY, CalcHead.VIEWSTYLE_FULL); + //openNewWorksheet(DialogGuide.STARTFROM_EMPTY_WORKSHEET, CalcHead.VIEWSTYLE_FULL); } else { loginScreen.showErrorMsg(); } @@ -537,7 +537,7 @@ logger.error("invalid source for ActionEvent"); } // Formalization f = new Formalization(); - // openNewWorksheet(f, DialogGuide.STARTFROM_EMPTY, + // openNewWorksheet(f, DialogGuide.STARTFROM_EMPTY_WORKSHEET, // CalcHead.VIEWSTYLE_SIMPLE_SOLVE); } diff -r f9316e5b5409 -r 630e014f478b src/java/isac/wsdialog/DGuide.java --- a/src/java/isac/wsdialog/DGuide.java Wed Feb 23 14:19:00 2005 +0100 +++ b/src/java/isac/wsdialog/DGuide.java Wed Feb 23 16:45:02 2005 +0100 @@ -34,7 +34,11 @@ /** * To express that the user started a calculation from scratch */ - public static final int STARTFROM_EMPTY = 0; + public static final int STARTFROM_EMPTY_WORKSHEET = 0; + /** + * To express that the user started a calculation from scratch + */ + public static final int STARTFROM_EMPTY_CALCHEAD = 0; /** * To express that the user started a calculation from the example collection */ @@ -43,7 +47,7 @@ * To express that the user started a calculation from the hierarchy of problems */ public static final int STARTFROM_PROBLEM = 2; - public static final int STARTFROM_METHOD = 3; //WN040826 + public static final int STARTFROM_METHOD = 3; /** * The Dialog is not doing anything at the moment @@ -69,7 +73,8 @@ * * @param user_id The user * @param f Formalization from the example collection or null - * @param started_from STARTFROM_EMPTY, STARTFROM_EXAMPLE, STARTFROM_PROBLEMTYPE + * @param started_from STARTFROM_EMPTY_WORKSHEET, STARTFROM_EMPTY_CALCHEAD, STARTFROM_EXAMPLE, STARTFROM_PROBLEM, + * STARTFROM_METHOD * @param requested_calchead_view * @return * @throws RemoteException diff -r f9316e5b5409 -r 630e014f478b src/java/isac/wsdialog/DialogGuide.java --- a/src/java/isac/wsdialog/DialogGuide.java Wed Feb 23 14:19:00 2005 +0100 +++ b/src/java/isac/wsdialog/DialogGuide.java Wed Feb 23 16:45:02 2005 +0100 @@ -43,7 +43,7 @@ private Vector datachange_listeners_; private IToWorksheet ui_control_listener_; - + protected UserSettings user_settings_; /** @@ -72,29 +72,29 @@ CalcHead startSpecifying(CalcHead calc_head) { int calchead_view; String setting_value; - + // set viewstyle according to user settings - + // dummy return of getValue() call until class is completed // setting_value = user_settings_.getValue("DefaultCalcHeadView"); setting_value = null; - + if (setting_value == null) calchead_view = CalcHead.VIEWSTYLE_SINGLELINE; else - calchead_view = Integer.parseInt(setting_value); + calchead_view = Integer.parseInt(setting_value); calc_head.setViewStyle(calchead_view); - - + phase_ = DIALOGPHASE_SPECIFY; - + // dummy return of getValue() call until class is completed // if (user_settings_.getValue("SkipSpecifyingPhase").equals("1")) { - + if (true) { calc_tree_.completeCalcHead(); try { - notifyUserAction(new UserAction(IUIElement.UI_SPECIFY_CALCULATE_1)); + notifyUserAction(new UserAction( + IUIElement.UI_SPECIFY_CALCULATE_1)); } catch (RemoteException e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -103,7 +103,7 @@ e.printStackTrace(); } } - + return calc_head; //WN040906 this is NOT completed !!! // FIXME.WN040906 do NOT return calc_head, like Formula in solve-phase } @@ -113,7 +113,7 @@ int start_from, int requested_calchead_view) { ICalcIterator temp_iterator; - + calc_tree_ = math_engine_.startCalculation(f); temp_iterator = calc_tree_.iterator(); try { @@ -184,32 +184,34 @@ // not // to be edited // try { -// while (!last_formula.isLast()) { -// if (last_formula.getElement().getType() == ICalcElement.CALCEL_CALCHEAD) { -// last_formula.getElement().setViewStyle( -// CalcHead.VIEWSTYLE_IN_CALC); -// } -// last_formula.moveDown(); -// //TODO last_formula.moveDown.. WN040824 DG may limit the level -// // down -// } -// -// // for now, do not specify the CalcHead, just display it. -// calc_elem = last_formula.getElement(); -// -// if (calc_elem.getType() == ICalcElement.CALCEL_CALCHEAD) { -// //WN040826 phase_ = DIALOGPHASE_SPECIFY; --->startSpecifying -// //WN040826 -// // calc_elem.setViewStyle(CalcHead.VIEWSTYLE_SINGLELINE);--->startSpecifying -// -// //WN040826calc_head = startSpecifying((CalcHead) calc_elem); -// // --->startSpecifying -// startSpecifying((CalcHead) calc_elem); -// //WN040826 math_engine_.completeCalcHead(calc_head); -// // --->startSpecifying -// } else { -// phase_ = DIALOGPHASE_SOLVE; -// } + // while (!last_formula.isLast()) { + // if (last_formula.getElement().getType() == + // ICalcElement.CALCEL_CALCHEAD) { + // last_formula.getElement().setViewStyle( + // CalcHead.VIEWSTYLE_IN_CALC); + // } + // last_formula.moveDown(); + // //TODO last_formula.moveDown.. WN040824 DG may limit the level + // // down + // } + // + // // for now, do not specify the CalcHead, just display it. + // calc_elem = last_formula.getElement(); + // + // if (calc_elem.getType() == ICalcElement.CALCEL_CALCHEAD) { + // //WN040826 phase_ = DIALOGPHASE_SPECIFY; --->startSpecifying + // //WN040826 + // // + // calc_elem.setViewStyle(CalcHead.VIEWSTYLE_SINGLELINE);--->startSpecifying + // + // //WN040826calc_head = startSpecifying((CalcHead) calc_elem); + // // --->startSpecifying + // startSpecifying((CalcHead) calc_elem); + // //WN040826 math_engine_.completeCalcHead(calc_head); + // // --->startSpecifying + // } else { + // phase_ = DIALOGPHASE_SOLVE; + // } } catch (Exception e) { e.printStackTrace(); } @@ -353,7 +355,7 @@ request = UI_SOLVE_CALCULATE_1; phase_ = DIALOGPHASE_SOLVE; } - break; + break; case (UI_CALCULATE_ALL): if (getActiveFormula().onCalcHead()) { request = UI_SPECIFY_CALCULATE_ALL; @@ -363,7 +365,7 @@ phase_ = DIALOGPHASE_SOLVE; } } - + // al other userActions belong to a certain dialogphase switch (phase_) { case DIALOGPHASE_IDLE: @@ -446,12 +448,12 @@ //if (user_settings_.getValue("")) calc_tree_.completeCalcHead(); //@@@@@@@WN050223 - + phase_ = DIALOGPHASE_SOLVE; // fall through to calculate case UI_SOLVE_CALCULATE_1: - //why not at (*) here ? + //why not at (*) here ? case UI_SOLVE_CALCULATE_ALL: switch (request) { case UI_SPECIFY_CALCULATE_ALL: @@ -459,7 +461,7 @@ autoCalculate(SCOPE_CALCULATION, 0); break; case UI_SPECIFY_CALCULATE_1://??? - // break; + // break; default: autoCalculate(SCOPE_CALCULATION, 1);//why not at (*) above ? break;