当前位置: 首页>>代码示例>>Java>>正文


Java GraphicalPTNet类代码示例

本文整理汇总了Java中de.uni.freiburg.iig.telematik.sepia.graphic.GraphicalPTNet的典型用法代码示例。如果您正苦于以下问题:Java GraphicalPTNet类的具体用法?Java GraphicalPTNet怎么用?Java GraphicalPTNet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


GraphicalPTNet类属于de.uni.freiburg.iig.telematik.sepia.graphic包,在下文中一共展示了GraphicalPTNet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: openPNMLFile

import de.uni.freiburg.iig.telematik.sepia.graphic.GraphicalPTNet; //导入依赖的package包/类
private void openPNMLFile(String filename) throws Exception {
	if (!filename.toLowerCase().endsWith(".pnml")) {
		if(!filename.startsWith("-psn_"))//Catching OS X specific argument on the very first startup
                               JOptionPane.showMessageDialog(null, "File \""+filename+"\" is not in .pnml format", "Open Error", JOptionPane.ERROR_MESSAGE);
		filePaths = null;
		startApplication();
	} else {
		@SuppressWarnings("rawtypes")
		AbstractGraphicalPN net = new PNMLParser().parse(filename, EditorProperties.getInstance().getRequireNetType(), EditorProperties.getInstance().getPNValidation());
		switch (net.getPetriNet().getNetType()) {
		case CPN:
			new WolfgangCPN((GraphicalCPN) net).setUpGUI();
			break;
		case PTNet:
			new WolfgangPT((GraphicalPTNet) net).setUpGUI();
			break;
		default:
			throw new Exception("Incompatible net type: " + net.getPetriNet().getNetType());
		}
	}
}
 
开发者ID:iig-uni-freiburg,项目名称:WOLFGANG,代码行数:22,代码来源:WolfgangStartup.java

示例2: doFancyStuff

import de.uni.freiburg.iig.telematik.sepia.graphic.GraphicalPTNet; //导入依赖的package包/类
@Override
public void doFancyStuff(ActionEvent e) throws Exception{
	String netName = requestNetName("Please choose a name for the new net:", "New Petri-Net");
	if (swatNewNetToolbar != null)
		swatNewNetToolbar.getToolBar().disposeAllWindows();
	if (netName != null) {
		// Test new file name
		switch (type) {
		case NEW_CPN:
			GraphicalCPN newCPN = new GraphicalCPN();
			newCPN.getPetriNet().setName(netName);
                               SwatComponents.getInstance().getContainerPetriNets().addComponent(newCPN, true);
			//SwatComponents.getInstance().addPetriNet(newCPN);
			break;
		case NEW_PT:
			GraphicalPTNet newPTNet = new GraphicalPTNet();
			newPTNet.getPetriNet().setName(netName);
			SwatComponents.getInstance().getContainerPetriNets().addComponent(newPTNet, true);
			break;
		case NEW_IF:
			GraphicalIFNet newIFNet = new GraphicalIFNet(new IFNet());
			newIFNet.getPetriNet().setName(netName);
			SwatComponents.getInstance().getContainerPetriNets().addComponent(newIFNet, true);
			break;
		case NEW_RTPN:
			GraphicalTimedNet newRTPNet = new GraphicalTimedNet(new TimedNet());
			newRTPNet.getPetriNet().setName(netName);
			SwatComponents.getInstance().getContainerPetriNets().addComponent(newRTPNet,true);
			break;

		default:
			break;
		}
	}
}
 
开发者ID:iig-uni-freiburg,项目名称:SWAT20,代码行数:36,代码来源:NewNetAction.java

示例3: doFancyStuff

import de.uni.freiburg.iig.telematik.sepia.graphic.GraphicalPTNet; //导入依赖的package包/类
@Override
protected void doFancyStuff(ActionEvent e) throws Exception {
	File f = getFile();
	if (f == null) return;
	PTNet net = BPMN2PNStartup.generateIFnet(f.getAbsolutePath());
	
	String name = requestNetName("Please enter name for net", "Net-Name");
	net.setName(name);
	GraphicalPTNet result = new GraphicalPTNet(net, new PTGraphics());
	SwatComponents.getInstance().getContainerPetriNets().addComponent(result,true);
	SwatComponents.getInstance().getContainerPetriNets().setAskForLayout(name);
	Workbench.consoleMessage("Net Imported "+name);
}
 
开发者ID:iig-uni-freiburg,项目名称:SWAT20,代码行数:14,代码来源:BpmnImportAction.java

示例4: parse

