Changeset 9

Show
Ignore:
Timestamp:
03/08/07 19:53:51 (2 years ago)
Author:
tueda2
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • SIGBIO/edu/uiuc/acm/sigbio/visualizer/MapPanelVisualizer.java

    r8 r9  
    1515 
    1616import edu.uiuc.acm.sigbio.CellularAutomata.Coordinate; 
     17import edu.uiuc.acm.sigbio.CellularAutomata.Element; 
    1718 
    1819public class MapPanelVisualizer extends Panel { 
     
    2223        private static List<Shape> previousShapes;  //  @jve:decl-index=0: 
    2324        private Hashtable<Shape,Color> colorTable; 
    24         private static Color backColor; 
     25        private static Color backColor;  //  @jve:decl-index=0: 
     26         
     27        public final static int NOFILL = 0; 
     28        public final static int FILL = 1; 
     29        public final static int NOROUND = 0; 
     30        public final static int ROUND = 1; 
     31        private static List<Element> elementList;  //  @jve:decl-index=0: 
    2532         
    2633        /** 
     
    4249    public void paint(Graphics g){ 
    4350        Graphics2D g2 = (Graphics2D)g; 
    44  
     51        g2.setColor(backColor); 
     52        //flesh 
     53        g2.fill3DRect(0, 0, this.getWidth(), this.getHeight(), true); 
     54        /* 
     55        for (element : elements) { 
     56                element.paint(g2); 
     57        } 
    4558        if(previousShapes !=null){ 
    4659                g2.setColor(backColor); 
     
    5568                } 
    5669        } 
     70        */ 
     71        if(elementList!=null){ 
     72                for(Element e:elementList){ 
     73                        /* 
     74                        if(((int)e.getFillOption())==FILL){ 
     75                        g2.getColor(e.getFillColor()); 
     76                                g2.fill(e.getShape()); 
     77                        } 
     78                        if(((int)e.getRoundOption())==ROUND){ 
     79                        g2.getColor(e.getRoundColor()); 
     80                                g2.draw(e.getShape()); 
     81                        } 
     82                        */ 
     83                        e.paint(g2); 
     84                } 
     85        } 
    5786    } 
    5887         
     
    6291                shapeList = newShapes; 
    6392                colorTable = colors; 
     93        } 
     94         
     95        public void drawMap(List<Element> lst){ 
     96                elementList = lst; 
    6497        } 
    6598