////////////////////////////////////////////////////////////////////////// // DCC++ CONTROLLER: Generic Windows // // Window - creates a window box of a specified size, color, and // initial position into which other components can be placed // such as buttons, message boxes, and text boxes // // DragBar - creates a drag bar on window to allow it to be dragged // across screen // // CloseButton - creates close button on window that closes window box // - windows are normally opened by other buttons or key commands // defined elsewhere // // ImageWindow - extends Window to create a window bx into which // a single cab image tied to a specified throttle will be displayed // // JPGWindow - extends Window to create a generic window box for diplaying a single jpg image // ////////////////////////////////////////////////////////////////////////// class Window extends DccComponent{ int xPos, yPos; int kWidth, kHeight; color backgroundColor; color outlineColor; ArrayList windowComponents = new ArrayList(); Window(int xPos, int yPos, int kWidth, int kHeight, color backgroundColor, color outlineColor){ this.xPos=xPos; this.yPos=yPos; this.kWidth=kWidth; this.kHeight=kHeight; this.backgroundColor=backgroundColor; this.outlineColor=outlineColor; } // Window ////////////////////////////////////////////////////////////////////////// void display(){ rectMode(CORNER); fill(backgroundColor); strokeWeight(3); stroke(outlineColor); rect(xPos,yPos,kWidth,kHeight); } // display ////////////////////////////////////////////////////////////////////////// void check(){ if(selectedComponent==null && (mouseX>xPos)&&(mouseXyPos)&&(mouseYxPos+window.xPos)&&(mouseXyPos+window.yPos)&&(mouseYxPos+window.xPos)&&(mouseXyPos+window.yPos)&&(mouseY