|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.malai.instrument.Instrument
org.malai.instrument.WidgetInstrument
net.sf.latexdraw.instruments.Exporter
public class Exporter
This instrument exports a drawing in different formats.
This file is part of LaTeXDraw.
Copyright (c) 2005-2012 Arnaud BLOUIN
LaTeXDraw is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later version.
LaTeXDraw is distributed without any warranty; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
05/23/2010
Field Summary | |
---|---|
protected ICanvas |
canvas
The canvas that contains the shapes to export. |
protected java.lang.String |
defaultPackages
The latex packages that the interactive system saves by default. |
protected IDrawing |
drawing
The drawing that contains the shapes to export. |
protected MMenu |
exportMenu
The export menu that contains all the export menu item. |
protected ExportDialog |
fileChooserExport
The dialog box that allows to define where the drawing must be exported. |
static java.lang.String |
LABEL_EXPORT_AS
The label of the menu export as |
static java.lang.String |
LABEL_EXPORT_BMP
The label of the exportAsBMPFile item |
static java.lang.String |
LABEL_EXPORT_JPG
The label of the exportDrawMenu item |
static java.lang.String |
LABEL_EXPORT_PNG
The label of the exportAsPNGFile item |
static java.lang.String |
LABEL_EXPORT_TRICKS
The label of the exportCodeMenu item |
protected MMenuItem |
menuItemBMP
The menu item that export as BMP picture. |
protected MMenuItem |
menuItemEPSLatex
The menu item that export as PS (using latex) document. |
protected MMenuItem |
menuItemJPG
The menu item that export as JPG picture. |
protected MMenuItem |
menuItemPDF
The menu item that export as PDF document. |
protected MMenuItem |
menuItemPDFcrop
The menu item that export as PDF (using pdfcrop) document. |
protected MMenuItem |
menuItemPNG
The menu item that export as PNG picture. |
protected MMenuItem |
menuItemPST
The menu item that export as PST code. |
protected java.lang.String |
pathExport
The default location of the exports. |
protected MButton |
pdfButton
The button used to export the drawing as a pdf document. |
protected javax.swing.JLabel |
statusBar
The field where messages are displayed. |
static java.lang.String |
TITLE_DIALOG_EXPORT
The title of the dialog box used to export drawings. |
Fields inherited from class org.malai.instrument.WidgetInstrument |
---|
composer |
Fields inherited from class org.malai.instrument.Instrument |
---|
activated, eventables, links, modified |
Constructor Summary | |
---|---|
Exporter(UIComposer<?> composer,
ICanvas canvas,
IDrawing drawing,
javax.swing.JLabel statusBar)
Creates the instrument. |
Method Summary | |
---|---|
java.lang.String |
getDefaultPackages()
|
protected ExportDialog |
getExportDialog(Export.ExportFormat format)
|
MMenu |
getExportMenu()
|
java.lang.String |
getPathExport()
|
MButton |
getPdfButton()
|
protected void |
initialiseLinks()
Initialises the links of the instrument. |
protected void |
initialiseWidgets()
Initialises the widgets of the instrument. |
void |
load(boolean generalPreferences,
java.lang.String nsURI,
org.w3c.dom.Element root)
Loads data save in an XML document. |
void |
onActionExecuted(Action action)
Notifies the handler when the given action is executed. |
void |
reinit()
Reinitialises the object. |
void |
save(boolean generalPreferences,
java.lang.String nsURI,
org.w3c.dom.Document document,
org.w3c.dom.Element root)
Saves the parameters of the instrument into an XML tag. |
void |
setActivated(boolean activated)
Activates or deactivates the instrument. |
void |
setActivated(boolean activated,
boolean hide)
Activates or deactivates the instrument. |
void |
setDefaultPackages(java.lang.String defaultPackages)
|
void |
setPackages(java.lang.String packages)
|
void |
setPathExport(java.lang.String pathExport)
|
Methods inherited from class org.malai.instrument.WidgetInstrument |
---|
getComposer |
Methods inherited from class org.malai.instrument.Instrument |
---|
addEventable, addLink, clearEvents, getLinks, getSizeLinks, hasLinks, interimFeedback, isActivated, isModified, onActionAborted, onActionAdded, onActionCancelled, onActionDone, onUndoableAdded, onUndoableRedo, onUndoableUndo, removeLink, setModified |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String TITLE_DIALOG_EXPORT
public static final java.lang.String LABEL_EXPORT_BMP
public static final java.lang.String LABEL_EXPORT_PNG
public static final java.lang.String LABEL_EXPORT_TRICKS
public static final java.lang.String LABEL_EXPORT_JPG
public static final java.lang.String LABEL_EXPORT_AS
protected ICanvas canvas
protected IDrawing drawing
protected MButton pdfButton
protected MMenu exportMenu
protected MMenuItem menuItemPST
protected MMenuItem menuItemJPG
protected MMenuItem menuItemPNG
protected MMenuItem menuItemBMP
protected MMenuItem menuItemPDF
protected MMenuItem menuItemEPSLatex
protected MMenuItem menuItemPDFcrop
protected ExportDialog fileChooserExport
protected java.lang.String pathExport
protected java.lang.String defaultPackages
protected javax.swing.JLabel statusBar
Constructor Detail |
---|
public Exporter(UIComposer<?> composer, ICanvas canvas, IDrawing drawing, javax.swing.JLabel statusBar)
composer
- The composer that manages the widgets of the instrument.canvas
- The canvas that contains the views to export (for pictures).drawing
- The drawing that contains the shapes to export (for latex and code).statusBar
- The status bar where messages are displayed.
java.lang.IllegalArgumentException
- If one of the given arguments is null.Method Detail |
---|
protected void initialiseWidgets()
WidgetInstrument
initialiseWidgets
in class WidgetInstrument
public void reinit()
Reinitialisable
reinit
in interface Reinitialisable
reinit
in class Instrument
public void load(boolean generalPreferences, java.lang.String nsURI, org.w3c.dom.Element root)
Preferenciable
load
in interface Preferenciable
load
in class Instrument
generalPreferences
- True: this operation is called to load the general preferences of the interactive system.
Otherwise, it is called to load a presentation in a document. This parameter is useful when different information
must be loaded during a presentation backup or a general preferences backup.nsURI
- The namespace that must be added to tags corresponding to the instrument's parameters.root
- The meta data element.public void save(boolean generalPreferences, java.lang.String nsURI, org.w3c.dom.Document document, org.w3c.dom.Element root)
Preferenciable
save
in interface Preferenciable
save
in class Instrument
generalPreferences
- True: this operation is called to save the general preferences of the interactive system.
Otherwise, it is called to save a presentation in a document. This parameter is useful when different information
must be saved during a presentation backup or a general preferences backup.nsURI
- The namespace that must be added to tags corresponding to the instrument's parameters.document
- The XML document.root
- The root element that will contains the instrument's parameters.public void setActivated(boolean activated, boolean hide)
WidgetInstrument
Instrument.setActivated(boolean)
but
the difference is that is this opedeactivateration another parameter can be used to define is the widgets of the
instrument must be hidden: in some cases, deactivating the instrument just implies disabling its widgets
(but they are still visible); in some others cases, deactivating the instrument means hiding the widgets.
Should be overridden to define the process of hiding the widgets.
setActivated
in class WidgetInstrument
activated
- True = activation.hide
- If true the widgets will be hidden. Only while deactivating the instrument.public void setActivated(boolean activated)
Instrument
setActivated
in class Instrument
activated
- True = activation.protected void initialiseLinks()
Instrument
initialiseLinks
in class Instrument
public MButton getPdfButton()
public MMenu getExportMenu()
protected ExportDialog getExportDialog(Export.ExportFormat format)
format
- The format of the document to export.
public void onActionExecuted(Action action)
ActionHandler
onActionExecuted
in interface ActionHandler
onActionExecuted
in class Instrument
action
- The executed action.public java.lang.String getDefaultPackages()
public void setDefaultPackages(java.lang.String defaultPackages)
defaultPackages
- The latex packages that the interactive system saves by default.
These packages should by set by the user and must be general, i.e. independent of any document.
Packages for a given document should by set using setPackages(String)
.public void setPackages(java.lang.String packages)
packages
- The latex packages used when exporting using latex.
These packages are defined for the current document but not for all documents.
These general packages can be set using setDefaultPackages(String)
.public java.lang.String getPathExport()
public void setPathExport(java.lang.String pathExport)
pathExport
- The path where files are exported.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |