From: Olivier G. <og...@us...> - 2008-02-17 22:11:47
|
Update of /cvsroot/osmose-dev/osmose/src/osmose/application/common/slidecomponent In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6501/src/osmose/application/common/slidecomponent Modified Files: OSMSlideBody.java OSMSlideTxtComponent.java Log Message: Added choice for putting bullet lists in notes (by Fatimatou) Index: OSMSlideBody.java =================================================================== RCS file: /cvsroot/osmose-dev/osmose/src/osmose/application/common/slidecomponent/OSMSlideBody.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** OSMSlideBody.java 30 Aug 2005 17:44:01 -0000 1.1.1.1 --- OSMSlideBody.java 17 Feb 2008 22:11:50 -0000 1.2 *************** *** 39,42 **** --- 39,187 ---- public class OSMSlideBody extends OSMSlideComponent { + + + /** + * Put in a string the text displayed in the body + */ + public void setTextBody (){ + boolean aboveTheLine = false; + m_TextBody = ""; + aboveTheLine = OSMTreeEditorPanel.isAboveTheLine(m_Element.getComponent()); + + if (!aboveTheLine) + { + Vector v = new Vector(); + OSMElement.getSons(m_Element, v); + int firstLevel = m_Element.getLevel(); + OSMElement element; + String chip; + for (int k = 0; k < v.size(); k++) + { + element = (OSMElement) v.get(k); + if(element.getTitleIsIncluded()) + { + int level = element.getLevel() - firstLevel; + chip = m_Model.getChips().getChip(level - 1); + int lTmp = level; + while (lTmp-- > 1){ + m_TextBody+=' '; + m_TextBody+=' '; + } + m_TextBody+= chip + ' ' +element.getTitle()+ '\n'; + } + } + } + + if(this.m_SlideType == OSMSlide.SUMMARY){ + Enumeration e=OSMApplication.TreeEditor.getDocument().elements(); + while(e.hasMoreElements()) + { + OSMElement root = (OSMElement)e.nextElement(); + if(root.isInSummary()) + { + int firstLevel = root.getLevel() + 1; + m_TextBody+=root.getTitle() + '\n'; + Vector v = new Vector(); + OSMElement.getSons(root, v); + for (int idx = 0; idx < v.size(); idx++) + { + OSMElement element = (OSMElement) v.get(idx); + if (element.isInSummary()) + { + int level = element.getLevel() - firstLevel + 1; + while (level-- > 0){ + m_TextBody+=' '; + m_TextBody+=' '; + } + m_TextBody+=element.getTitle()+'\n'; + } + } + } + } + } + if(m_SlideType == OSMSlide.TITLE) + { + String str = ""; + OSMPresentation presentation = OSMApplication.getPresentation(); + // Add author name + if(presentation.isThereAuthorNameIncluded()) + { + str = (String)OSMUser.USER.getProperty("labels.author",OSMApplication .Localisation.getString("OSM_LabelsAuthor")); + str += " : " + presentation.getAuthorName(); + m_TextBody+= str + '\n'; + } + // Add author address + if(presentation.isThereAuthorAddressIncluded()) + m_TextBody += presentation.getAuthorAddress() + '\n'; + // Add author organism + if(presentation.isThereAuthorOrganismIncluded()) + m_TextBody+= presentation.getAuthorOrganism()+ '\n'; + // Add version number + if(presentation.isThereVersionNumberIncluded()) + { + str = (String)OSMUser.USER.getProperty("labels.version",OSMApplication.Localisation.getString("OSM_LabelsVersion")); + str += " : " + presentation.getVersionNumber(); + m_TextBody += str + '\n'; + + } + // Add date + if(presentation.isThereVersionDateIncluded()) + m_TextBody+= presentation.getVersionDate()+'\n'; + // Add keywords + if(presentation.isThereKeywordsIncluded()) + { + str = (String)OSMUser.USER.getProperty("labels.keywords",OSMApplication.Localisation.getString("OSM_LabelsKeywords")); + str += " : " + presentation.getKeywords(); + m_TextBody += str +'\n'; + + } + // Add summary + if(presentation.isThereResumeIncluded()) + { + str = (String)OSMUser.USER.getProperty("labels.resume",OSMApplication.Localisation.getString("OSM_LabelsResume")); + str += " : " + presentation.getResume(); + m_TextBody+= str + '\n'; + } + // Add purpose + if(presentation.isTherePurposeIncluded()) + { + str = (String)OSMUser.USER.getProperty("labels.purpose",OSMApplication.Localisation.getString("OSM_LabelsPurpose")); + str += " : " + presentation.getPurpose(); + m_TextBody += str + '\n'; + } + } + } + + /** + * Put a vector of string in the body + * @param a vector of string + */ + + public void addTextChipsList(Vector chipsList){ + for(int i = 0;i < chipsList.size();i++) { + String text ; + int level; + OSMSlideBodyLine line = (OSMSlideBodyLine)chipsList.elementAt(i); + text = line.getText(); + level = line.getLevel(); + addStaticLine(text, level); + } + } + + /** + * Return the OSMSlideBodyLine list + * @return the OSMSlideBodyLine list + */ + public Vector getSlideBodyLineList(){ + return m_LineList; + } + + /** + * Return the text displayed in the body + * @return the text of the body + */ + public String getTextBody(){ + return m_TextBody; + } /** *************** *** 455,459 **** * @param level The level in hierarchy. */ ! private void addStaticLine(String txt, int level) { OSMSlideBodyLine line = new OSMSlideBodyLine(m_SlidePanel, this, m_Element, txt, level); line.setSelectionnable(false); --- 600,604 ---- * @param level The level in hierarchy. */ ! public void addStaticLine(String txt, int level) { OSMSlideBodyLine line = new OSMSlideBodyLine(m_SlidePanel, this, m_Element, txt, level); line.setSelectionnable(false); *************** *** 560,564 **** * To remove all lines of the body. */ ! private void removeAllLines() { Iterator it = m_LineList.iterator(); while(it.hasNext()) { --- 705,709 ---- * To remove all lines of the body. */ ! public void removeAllLines() { Iterator it = m_LineList.iterator(); while(it.hasNext()) { *************** *** 587,591 **** add(line); } ! /** --- 732,740 ---- add(line); } ! ! /** ! * The Text displayed in the body ! */ ! public String m_TextBody; /** *************** *** 611,614 **** --- 760,764 ---- */ private boolean m_OnlyDisplay = false; + Index: OSMSlideTxtComponent.java =================================================================== RCS file: /cvsroot/osmose-dev/osmose/src/osmose/application/common/slidecomponent/OSMSlideTxtComponent.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OSMSlideTxtComponent.java 3 Oct 2007 21:31:13 -0000 1.2 --- OSMSlideTxtComponent.java 17 Feb 2008 22:11:50 -0000 1.3 *************** *** 126,129 **** --- 126,139 ---- repaint(); } + + + /** + * Return the text displayed + * @return the text of a line of a body + */ + + public String getText(){ + return m_Text; + } |