Answers:
在Ubuntu上有两种安装yEd的方法。
使用提供的图形安装程序
yEd附带一个易于使用的图形安装程序,该程序可以处理所有系统依赖性(Java,最重要的是):
按着这些次序:
chmod +x yEd<...>.sh
或进入文件管理器的属性菜单,使安装程序可执行(属性→权限→允许将文件作为程序执行)手动安装
导航到解压缩的文件夹并yed.jar
在java中打开:
java -jar "yed.jar"
要将yEd集成到系统中,可以在下创建.desktop
启动器~/.local/share/applications
。例如:
$ cat ~/.local/share/applications/yed.desktop
[Desktop Entry]
Encoding=UTF-8
Name=yEd Graph Editor
Comment=Edit graphml files in yed
Exec=java -jar /home/user/applications/yEd/yed.jar %u
Terminal=false
Type=Application
Icon=/home/user/applications/yEd/icons/yicon32.png
Categories=Application;Office
StartupNotify=false
MimeType=application/xml;
NoDisplay=false
确保根据您的系统更改Exec=
和Icon=
行。
如果要关联yEd的.graphml文件(安装程序不会自动完成),则可以使用以下脚本:
#! /bin/bash
# Run the script in the root of yEd installation directory
# Tested with Ubuntu 18.04
# Create a new mime type definition file
cat >graphml+xml-mime.xml << EOL
<?xml version="1.0"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
<mime-type type="application/x-graphml+xml">
<comment>yEd graphml file (xml format)</comment>
<glob pattern="*.graphml"/>
<generic-icon name="x-application-graphml+xml"/>
</mime-type>
</mime-info>
EOL
# Install the new mime definition
sudo xdg-mime install graphml+xml-mime.xml
# Install icon (size 48 can be extracted from i4j_extf_2_1aawyej_k3n8ea.ico file)
sudo xdg-icon-resource install --context mimetypes --size 32 .install4j/yEd.png x-application-graphml+xml
# Append %F to yEd .desktop file so it is visible in "Open With Other Application" menu
sed -i '/Exec/ s/$/ %F/' ~/.local/share/applications/yEd\ Graph\ Editor-0.desktop
# Finally go to file manager, right click, select "Open With Other Application",
# click "View All Applications" and select yEd.