public void paint(Graphics g) {
		//
		//System.out.println("here1:"+this.hashCode()+":"+this.dirtyFlag1);
		if (setup ){

			//	draw top bar
			g.drawImage(
					topBarDraw.getImage(this),
					topBarDraw.getLeft(),topBarDraw.getTop(), Color.black, null
			);
			
//			draw buttons
			g.drawImage(
					buttonsDraw.getImage(this),
					buttonsDraw.getLeft(),buttonsDraw.getTop(), Color.black, null
			);
			popupWindowDraw.setPopupDisplay(this);
			Image popupDisp = null;
			if (popupWindowDraw.isVisible()) {
				popupWindowDraw.setTop(buttonsDraw.getTop()+buttonsDraw.getHeight());
				popupWindowDraw.setHeight(timeLinesHeight);
				popupDisp=popupWindowDraw.getImage(this);
			}
			timeLinesHeight=0;
			for (int i=0;i<timeLineDisplays.size(); i++) {
				TimeLineDraw tld= (TimeLineDraw) timeLineDisplays.get(i);
				Image tlDisp=tld.getImage(this);
				if (popupDisp!=null && timeLinesHeight<popupWindowDraw.getHeight()) {
					tlDisp.getGraphics().drawImage(popupDisp, 0, 0, popupWindowDraw.getWidth(), tld.getHeight(), 0, timeLinesHeight, popupWindowDraw.getWidth(), timeLinesHeight+tld.getHeight(), Color.black, null);
				}
				// draw timeline.
				g.drawImage(
						tlDisp,
						tld.getLeft(), tld.getTop(), Color.black, null
				);
				timeLinesHeight+=tld.getHeight();
			}
			//	 draw bottom bar
			g.drawImage(
					inputBarDraw.getImage(this),
					inputBarDraw.getLeft(),inputBarDraw.getTop(), Color.black, null
			);
			
			debugWindow.paint(debugWindow.getGraphics());
			midiWin.paint(midiWin.getGraphics());
			checkAndDrawTooltip(g);
		}
	}