public void addArtifactListsToPlotter(PlotterInterface plotter) { if (alreadyAddedToPlotter) { throw new RuntimeException("Already added this ArtifactLists To Plotter: " + artifactLists); } if (artifactLists != null) { for (ArtifactList artifactList : artifactLists) { if (artifactList != null) { // YoGraphicCheckBoxMenuItem checkBox = new YoGraphicCheckBoxMenuItem(graphicsList.getLabel(), graphicsList.getYoGraphics()); // yoGraphicMenu.add(checkBox); // add graphics to simulation individually artifactList.addArtifactsToPlotter(plotter); } else System.out.println("ArtifactList is null!"); } } alreadyAddedToPlotter = true; }
public void addArtifactListsToPlotter(PlotterInterface plotter) { if (alreadyAddedToPlotter) { throw new RuntimeException("Already added this ArtifactLists To Plotter: " + artifactLists); } if (artifactLists != null) { for (ArtifactList artifactList : artifactLists) { if (artifactList != null) { // DynamicGraphicCheckBoxMenuItem checkBox = new DynamicGraphicCheckBoxMenuItem(graphicsList.getLabel(), graphicsList.getDynamicGraphicObjects()); // dynamicGraphicMenu.add(checkBox); // add graphics to simulation individually artifactList.addArtifactsToPlotter(plotter); } else System.out.println("ArtifactList is null!"); } } alreadyAddedToPlotter = true; }
private static void showPlotterAndSleep(ArtifactList artifacts) { Plotter plotter = new Plotter(); plotter.setViewRange(2.0); artifacts.setVisible(true); JFrame frame = new JFrame("PolygonWigglingTest"); Dimension preferredSize = new Dimension(600, 600); frame.setPreferredSize(preferredSize); frame.add(plotter.getJPanel(), BorderLayout.CENTER); frame.setSize(preferredSize); frame.setVisible(true); artifacts.addArtifactsToPlotter(plotter); ThreadTools.sleepForever(); }