@Override public void setWeight(int id, IArc arc, int weight) throws EngineException { if (arc instanceof PreArc) { ruleManipulationBackend.setWeight(id, (PreArc) arc, weight); } else if (arc instanceof PostArc) { ruleManipulationBackend.setWeight(id, (PostArc) arc, weight); } else { warning("this isn't an arc"); } }
@Override public void createArc(int id, UUID nacId, INode from, INode to) throws EngineException { if (from instanceof Place && to instanceof Transition) { ruleManipulationBackend.createPreArc(id, nacId, (Place) from, (Transition) to); } else if (from instanceof Transition && to instanceof Place) { ruleManipulationBackend.createPostArc(id, nacId, (Transition) from, (Place) to); } else { warning( "Pfeile dürfen nicht zwischen Stelle und Stelle bzw. " + "zwischen Transition und Transition bestehen."); } }
@Override public int createRule() { int id = ruleManipulationBackend.createRule(); return id; }
@Override public void setPname(int id, INode place, String pname) throws EngineException { if (!(place instanceof Place)) { warning("place isn't a Place"); return; } ruleManipulationBackend.setPname(id, (Place) place, pname); }
@Override public void setMarking(int id, INode place, int marking) throws EngineException { if (!(place instanceof Place)) { warning("place isn't a Place"); return; } ruleManipulationBackend.setMarking(id, (Place) place, marking); }
@Override public void deleteTransition(int id, RuleNet net, INode transition) throws EngineException { if (!(transition instanceof Transition)) { warning("transition isn't a Transition"); return; } ruleManipulationBackend.deleteTransition(id, net, (Transition) transition); }
@Override public void setRnw(int id, UUID nacId, INode transition, IRenew renews) throws EngineException { if (!(transition instanceof Transition)) { warning("transition isn't a Transition"); return; } ruleManipulationBackend.setRnw(id, nacId, (Transition) transition, renews); }
@Override public void deletePlace(int id, RuleNet net, INode place) throws EngineException { if (!(place instanceof Place)) { warning("node isn't a place"); return; } ruleManipulationBackend.deletePlace(id, net, (Place) place); }
@Override public void setTname(int id, UUID nacId, INode transition, String tname) throws EngineException { if (!(transition instanceof Transition)) { warning("transition isn't a Transition"); return; } ruleManipulationBackend.setTname(id, nacId, (Transition) transition, tname); }
@Override public void setPlaceColor(int id, UUID nacId, INode place, Color color) throws EngineException { if (!(place instanceof Place)) { warning("place isn't a Place"); return; } ruleManipulationBackend.setPlaceColor(id, nacId, (Place) place, color); }
@Override public PlaceAttribute getPlaceAttribute(int id, UUID nacId, INode place) throws EngineException { if (!(place instanceof Place)) { warning("node isn't a place"); return null; } return ruleManipulationBackend.getPlaceAttribute(id, nacId, (Place) place); }
@Override public void deleteArc(int id, UUID nacId, IArc arc) throws EngineException { if (!(arc instanceof IArc)) { warning("this isn't an arc"); return; } ruleManipulationBackend.deleteArc(id, nacId, arc); }
@Override public TransitionAttribute getTransitionAttribute(int id, UUID nacId, INode transition) throws EngineException { if (!(transition instanceof Transition)) { warning("node isn't a transition"); return null; } return ruleManipulationBackend.getTransitionAttribute(id, nacId, (Transition) transition); }
@Override public void setCapacity(@NotNull int id, @NotNull INode place, @NotNull int capacity) throws EngineException { if (!(place instanceof Place)) { warning("place isn't a Place"); return; } ruleManipulationBackend.setCapacity(id, (Place) place, capacity); }
@Override public void createTransition(int id, UUID nacId, Point2D coordinate) throws EngineException { ruleManipulationBackend.createTransition(id, nacId, coordinate); }
@Override public AbstractLayout<INode, IArc> getJungLayout(int ruleId, UUID nacId) throws EngineException { return ruleManipulationBackend.getJungLayout(ruleId, nacId); }
@Override public ArcAttribute getArcAttribute(int id, UUID nacId, IArc arc) throws EngineException { return ruleManipulationBackend.getArcAttribute(id, nacId, arc); }
@Override public void moveGraph(int id, Point2D relativePosition) throws EngineException { ruleManipulationBackend.moveGraph(id, relativePosition); }
@Override public void setWeight(int id, UUID nacId, IArc arc, int weight) throws EngineException { ruleManipulationBackend.setWeight(id, nacId, arc, weight); }
@Override public UUID createNac(int ruleId) throws EngineException { return ruleManipulationBackend.createNac(ruleId); }
@Override public double getNodeSize(int id) throws EngineException { return ruleManipulationBackend.getNodeSize(id); }
@Override public void setNodeSize(int id, double nodeSize) throws EngineException { ruleManipulationBackend.setNodeSize(id, nodeSize); }
@Override public void moveAllNodesTo(int id, float factor, Point point) throws EngineException { ruleManipulationBackend.moveAllNodesTo(id, factor, point); }
@Override public void moveGraphIntoVision(int id) throws EngineException { ruleManipulationBackend.moveGraphIntoVision(id); }
@Override public List<UUID> getNacIds(int ruleId) throws EngineException { return ruleManipulationBackend.getNacIds(ruleId); }
@Override public void deleteTransition(int id, UUID nacId, INode transition) throws EngineException { ruleManipulationBackend.deleteTransition(id, nacId, (Transition) transition); }
@Override public void deleteNac(int ruleId, UUID nacId) throws EngineException { ruleManipulationBackend.deleteNac(ruleId, nacId); }
@Override public void closeRule(int id) throws EngineException { ruleManipulationBackend.closeRule(id); }
public void registerRuleHandler(RuleHandler handler) throws Exception { if (this.handlers.containsKey(handler.getName())) throw new Exception("Trying to register specific rule handler twice!"); this.handlers.put(handler.getName(), handler); handler.register(this); }
@Override public void deletePlace(int id, UUID nacId, INode place) throws EngineException { ruleManipulationBackend.deletePlace(id, nacId, (Place) place); }