de.uni.freiburg.iig.telematik.sepia.parser.graphic.PNChooser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of SEPIA Show documentation
Show all versions of SEPIA Show documentation
SEPIA provides implementations for various types of Petri nets. Along Place/Transition-nets, it supports Petri nets with distinguishable token colors and defines coloured workflow nets, where coloured tokens are interpreted as data elements used during process execution. To support information flow analysis of processes, SEPIA defines so-called IF-Nets, tailored for security-oriented workflow modeling which enable users to assign security-levels (HIGH, LOW) to transitions, data elements and persons/agents participating in the process execution.
The newest version!
package de.uni.freiburg.iig.telematik.sepia.parser.graphic;
import java.io.File;
import javax.swing.JFileChooser;
import javax.swing.filechooser.FileView;
import de.invation.code.toval.file.FileUtils;
public class PNChooser extends JFileChooser {
private static final long serialVersionUID = 5434773911883000233L;
public PNChooser(){
super();
setAcceptAllFileFilterUsed(false);
setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
addChoosableFileFilter(new PetrifyFileFilter());
addChoosableFileFilter(new PNMLFileFilter());
setFileView(new PNFileView());
}
public class PNFileView extends FileView {
@Override
public String getName(File f) {
String fileName = null;
if(f != null) {
fileName = PNChooser.this.getFileSystemView().getSystemDisplayName(f);
}
return fileName;
}
@Override
public String getDescription(File f) {
return f.getName();
}
// public Boolean isTraversable(File f) {
// return null;
// }
@Override
public String getTypeDescription(File f) {
String extension = FileUtils.getExtension(f);
String type = null;
if (extension != null) {
if (extension.equals("pnml")) {
type = "PNML";
} else if (extension.equals("pn")){
type = "Petrify";
}
}
return type;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy