return box;
gridbag.setConstraints(box, c); panel.add(box); return panel;
    public java.awt.Component getGUI() {	JPanel box = PaletteHelper.createVerticalPanel("Filtering Demo");	box.setLayout(new java.awt.GridLayout(0, 1));	//  	JButton button = new JButton("Add and Edit Offset Line");	//  	button.addActionListener(new ActionListener() {	//  		public void actionPerformed(ActionEvent event) {	//  		    DrawingTool dt = getDrawingTool();	//  		    if (dt != null) {	//  			OMLine line = new OMLine(42f, -72f, -50, -70, 200, 200);	//  			line.setStroke(new java.awt.BasicStroke(5));	//  			line.setLinePaint(java.awt.Color.red);	//  			line.setFillPaint(java.awt.Color.green);	//  			line  = (OMLine) getDrawingTool().edit(line, layer);	//  			if (line != null) {	//  			    getList().add(line);	//  			} else {	//  			    Debug.error("DemoLayer: Drawing tool can't create OMLine");	//  			} 	//  		    } else {	//  			Debug.output("DemoLayer can't find a drawing tool");	//  		    }	//  		}	//  	    });	//  	box.add(button);	//  	button = new JButton("Add and Edit XY Line");	//  	button.addActionListener(new ActionListener() {	//  		public void actionPerformed(ActionEvent event) {	//  		    DrawingTool dt = getDrawingTool();	//  		    if (dt != null) {	//  			OMLine line = new OMLine(200, 200, 420, 520);	//  			line.setLinePaint(java.awt.Color.blue);	//  			line.setFillPaint(java.awt.Color.green);	//  			line  = (OMLine) getDrawingTool().edit(line, layer);	//  			if (line != null) {	//  			    getList().add(line);	//  			} else {	//  			    Debug.error("DemoLayer: Drawing tool can't create OMLine");	//  			} 	//  		    } else {	//  			Debug.output("DemoLayer can't find a drawing tool");	//  		    }	//  		}	//  	    });	//  	box.add(button);	//  	button = new JButton("Add and Edit LatLon Line, no GUI");	//  	button.addActionListener(new ActionListener() {	//  		public void actionPerformed(ActionEvent event) {	//  		    DrawingTool dt = getDrawingTool();	//  		    if (dt != null) {	//    			OMLine line = new OMLine(30f, -60f, 42f, -72f, 	//  						 OMGraphic.LINETYPE_GREATCIRCLE);	//  			line.setStroke(new java.awt.BasicStroke(5));	//  			line.setLinePaint(java.awt.Color.red);	//  			line.setFillPaint(java.awt.Color.green);	//  			line  = (OMLine) getDrawingTool().edit(line, layer, false);	//  			if (line != null) {	//  			    getList().add(line);	//  			} else {	//  			    Debug.error("DemoLayer: Drawing tool can't create OMLine");	//  			} 	//  		    } else {	//  			Debug.output("DemoLayer can't find a drawing tool");	//  		    }	//  		}	//  	    });	//  	box.add(button);	//  	button = new JButton("Create XY Line");	//  	button.addActionListener(new ActionListener() {	//  		public void actionPerformed(ActionEvent event) {	//  		    DrawingTool dt = getDrawingTool();	//  		    if (dt != null) {	//    			OMLine line  = (OMLine) getDrawingTool().create("com.bbn.openmap.omGraphics.OMLine", layer);	//  			if (line != null) {	//  			    getList().add(line);	//  			} else {	//  			    Debug.error("DemoLayer: Drawing tool can't create OMLine");	//  			} 	//  		    } else {	//  			Debug.output("DemoLayer can't find a drawing tool");	//  		    }	//  		}	//  	    });	//  	box.add(button);	//  	button = new JButton("Create Offset Line");	//  	button.addActionListener(new ActionListener() {	//  		public void actionPerformed(ActionEvent event) {	//  		    DrawingTool dt = getDrawingTool();	//  		    GraphicAttributes ga = new GraphicAttributes();	//  		    ga.setRenderType(OMGraphic.RENDERTYPE_OFFSET);	//  		    if (dt != null) {	//    			OMLine line  = (OMLine) getDrawingTool().create("com.bbn.openmap.omGraphics.OMLine", ga, layer);	//  			if (line != null) {	//  			    getList().add(line);	//  			} else {	//  			    Debug.error("DemoLayer: Drawing tool can't create OMLine");	//  			} 	//  		    } else {	//  			Debug.output("DemoLayer can't find a drawing tool");	//  		    }	//  		}	//  	    });	//  	box.add(button);	//  	button = new JButton("Create Lat/Lon Circle");	//  	button.addActionListener(new ActionListener() {	//  		public void actionPerformed(ActionEvent event) {	//  		    DrawingTool dt = getDrawingTool();	//  		    GraphicAttributes ga = new GraphicAttributes();	//  		    ga.setRenderType(OMGraphic.RENDERTYPE_LATLON);	//  		    if (dt != null) {	//    			OMCircle circle  = (OMCircle) getDrawingTool().create("com.bbn.openmap.omGraphics.OMCircle", ga, layer);	//  			if (circle != null) {	//  			    getList().add(circle);	//  			} else {	//  			    Debug.error("DemoLayer: Drawing tool can't create OMCircle");	//  			} 	//  		    } else {	//  			Debug.output("DemoLayer can't find a drawing tool");	//  		    }	//  		}	//  	    });	//  	box.add(button);	//  	button = new JButton("Create XY Circle");	//  	button.addActionListener(new ActionListener() {	//  		public void actionPerformed(ActionEvent event) {	//  		    DrawingTool dt = getDrawingTool();	//  		    GraphicAttributes ga = new GraphicAttributes();	//  		    ga.setRenderType(OMGraphic.RENDERTYPE_XY);	//  		    if (dt != null) {	//    			OMCircle circle  = (OMCircle) getDrawingTool().create("com.bbn.openmap.omGraphics.OMCircle", ga, layer);	//  			if (circle != null) {	//  			    getList().add(circle);	//  			} else {	//  			    Debug.error("DemoLayer: Drawing tool can't create OMCircle");	//  			} 	//  		    } else {	//  			Debug.output("DemoLayer can't find a drawing tool");	//  		    }	//  		}	//  	    });	//  	box.add(button);	//  	button = new JButton("Create Offset Circle");	//  	button.addActionListener(new ActionListener() {	//  		public void actionPerformed(ActionEvent event) {	//  		    DrawingTool dt = getDrawingTool();	//  		    GraphicAttributes ga = new GraphicAttributes();	//  		    ga.setRenderType(OMGraphic.RENDERTYPE_OFFSET);	//  		    ga.setFillPaint(Color.red);	//  		    if (dt != null) {	//    			OMCircle circle  = (OMCircle) getDrawingTool().create("com.bbn.openmap.omGraphics.OMCircle", ga, layer);	//  			if (circle != null) {	//  			    getList().add(circle);	//  			} else {	//  			    Debug.error("DemoLayer: Drawing tool can't create OMCircle");	//  			} 	//  		    } else {	//  			Debug.output("DemoLayer can't find a drawing tool");	//  		    }	//  		}	//  	    });	//  	box.add(button);	JButton button = new JButton("Create Containing Rectangle Filter");	button.addActionListener(new ActionListener() {		public void actionPerformed(ActionEvent event) {		    DrawingTool dt = getDrawingTool();		    if (dt != null) {			GraphicAttributes fga = getFilterGA();			fga.setFillPaint(new OMColor(0x0c0a0a0a));			OMRect rect =			    (OMRect) getDrawingTool().create(				"com.bbn.openmap.omGraphics.OMRect",				fga,				layer,				false);			if (rect != null) {			    rect.setAppObject(internalKey);			}			else {			    Debug.error(				"DemoLayer: Drawing tool can't create OMRect");			}		    }		    else {			Debug.output("DemoLayer can't find a drawing tool");		    }		}	    });	box.add(button);	button = new JButton("Create Containing Polygon Filter");	button.addActionListener(new ActionListener() {		public void actionPerformed(ActionEvent event) {		    DrawingTool dt = getDrawingTool();		    if (dt != null) {			GraphicAttributes fga = getFilterGA();			fga.setFillPaint(OMColor.clear);			EditableOMPoly eomp = new EditableOMPoly(fga);			eomp.setEnclosed(true);			eomp.setShowGUI(false);			dt.setBehaviorMask(OMDrawingTool.DEFAULT_BEHAVIOR_MASK);			OMPoly poly = (OMPoly) getDrawingTool().edit(eomp, layer);			if (poly != null) {			    poly.setIsPolygon(true);			    poly.setAppObject(internalKey);			}			else {			    Debug.error(				"DemoLayer: Drawing tool can't create OMPoly");			}		    }		    else {			Debug.output("DemoLayer can't find a drawing tool");		    }		}	    });	box.add(button);	button = new JButton("Create Excluding Rectangle Filter");	button.addActionListener(new ActionListener() {		public void actionPerformed(ActionEvent event) {		    DrawingTool dt = getDrawingTool();		    if (dt != null) {			GraphicAttributes fga = getFilterGA();			fga.setFillPaint(OMColor.clear);			OMRect rect =			    (OMRect) getDrawingTool().create(				"com.bbn.openmap.omGraphics.OMRect",				fga,				layer,				false);			if (rect != null) {			    rect.setAppObject(externalKey);			}			else {			    Debug.error(				"DemoLayer: Drawing tool can't create OMRect");			}		    }		    else {			Debug.output("DemoLayer can't find a drawing tool");		    }		}	    });	box.add(button);	button = new JButton("Reset filter");	button.addActionListener(new ActionListener() {		public void actionPerformed(ActionEvent event) {		    resetFiltering();		    repaint();		}	    });	box.add(button);	//  	button = new JButton("Create XY Rect");	//  	button.addActionListener(new ActionListener() {	//  		public void actionPerformed(ActionEvent event) {	//  		    DrawingTool dt = getDrawingTool();	//  		    GraphicAttributes ga = new GraphicAttributes();	//  		    ga.setRenderType(OMGraphic.RENDERTYPE_XY);	//  		    if (dt != null) {	//    			OMRect rect  = (OMRect) getDrawingTool().create("com.bbn.openmap.omGraphics.OMRect", ga, layer);	//  			if (rect != null) {	//  			    getList().add(rect);	//  			} else {	//  			    Debug.error("DemoLayer: Drawing tool can't create OMRect");	//  			} 	//  		    } else {	//  			Debug.output("DemoLayer can't find a drawing tool");	//  		    }	//  		}	//  	    });	//  	box.add(button);	//  	button = new JButton("Create Offset Rect");	//  	button.addActionListener(new ActionListener() {	//  		public void actionPerformed(ActionEvent event) {	//  		    DrawingTool dt = getDrawingTool();	//  		    GraphicAttributes ga = new GraphicAttributes();	//  		    ga.setRenderType(OMGraphic.RENDERTYPE_OFFSET);	//  		    ga.setFillPaint(Color.red);	//  		    if (dt != null) {	//    			OMRect rect  = (OMRect) getDrawingTool().create("com.bbn.openmap.omGraphics.OMRect", ga, layer);	//  			if (rect != null) {	//  			    getList().add(rect);	//  			} else {	//  			    Debug.error("DemoLayer: Drawing tool can't create OMRect");	//  			} 	//  		    } else {	//  			Debug.output("DemoLayer can't find a drawing tool");	//  		    }	//  		}	//  	    });	//  	box.add(button);	//  	button = new JButton("Create RangeRings");	//  	button.addActionListener(new ActionListener() {	//  		public void actionPerformed(ActionEvent event) {	//  		    DrawingTool dt = getDrawingTool();	//  		    GraphicAttributes ga = new GraphicAttributes();	//  		    ga.setLinePaint(Color.yellow);	//  		    if (dt != null) {	//    			OMRangeRings rr  = (OMRangeRings) getDrawingTool().create("com.bbn.openmap.omGraphics.OMRangeRings", ga, layer);	//  			if (rr != null) {	//  //   			    rr.setInterval(25, Length.MILE);	//  			} else {	//  			    Debug.error("DemoLayer: Drawing tool can't create OMRangeRings");	//  			} 	//  		    } else {	//  			Debug.output("DemoLayer can't find a drawing tool");	//  		    }	//  		}	//  	    });	//  	box.add(button);	//  	button = new JButton("Create XY Poly");	//  	button.addActionListener(new ActionListener() {	//  		public void actionPerformed(ActionEvent event) {	//  		    DrawingTool dt = getDrawingTool();	//  		    GraphicAttributes ga = new GraphicAttributes();	//  		    ga.setRenderType(OMGraphic.RENDERTYPE_XY);	//  		    ga.setLinePaint(Color.red);	//  		    ga.setFillPaint(Color.red);	//  		    if (dt != null) {	//    			OMPoly point  = (OMPoly) getDrawingTool().create("com.bbn.openmap.omGraphics.OMPoly", ga, layer);	//  			if (point != null) {	//  			} else {	//  			    Debug.error("DemoLayer: Drawing tool can't create OMPoly");	//  			} 	//  		    } else {	//  			Debug.output("DemoLayer can't find a drawing tool");	//  		    }	//  		}	//  	    });	//  	box.add(button);	//  	button = new JButton("Create LatLon Labeled Poly");	//  	button.addActionListener(new ActionListener() {	//  		public void actionPerformed(ActionEvent event) {	//  		    DrawingTool dt = getDrawingTool();	//  		    GraphicAttributes ga = new GraphicAttributes();	//  		    ga.setRenderType(OMGraphic.RENDERTYPE_LATLON);	//  		    ga.setLinePaint(Color.green);	//  		    ga.setFillPaint(Color.green);	//  		    if (dt != null) {	//    			LabeledOMPoly point  = (LabeledOMPoly) getDrawingTool().create("com.bbn.openmap.omGraphics.labeled.LabeledOMPoly", ga, layer);	//  			if (point != null) {	//  //  			    point.setOval(true);	//  //  			    point.setRadius(8);	//  			    point.setText("Active Testing");	//  			} else {	//  			    Debug.error("DemoLayer: Drawing tool can't create OMPoly");	//  			} 	//  		    } else {	//  			Debug.output("DemoLayer can't find a drawing tool");	//  		    }	//  		}	//  	    });	//  	box.add(button);	//  	button = new JButton("Create LatLon Offset Poly");	//  	button.addActionListener(new ActionListener() {	//  		public void actionPerformed(ActionEvent event) {	//  		    DrawingTool dt = getDrawingTool();	//  		    GraphicAttributes ga = new GraphicAttributes();	//  		    ga.setRenderType(OMGraphic.RENDERTYPE_OFFSET);	//  		    ga.setLinePaint(Color.green);	//  		    ga.setFillPaint(Color.green);	//  		    if (dt != null) {	//    			OMPoly point  = (OMPoly) getDrawingTool().create("com.bbn.openmap.omGraphics.OMPoly", ga, layer);	//  			if (point != null) {	//  //  			    rr.setInterval(25, Length.MILE);	//  			} else {	//  			    Debug.error("DemoLayer: Drawing tool can't create OMPoly");	//  			} 	//  		    } else {	//  			Debug.output("DemoLayer can't find a drawing tool");	//  		    }	//  		}	//  	    });	//  	box.add(button);	return box;    }