本文整理汇总了Java中de.uni.freiburg.iig.telematik.sewol.context.process.ProcessContext类的典型用法代码示例。如果您正苦于以下问题:Java ProcessContext类的具体用法?Java ProcessContext怎么用?Java ProcessContext使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ProcessContext类属于de.uni.freiburg.iig.telematik.sewol.context.process包,在下文中一共展示了ProcessContext类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showDialog
import de.uni.freiburg.iig.telematik.sewol.context.process.ProcessContext; //导入依赖的package包/类
public static AbstractACModel showDialog(Window owner) throws Exception{
if(!SwatComponents.getInstance().containsProcessContexts()){
int result = JOptionPane.showConfirmDialog(owner, "Working directory does not contain any contexts so far.\nCreate new context now?", "No process contexts found", JOptionPane.YES_NO_OPTION);
if(result != JOptionPane.YES_OPTION)
return null;
ProcessContext newContext = ProcessContextDialog.showDialog(owner);
if(newContext == null)
return null;
SwatComponents.getInstance().getContainerProcessContexts().addComponent(newContext, true);
}
SwatACModelChooserDialog dialog = new SwatACModelChooserDialog(owner);
dialog.setUpGUI();
return dialog.getDialogObject();
}
示例2: addComponents
import de.uni.freiburg.iig.telematik.sewol.context.process.ProcessContext; //导入依赖的package包/类
@Override
protected void addComponents() throws Exception {
mainPanel().setLayout(new BorderLayout());
JPanel topPanel = new JPanel();
BoxLayout topPanelLayout = new BoxLayout(topPanel, BoxLayout.LINE_AXIS);
topPanel.setLayout(topPanelLayout);
topPanel.add(getViewBox());
if(aclModel.getContext() instanceof ProcessContext)
topPanel.add(getDeriveBox());
topPanel.add(Box.createHorizontalGlue());
mainPanel().add(topPanel, BorderLayout.NORTH);
JScrollPane scrollPane = new JScrollPane(getPermissionTable());
mainPanel().add(scrollPane, BorderLayout.CENTER);
// aclModel = aclTable.getACLModel();
}
示例3: DataUsageTableModel
import de.uni.freiburg.iig.telematik.sewol.context.process.ProcessContext; //导入依赖的package包/类
public DataUsageTableModel(ProcessContext context) {
Validate.notNull(context);
if (!context.containsActivities()) {
throw new ParameterException(ErrorCode.EMPTY, "Context does not contain any activities");
}
this.context = context;
}
示例4: DataUsageDialog
import de.uni.freiburg.iig.telematik.sewol.context.process.ProcessContext; //导入依赖的package包/类
public DataUsageDialog(Window owner, ProcessContext context) {
super(owner, ButtonPanelLayout.CENTERED);
if (!context.containsActivities()) {
throw new ParameterException("Context does not contain any " + context.getActivityDescriptorPlural().toLowerCase());
}
if (!context.containsObjects()) {
throw new ParameterException("Context does not contain any " + context.getObjectDescriptorPlural().toLowerCase());
}
this.context = context;
setIncludeCancelButton(false);
}
示例5: DataUsageListRenderer
import de.uni.freiburg.iig.telematik.sewol.context.process.ProcessContext; //导入依赖的package包/类
public DataUsageListRenderer(ProcessContext context) {
this.context = context;
setOpaque(true);
setHorizontalAlignment(LEFT);
setVerticalAlignment(CENTER);
this.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
}
示例6: itemStateChanged
import de.uni.freiburg.iig.telematik.sewol.context.process.ProcessContext; //导入依赖的package包/类
@Override
public void itemStateChanged(ItemEvent e) {
if (currentView == VIEW.TRANSACTION) {
if (getSelectedRow() >= 0 && getSelectedColumn() >= 0) {
JCheckBox checkBox = (JCheckBox) e.getSource();
boolean permissionActivated = checkBox.isSelected();
String subject = ((ActivityPermissionTableModel) getModel()).getRowName(getSelectedRow());
String transaction = getModel().getColumnName(getSelectedColumn());
try {
if (permissionActivated) {
aclModel.addActivityPermission(subject, transaction);
if (deriveAttributePermissions && aclModel.getContext() instanceof ProcessContext) {
Map<String, Set<DataUsage>> transactionDataUsage = ((ProcessContext) aclModel.getContext()).getDataUsageFor(transaction);
for (String object : transactionDataUsage.keySet()) {
aclModel.addObjectPermission(subject, object, transactionDataUsage.get(object));
}
}
} else {
aclModel.removeActivityPermission(subject, transaction);
if (deriveAttributePermissions) {
deriveObjectPermission(subject);
}
}
} catch (ParameterException ex) {
ex.printStackTrace();
}
}
}
}
示例7: deriveObjectPermission
import de.uni.freiburg.iig.telematik.sewol.context.process.ProcessContext; //导入依赖的package包/类
private void deriveObjectPermission(String subject){
if(!(aclModel.getContext() instanceof ProcessContext))
return;
try{
aclModel.removeObjectPermissions(subject);
for(String authorizedTransaction: aclModel.getAuthorizedTransactionsForSubject(subject)){
Map<String, Set<DataUsage>> transactionDataUsage = ((ProcessContext) aclModel.getContext()).getDataUsageFor(authorizedTransaction);
for(String object: transactionDataUsage.keySet()){
aclModel.addObjectPermission(subject, object, transactionDataUsage.get(object));
}
}
} catch(ParameterException e){
e.printStackTrace();
}
}
示例8: TimedNet
import de.uni.freiburg.iig.telematik.sewol.context.process.ProcessContext; //导入依赖的package包/类
public TimedNet() {
super();
clock = 0.0;
setAccessControl(new ProcessContext());
}
示例9: getProcessContext
import de.uni.freiburg.iig.telematik.sewol.context.process.ProcessContext; //导入依赖的package包/类
private static ProcessContext getProcessContext(){
ProcessContext bla = new ProcessContext("Test Process-Context");
bla.setACModel(new RBACModel("RBAC"));
return bla;
}
示例10: showDialog
import de.uni.freiburg.iig.telematik.sewol.context.process.ProcessContext; //导入依赖的package包/类
public static void showDialog(Window owner, ProcessContext context) throws Exception {
DataUsageDialog dialog = new DataUsageDialog(owner, context);
dialog.setUpGUI();
}
示例11: DataUsageTable
import de.uni.freiburg.iig.telematik.sewol.context.process.ProcessContext; //导入依赖的package包/类
public DataUsageTable(ProcessContext context) {
super(new DataUsageTableModel(context));
Validate.notNull(context);
this.context = context;
initialize();
}
示例12: createRandomContext
import de.uni.freiburg.iig.telematik.sewol.context.process.ProcessContext; //导入依赖的package包/类
/**
* Creates a new context using an RBAC access control model.<br>
* Users and permissions to execute transactions are randomly assigned to the given roles.<br>
* Each person is assigned to exactly one role.
* @param transitions A collection of Petri net transitions.
* @param originatorCount The number of desired originators.
* @param roles The roles to use.
* @return A new randomly generated Context.
* @throws ParameterException
*/
public static ConstraintContext createRandomContext(Collection<AbstractTransition<?,?>> transitions, int originatorCount, List<String> roles){
ProcessContext duContext = ProcessContext.createRandomContext(PNUtils.getLabelSetFromTransitions(transitions, false), originatorCount, roles);
try {
return ConstraintContext.newInstance(duContext);
} catch (Exception e) {
throw new RuntimeException(e);
}
}