1 26 27 package org.nightlabs.editor2d.render; 28 29 import java.awt.Graphics2D ; 30 import java.util.Iterator ; 31 32 import org.nightlabs.editor2d.DrawComponent; 33 import org.nightlabs.editor2d.DrawComponentContainer; 34 35 43 public class RendererImpl 44 implements Renderer 45 { 46 public RendererImpl() { 47 super(); 48 init(); 49 } 50 51 57 public void paint(DrawComponent dc, Graphics2D g2d) 58 { 59 if (dc instanceof DrawComponentContainer) { 60 DrawComponentContainer container = (DrawComponentContainer) dc; 61 if (container != null) { 62 for (Iterator it = container.getDrawComponents().iterator(); it.hasNext(); ) { 63 DrawComponent d = (DrawComponent) it.next(); 64 Renderer r = d.getRenderer(); 65 if (r != null) { 66 r.paint(dc, g2d); 67 } 68 } 69 } 70 } 71 } 72 73 80 protected void init() 81 { 82 }; 83 } 84 | Popular Tags |