import de.uni.freiburg.iig.telematik.sepia.graphic.GraphicalPTNet; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public GraphicalPTNet parse(File file) throws IOException, ParserException {
    GraphicalPTNet net = new GraphicalPTNet();
    FileReader reader = new FileReader(file.getAbsolutePath());
    String nextLine;
    while ((nextLine = reader.readLine()) != null) {
        String lineContent;
        if (nextLine.startsWith(PREFIX_COMMENT)) {
            // Do nothing
        } else if (nextLine.startsWith(PREFIX_OUTPUTS)) {
            lineContent = nextLine.replace(PREFIX_OUTPUTS, "");
            insertTransitions(net.getPetriNet(), lineContent);
        } else if (nextLine.isEmpty() || nextLine.startsWith(PREFIX_GRAPH) || nextLine.startsWith(PREFIX_END)) {
            // Do nothing
        } else if (nextLine.startsWith(PREFIX_CAPACITIES)) {
            lineContent = nextLine.replace(PREFIX_CAPACITIES, "");
            setCapacities(net.getPetriNet(), lineContent);
        } else if (nextLine.startsWith(PREFIX_MARKING)) {
            lineContent = nextLine.replace(PREFIX_MARKING, "");
            lineContent = lineContent.replace("{", "");
            lineContent = lineContent.replace("}", "");
            setMarking(net.getPetriNet(), lineContent);
        } else {
            addFlowRelation(net.getPetriNet(), nextLine);
        }
    }
    reader.closeFile();
    return net;
}
 
开发者ID:iig-uni-freiburg,项目名称:SEPIA,代码行数:31,代码来源:PetrifyParser.java

示例5: doFancyStuff

import de.uni.freiburg.iig.telematik.sepia.graphic.GraphicalPTNet; //导入依赖的package包/类
@Override
protected void doFancyStuff(ActionEvent e) throws Exception {
	if (wolfgang.getEditorComponent() == null)
		return;
	success = true;
	setUpGui();

	int returnVal = fch.showDialog(wolfgang.getEditorComponent().getGraphComponent(), "load PNML");

	if (returnVal == JFileChooser.APPROVE_OPTION) {
		String filename = fch.getSelectedFile().getAbsolutePath();

		if (filename.toLowerCase().endsWith(".pnml")) {
			AbstractGraphicalPN net = new PNMLParser().parse(filename, EditorProperties.getInstance().getRequireNetType(), EditorProperties.getInstance().getPNValidation());
			switch (net.getPetriNet().getNetType()) {
			case CPN:
				wolfgang = new WolfgangCPN((GraphicalCPN) net);
				break;
			case PTNet:
				wolfgang = new WolfgangPT((GraphicalPTNet) net);
				break;
			default:
				throw new Exception("Incompatible net type: " + net.getPetriNet().getNetType());
			}
			wolfgang.setUpGUI();
		} else
			throw new Exception("File is not in .pnml format");
	}

}
 
开发者ID:iig-uni-freiburg,项目名称:WOLFGANG,代码行数:31,代码来源:LoadAction.java

示例6: main

import de.uni.freiburg.iig.telematik.sepia.graphic.GraphicalPTNet; //导入依赖的package包/类
public static void main(String[] args) throws PropertyException, IOException {
	PTNet ptNet = createPTNet();
	PTGraphics ptNetGraphics = createPTNetGraphics(ptNet);
	GraphicalPTNet netContainer = new GraphicalPTNet(ptNet, ptNetGraphics);
	JPanel pnlPv = new JPanel();
	PropertiesView propertiesView = new PropertiesView(new PTProperties(netContainer));
	propertiesView.setUpGUI();
	pnlPv.add(propertiesView);
	new DisplayFrame(pnlPv, true);

}
 
开发者ID:iig-uni-freiburg,项目名称:WOLFGANG,代码行数:12,代码来源:PropertiesView.java

示例7: getSerializer

import de.uni.freiburg.iig.telematik.sepia.graphic.GraphicalPTNet; //导入依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
public static <	P extends AbstractPlace<F, S>, 
				T extends AbstractTransition<F, S>, 
				F extends AbstractFlowRelation<P, T, S>, 
				M extends AbstractMarking<S>, 
				S extends Object, 
				N extends AbstractPetriNet<P, T, F, M, S>, 
				G extends AbstractPNGraphics<P, T, F, M, S>>

PNSerializer<P, T, F, M, S, N, G>

