@Test public void throwsUnparsableExceptionForNonIntegerWeights() throws UnparsableException { Map<String, String> tokenWeights = new HashMap<>(); FunctionalResults<Double> result = new FunctionalResults<>(5.2, new HashSet<String>()); when(mockPetriNetController.parseFunctionalExpression(anyString())).thenReturn(result); exception.expect(UnparsableException.class); exception.expectMessage("Value is not an integer, please surround expression with floor or ceil"); tokenWeights.put(DEFAULT_TOKEN_ID, "5.2"); controller.setWeights(tokenWeights); }
public void setWeights(Map<String, String> newWeights) throws UnparsableException { throwExceptionIfWeightsNotValid(newWeights); List<UndoableEdit> edits = new LinkedList<>(); for (Map.Entry<String, String> entry : newWeights.entrySet()) { edits.add(updateWeightForArc(entry.getKey(), entry.getValue())); } registerUndoableEdit(new MultipleEdit(edits)); }
ArcController extends AbstractPetriNetComponentController<Arc<S, T>> { public void setWeights(Map<String, String> newWeights) throws UnparsableException { throwExceptionIfWeightsNotValid(newWeights); List<UndoableEdit> edits = new LinkedList<>(); for (Map.Entry<String, String> entry : newWeights.entrySet()) { edits.add(updateWeightForArc(entry.getKey(), entry.getValue())); } registerUndoableEdit(new MultipleEdit(edits)); } }
ArcController extends AbstractPetriNetComponentController<Arc<S, T>> { public void setWeights(Map<String, String> newWeights) throws UnparsableException { throwExceptionIfWeightsNotValid(newWeights); List<UndoableEdit> edits = new LinkedList<>(); for (Map.Entry<String, String> entry : newWeights.entrySet()) { edits.add(updateWeightForArc(entry.getKey(), entry.getValue())); } registerUndoableEdit(new MultipleEdit(edits)); } ArcController(Arc<S, T> arc, PetriNetController petriNetController, UndoableEditListener listener); }
ArcController extends AbstractPetriNetComponentController<Arc<S, T>> { public void setWeights(Map<String, String> newWeights) throws UnparsableException { throwExceptionIfWeightsNotValid(newWeights); List<UndoableEdit> edits = new LinkedList<>(); for (Map.Entry<String, String> entry : newWeights.entrySet()) { edits.add(updateWeightForArc(entry.getKey(), entry.getValue())); } registerUndoableEdit(new MultipleEdit(edits)); } ArcController(Arc<S, T> arc, PetriNetController petriNetController, UndoableEditListener listener); void setWeight(String token, String expr); void setWeights(Map<String, String> newWeights); String getWeightForToken(String token); Connectable getTarget(); void toggleArcPointType(ArcPoint arcPoint); void splitArcPoint(ArcPoint arcPoint); void addPoint(Point2D point); void deletePoint(ArcPoint point); }
ArcController extends AbstractPetriNetComponentController<Arc<S, T>> { public void setWeights(Map<String, String> newWeights) throws UnparsableException { throwExceptionIfWeightsNotValid(newWeights); List<UndoableEdit> edits = new LinkedList<>(); for (Map.Entry<String, String> entry : newWeights.entrySet()) { edits.add(updateWeightForArc(entry.getKey(), entry.getValue())); } registerUndoableEdit(new MultipleEdit(edits)); } ArcController(Arc<S, T> arc, PetriNetController petriNetController, UndoableEditListener listener); void setWeight(String token, String expr); void setWeights(Map<String, String> newWeights); String getWeightForToken(String token); Connectable getTarget(); void toggleArcPointType(ArcPoint arcPoint); void splitArcPoint(ArcPoint arcPoint); void addPoint(Point2D point); void deletePoint(ArcPoint point);  }