/** * Adds the MATSim Logo in the lower right corner of the chart. */ public void addMatsimLogo() { try { Image image = MatsimResource.getAsImage("matsim_logo_transparent_small.png"); Title subtitle = new ImageTitle(image, RectangleEdge.BOTTOM, HorizontalAlignment.RIGHT, VerticalAlignment.BOTTOM); this.chart.addSubtitle(subtitle); } catch ( Exception e ) { e.printStackTrace() ; // I just had a resource-not-found error inside the method; don't know what that means but does not feel like a reason // to not continue. kai, apr'30 } }
public final void testGetAsImage() { final Image logo = MatsimResource.getAsImage("matsim_logo_transparent.png"); // verify that the correct image was correctly loaded by testing its dimension assertEquals(256, logo.getWidth(null)); assertEquals(48, logo.getHeight(null)); }
playIcon = new ImageIcon(MatsimResource.getAsImage("otfvis/buttonPlay.png"), "Play"); pauseIcon = new ImageIcon(MatsimResource.getAsImage("otfvis/buttonPause.png"), "Pause"); button2.setToolTipText("restart the server/simulation"); String imgLocation2 = "otfvis/" + "buttonRestart" + ".png"; ImageIcon icon2 = new ImageIcon(MatsimResource.getAsImage(imgLocation2), "Restart"); button2.setIcon(icon2); add(button2); button1.setToolTipText("go several timesteps backwards"); String imgLocation1 = "otfvis/" + "buttonStepBB" + ".png"; ImageIcon icon1 = new ImageIcon(MatsimResource.getAsImage(imgLocation1), "<<"); button1.setIcon(icon1); add(button1); button.setToolTipText("go one timestep backwards"); String imgLocation = "otfvis/" + "buttonStepB" + ".png"; ImageIcon icon = new ImageIcon(MatsimResource.getAsImage(imgLocation), "<"); button.setIcon(icon); add(button); button2.setToolTipText("press to play simulation continuously"); String imgLocation2 = "otfvis/" + "buttonPlay" + ".png"; ImageIcon icon2 = new ImageIcon(MatsimResource.getAsImage(imgLocation2), "PLAY"); button2.setIcon(icon2); playPauseButton = button2; button1.setToolTipText("go one timestep forward"); String imgLocation1 = "otfvis/" + "buttonStepF" + ".png";