#!/bin/sh
#
# @author plumber
# @version $Id: Margo,v 1.0 plumber Exp $
# @category starter JDK 1.3 / 1.4
#
AppDir=`dirname "${0}"`
ResourcesDir="${AppDir}"/../Resources
JAVAROOT="${AppDir}"/../Resources/Java
WorkingDirectory="${JAVAROOT}"
UserDirectory="${HOME}"/Library/Margo
#arg="Margo"
arg=""
if [ -n "${2}" ]; then
arg=`basename "${2}"|sed 's/\.zargo//g'`
fi
JAVAMAIN="${JAVAROOT}"/argouml.jar
MARGO_MAIN=org.argouml.application.Main
MARGO_CLASSES="${JAVAROOT}"/antlrall.jar:\
"${JAVAROOT}"/nsuml.jar:\
"${JAVAROOT}"/argouml-model.jar:\
"${JAVAROOT}"/gef.jar:\
"${JAVAROOT}"/ocl-argo.jar:\
"${JAVAROOT}"/jmi.jar:\
"${JAVAROOT}"/swidgets.jar:\
"${JAVAROOT}"/commons-logging.jar:\
"${JAVAROOT}"/log4j.jar:\
"${JAVAROOT}"/toolbar.jar
MARGO_EXT="${JAVAROOT}"/ext/argo_classfile.jar:\
"${JAVAROOT}"/ext/argo_idl.jar:\
"${JAVAROOT}"/ext/argouml-i18n-nb.jar:\
"${JAVAROOT}"/ext/argo_cpp.jar:\
"${JAVAROOT}"/ext/argo_php.jar:\
"${JAVAROOT}"/ext/argouml-i18n-zh.jar
mkdir -p "${HOME}"/Library/Margo
echo "" > "${HOME}"/Library/Margo/argouml.log
ln -sf /usr/bin/java "${AppDir}"/Margo_Java
(cd "${HOME}"/Library/Margo && "${AppDir}"/Margo_Java \
-cp "${JAVAMAIN}":"${MARGO_CLASSES}" \
-Djava.library.path="${JAVAROOT}":"${JAVAROOT}/ext" \
-Duser.home="${UserDirectory}" \
-Duser.dir="${UserDirectory}" -Xdock:name=Margo \
-Xdock:icon=$ResourcesDir/MargoApplication.icns \
-Dcom.apple.macos.use-file-dialog-packages=true \
-Dcom.apple.macos.smallTabs=true \
-Dapple.laf.useScreenMenuBar=true \
-Dcom.apple.mrj.application.live-resize=true \
-Dcom.apple.mrj.application.main="${MARGO_MAIN}" \
-Dcom.apple.mrj.application.classpath="${JAVAMAIN}":"${MARGO_CLASSES}":"${MARGO_EXT}" \
-Dcom.apple.mrj.application.workingdirectory="${WorkingDirectory}" \
-Dapple.awt.brushMetalLook=false \
-Dcom.apple.mrj.application.growbox.intrudes=false \
-jar "${JAVAMAIN}" -nopreload \
"${arg}" > "${HOME}"/Library/Margo/argo.consol)