public void registerArtifactList(ArtifactList artifactList) { if (alreadyAddedToSimulationConstructionSet) throw new RuntimeException("Graphics have already been added to the SimulationConstructionSet. Cannot register more objects after this."); if (artifactLists.contains(artifactList)) { throw new RuntimeException("Already registered artifactList " + artifactList); } checkForRepeatNames(artifactList); for (ArtifactList list : artifactLists) { if (list.getLabel().equals(artifactList.getLabel())) { // Combine them: list.addAll(artifactList.getArtifacts()); return; } } artifactLists.add(artifactList); }
public void registerArtifactList(ArtifactList artifactList) { if (alreadyAddedToSimulationConstructionSet) throw new RuntimeException("Graphics have already been added to the SimulationConstructionSet. Cannot register more objects after this."); if (artifactLists.contains(artifactList)) { throw new RuntimeException("Already registered artifactList " + artifactList); } checkForRepeatNames(artifactList); for (ArtifactList list : artifactLists) { if (list.getLabel().equals(artifactList.getLabel())) { // Combine them: list.addAll(artifactList.getArtifacts()); return; } } artifactLists.add(artifactList); }
public void registerYoGraphicsList(YoGraphicsList yoGraphicsList) { if (alreadyAddedToSimulationConstructionSet) throw new RuntimeException("Graphics have already been added to the SimulationConstructionSet. Cannot register more objects after this."); if (yoGraphicsLists.contains(yoGraphicsList)) { throw new RuntimeException("Already registered YoGraphicsList " + yoGraphicsList); } checkForRepeatNames(yoGraphicsList); for (YoGraphicsList list : yoGraphicsLists) { if (list.getLabel().equals(yoGraphicsList.getLabel())) { // Combine them: ArrayList<YoGraphic> yoGraphics = yoGraphicsList.getYoGraphics(); list.addAll(yoGraphics); return; } } yoGraphicsLists.add(yoGraphicsList); }
public void registerYoGraphicsList(YoGraphicsList yoGraphicsList) { if (alreadyAddedToSimulationConstructionSet) throw new RuntimeException("Graphics have already been added to the SimulationConstructionSet. Cannot register more objects after this."); if (yoGraphicsLists.contains(yoGraphicsList)) { throw new RuntimeException("Already registered YoGraphicsList " + yoGraphicsList); } checkForRepeatNames(yoGraphicsList); for (YoGraphicsList list : yoGraphicsLists) { if (list.getLabel().equals(yoGraphicsList.getLabel())) { // Combine them: ArrayList<YoGraphic> yoGraphics = yoGraphicsList.getYoGraphics(); list.addAll(yoGraphics); return; } } yoGraphicsLists.add(yoGraphicsList); }