From: Olivier G. <og...@us...> - 2008-02-17 22:11:47
|
Update of /cvsroot/osmose-dev/osmose/src/osmose/application/export In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6501/src/osmose/application/export Modified Files: OSMExportHTML.java Log Message: Added choice for putting bullet lists in notes (by Fatimatou) Index: OSMExportHTML.java =================================================================== RCS file: /cvsroot/osmose-dev/osmose/src/osmose/application/export/OSMExportHTML.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** OSMExportHTML.java 3 Oct 2007 21:31:14 -0000 1.6 --- OSMExportHTML.java 17 Feb 2008 22:11:51 -0000 1.7 *************** *** 20,23 **** --- 20,24 ---- import java.util.*; import java.awt.*; + import javax.swing.*; import osmose.application.*; *************** *** 200,204 **** boolean aboveTheLine = false; JFrame frame = new JFrame(); ! OSMSlideViewerPanel panel = new OSMSlideViewerPanel(null, m_Document, 800, 600); frame.getContentPane().add(panel); frame.setVisible(true); --- 201,206 ---- boolean aboveTheLine = false; JFrame frame = new JFrame(); ! //OSMSlideViewerPanel panel = new OSMSlideViewerPanel(null, m_Document, 800, 600,false); ! OSMSlideViewerPanel panel = new OSMSlideViewerPanel(null, m_Document, 600, 450,false); frame.getContentPane().add(panel); frame.setVisible(true); *************** *** 310,317 **** String notesStr = ""; if (m_DialogExport.isHTMLNotIncluded()) { - if (!slide.getWrittenNotes().equals("")) { notesStr += "Notes : <br>"; ! notesStr += convert2HTML(slide.getWrittenNotes()); ! } } slideStr=replaceTag(slideStr,"{NOTES.TEXT}", notesStr); --- 312,450 ---- String notesStr = ""; if (m_DialogExport.isHTMLNotIncluded()) { notesStr += "Notes : <br>"; ! if(slide.getStateBox()==false){ ! notesStr += convert2HTML(slide.getWrittenNotes()); ! } ! else { ! if(model.getBody().isDisplayed() & slide.getStateBox()== true){ ! int thickness = 8; ! styleStr = ""; ! OSMPageItemProperties properties = slide.getBodyProperties(); ! Font f = slide.getModel().getBody().getFont(); ! Font nf = f.deriveFont((f.getSize()) / m_FontCoeff); ! Color c = slide.getModel().getBody().getFontColor(); ! int x = properties.getX()/m_coeff + thickness; ! int y = (properties.getY()/m_coeff); ! int w = properties.getW()/m_coeff - thickness; ! int h = properties.getH()/m_coeff - nf.getSize() - thickness; ! styleStr += " #body_"+parent.hashCode(); ! styleStr += " {position:absolute;left:"+(x)+"px;top:"+(y)+"px;"; ! styleStr += "width:"+(w)+"px;height:"+(h)+"px;"; ! styleStr += "font-family:"+convertJavaFontToCSSFont(f)+",sans-serif;"; ! styleStr += "font-size:"+nf.getSize()+"pt;"; ! styleStr += "color : #" + getHexaColor(c) + ";"; ! if(nf.isBold()) ! styleStr += "font-weight : bold;"; ! if(nf.isItalic()) ! styleStr += "font-style : italic;"; ! if (slide.getModel().getBody().getFontUnderlined()) ! styleStr += "text-decoration:underline;"; ! styleStr += "}\n"; ! notesStr +=" <div id=\"body_"+parent.hashCode()+"\">"; ! if (!aboveTheLine) ! { ! Vector v = new Vector(); ! OSMElement.getSons(parent, v); ! int firstLevel = parent.getLevel(); ! OSMElement elt; ! String chip; ! for (int k = 0; k < v.size(); k++) ! { ! elt = (OSMElement) v.get(k); ! if(elt.getTitleIsIncluded()) ! { ! int level = elt.getLevel() - firstLevel; ! chip = slide.getModel().getChips().getChip(level - 1); ! int lTmp = level; ! while (lTmp-- > 1) ! notesStr += " "; ! notesStr += convert2HTML(chip + " " + elt.getTitle()) +"<br>"; ! } ! } ! } ! if(slide.getType() == OSMSlide.SUMMARY) ! { ! // If summary never has been created, generate it ! OSMSummaryCreator creator = new OSMSummaryCreator(OSMApplication.getDocument()); ! creator.generateSummary(OSMApplication.getPresentation().getSummaryDepth()); ! // Then add lines... ! Enumeration e=OSMApplication.TreeEditor.getDocument().elements(); ! while(e.hasMoreElements()) ! { ! OSMElement root = (OSMElement)e.nextElement(); ! if(root.isInSummary()) ! { ! int firstLevel = root.getLevel() + 1; ! notesStr += convert2HTML(root.getTitle()) + "<br>"; ! Vector v = new Vector(); ! OSMElement.getSons(root, v); ! for (int idx = 0; idx < v.size(); idx++) ! { ! OSMElement elt = (OSMElement) v.get(idx); ! if (elt.isInSummary()) ! { ! int level = elt.getLevel() - firstLevel + 1; ! while (level-- > 0) ! notesStr += " "; ! notesStr += convert2HTML(elt.getTitle()) + "<br>"; ! } ! } ! } ! } ! } ! if(slide.getType() == OSMSlide.TITLE) ! { ! String str = ""; ! OSMPresentation presentation = m_Document.getPresentation(); ! // Add author name ! if(presentation.isThereAuthorNameIncluded()) ! { ! str = (String)OSMUser.USER.getProperty("labels.author",OSMApplication .Localisation.getString("OSM_LabelsAuthor")); ! str += " : " + presentation.getAuthorName(); ! notesStr+=convert2HTML(str) + "<br>"; ! } ! // Add author address ! if(presentation.isThereAuthorAddressIncluded()) ! notesStr += convert2HTML(presentation.getAuthorAddress()) + "<br>"; ! // Add author organism ! if(presentation.isThereAuthorOrganismIncluded()) ! notesStr += convert2HTML(presentation.getAuthorOrganism())+"<br>"; ! // Add version number ! if(presentation.isThereVersionNumberIncluded()) ! { ! str = (String)OSMUser.USER.getProperty("labels.version",OSMApplication.Localisation.getString("OSM_LabelsVersion")); ! str += " : " + presentation.getVersionNumber(); ! notesStr += convert2HTML(str) + "<br>"; ! ! } ! // Add date ! if(presentation.isThereVersionDateIncluded()) ! notesStr+= convert2HTML(presentation.getVersionDate())+"<br>"; ! // Add keywords ! if(presentation.isThereKeywordsIncluded()) ! { ! str = (String)OSMUser.USER.getProperty("labels.keywords",OSMApplication.Localisation.getString("OSM_LabelsKeywords")); ! str += " : " + presentation.getKeywords(); ! notesStr += convert2HTML(str) + "<br>"; ! } ! // Add summary ! if(presentation.isThereResumeIncluded()) ! { ! str = (String)OSMUser.USER.getProperty("labels.resume",OSMApplication.Localisation.getString("OSM_LabelsResume")); ! str += " : " + presentation.getResume(); ! notesStr += convert2HTML(str) + "<br>"; ! } ! // Add purpose ! if(presentation.isTherePurposeIncluded()) ! { ! str = (String)OSMUser.USER.getProperty("labels.purpose",OSMApplication.Localisation.getString("OSM_LabelsPurpose")); ! str += " : " + presentation.getPurpose(); ! notesStr += convert2HTML(str) + "<br>"; ! } ! } ! notesStr += "</div>\n"; ! } ! ! } } slideStr=replaceTag(slideStr,"{NOTES.TEXT}", notesStr); *************** *** 357,361 **** styleStr += "width:"+(w)+"px;height:"+(h)+"px;"; styleStr += "font-family:"+convertJavaFontToCSSFont(f)+",sans-serif;"; ! styleStr += "font-size:"+nf.getSize()+"pt;"; styleStr += "color : #" + getHexaColor(c) + ";"; if(nf.isBold()) --- 490,494 ---- styleStr += "width:"+(w)+"px;height:"+(h)+"px;"; styleStr += "font-family:"+convertJavaFontToCSSFont(f)+",sans-serif;"; ! styleStr += "font-size:"+nf.getSize()+"pt;"; styleStr += "color : #" + getHexaColor(c) + ";"; if(nf.isBold()) *************** *** 444,448 **** // Body ! if(model.getBody().isDisplayed()) { OSMPageItemProperties properties = slide.getBodyProperties(); --- 577,581 ---- // Body ! if(model.getBody().isDisplayed() & slide.getStateBox()==false) { OSMPageItemProperties properties = slide.getBodyProperties(); *************** *** 458,462 **** styleStr += "width:"+(w)+"px;height:"+(h)+"px;"; styleStr += "font-family:"+convertJavaFontToCSSFont(f)+",sans-serif;"; ! styleStr += "font-size:"+nf.getSize()+"pt;"; styleStr += "color : #" + getHexaColor(c) + ";"; if(nf.isBold()) --- 591,595 ---- styleStr += "width:"+(w)+"px;height:"+(h)+"px;"; styleStr += "font-family:"+convertJavaFontToCSSFont(f)+",sans-serif;"; ! styleStr += "font-size:"+nf.getSize()+"pt;"; styleStr += "color : #" + getHexaColor(c) + ";"; if(nf.isBold()) |