1 8 package com.nightlabs.editor2d.render; 9 10 import java.awt.Graphics2D ; 11 import java.util.Iterator ; 12 13 import com.nightlabs.editor2d.DrawComponent; 14 import com.nightlabs.editor2d.DrawComponentContainer; 15 16 17 public class RendererImpl 18 implements Renderer 19 { 20 public RendererImpl() { 21 super(); 22 init(); 23 } 24 25 public void paint(DrawComponent dc, Graphics2D g2d) 26 { 27 if (dc instanceof DrawComponentContainer) { 28 DrawComponentContainer container = (DrawComponentContainer) dc; 29 if (container != null) { 30 for (Iterator it = container.getDrawComponents().iterator(); it.hasNext(); ) { 31 DrawComponent d = (DrawComponent) it.next(); 32 Renderer r = d.getRenderer(); 33 if (r != null) { 34 r.paint(dc, g2d); 35 } 36 } 37 } 38 } 39 } 40 41 protected void init() 42 { 43 }; 44 } 45 | Popular Tags |