getSerializer(AbstractGraphicalPN<P, T, F, M, S, N, G> net, PNSerializationFormat format) throws SerializationException {

	// ugly unbounded wildcards as work-around for bug JDK-6932571
	Object serializer = null;
	Object netObject = net;

	switch (format) {
	case PNML:
		if (netObject instanceof GraphicalIFNet) {
			serializer = new PNMLIFNetSerializer((AbstractGraphicalIFNet) net);
		}
		if (netObject instanceof GraphicalCPN) {
			serializer = new PNMLCPNSerializer((AbstractGraphicalCPN) net);
		}
		if (netObject instanceof GraphicalPTNet) {
			serializer = new PNMLPTNetSerializer((AbstractGraphicalPTNet) net);
		}
		if(netObject instanceof GraphicalTimedNet) {
			serializer = new PNMLTimedNetSerializer((AbstractGraphicalTimedNet)net);
		}
		
		break;
	case PETRIFY:
		if (netObject instanceof AbstractGraphicalPTNet)
			serializer = new PetrifyPTNetSerializer((AbstractGraphicalPTNet) net);
		break;
	default:
		throw new SerializationException(de.uni.freiburg.iig.telematik.sepia.serialize.SerializationException.ErrorCode.UNSUPPORTED_FORMAT, format);
	}

	if (serializer != null)
		return (PNSerializer<P, T, F, M, S, N, G>) serializer;
	else
		throw new SerializationException(de.uni.freiburg.iig.telematik.sepia.serialize.SerializationException.ErrorCode.UNSUPPORTED_NET_TYPE, net.getClass());
}
 
开发者ID:iig-uni-freiburg,项目名称:SEPIA,代码行数:47,代码来源:PNSerialization.java

示例8: main

import de.uni.freiburg.iig.telematik.sepia.graphic.GraphicalPTNet; //导入依赖的package包/类
public static void main(String[] args) throws SerializationException, IOException {
	GraphicalPTNet net = new GraphicalPTNet();
	net.getPetriNet().setName("gerd");
	System.out.println(net.getPetriNet().getName());
	PNSerialization.serialize(net, PNSerializationFormat.PNML, "/Users/stocker/Desktop/test.pnml");
}
 
开发者ID:iig-uni-freiburg,项目名称:SEPIA,代码行数:7,代码来源:PNSerialization.java

示例9: createNewGraphicalPN

import de.uni.freiburg.iig.telematik.sepia.graphic.GraphicalPTNet; //导入依赖的package包/类
@Override
protected GraphicalPTNet createNewGraphicalPN() {
	return new GraphicalPTNet();
}
 
开发者ID:iig-uni-freiburg,项目名称:WOLFGANG,代码行数:5,代码来源:NewPTNetAction.java

示例10: getNetContainer

import de.uni.freiburg.iig.telematik.sepia.graphic.GraphicalPTNet; //导入依赖的package包/类
/**
 * Overrides super{@link #getNetContainer()} and returns a
 * {@link GraphicalPTNet}.
 */
@Override
protected GraphicalPTNet getNetContainer() {
	return (GraphicalPTNet) super.getNetContainer();
}
 
开发者ID:iig-uni-freiburg,项目名称:WOLFGANG,代码行数:9,代码来源:PTProperties.java

示例11: WolfgangPT

import de.uni.freiburg.iig.telematik.sepia.graphic.GraphicalPTNet; //导入依赖的package包/类
public WolfgangPT(GraphicalPTNet net, boolean askForLayout) throws Exception {
	super(net, askForLayout);
}
 
开发者ID:iig-uni-freiburg,项目名称:WOLFGANG,代码行数:4,代码来源:WolfgangPT.java

示例12: newEditorComponent

import de.uni.freiburg.iig.telematik.sepia.graphic.GraphicalPTNet; //导入依赖的package包/类
@Override
protected PNEditorComponent newEditorComponent(GraphicalPTNet net, LayoutOption layoutOption) {
	return new PTNetEditorComponent(net, layoutOption);
}
 
开发者ID:iig-uni-freiburg,项目名称:WOLFGANG,代码行数:5,代码来源:WolfgangPT.java

示例13: newNet

import de.uni.freiburg.iig.telematik.sepia.graphic.GraphicalPTNet; //导入依赖的package包/类
@Override
protected GraphicalPTNet newNet() {
	return new GraphicalPTNet();
}
 
开发者ID:iig-uni-freiburg,项目名称:WOLFGANG,代码行数:5,代码来源:WolfgangPT.java

示例14: PTNetEditorComponent

import de.uni.freiburg.iig.telematik.sepia.graphic.GraphicalPTNet; //导入依赖的package包/类
public PTNetEditorComponent(GraphicalPTNet netContainer, boolean askForLayout) {
	super(netContainer, askForLayout);
}
 
开发者ID:iig-uni-freiburg,项目名称:WOLFGANG,代码行数:4,代码来源:PTNetEditorComponent.java

示例15: createNetContainer

import de.uni.freiburg.iig.telematik.sepia.graphic.GraphicalPTNet; //导入依赖的package包/类
@Override
protected GraphicalPTNet createNetContainer() {
	return new GraphicalPTNet(new PTNet(), new PTGraphics());
}
 
开发者ID:iig-uni-freiburg,项目名称:WOLFGANG,代码行数:5,代码来源:PTNetEditorComponent.java


注:本文中的de.uni.freiburg.iig.telematik.sepia.graphic.GraphicalPTNet类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。