|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
jpicedt.ui.util.RunExternalCommand
public class RunExternalCommand
A class implementing methods for calling external processes like latex, (x)dvi, ghostscript... on the current picture file (e.g. the active internal frame)
A "tmp" file is generated on-the-fly in the "tmp" directory of the underlying platform, This tmp file contains an adequate preamble (e.g. usepackage{epic}) depending on current options, and LaTeX commands (or PsTricks or eepic commands) corresponding to each object found in the given picture.
These command lines may include the following special symbols :
- {f} : tmp file name w/o extension (the user need to specify explicitely any extension required by the external program)
- {p} : tmp file path including trailing separator
- {i} : jPicEdt add-ons dir, that is : "jpicedt.home/add-ons" (trailing separtor excluded)
Ex : kghostview {p}{f}.ps or {i}run_latex.bat {p}{f}
Since we don't want to resort on platform dependent tricks (working dirs, PATH variables, root directory names differing on UNIX and Win32 systems, latex command line which might also differ, aso...), the better thing the user could do is to write one batch/shell script per process he wants to launch, then provide the names of these scripts to PicEdt.
Scripts are easy to write on UNIX/Window platforms, and very likely on MacOS platforms by using AppleScript.
Nested Class Summary | |
---|---|
class |
RunExternalCommand.DlgBoxDisplayProcessIOStream
An inner class implementing a JDialog to display external process inputStream and send keyboard events to process outputStream |
Nested classes/interfaces inherited from class java.lang.Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
static String |
BITMAP_CREATION
static field defining an external bitmap creation command, and also used by ActionLocalizer |
static String |
DEFAULT_BITMAP_CREATION_COMMAND
default commands parameters |
static String |
DEFAULT_DVI_COMMAND
default commands parameters |
static String |
DEFAULT_DVIPS_COMMAND
default commands parameters |
static String |
DEFAULT_GS_COMMAND
default commands parameters |
static String |
DEFAULT_LATEX_COMMAND
default commands parameters |
static String |
DEFAULT_USER1_COMMAND
default commands parameters |
static String |
DEFAULT_USER2_COMMAND
default commands parameters |
static String |
DVIPS
static field defining an external "dvips" command, and also used by ActionLocalizer |
static String |
DVIVIEWER
static field defining an external "xdvi" (or similar) command, and also used by ActionLocalizer |
static String |
GHOSTVIEW
static field defining an external "gv" (or similar) command, and also used by ActionLocalizer |
static boolean |
isGUI
|
static String |
KEY_BITMAP_CREATION
key used to fetch command parameters from a Properties object |
static String |
KEY_DVIPS
key used to fetch command parameters from a Properties object |
static String |
KEY_DVIVIEWER
key used to fetch command parameters from a Properties object |
static String |
KEY_GHOSTVIEW
key used to fetch command parameters from a Properties object |
static String |
KEY_LATEX
key used to fetch command parameters from a Properties object |
static String |
KEY_USER1
key used to fetch command parameters from a Properties object |
static String |
KEY_USER2
key used to fetch command parameters from a Properties object |
static String |
LATEX
static field defining an external "latex" command, and also used by ActionLocalizer |
static String |
USER1
static field defining an external user command, and also used by ActionLocalizer |
static String |
USER2
static field defining an external user command, and also used by ActionLocalizer |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
RunExternalCommand(Drawing drawing,
ContentType contentType,
String commandToRun)
|
|
RunExternalCommand(Drawing drawing,
ContentType contentType,
String cmdLine,
boolean isWriteTmpTeXfile)
Mostly for debugging purpose, or when used outside the jpicedt.ui package (since then JPicEdt.preferences are no longer available). |
Method Summary | |
---|---|
static void |
cleanTmpDir()
Delete files created by JPicEdt or programms called by JPicEdt (LaTeX, dvips,...). |
static AbstractCustomizer |
createCustomizer(Properties preferences)
|
static void |
createTmpFile()
Create a new tmp file if it doesn't exit yet |
static String |
getAddonDir()
Return the add-ons directory w/o trailing "/" |
static File |
getTmpFile()
|
static String |
getTmpFilePrefix()
|
static String |
getTmpPath()
|
void |
run()
run an external process as a thread (overloading Thread.run() method) we then pipe the process std output to a JTextArea |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String LATEX
public static final String DVIVIEWER
public static final String DVIPS
public static final String GHOSTVIEW
public static final String USER1
public static final String USER2
public static final String BITMAP_CREATION
public static final String KEY_LATEX
public static final String KEY_DVIVIEWER
public static final String KEY_DVIPS
public static final String KEY_GHOSTVIEW
public static final String KEY_USER1
public static final String KEY_USER2
public static final String KEY_BITMAP_CREATION
public static final String DEFAULT_LATEX_COMMAND
public static final String DEFAULT_DVI_COMMAND
public static final String DEFAULT_DVIPS_COMMAND
public static final String DEFAULT_GS_COMMAND
public static final String DEFAULT_USER1_COMMAND
public static final String DEFAULT_USER2_COMMAND
public static final String DEFAULT_BITMAP_CREATION_COMMAND
public static boolean isGUI
Constructor Detail |
---|
public RunExternalCommand(Drawing drawing, ContentType contentType, String commandToRun)
drawing
- The target document upon which the command will actscontentType
- the content-type used to format the documentcommandToRun
- one of the predefined constant fields (e.g. LATEX, DVIVIEWER, DVIPS or GHOSTVIEW)public RunExternalCommand(Drawing drawing, ContentType contentType, String cmdLine, boolean isWriteTmpTeXfile)
drawing
- The target document upon which the command will actscontentType
- the content-type used to format the documentcmdLine
- a string containing the command to be executed (e.g. "ext_prod.sh {p} latex {f}")Method Detail |
---|
public static File getTmpFile()
public static String getTmpPath()
public static String getTmpFilePrefix()
public void run()
run
in interface Runnable
run
in class Thread
public static void cleanTmpDir()
public static String getAddonDir()
public static void createTmpFile() throws IOException
IOException
public static AbstractCustomizer createCustomizer(Properties preferences)
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |