~ubuntu-branches/debian/sid/latexdraw/sid

« back to all changes in this revision

Viewing changes to latexDraw/ui/DrawPanel.java

  • Committer: Bazaar Package Importer
  • Author(s): Stuart Prescott
  • Date: 2009-07-15 23:35:52 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090715233552-2bblktyf2lmrkyo3
Tags: 2.0.3+1-1
* New upstream release.
* Add additional Recommended packages for new export features.
* Fix typo in long description, with thanks to Kai Weber (Closes: #529195).
* Bump standards to 3.8.2 (no changes).

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
import latexDraw.lang.LaTeXDrawLang;
17
17
import latexDraw.psTricks.PSTricksConstants;
18
18
import latexDraw.ui.dialog.ExceptionFrameDialog;
19
 
import latexDraw.util.*;
 
19
import latexDraw.util.LaTeXDrawCursor;
 
20
import latexDraw.util.LaTeXDrawNamespace;
 
21
import latexDraw.util.LaTeXDrawPoint2D;
 
22
import latexDraw.util.LaTeXDrawResources;
 
23
import latexDraw.util.UndoRedoManager;
20
24
 
21
25
import org.w3c.dom.Document;
22
26
import org.w3c.dom.Element;
23
 
import org.w3c.dom.Node;
24
27
import org.w3c.dom.NodeList;
25
28
 
26
29
/** 
514
517
        
515
518
        
516
519
        /**
517
 
         * Allows to export the drawing as a jpeg file
518
 
         * @param file The new jpeg file
 
520
         * Exports the drawing as a picture.
 
521
         * @param file The new picture to create.
 
522
         * @param format The extension of the picture to create.
519
523
         * @param compressionRate The compression rate for jpg pictures.
520
524
         */
521
525
        public void exportAsPicture(File file, String format, float compressionRate) 
522
526
        {
523
527
                if(format.equals(LaTeXDrawResources.LABEL_EXPORT_JPG))
524
528
                          draw.exportAsJPG(file, compressionRate);
525
 
                else
526
 
                if(format.equals(LaTeXDrawResources.LABEL_EXPORT_EPS))  
 
529
                else if(format.equals(LaTeXDrawResources.LABEL_EXPORT_EPS))     
527
530
                        draw.exportAsEPS(file);
528
 
                else
529
 
                if(format.equals(LaTeXDrawResources.LABEL_EXPORT_PNG))  
 
531
                else if(format.equals(LaTeXDrawResources.LABEL_EXPORT_PNG))     
530
532
                        draw.exportAsPNG(file);
531
 
                else
532
 
                if(format.equals(LaTeXDrawResources.LABEL_EXPORT_BMP))  
 
533
                else if(format.equals(LaTeXDrawResources.LABEL_EXPORT_BMP))     
533
534
                        draw.exportAsBMP(file);
534
 
                else
535
 
                if(format.equals(LaTeXDrawResources.LABEL_EXPORT_PPM))  
 
535
                else if(format.equals(LaTeXDrawResources.LABEL_EXPORT_PPM))     
536
536
                        draw.exportAsPPMFile(file);
537
 
                else
538
 
                        throw new IllegalArgumentException();
 
537
                else if(format.equals(LaTeXDrawResources.LABEL_EXPORT_PDF_LATEX))       
 
538
                        draw.createPDFFile(frameParent.getPathDistribLatex(), file.getPath());
 
539
                else if(format.equals(LaTeXDrawResources.LABEL_EXPORT_EPS_LATEX))       
 
540
                        draw.createPSFile(frameParent.getPathDistribLatex(), file.getPath());
 
541
                else throw new IllegalArgumentException(format);
539
542
        }
540
543
        
541
544
                
1380
1383
                        DrawBorders db = draw.getCompleteBorders();
1381
1384
                        if(db!=null && db.isSelected() && db.isADelimitorSelected())
1382
1385
                        {
 
1386
                                setIsModified(true);
1383
1387
                                db.onDelimitorRelease();
1384
1388
                                return ;
1385
1389
                        }
2001
2005
         * @param nl The list of the parameters.
2002
2006
         * @since 2.0.0
2003
2007
         */
2004
 
        public void setXMLMetadata(NodeList nl)
2005
 
        {
2006
 
                if(nl==null)
2007
 
                        return ;
2008
 
                
2009
 
                Node n;
2010
 
                String name;
2011
 
                
2012
 
                for(int i=0, size = nl.getLength(); i<size; i++)
2013
 
                {
2014
 
                        n = nl.item(i);
2015
 
                        
2016
 
                        if(n!=null && LaTeXDrawNamespace.LATEXDRAW_NAMESPACE_URI.equals(n.getNamespaceURI()))
2017
 
                        {
2018
 
                                name = n.getNodeName();
2019
 
                                
2020
 
                                try
2021
 
                                {
2022
 
                                        if(name.endsWith(LaTeXDrawNamespace.XML_MAGNETIC_GRID))
2023
 
                                                setGridIsMagnetic(Boolean.valueOf(n.getTextContent()).booleanValue());
2024
 
                                }
2025
 
                                catch(Exception e) { System.out.println(name + ": invalid value."); }//$NON-NLS-1$
2026
 
                        }
2027
 
                }
 
2008
        public void setXMLMetadata(NodeList nl) {
 
2009
                // Nothing to do.
2028
2010
        }
2029
2011
 
2030
2012