List of usage examples for java.awt.event KeyEvent VK_TAB
int VK_TAB
To view the source code for java.awt.event KeyEvent VK_TAB.
Click Source Link
From source file:swift.selenium.WebHelper.java
@SuppressWarnings("incomplete-switch") public static String doAction(String imageType, String controlType, String controlId, String controlName, String ctrlValue, String logicalName, String action, WebElement webElement, Boolean Results, HSSFSheet strucSheet, HSSFSheet valSheet, int rowIndex, int rowcount, String rowNo, String colNo) throws Exception { List<WebElement> WebElementList = null; String currentValue = null;//from w w w. j av a 2 s .c o m //HSSFSheet uniqueNumberSheet =null; String uniqueNumber = ""; WebVerification.isFromVerification = false; //HashMap<String ,Object> uniqueValuesHashMap = null; //HSSFRow uniqueRow = null; ControlTypeEnum controlTypeEnum = ControlTypeEnum.valueOf(controlType); ControlTypeEnum actionName = ControlTypeEnum.valueOf(action.toString()); if (controlType.contains("Robot") && !isIntialized) { robot = new Robot(); isIntialized = true; } if (action.toString().equalsIgnoreCase("I") && !ctrlValue.equalsIgnoreCase("") || action.toString().equalsIgnoreCase("Read") || action.toString().equalsIgnoreCase("Write") || action.toString().equalsIgnoreCase("V") && !ctrlValue.equalsIgnoreCase("") || action.toString().equalsIgnoreCase("NC") || action.toString().equalsIgnoreCase("T") && !ctrlValue.equalsIgnoreCase("") || action.toString().equalsIgnoreCase("F") && !ctrlValue.equalsIgnoreCase("") || action.toString().equalsIgnoreCase("VA") && !ctrlValue.equalsIgnoreCase("") || action.toString().equalsIgnoreCase("O") || action.toString().equalsIgnoreCase("CP") || action.toString().equalsIgnoreCase("GV") || action.toString().equalsIgnoreCase("LV") || action.toString().equalsIgnoreCase("GB") || action.toString().equalsIgnoreCase("Get") || action.toString().equalsIgnoreCase("Post")) { try { switch (controlTypeEnum) { case WebEdit: switch (actionName) { case Read: uniqueNumber = ReadFromExcel(ctrlValue); webElement.clear(); webElement.sendKeys(uniqueNumber); break; case Write: writeToExcel(ctrlValue, webElement, controlId, controlType, controlName, rowNo, colNo); break; case I: if (!ctrlValue.equalsIgnoreCase("null")) { webElement.clear(); webElement.sendKeys(ctrlValue); } else { webElement.clear(); } break; case T: if (!ctrlValue.equalsIgnoreCase("null")) { webElement.clear(); webElement.sendKeys(ctrlValue); ((DeviceActionShortcuts) Automation.driver).hideKeyboard(); } else { webElement.clear(); } break; case V: currentValue = webElement.getText(); break; } break; case WebButton: switch (actionName) { case I: if (ctrlValue.equalsIgnoreCase("Y") || ctrlValue.equalsIgnoreCase("Yes")) { webElement.click(); } break; case NC: webElement.click(); break; case V: if (webElement.isDisplayed()) { if (webElement.isEnabled() == true) currentValue = "True"; else currentValue = "False"; } } break; case WebElement: switch (actionName) { case I: webElement = wait.until(ExpectedConditions.elementToBeClickable(webElement)); webElement.click(); break; case Read: uniqueNumber = ReadFromExcel(ctrlValue); webElement.clear(); webElement.sendKeys(uniqueNumber); break; case Write: writeToExcel(ctrlValue, webElement, controlId, controlType, controlName, rowNo, colNo); break; case V: if (WebVerification.isFromVerification == true) { currentValue = webElement.getText(); break; } boolean textPresent = false; String ObservedText = webElement.getText(); if (StringUtils.isBlank(ObservedText)) { ObservedText = webElement.getAttribute("value"); } textPresent = ObservedText.contains(ctrlValue); if (textPresent == false) currentValue = Boolean.toString(textPresent); else currentValue = ctrlValue; break; case T: Point p = ((Locatable) webElement).getCoordinates().onPage(); ((MobileDriver) Automation.driver).tap(1, p.getX(), p.getY(), 1); break; } break; case JSScript: ((JavascriptExecutor) Automation.driver).executeScript(controlName, ctrlValue); break; case Wait: Thread.sleep(Integer.parseInt(controlName) * 1000); break; case CheckBox: switch (actionName) { case I: if (ctrlValue.equalsIgnoreCase("Y") || ctrlValue.equalsIgnoreCase("Yes")) { webElement.click(); } break; case NC: webElement.click(); break; } break; case Radio: switch (actionName) { case I: if (ctrlValue.equalsIgnoreCase("Y") || ctrlValue.equalsIgnoreCase("Yes")) { if (!webElement.isSelected()) { webElement.click(); } } break; case NC: if (!webElement.isSelected()) { webElement.click(); } break; case V: if (webElement.isSelected()) { currentValue = webElement.getAttribute(controlName.toString()); } break; case F: if (webElement != null) { currentValue = "Y"; } break; } break; case WebLink: //case CloseWindow://added this Case to bypass page loading after clicking the event switch (actionName) { case Read: uniqueNumber = ReadFromExcel(ctrlValue); WebElementList = getElementsByType(controlId, controlName, controlType, imageType, uniqueNumber); webElement = GetControlByIndex("", WebElementList, controlId, controlName, controlType, uniqueNumber); webElement.click(); break; case Write: writeToExcel(ctrlValue, webElement, controlId, controlType, controlName, rowNo, colNo); break; case I: if (controlId.equalsIgnoreCase("LinkValue")) { webElement.click(); } else { if (ctrlValue.equalsIgnoreCase("Y") || ctrlValue.equalsIgnoreCase("Yes")) { webElement.click(); } } break; case NC: webElement.click(); break; } break; case CloseWindow: //TM-09/09/2015: This case is written to help in closing any specific windows switch (actionName) { case I: //This case helps in closing a specific window on the basis on the given title Set<String> handlers = null; handlers = Automation.driver.getWindowHandles(); for (String handler : handlers) { Automation.driver = Automation.driver.switchTo().window(handler); //TM-19/01/2015: Changed following comparison from equalsIgnoreCase to contains if (Automation.driver.getTitle().contains(ctrlValue)) { System.out.println("Closing required window :-" + Automation.driver.getTitle()); Automation.driver.close(); break; } } break; case NC://This case helps in closing the window with current focus Automation.driver.close(); break; } break; case WaitForJS: waitForCondition(); break; case ListBox: case WebList: switch (actionName) { case Read: uniqueNumber = ReadFromExcel(ctrlValue); new Select(webElement).selectByVisibleText(uniqueNumber); break; case Write: writeToExcel(ctrlValue, webElement, controlId, controlType, controlName, rowNo, colNo); break; case I: ExpectedCondition<Boolean> isTextPresent = CommonExpectedConditions .textToBePresentInElement(webElement, ctrlValue); if (isTextPresent != null) { if (webElement != null) { new Select(webElement).selectByVisibleText(ctrlValue); } } break; case V: if (!ctrlValue.contains(",")) { currentValue = new Select(webElement).getFirstSelectedOption().getText(); if (currentValue.isEmpty()) { currentValue = new Select(webElement).getFirstSelectedOption() .getAttribute("value"); } break; } else { currentValue = new String(); List<WebElement> currentValues = new ArrayList<WebElement>(); currentValues = new Select(webElement).getOptions(); for (int j = 0; j < currentValues.size(); j++) { if (j + 1 == currentValues.size()) currentValue = currentValue.concat(currentValues.get(j).getText()); else { currentValue = currentValue.concat(currentValues.get(j).getText() + ","); } } break; } } break; //New code for AJAX Dropdown with dojo case AjaxWebList: switch (actionName) { case I: webElement.click(); break; case VA: Thread.sleep(20000); currentValue = new String(); List<WebElement> currentValues = new ArrayList<WebElement>(); currentValues = Automation.driver.findElements(By.xpath(controlName)); for (int j = 0; j < currentValues.size(); j++) { if (j + 1 == currentValues.size()) currentValue = currentValue.concat(currentValues.get(j).getText()); else { currentValue = currentValue.concat(currentValues.get(j).getText() + ","); } } break; } break; case IFrame: Automation.driver = Automation.driver.switchTo().frame(controlName); break; case Browser: Set<String> handlers = null; handlers = Automation.driver.getWindowHandles(); for (String handler : handlers) { Automation.driver = Automation.driver.switchTo().window(handler); if (Automation.driver.getTitle().contains(controlName)) { System.out.println("Focus on window with title: " + Automation.driver.getTitle()); break; } } break; case BrowserControl: Set<String> winHandles = Automation.driver.getWindowHandles(); boolean controlfound = false; winHandles = Automation.driver.getWindowHandles(); for (String handler : winHandles) { Automation.driver = Automation.driver.switchTo().window(handler); try { Automation.driver.findElement(By.xpath(controlName)); System.out.println("Focus on window with Control: " + controlName); controlfound = true; break; } catch (Exception e) { // TODO: handle exception } } if (!controlfound) System.out.println("Unable to find control with : " + controlName); break; case BrowserType: switch (actionName) { case I: if (StringUtils.isNotBlank(ctrlValue)) { Automation.browser = Automation.configHashMap.get("BROWSERTYPE").toString(); if (StringUtils.equalsIgnoreCase("none", Automation.browser)) { Automation.browser = ctrlValue.toString(); Automation.browserType = Automation.browserTypeEnum.valueOf(Automation.browser); Automation.setUp(); wait = new WebDriverWait(Automation.driver, Integer.parseInt(Automation.configHashMap.get("TIMEOUT").toString())); //Thread.sleep(5000); } } break; case NC: if (StringUtils.isNotBlank(controlName)) { Automation.browser = Automation.configHashMap.get("BROWSERTYPE").toString(); if (StringUtils.equalsIgnoreCase("none", Automation.browser)) { Automation.browser = controlName.toString(); Automation.browserType = Automation.browserTypeEnum.valueOf(Automation.browser); Automation.setUp(); wait = new WebDriverWait(Automation.driver, Integer.parseInt(Automation.configHashMap.get("TIMEOUT").toString())); //Thread.sleep(5000); } } break; } break; case BrowserAuth: final String details[] = ctrlValue.split(","); Runnable thread2 = new Runnable() { public void run() { try { smartRobot = new SmartRobot(); Thread.sleep(5000); smartRobot.type(details[0].toString());// Enter username Thread.sleep(2000); smartRobot.pressTab();// Click Keyboard Tab smartRobot.type(details[1].toString());// Enter password Thread.sleep(2000); smartRobot.pressEnter();// Click Enter button Thread.sleep(5000); } catch (Exception e) { e.printStackTrace(); } } }; Thread thr2 = new Thread(thread2); thr2.start(); break; case URL: final String url = ctrlValue; if (!StringUtils.isBlank(ctrlValue)) { if (Automation.browser.equals("InternetExplorer")) { Automation.driver.navigate().to(url); Thread.sleep(5000); } else { Runnable thread1 = new Runnable() { public void run() { try { Automation.driver.navigate().to(url); Thread.sleep(5000); } catch (InterruptedException e) { e.printStackTrace(); } } }; Thread thr1 = new Thread(thread1); thr1.start(); } } break; case Menu: webElement.click(); break; case Alert: switch (actionName) { case V: Alert alert = wait.until(ExpectedConditions.alertIsPresent()); if (alert != null) { Automation.driver.switchTo().alert(); currentValue = alert.getText(); System.out.println(currentValue); alert.accept(); } break; } break; case WebImage: webElement.sendKeys(Keys.TAB); webElement.click(); Thread.sleep(5000); for (int Seconds = 0; Seconds <= Integer .parseInt(Automation.configHashMap.get("TIMEOUT").toString()); Seconds++) { if (!((Automation.driver.getWindowHandles().size()) > 1)) { webElement.click(); Thread.sleep(5000); } else { break; } } break; case ActionClick: Actions builderClick = new Actions(Automation.driver); Action clickAction = builderClick.moveToElement(webElement).clickAndHold().release().build(); clickAction.perform(); break; case ActionDoubleClick: Actions builderdoubleClick = new Actions(Automation.driver); builderdoubleClick.doubleClick(webElement).perform();//TM-27/01/2015 :- commented following code and used this code for simultaneous clicks //Action doubleClickAction = builderdoubleClick.moveToElement(webElement).click().build(); //doubleClickAction.perform(); //doubleClickAction.perform(); break; case ActionClickandEsc: Actions clickandEsc = new Actions(Automation.driver); Action clickEscAction = clickandEsc.moveToElement(webElement).click() .sendKeys(Keys.ENTER, Keys.ESCAPE).build(); clickEscAction.perform(); break; case ActionMouseOver: Actions builderMouserOver = new Actions(Automation.driver); Action mouseOverAction = builderMouserOver.moveToElement(webElement).build(); mouseOverAction.perform(); break; case Calendar: // Thread.sleep(5000); Boolean isCalendarDisplayed = Automation.driver.switchTo().activeElement().isDisplayed(); System.out.println(isCalendarDisplayed); if (isCalendarDisplayed == true) { String[] dtMthYr = ctrlValue.split("/"); WebElement Year = WaitTool.waitForElement(Automation.driver, By.name("year"), Integer.parseInt(Automation.configHashMap.get("TIMEOUT").toString()));//Automation.driver.findElement(By.name("year")); while (!Year.getAttribute("value").equalsIgnoreCase(dtMthYr[2])) { if (Integer.parseInt(Year.getAttribute("value")) > Integer.parseInt(dtMthYr[2])) { WebElement yearButton = WaitTool.waitForElement(Automation.driver, By.id("button1"), Integer.parseInt(Automation.configHashMap.get("TIMEOUT").toString()));//Automation.driver.findElement(By.id("button1")); yearButton.click(); } else if (Integer.parseInt(Year.getAttribute("value")) < Integer .parseInt(dtMthYr[2])) { WebElement yearButton = WaitTool.waitForElement(Automation.driver, By.id("Button5"), Integer.parseInt(Automation.configHashMap.get("TIMEOUT").toString()));//Automation.driver.findElement(By.id("Button5")); yearButton.click(); } } Select date = new Select(WaitTool.waitForElement(Automation.driver, By.name("month"), Integer.parseInt(Automation.configHashMap.get("TIMEOUT").toString()))); month = CalendarSnippet.getMonthForInt(Integer.parseInt(dtMthYr[1])); date.selectByVisibleText(month); WebElement Day = WaitTool.waitForElement(Automation.driver, By.id("Button6"), Integer.parseInt(Automation.configHashMap.get("TIMEOUT").toString()));//Automation.driver.findElement(By.id("Button6")); int day = 6; while (Day.getAttribute("value") != null) { Day = WaitTool.waitForElement(Automation.driver, By.id("Button" + day), Integer.parseInt(Automation.configHashMap.get("TIMEOUT").toString()));//Automation.driver.findElement(By.id("Button"+day)); if (Day.getAttribute("value").toString().equalsIgnoreCase(dtMthYr[0])) { Day.click(); break; } day++; } } else { System.out.println("Calendar not Diplayed"); } //Automation.selenium.click(controlName); break; case CalendarNew: isCalendarDisplayed = Automation.driver.switchTo().activeElement().isDisplayed(); System.out.println(isCalendarDisplayed); if (isCalendarDisplayed == true) { String[] dtMthYr = ctrlValue.split("/"); Thread.sleep(2000); //String[] CurrentDate = dtFormat.format(frmDate).split("/"); WebElement Monthyear = Automation.driver.findElement(By.xpath("//table/thead/tr/td[2]")); String Monthyear1 = Monthyear.getText(); String[] Monthyear2 = Monthyear1.split(","); Monthyear2[1] = Monthyear2[1].trim(); month = CalendarSnippet.getMonthForString(Monthyear2[0]); while (!Monthyear2[1].equalsIgnoreCase(dtMthYr[2])) { if (Integer.parseInt(Monthyear2[1]) > Integer.parseInt(dtMthYr[2])) { WebElement yearButton = Automation.driver .findElement(By.cssSelector("td:contains('')")); yearButton.click(); Monthyear2[1] = Integer.toString(Integer.parseInt(Monthyear2[1]) - 1); } else if (Integer.parseInt(Monthyear2[1]) < Integer.parseInt(dtMthYr[2])) { WebElement yearButton = Automation.driver .findElement(By.cssSelector("td:contains('')")); yearButton.click(); Monthyear2[1] = Integer.toString(Integer.parseInt(Monthyear2[1]) + 1); } } while (!month.equalsIgnoreCase(dtMthYr[1])) { if (Integer.parseInt(month) > Integer.parseInt(dtMthYr[1])) { WebElement monthButton = Automation.driver .findElement(By.cssSelector("td:contains('')")); monthButton.click(); if (Integer.parseInt(month) < 11) { month = "0" + Integer.toString(Integer.parseInt(month) - 1); } else { month = Integer.toString(Integer.parseInt(month) - 1); } } else if (Integer.parseInt(month) < Integer.parseInt(dtMthYr[1])) { WebElement monthButton = Automation.driver .findElement(By.cssSelector("td:contains('')")); monthButton.click(); if (Integer.parseInt(month) < 9) { month = "0" + Integer.toString(Integer.parseInt(month) + 1); } else { month = Integer.toString(Integer.parseInt(month) + 1); } } } WebElement dateButton = Automation.driver .findElement(By.cssSelector("td.day:contains('" + dtMthYr[0] + "')")); System.out.println(dateButton); dateButton.click(); } else { System.out.println("Calendar not Diplayed"); } break; case CalendarIPF: String[] dtMthYr = ctrlValue.split("/"); Thread.sleep(2000); String year = dtMthYr[2]; String monthNum = dtMthYr[1]; String day = dtMthYr[0]; //Xpath for Year, mMnth & Days String xpathYear = "//div[@class='datepicker datepicker-dropdown dropdown-menu datepicker-orient-left datepicker-orient-bottom']/div[@class='datepicker-years']"; String xpathMonth = "//div[@class='datepicker datepicker-dropdown dropdown-menu datepicker-orient-left datepicker-orient-bottom']/div[@class='datepicker-months']"; String xpathDay = "//div[@class='datepicker datepicker-dropdown dropdown-menu datepicker-orient-left datepicker-orient-bottom']/div[@class='datepicker-days']"; //Selecting year in 3 steps Automation.driver.findElement(By.xpath(xpathDay + "/table/thead/tr[1]/th[2]")).click(); Automation.driver.findElement(By.xpath(xpathMonth + "/table/thead/tr/th[2]")).click(); Automation.driver .findElement(By.xpath(xpathYear + "/table/tbody/tr/td/span[@class='year'][contains(text()," + year + ")]")) .click(); //Selecting month in 1 step Automation.driver .findElement(By.xpath(xpathMonth + "/table/tbody/tr/td/span[" + monthNum + "]")) .click(); //Selecting day in 1 step Automation.driver .findElement(By.xpath( xpathDay + "/table/tbody/tr/td[@class='day'][contains(text()," + day + ")]")) .click(); case CalendarEBP: String[] dtMthYrEBP = ctrlValue.split("/"); Thread.sleep(500); String yearEBP = dtMthYrEBP[2]; String monthNumEBP = CalendarSnippet.getMonthForInt(Integer.parseInt(dtMthYrEBP[1])) .substring(0, 3); String dayEBP = dtMthYrEBP[0]; //common path used for most of the elements String pathToVisibleCalendar = "//div[@class='ajax__calendar'][contains(@style, 'visibility: visible;')]/div"; //following is to click the title once to reach the year page wait.until(ExpectedConditions.elementToBeClickable( By.xpath(pathToVisibleCalendar + "/div[@class='ajax__calendar_header']/div[3]/div"))) .click(); //check if 'Dec' is visibly clickable after refreshing wait.until(ExpectedConditions.elementToBeClickable(By.xpath( pathToVisibleCalendar + "/div/div/table/tbody/tr/td/div[contains(text(), 'Dec')]"))); Thread.sleep(5000); //following is to click the title once again to reach the year page wait.until(ExpectedConditions.elementToBeClickable( (By.xpath(pathToVisibleCalendar + "/div[@class='ajax__calendar_header']/div[3]/div")))) .click(); //common path used for most of the elements while selection of year, month and date pathToVisibleCalendar = "//div[@class='ajax__calendar'][contains(@style, 'visibility: visible;')]/div/div/div/table/tbody/tr/td"; Thread.sleep(2000); //each of the following line selects the year, month and date wait.until(ExpectedConditions.elementToBeClickable( By.xpath(pathToVisibleCalendar + "/div[contains(text()," + yearEBP + ")]"))).click(); Thread.sleep(2000); wait.until(ExpectedConditions.elementToBeClickable(By.xpath(pathToVisibleCalendar + "/div[@class='ajax__calendar_month'][contains(text(),'" + monthNumEBP + "')]"))) .click(); Thread.sleep(2000); wait.until(ExpectedConditions.elementToBeClickable(By.xpath(pathToVisibleCalendar + "/div[@class='ajax__calendar_day'][contains(text()," + dayEBP + ")]"))).click(); break; /**Code for window popups**/ case Window: switch (actionName) { case O: String parentHandle = Automation.driver.getWindowHandle(); for (String winHandle : Automation.driver.getWindowHandles()) { Automation.driver.switchTo().window(winHandle); if (Automation.driver.getTitle().contains(controlName)) { ((JavascriptExecutor) Automation.driver) .executeScript("window.onbeforeunload = function(e){};");//By Tripti: 16/02/2015 Automation.driver.close(); } else { parentHandle = winHandle; } } Automation.driver.switchTo().window(parentHandle); break; } break; case WebTable: switch (actionName) { case Read: ReadFromExcel(ctrlValue); break; case Write: writeToExcel(ctrlValue, webElement, controlId, controlType, controlName, rowNo, colNo); break; case NC: WebElement table = webElement; List<WebElement> tableRows = table.findElements(By.tagName("tr")); int tableRowIndex = 0; //int tableColumnIndex = 0; boolean matchFound = false; for (WebElement tableRow : tableRows) { tableRowIndex += 1; List<WebElement> tableColumns = tableRow.findElements(By.tagName("td")); if (tableColumns.size() > 0) { for (WebElement tableColumn : tableColumns) if (tableColumn.getText().equals(ctrlValue)) { matchFound = true; System.out.println(tableRowIndex); List<Object> elementProperties = getPropertiesOfWebElement( tableColumns.get(Integer.parseInt(colNo)), imageType); controlName = elementProperties.get(0).toString(); if (controlName.equals("")) { controlName = elementProperties.get(1).toString(); } controlType = elementProperties.get(2).toString(); webElement = (WebElement) elementProperties.get(3); doAction(imageType, controlType, controlId, controlName, ctrlValue, logicalName, action, webElement, Results, strucSheet, valSheet, tableRowIndex, rowcount, rowNo, colNo); break; } if (matchFound) { break; } } } break; case V: WriteToDetailResults(ctrlValue, "", logicalName); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } break; case GB: WebVerification.GroupBy = ctrlValue; break; } break; case Robot: if (controlName.equalsIgnoreCase("SetFilePath")) { StringSelection stringSelection = new StringSelection(ctrlValue); Toolkit.getDefaultToolkit().getSystemClipboard().setContents(stringSelection, null); robot.delay(5000); robot.keyPress(KeyEvent.VK_CONTROL); robot.keyPress(KeyEvent.VK_V); robot.keyRelease(KeyEvent.VK_V); robot.keyRelease(KeyEvent.VK_CONTROL); } else if (controlName.equalsIgnoreCase("Type")) { robot.keyPress(KeyEvent.VK_M); robot.keyRelease(KeyEvent.VK_TAB); } else if (controlName.equalsIgnoreCase("TAB")) { robot.keyPress(KeyEvent.VK_TAB); robot.keyRelease(KeyEvent.VK_TAB); } else if (controlName.equalsIgnoreCase("SPACE")) { robot.keyPress(KeyEvent.VK_SPACE); robot.keyRelease(KeyEvent.VK_SPACE); } else if (controlName.equalsIgnoreCase("ENTER")) { robot.keyPress(KeyEvent.VK_ENTER); robot.keyRelease(KeyEvent.VK_ENTER); } break; case DB: switch (actionName) { case Write: ResultSet rs = JDBCConnection.establishDBConn("", ctrlValue); rs.next(); ctrlValue = String.valueOf(rs.getLong("COL_1")); rs.close(); writeToExcel(ctrlValue, webElement, controlId, controlType, controlName, rowNo, colNo); break; } break; //Kinjal 9/6/2015 Added for DB Approach case DBV: switch (actionName) { case CP: currentValue = webElement.getText(); if (StringUtils.isBlank(currentValue)) { currentValue = webElement.getAttribute("value"); } ctrlValue = JDBCConnection.getFirstColumnName(ctrlValue); System.out.println("Database value fetched from DB is " + ctrlValue); break; case V: List<WebElement> rowElements = WebHelper.getElementsByType(controlId, controlName, "", "", ""); if (rowElements != null) { currentValue = Integer.toString(rowElements.size()); } else { currentValue = "0"; } ctrlValue = JDBCConnection.getFirstColumnName(ctrlValue); break; } break; case WaitForEC: wait.until(CommonExpectedConditions.elementToBeClickable(webElement)); break; case SikuliType: sikuliScreen.type(controlName, ctrlValue); break; case SikuliButton: sikuliScreen.click(controlName); System.out.println("Done"); break; case Date: Calendar cal = new GregorianCalendar(); int i = cal.get(Calendar.DAY_OF_MONTH); if (i >= 31) { i = i - 10; } break; case FileUpload: webElement.sendKeys(ctrlValue); break; case ScrollTo: //Locatable element = (Locatable) webElement; //TM:04/03/2015-commented as incorrect //Point p= element.getCoordinates().onScreen();//TM:04/03/2015-commented as incorrect Point p = webElement.getLocation();//TM:04/03/2015-New correct code System.out.println("X,Y co-ordinates of textbox is:- " + p);//TM:04/03/2015-New correct code JavascriptExecutor js = (JavascriptExecutor) Automation.driver; //TM:04/03/2015-New correct code js.executeScript("window.scrollTo(" + p.getX() + "," + (p.getY() + 150) + ");"); break; case SwitchContext: Thread.sleep(3000); Set<String> contexts = ((AppiumDriver) Automation.driver).getContextHandles(); for (String s : contexts) { System.out.println("Count of contexts : " + contexts.size()); System.out.println("Context Name : " + s); if (s.contains(ctrlValue)) { System.out.println("Mobile Web View found"); ((AppiumDriver) Automation.driver).context(s); break; } } Thread.sleep(2000); break; case SwipeDown: //((AppiumDriver)(Automation.driver)).swipe(0, 0, 0, 1500, 2000); ((AppiumDriver) (Automation.driver)).scrollTo(ctrlValue); break; case CaptureScreen: Date toDate = new Date(); TransactionMapping.report.setFromDate(Automation.dtFormat.format(frmDate)); TransactionMapping.report .setStrIteration(Automation.configHashMap.get("CYCLENUMBER").toString()); TransactionMapping.report.setStrTestcaseId(MainController.controllerTestCaseID.toString()); TransactionMapping.report.setStrGroupName(MainController.controllerGroupName.toString()); TransactionMapping.report .setStrTrasactionType(MainController.controllerTransactionType.toString()); TransactionMapping.report.setStrTestDescription(MainController.testDesciption); TransactionMapping.report.setStrMessage( "Screenshot of Test Case Id:" + MainController.controllerTestCaseID.toString() + " & Transaction Type:" + MainController.controllerTransactionType.toString()); TransactionMapping.report.setToDate(Automation.dtFormat.format(toDate)); saveScreenShot(TransactionMapping.report, logicalName); break; case WebService: switch (actionName) { case I: if (logicalName.equalsIgnoreCase("WSDL_URL")) wsdl_url = ctrlValue; else if (logicalName.equalsIgnoreCase("REQUEST_URL")) request_url = ctrlValue; else if (logicalName.equalsIgnoreCase("REQUEST_XML")) request_xml = ctrlValue; break; case T: WebService.callWebService(); break; case V: currentValue = WebService.getXMLTagValue(controlName); break; } break; case WebService_REST: switch (actionName) { case I: if (logicalName.equalsIgnoreCase("REQUEST_URL")) request_url = ctrlValue; else if (logicalName.equalsIgnoreCase("REQUEST_XML")) { request_xml = ctrlValue; } break; case Get: WebService.callRESTWebService("Get", controlId); break; case Post: WebService.callRESTWebService("Post", controlId); break; case V: if (controlId.equalsIgnoreCase("JSON")) { currentValue = WebService.getJSONTagValue(controlName); } else { currentValue = WebService.getXMLTagValue(controlName); } break; } break; case JSONResp: switch (actionName) { case I: if (logicalName.equalsIgnoreCase("JSON_URL")) { response_url = controlName; response_fileName = ctrlValue; WebService.downloadAndStoreJson(response_url, response_fileName); } break; } break; case DonutChart: switch (actionName) { case GV: DonutChart donut = new DonutChart(Automation.driver, webElement); WebVerification.verifyTabularData(testcaseID.toString(), MainController.controllerTransactionType.toString(), donut.getDonutColumnNames(), donut.getDonutChartData()); break; case LV: DonutChart donutLegend = new DonutChart(Automation.driver, webElement); WebVerification.verifyTabularData(testcaseID.toString(), MainController.controllerTransactionType.toString(), donutLegend.getDonutLegendColumnNames(), donutLegend.getDonutLegendData()); break; } break; case BarChart: switch (actionName) { case GV: String[] series = ctrlValue.split("!"); List<String> seriesList = Arrays.asList(series); BarChart barChart = new BarChart(Automation.driver, webElement); WebVerification.verifyTabularData(testcaseID.toString(), MainController.controllerTransactionType.toString(), barChart.getColumnNames(), barChart.getChartData(seriesList)); break; case LV: BarChart barchartLegend = new BarChart(Automation.driver, webElement); WebVerification.verifyTabularData(testcaseID.toString(), MainController.controllerTransactionType.toString(), barchartLegend.getLegendColumnNames(), barchartLegend.getLegendData()); break; } break; case BasicLineChart: switch (actionName) { case GV: BasicLineChart lineChart = new BasicLineChart(Automation.driver, webElement); WebVerification.verifyTabularData(testcaseID.toString(), MainController.controllerTransactionType.toString(), lineChart.getColumnNames(), lineChart.getChartData()); break; case LV: BasicLineChart linechartLegend = new BasicLineChart(Automation.driver, webElement); WebVerification.verifyTabularData(testcaseID.toString(), MainController.controllerTransactionType.toString(), linechartLegend.getLegendColumnNames(), linechartLegend.getLegendData()); break; } break; default: System.out.println("U r in Default"); break; } } catch (WebDriverException we) { throw new Exception("Error Occurred from Do Action " + controlName + we.getMessage()); } catch (Exception e) { throw new Exception(e.getMessage()); } } //TM-02/02/2015: Radio button found ("F") & AJAX control ("VA") if ((action.toString().equalsIgnoreCase("V") || action.toString().equalsIgnoreCase("CP") || action.toString().equalsIgnoreCase("F") || action.toString().equalsIgnoreCase("VA")) && !ctrlValue.equalsIgnoreCase("")) { if (Results == true) { TransactionMapping.report = WriteToDetailResults(ctrlValue, currentValue, logicalName); } } return currentValue; }
From source file:br.com.atmatech.sac.view.ViewAtendimento.java
private void jTsolicitacaoKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTsolicitacaoKeyPressed // TODO add your handling code here: if (evt.getKeyCode() == KeyEvent.VK_TAB) { jTsolicitacao.transferFocus();// www . j a v a 2 s. c o m } }
From source file:br.com.atmatech.sac.view.ViewAtendimento.java
private void jTrealizadoKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTrealizadoKeyPressed // TODO add your handling code here: if (evt.getKeyCode() == KeyEvent.VK_TAB) { jTrealizado.transferFocus();/*w w w .jav a 2s . c o m*/ } }
From source file:br.com.atmatech.sac.view.ViewAtendimento.java
private void jTpendenteKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTpendenteKeyPressed // TODO add your handling code here: if (evt.getKeyCode() == KeyEvent.VK_TAB) { jTsolicitacao.transferFocus();//from w w w . j a va2 s . c o m } }
From source file:org.nuclos.client.ui.collect.SubForm.java
/** * create an Tablecelleditor for the given component * @param clctcomp// w w w. j a va 2 s . co m * @return the newly created table cell editor */ private CollectableComponentTableCellEditor createTableCellEditor(final CollectableComponent clctcomp) { if (getColumn(clctcomp.getFieldName()) != null) { final Map<String, Object> properties = getColumn(clctcomp.getFieldName()).getProperties(); for (String property : properties.keySet()) { clctcomp.setProperty(property, properties.get(property)); } } final CollectableComponentTableCellEditor result = new CollectableComponentTableCellEditor(clctcomp, clctcomp.isSearchComponent()); result.addCollectableComponentModelListener(getCollectableTableCellEditorChangeListener()); // @see NUCLOS-603. checkboxes and options should setvalue directly. if (clctcomp instanceof CollectableCheckBox) { ((CollectableCheckBox) clctcomp).getJCheckBox().addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { SwingUtilities.invokeLater(new Runnable() { //@see NUCLOSINT-1635 public void run() { try { if (getSubformTable().getModel() instanceof SubFormTableModel) { int row = getSubformTable().getSelectedRow(); int column = ((SubFormTableModel) getSubformTable().getModel()) .findColumnByFieldName(clctcomp.getFieldName()); if (row != -1 && column != -1) { if (getSubformTable().getModel() instanceof SearchConditionTableModel) getSubformTable().setValueAt(clctcomp.getSearchCondition(), row, column); else getSubformTable().setValueAt(clctcomp.getField(), row, column); } } } catch (CollectableFieldFormatException e1) { LOG.warn("could not set value for " + clctcomp.getFieldName(), e1); } } }); } }); } if (clctcomp instanceof CollectableOptionGroup) { ((CollectableOptionGroup) clctcomp).getOptionGroup().addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { try { if (getSubformTable().getModel() instanceof SubFormTableModel) { int row = getSubformTable().getSelectedRow(); int column = ((SubFormTableModel) getSubformTable().getModel()) .findColumnByFieldName(clctcomp.getFieldName()); if (row != -1 && column != -1) getSubformTable().setValueAt(clctcomp.getField(), row, column); } } catch (CollectableFieldFormatException e1) { LOG.warn("could not set value for " + clctcomp.getFieldName(), e1); } } }); } // textarea have to handle Tab in an subform differently. if (clctcomp instanceof NuclosCollectableTextArea) { ((NuclosCollectableTextArea) clctcomp).overrideActionMap(new AbstractAction() { @Override public void actionPerformed(ActionEvent evt) { Component c = (Component) ((NuclosCollectableTextArea) clctcomp).getJTextArea().getParent(); c.dispatchEvent( new KeyEvent(c, KeyEvent.KEY_PRESSED, System.currentTimeMillis(), 0, KeyEvent.VK_TAB)); } }, new AbstractAction() { @Override public void actionPerformed(ActionEvent evt) { Component c = (Component) ((NuclosCollectableTextArea) clctcomp).getJTextArea().getParent(); c.dispatchEvent(new KeyEvent(c, KeyEvent.KEY_PRESSED, System.currentTimeMillis(), KeyEvent.SHIFT_MASK, KeyEvent.VK_TAB)); } }); } if (clctcomp instanceof DynamicRowHeightChangeProvider) { ((DynamicRowHeightChangeProvider) clctcomp).addDynamicRowHeightChangeListener(this); } return result; }
From source file:org.martin.ftp.gui.GUIClient.java
private void txtMyHostKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtMyHostKeyReleased String text = txtMyHost.getText(); if (evt.getKeyCode() == KeyEvent.VK_ENTER || evt.getKeyCode() == KeyEvent.VK_TAB) { if (!text.isEmpty()) { txtMyHost.setText(text.trim()); }/*from www . j av a 2s .c om*/ if (!txtMyUser.getText().trim().isEmpty()) txtMyUser.selectAll(); txtMyUser.requestFocus(); } }
From source file:org.sikuli.ide.SikuliIDE.java
private void initShortcutKeys() { final int scMask = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(); Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() { private boolean isKeyNextTab(java.awt.event.KeyEvent ke) { if (ke.getKeyCode() == java.awt.event.KeyEvent.VK_TAB && ke.getModifiers() == InputEvent.CTRL_MASK) { return true; }// w ww . ja va2 s .c o m if (ke.getKeyCode() == java.awt.event.KeyEvent.VK_CLOSE_BRACKET && ke.getModifiers() == (InputEvent.META_MASK | InputEvent.SHIFT_MASK)) { return true; } return false; } private boolean isKeyPrevTab(java.awt.event.KeyEvent ke) { if (ke.getKeyCode() == java.awt.event.KeyEvent.VK_TAB && ke.getModifiers() == (InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK)) { return true; } if (ke.getKeyCode() == java.awt.event.KeyEvent.VK_OPEN_BRACKET && ke.getModifiers() == (InputEvent.META_MASK | InputEvent.SHIFT_MASK)) { return true; } return false; } public void eventDispatched(AWTEvent e) { java.awt.event.KeyEvent ke = (java.awt.event.KeyEvent) e; //Debug.log(ke.toString()); if (ke.getID() == java.awt.event.KeyEvent.KEY_PRESSED) { if (isKeyNextTab(ke)) { nextTab(); } else if (isKeyPrevTab(ke)) { prevTab(); } } } }, AWTEvent.KEY_EVENT_MASK); }
From source file:org.martin.ftp.gui.GUIClient.java
private void txtMyUserKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtMyUserKeyReleased String text = txtMyUser.getText(); if (evt.getKeyCode() == KeyEvent.VK_ENTER || evt.getKeyCode() == KeyEvent.VK_TAB) { if (!text.isEmpty()) { txtMyUser.setText(text.trim()); }//from w w w . j a v a2s .c o m if (!txtMyPass.getText().trim().isEmpty()) txtMyPass.selectAll(); txtMyPass.requestFocus(); } }
From source file:uk.ac.kcl.texthunter.core.AnnotationEditor.java
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor./*from w ww.j ava2s . co m*/ */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { modeChangeButtonGroup = new javax.swing.ButtonGroup(); contextChangeButtonGroup = new javax.swing.ButtonGroup(); xmlOutPutButtonGroup = new javax.swing.ButtonGroup(); fullDocsOrContextOnlyButtonGroup = new javax.swing.ButtonGroup(); xValTypeButtonGroup = new javax.swing.ButtonGroup(); getAnnotationsButtonGroup = new javax.swing.ButtonGroup(); xmlOrTableButtonGroup = new javax.swing.ButtonGroup(); GATEorKnowtatorbuttonGroup = new javax.swing.ButtonGroup(); DBConnectjDialog = new javax.swing.JDialog(); jPanel1 = new javax.swing.JPanel(); jdbcConnectionTextField = new javax.swing.JTextField(); testDBConnectionButton = new javax.swing.JButton(); databasePasswordField = new javax.swing.JPasswordField(); databaseUserNameTextField = new javax.swing.JTextField(); integratedSecurityCheckBox = new javax.swing.JCheckBox(); longRunningProcessDialog = new javax.swing.JDialog(); jPanel3 = new javax.swing.JPanel(); longRunningProcessProgressBar = new javax.swing.JProgressBar(); cancelButton = new javax.swing.JButton(); jScrollPane5 = new javax.swing.JScrollPane(); longRunningProcessInfoTextPane = new javax.swing.JTextPane(); iAAbuttonGroup = new javax.swing.ButtonGroup(); textHunterJTabbedPane = new javax.swing.JTabbedPane(); createNewProjectJPanel = new javax.swing.JPanel(); createNewProjectButton = new javax.swing.JButton(); newProjectJTextField = new javax.swing.JTextField(); connectToExternalDatabaseCheckBox = new javax.swing.JCheckBox(); loadExistingProjectJPanel = new javax.swing.JPanel(); loadProjectJFileChooser = new javax.swing.JFileChooser(); loadProjectButton = new javax.swing.JButton(); connectToDBJPanel = new javax.swing.JPanel(); jScrollPane6 = new javax.swing.JScrollPane(); projectSummaryTextPane = new javax.swing.JTextPane(); specifyKeywordsJPanel = new javax.swing.JPanel(); jScrollPane10 = new javax.swing.JScrollPane(); japeKeyPhraseTextArea = new javax.swing.JTextArea(); jScrollPane11 = new javax.swing.JScrollPane(); japeOtherPhraseTextArea = new javax.swing.JTextArea(); HunterJPanel = new javax.swing.JPanel(); HunterDirJFileChooser = new javax.swing.JFileChooser(); launchHunterTableButton = new javax.swing.JButton(); setUpDataForAnnotationJPanel = new javax.swing.JPanel(); jScrollPane3 = new javax.swing.JScrollPane(); tab1SQLEditorPane = new javax.swing.JEditorPane(); getAnnotationsButton = new javax.swing.JButton(); modelSeedRadioButton = new javax.swing.JRadioButton(); goldStandardRadioButton = new javax.swing.JRadioButton(); activeLearningRadioButton = new javax.swing.JRadioButton(); reviewTrainingRadioButton = new javax.swing.JRadioButton(); getAnnotationsForIAA = new javax.swing.JRadioButton(); annotateJPanel = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); annotationPane = new javax.swing.JEditorPane(); brcIDField = new javax.swing.JTextField(); cnDocIDField = new javax.swing.JTextField(); srcTableField = new javax.swing.JTextField(); probEditorPane = new javax.swing.JEditorPane(); keyObsEditorPane = new javax.swing.JEditorPane(); numpad1Action = new Numpad1Action("positive", new Integer(KeyEvent.VK_NUMPAD1)); numpad0Action = new Numpad0Action("negative", new Integer(KeyEvent.VK_NUMPAD0)); numpad2Action = new Numpad2Action("unknown", new Integer(KeyEvent.VK_NUMPAD2)); numpad3Action = new Numpad3Action("form", new Integer(KeyEvent.VK_NUMPAD3)); numpadPlusAction = new NumpadPlusAction("contextChange", new Integer(KeyEvent.VK_ADD)); keyAltToPrevRecordAction = new KeyAltToPrevRecordAction("alt", new Integer(KeyEvent.VK_ALT)); keyTabToCommentsAction = new KeyTabToCommentsAction("tab", new Integer(KeyEvent.VK_TAB)); keyObsEditorPane.getActionMap().put("numpadPlus", numpadPlusAction); keyObsEditorPane.getActionMap().put("numpad1", numpad1Action); keyObsEditorPane.getActionMap().put("numpad0", numpad0Action); keyObsEditorPane.getActionMap().put("numpad2", numpad2Action); keyObsEditorPane.getActionMap().put("numpad3", numpad3Action); keyObsEditorPane.getActionMap().put("tab", keyTabToCommentsAction); keyObsEditorPane.getActionMap().put("alt", keyAltToPrevRecordAction); keyObsEditorPane.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ADD, 0), "numpadPlus"); keyObsEditorPane.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD1, 0), "numpad1"); keyObsEditorPane.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD0, 0), "numpad0"); keyObsEditorPane.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD2, 0), "numpad2"); keyObsEditorPane.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD3, 0), "numpad3"); keyObsEditorPane.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "tab"); keyObsEditorPane.getInputMap() .put(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, java.awt.event.InputEvent.SHIFT_DOWN_MASK), "alt"); MLObsEditorPane = new javax.swing.JEditorPane(); useNumericKeysCheckBox = new javax.swing.JCheckBox(); keyObsContextCat = new javax.swing.JTextField(); commentsEditorPane = new javax.swing.JEditorPane(); commentsAltToKeyAction = new CommentsAltToKeyAction("comments to key", new Integer(KeyEvent.VK_ALT)); commentsTabToNextRecordAction = new CommentsTabToNextRecordAction("comments to next record", new Integer(KeyEvent.VK_TAB)); commentsEditorPane.getActionMap().put("tab", commentsTabToNextRecordAction); commentsEditorPane.getActionMap().put("alt", commentsAltToKeyAction); commentsEditorPane.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "tab"); commentsEditorPane.getInputMap() .put(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, java.awt.event.InputEvent.SHIFT_DOWN_MASK), "alt"); nextRecordButton = new javax.swing.JButton(); prevRecordButton = new javax.swing.JButton(); jumpToRecordButton = new javax.swing.JButton(); firstRecordButton = new javax.swing.JButton(); currentRecordNumberTextField = new javax.swing.JTextField(); totalRecordsInResultSetTextField = new javax.swing.JTextField(); jLabel2 = new javax.swing.JLabel(); hextextNextContext = new javax.swing.JButton(); annotator1RadioButton = new javax.swing.JRadioButton(); annotator2RadioButton = new javax.swing.JRadioButton(); viewFullDocJPanel = new javax.swing.JPanel(); jScrollPane7 = new javax.swing.JScrollPane(); fullTextPane = new javax.swing.JEditorPane(); svmConsoleJPanel = new javax.swing.JPanel(); jScrollPane8 = new javax.swing.JScrollPane(); tab2SQLEditorPane = new javax.swing.JEditorPane(); crossValidateButton = new javax.swing.JButton(); resultsDirTextField = new javax.swing.JTextField(); foldNoTextField = new javax.swing.JTextField(); trainAllButton = new javax.swing.JButton(); applyAllButton = new javax.swing.JButton(); xValQADRadioButton = new javax.swing.JRadioButton(); xValSACRadioButton = new javax.swing.JRadioButton(); resumePreviousCheckBox = new javax.swing.JCheckBox(); removePrevCheckBox = new javax.swing.JCheckBox(); tableToWorkOnjTextField = new javax.swing.JTextField(); jLabel3 = new javax.swing.JLabel(); outputConsoleJPanel = new javax.swing.JPanel(); exportResultsButton = new javax.swing.JButton(); withKeyAnnotationsRadioButton = new javax.swing.JRadioButton(); noKeyAnnotationsRadioButton = new javax.swing.JRadioButton(); outputContextOnlyRadioButton = new javax.swing.JRadioButton(); outputFullDocumentsRadioButton = new javax.swing.JRadioButton(); outputFileChooser = new javax.swing.JFileChooser(); XMLradioButton = new javax.swing.JRadioButton(); tableRadioButton = new javax.swing.JRadioButton(); gateXMLjRadioButton = new javax.swing.JRadioButton(); knowtatorXMLjRadioButton = new javax.swing.JRadioButton(); licenceJPanel = new javax.swing.JPanel(); jPanel2 = new javax.swing.JPanel(); jScrollPane12 = new javax.swing.JScrollPane(); jTextPane1 = new javax.swing.JTextPane(); quitButton = new javax.swing.JButton(); expressModeRadioButton = new javax.swing.JRadioButton(); advancedModeRadioButton = new javax.swing.JRadioButton(); svmProgressBar = new javax.swing.JProgressBar(); threadCountTextField = new javax.swing.JTextField(); saveProjectJButton = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); targetTableTextField = new javax.swing.JTextField(); jScrollPane2 = new javax.swing.JScrollPane(); infoTextPane = new javax.swing.JTextPane(); DBConnectjDialog.setMinimumSize(new java.awt.Dimension(605, 257)); DBConnectjDialog.setModal(true); DBConnectjDialog.setName("DB connection"); // NOI18N DBConnectjDialog.setResizable(false); DBConnectjDialog.setType(java.awt.Window.Type.POPUP); jdbcConnectionTextField.setText("jdbc:jtds:sqlserver://<ipaddress>:<port>"); jdbcConnectionTextField.setBorder(javax.swing.BorderFactory .createTitledBorder(javax.swing.BorderFactory.createTitledBorder(""), "JDBC Connection String")); testDBConnectionButton.setText("Test database connection"); testDBConnectionButton.setActionCommand("connectToDatabase"); testDBConnectionButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { testDBConnectionButtonActionPerformed(evt); } }); databasePasswordField.setBorder(javax.swing.BorderFactory.createTitledBorder("Password")); databasePasswordField.setEnabled(false); databaseUserNameTextField.setBorder(javax.swing.BorderFactory .createTitledBorder(javax.swing.BorderFactory.createTitledBorder(""), "User Name")); databaseUserNameTextField.setEnabled(false); integratedSecurityCheckBox.setSelected(true); integratedSecurityCheckBox.setText("Use Integrated Security?"); integratedSecurityCheckBox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { integratedSecurityCheckBoxActionPerformed(evt); } }); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(integratedSecurityCheckBox) .addComponent(databaseUserNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 181, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(databasePasswordField, javax.swing.GroupLayout.PREFERRED_SIZE, 186, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jdbcConnectionTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 373, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) .addGroup(jPanel1Layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(testDBConnectionButton) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jdbcConnectionTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(testDBConnectionButton) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(jPanel1Layout.createSequentialGroup().addComponent(integratedSecurityCheckBox) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(databaseUserNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(databasePasswordField, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE))))); javax.swing.GroupLayout DBConnectjDialogLayout = new javax.swing.GroupLayout( DBConnectjDialog.getContentPane()); DBConnectjDialog.getContentPane().setLayout(DBConnectjDialogLayout); DBConnectjDialogLayout.setHorizontalGroup(DBConnectjDialogLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 605, Short.MAX_VALUE) .addGroup(DBConnectjDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, DBConnectjDialogLayout.createSequentialGroup().addContainerGap() .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()))); DBConnectjDialogLayout.setVerticalGroup( DBConnectjDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 210, Short.MAX_VALUE) .addGroup(DBConnectjDialogLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(DBConnectjDialogLayout.createSequentialGroup().addContainerGap() .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()))); longRunningProcessDialog.setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); longRunningProcessDialog.setMinimumSize(new java.awt.Dimension(605, 257)); longRunningProcessDialog.setModal(true); longRunningProcessDialog.setName("DB connection"); // NOI18N longRunningProcessDialog.setResizable(false); longRunningProcessDialog.setType(java.awt.Window.Type.POPUP); cancelButton.setText("Cancel"); cancelButton.setEnabled(false); cancelButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cancelButtonActionPerformed(evt); } }); jScrollPane5.setViewportView(longRunningProcessInfoTextPane); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup(jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jScrollPane5) .addComponent(longRunningProcessProgressBar, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 565, Short.MAX_VALUE) .addComponent(cancelButton, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap())); jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 94, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(longRunningProcessProgressBar, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18).addComponent(cancelButton, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap())); javax.swing.GroupLayout longRunningProcessDialogLayout = new javax.swing.GroupLayout( longRunningProcessDialog.getContentPane()); longRunningProcessDialog.getContentPane().setLayout(longRunningProcessDialogLayout); longRunningProcessDialogLayout .setHorizontalGroup( longRunningProcessDialogLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(longRunningProcessDialogLayout.createSequentialGroup().addContainerGap() .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap())); longRunningProcessDialogLayout.setVerticalGroup( longRunningProcessDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, longRunningProcessDialogLayout.createSequentialGroup().addContainerGap() .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("v1.0.0"); getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); textHunterJTabbedPane.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { textHunterJTabbedPaneStateChanged(evt); } }); createNewProjectButton.setText("Create new project!"); createNewProjectButton.setActionCommand("createNewProject"); createNewProjectButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { createNewProjectButtonActionPerformed(evt); } }); newProjectJTextField.setToolTipText(""); newProjectJTextField.setBorder(javax.swing.BorderFactory.createTitledBorder("New Project name")); connectToExternalDatabaseCheckBox.setText("Project uses external database?"); connectToExternalDatabaseCheckBox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { connectToExternalDatabaseCheckBoxActionPerformed(evt); } }); javax.swing.GroupLayout createNewProjectJPanelLayout = new javax.swing.GroupLayout(createNewProjectJPanel); createNewProjectJPanel.setLayout(createNewProjectJPanelLayout); createNewProjectJPanelLayout.setHorizontalGroup(createNewProjectJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(createNewProjectJPanelLayout.createSequentialGroup().addContainerGap() .addGroup(createNewProjectJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(newProjectJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 418, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(connectToExternalDatabaseCheckBox) .addComponent(createNewProjectButton)) .addContainerGap(707, Short.MAX_VALUE))); createNewProjectJPanelLayout.setVerticalGroup(createNewProjectJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(createNewProjectJPanelLayout.createSequentialGroup().addContainerGap() .addComponent(newProjectJTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 118, Short.MAX_VALUE) .addGap(83, 83, 83).addComponent(connectToExternalDatabaseCheckBox).addGap(97, 97, 97) .addComponent(createNewProjectButton).addGap(370, 370, 370))); textHunterJTabbedPane.addTab("Create new project", createNewProjectJPanel); loadProjectJFileChooser.setControlButtonsAreShown(false); loadProjectJFileChooser.setCurrentDirectory(new File(relFilePath + File.separator + "projects")); loadProjectJFileChooser.setDialogTitle(""); loadProjectJFileChooser.setFileSelectionMode(javax.swing.JFileChooser.DIRECTORIES_ONLY); loadProjectJFileChooser.setRequestFocusEnabled(false); loadProjectJFileChooser.setFileFilter(new DirectoryFilter()); loadProjectButton.setText("Load Project"); loadProjectButton.setActionCommand("loadProject"); loadProjectButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { loadProjectButtonActionPerformed(evt); } }); javax.swing.GroupLayout loadExistingProjectJPanelLayout = new javax.swing.GroupLayout( loadExistingProjectJPanel); loadExistingProjectJPanel.setLayout(loadExistingProjectJPanelLayout); loadExistingProjectJPanelLayout.setHorizontalGroup( loadExistingProjectJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(loadExistingProjectJPanelLayout.createSequentialGroup().addContainerGap() .addGroup(loadExistingProjectJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(loadProjectButton).addComponent(loadProjectJFileChooser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(566, Short.MAX_VALUE))); loadExistingProjectJPanelLayout.setVerticalGroup(loadExistingProjectJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(loadExistingProjectJPanelLayout.createSequentialGroup().addContainerGap() .addComponent(loadProjectJFileChooser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(loadProjectButton).addContainerGap(308, Short.MAX_VALUE))); textHunterJTabbedPane.addTab("Load existing project", loadExistingProjectJPanel); jScrollPane6.setViewportView(projectSummaryTextPane); javax.swing.GroupLayout connectToDBJPanelLayout = new javax.swing.GroupLayout(connectToDBJPanel); connectToDBJPanel.setLayout(connectToDBJPanelLayout); connectToDBJPanelLayout.setHorizontalGroup(connectToDBJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(connectToDBJPanelLayout.createSequentialGroup().addContainerGap() .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 1115, Short.MAX_VALUE) .addContainerGap())); connectToDBJPanelLayout.setVerticalGroup(connectToDBJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(connectToDBJPanelLayout.createSequentialGroup().addContainerGap() .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 703, Short.MAX_VALUE) .addContainerGap())); textHunterJTabbedPane.addTab("Project Overview", connectToDBJPanel); specifyKeywordsJPanel.setEnabled(false); specifyKeywordsJPanel.setFocusable(false); japeKeyPhraseTextArea.setColumns(20); japeKeyPhraseTextArea.setRows(5); japeKeyPhraseTextArea.setBorder(javax.swing.BorderFactory.createTitledBorder("Key Phrases/Words")); jScrollPane10.setViewportView(japeKeyPhraseTextArea); japeOtherPhraseTextArea.setColumns(20); japeOtherPhraseTextArea.setRows(5); japeOtherPhraseTextArea.setBorder(javax.swing.BorderFactory.createTitledBorder("Other Phrases/Words")); jScrollPane11.setViewportView(japeOtherPhraseTextArea); javax.swing.GroupLayout specifyKeywordsJPanelLayout = new javax.swing.GroupLayout(specifyKeywordsJPanel); specifyKeywordsJPanel.setLayout(specifyKeywordsJPanelLayout); specifyKeywordsJPanelLayout.setHorizontalGroup( specifyKeywordsJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(specifyKeywordsJPanelLayout.createSequentialGroup().addContainerGap() .addGroup(specifyKeywordsJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jScrollPane10, javax.swing.GroupLayout.DEFAULT_SIZE, 788, Short.MAX_VALUE) .addComponent(jScrollPane11)) .addContainerGap(337, Short.MAX_VALUE))); specifyKeywordsJPanelLayout.setVerticalGroup( specifyKeywordsJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(specifyKeywordsJPanelLayout.createSequentialGroup().addContainerGap() .addComponent(jScrollPane10, javax.swing.GroupLayout.PREFERRED_SIZE, 264, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane11, javax.swing.GroupLayout.PREFERRED_SIZE, 226, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(218, Short.MAX_VALUE))); textHunterJTabbedPane.addTab("Specify Keywords", specifyKeywordsJPanel); HunterDirJFileChooser.setControlButtonsAreShown(false); HunterDirJFileChooser.setCurrentDirectory(new File(relFilePath + File.separator + "projects")); HunterDirJFileChooser.setFileSelectionMode(javax.swing.JFileChooser.DIRECTORIES_ONLY); launchHunterTableButton.setText("Launch Context Hunter"); launchHunterTableButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { launchHunterTableButtonActionPerformed(evt); } }); javax.swing.GroupLayout HunterJPanelLayout = new javax.swing.GroupLayout(HunterJPanel); HunterJPanel.setLayout(HunterJPanelLayout); HunterJPanelLayout.setHorizontalGroup(HunterJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(HunterJPanelLayout.createSequentialGroup().addContainerGap() .addGroup(HunterJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(launchHunterTableButton).addComponent(HunterDirJFileChooser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(566, Short.MAX_VALUE))); HunterJPanelLayout.setVerticalGroup(HunterJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(HunterJPanelLayout.createSequentialGroup() .addComponent(HunterDirJFileChooser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(launchHunterTableButton).addGap(0, 319, Short.MAX_VALUE))); textHunterJTabbedPane.addTab("Hunter Launcher", HunterJPanel); tab1SQLEditorPane.setBorder(javax.swing.BorderFactory.createTitledBorder("SQL")); tab1SQLEditorPane.setText("SELECT t1.* \n" + ",t2.TextContent \n" + "FROM " + targetTableName + " t1\n" + "join GateDB_Cris.dbo.gate t2 on t1.cn_doc_id = t2.CN_Doc_ID and t1.src_table = t2.src_table and t1.src_col = t2.src_col\n" + "order by t1.[id]"); tab1SQLEditorPane.setEnabled(false); tab1SQLEditorPane.setMinimumSize(new java.awt.Dimension(5, 5)); tab1SQLEditorPane.setPreferredSize(new java.awt.Dimension(5, 5)); tab1SQLEditorPane.addFocusListener(new java.awt.event.FocusAdapter() { public void focusLost(java.awt.event.FocusEvent evt) { tab1SQLEditorPaneFocusLost(evt); } }); tab1SQLEditorPane.addKeyListener(new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { tab1SQLEditorPaneKeyTyped(evt); } }); jScrollPane3.setViewportView(tab1SQLEditorPane); getAnnotationsButton.setText("Get Annotations"); getAnnotationsButton.setActionCommand("getAnnotations"); getAnnotationsButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { getAnnotationsButtonActionPerformed(evt); } }); getAnnotationsButtonGroup.add(modelSeedRadioButton); modelSeedRadioButton.setText("Create model seed data"); modelSeedRadioButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { modelSeedRadioButtonActionPerformed(evt); } }); getAnnotationsButtonGroup.add(goldStandardRadioButton); goldStandardRadioButton.setSelected(true); goldStandardRadioButton.setText("Create gold standard"); goldStandardRadioButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { goldStandardRadioButtonActionPerformed(evt); } }); getAnnotationsButtonGroup.add(activeLearningRadioButton); activeLearningRadioButton.setText("Create active learning data"); activeLearningRadioButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { activeLearningRadioButtonActionPerformed(evt); } }); getAnnotationsButtonGroup.add(reviewTrainingRadioButton); reviewTrainingRadioButton.setText("Review all training data"); reviewTrainingRadioButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { reviewTrainingRadioButtonActionPerformed(evt); } }); getAnnotationsButtonGroup.add(getAnnotationsForIAA); getAnnotationsForIAA.setText("Get Annotations for IAA"); javax.swing.GroupLayout setUpDataForAnnotationJPanelLayout = new javax.swing.GroupLayout( setUpDataForAnnotationJPanel); setUpDataForAnnotationJPanel.setLayout(setUpDataForAnnotationJPanelLayout); setUpDataForAnnotationJPanelLayout.setHorizontalGroup(setUpDataForAnnotationJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, setUpDataForAnnotationJPanelLayout .createSequentialGroup() .addGroup(setUpDataForAnnotationJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(setUpDataForAnnotationJPanelLayout.createSequentialGroup() .addContainerGap().addComponent(getAnnotationsButton)) .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 597, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 30, Short.MAX_VALUE) .addGroup(setUpDataForAnnotationJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(activeLearningRadioButton).addComponent(goldStandardRadioButton) .addComponent(modelSeedRadioButton).addComponent(reviewTrainingRadioButton) .addComponent(getAnnotationsForIAA)) .addGap(351, 351, 351))); setUpDataForAnnotationJPanelLayout.setVerticalGroup(setUpDataForAnnotationJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(setUpDataForAnnotationJPanelLayout.createSequentialGroup().addContainerGap() .addGroup(setUpDataForAnnotationJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(getAnnotationsButton) .addComponent(goldStandardRadioButton, javax.swing.GroupLayout.Alignment.TRAILING)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(modelSeedRadioButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(activeLearningRadioButton) .addGroup(setUpDataForAnnotationJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(setUpDataForAnnotationJPanelLayout.createSequentialGroup().addGap(6, 6, 6) .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 231, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(setUpDataForAnnotationJPanelLayout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(reviewTrainingRadioButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(getAnnotationsForIAA))) .addContainerGap(406, Short.MAX_VALUE))); textHunterJTabbedPane.addTab("Set Up Data For Annotation", setUpDataForAnnotationJPanel); jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPane1.setPreferredSize(new java.awt.Dimension(0, 0)); annotationPane.setEditable(false); annotationPane.setBorder(javax.swing.BorderFactory.createTitledBorder("Annotation")); annotationPane.setContentType("text/html"); // NOI18N annotationPane.setFocusable(false); annotationPane.setMinimumSize(new java.awt.Dimension(90, 40)); annotationPane.setPreferredSize(new java.awt.Dimension(90, 40)); jScrollPane1.setViewportView(annotationPane); brcIDField.setEditable(false); brcIDField.setBorder(javax.swing.BorderFactory.createTitledBorder("BrcId")); brcIDField.setFocusable(false); cnDocIDField.setEditable(false); cnDocIDField.setBorder(javax.swing.BorderFactory.createTitledBorder("CN_Doc_ID")); cnDocIDField.setFocusable(false); cnDocIDField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cnDocIDFieldActionPerformed(evt); } }); srcTableField.setEditable(false); srcTableField.setBorder(javax.swing.BorderFactory.createTitledBorder("src_table")); srcTableField.setFocusable(false); probEditorPane.setEditable(false); probEditorPane.setBorder(javax.swing.BorderFactory.createTitledBorder("Probability")); probEditorPane.setFocusable(false); keyObsEditorPane.setBorder(javax.swing.BorderFactory.createTitledBorder("Key Observation")); keyObsEditorPane.addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { keyObsEditorPaneFocusGained(evt); } }); keyObsEditorPane.addKeyListener(new java.awt.event.KeyAdapter() { public void keyReleased(java.awt.event.KeyEvent evt) { keyObsEditorPaneKeyReleased(evt); } public void keyTyped(java.awt.event.KeyEvent evt) { keyObsEditorPaneKeyTyped(evt); } }); MLObsEditorPane.setEditable(false); MLObsEditorPane.setBorder(javax.swing.BorderFactory.createTitledBorder("ML Observation")); MLObsEditorPane.setFocusable(false); useNumericKeysCheckBox.setSelected(true); useNumericKeysCheckBox.setText("Use numeric\n keys for\n classes"); keyObsContextCat.setEditable(false); keyObsContextCat.setBorder(javax.swing.BorderFactory.createTitledBorder("Context")); commentsEditorPane.setBorder(javax.swing.BorderFactory.createTitledBorder("Comments")); nextRecordButton.setText("Next Record (tab)"); nextRecordButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { nextRecordButtonActionPerformed(evt); } }); prevRecordButton.setText("Previous Record\n(shift + tab)"); prevRecordButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { prevRecordButtonActionPerformed(evt); } }); jumpToRecordButton.setText("Jump to Record"); jumpToRecordButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jumpToRecordButtonActionPerformed(evt); } }); firstRecordButton.setText("First Record"); firstRecordButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { firstRecordButtonActionPerformed(evt); } }); totalRecordsInResultSetTextField.setEditable(false); totalRecordsInResultSetTextField.setText("0"); jLabel2.setText("of"); hextextNextContext.setText("nextContext"); hextextNextContext.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { hextextNextContextActionPerformed(evt); } }); iAAbuttonGroup.add(annotator1RadioButton); annotator1RadioButton.setSelected(true); annotator1RadioButton.setText("Annotator 1"); annotator1RadioButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { annotator1RadioButtonActionPerformed(evt); } }); iAAbuttonGroup.add(annotator2RadioButton); annotator2RadioButton.setText("Annotator 2"); annotator2RadioButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { annotator2RadioButtonActionPerformed(evt); } }); javax.swing.GroupLayout annotateJPanelLayout = new javax.swing.GroupLayout(annotateJPanel); annotateJPanel.setLayout(annotateJPanelLayout); annotateJPanelLayout.setHorizontalGroup(annotateJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(annotateJPanelLayout.createSequentialGroup().addContainerGap() .addGroup(annotateJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(annotateJPanelLayout.createSequentialGroup() .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) .addGroup(annotateJPanelLayout.createSequentialGroup() .addGroup(annotateJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(brcIDField, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(cnDocIDField, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(srcTableField, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(annotateJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(MLObsEditorPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(probEditorPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(annotateJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(keyObsContextCat, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(keyObsEditorPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(commentsEditorPane, javax.swing.GroupLayout.PREFERRED_SIZE, 230, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(annotateJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(annotateJPanelLayout.createSequentialGroup() .addGroup(annotateJPanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent(useNumericKeysCheckBox) .addComponent(prevRecordButton)) .addContainerGap(277, Short.MAX_VALUE)) .addGroup(annotateJPanelLayout.createSequentialGroup() .addGroup(annotateJPanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addGroup( annotateJPanelLayout.createSequentialGroup() .addComponent(nextRecordButton) .addGap(95, 95, 95) .addComponent(hextextNextContext)) .addGroup(annotateJPanelLayout .createSequentialGroup() .addComponent(firstRecordButton) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jumpToRecordButton) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(currentRecordNumberTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent( totalRecordsInResultSetTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(annotateJPanelLayout .createSequentialGroup() .addComponent(annotator1RadioButton) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(annotator2RadioButton))) .addGap(0, 53, Short.MAX_VALUE))))))); annotateJPanelLayout.setVerticalGroup(annotateJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(annotateJPanelLayout.createSequentialGroup().addContainerGap() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 447, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(annotateJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(annotateJPanelLayout.createSequentialGroup().addGroup(annotateJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(keyObsEditorPane, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(MLObsEditorPane, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(brcIDField, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(annotateJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(annotateJPanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(keyObsContextCat, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(probEditorPane, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(annotateJPanelLayout.createSequentialGroup() .addGap(6, 6, 6).addComponent(cnDocIDField, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(srcTableField, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(annotateJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, annotateJPanelLayout .createSequentialGroup().addComponent(useNumericKeysCheckBox) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(annotateJPanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(nextRecordButton) .addComponent(hextextNextContext)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(prevRecordButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(annotateJPanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent(firstRecordButton) .addGroup(annotateJPanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(currentRecordNumberTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(totalRecordsInResultSetTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2)) .addComponent(jumpToRecordButton)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(annotateJPanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(annotator1RadioButton) .addComponent(annotator2RadioButton))) .addComponent(commentsEditorPane, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(45, Short.MAX_VALUE))); textHunterJTabbedPane.addTab("Annotate", annotateJPanel); jScrollPane7.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPane7.setPreferredSize(new java.awt.Dimension(0, 0)); fullTextPane.setEditable(false); fullTextPane.setBorder(javax.swing.BorderFactory.createTitledBorder("Full Text")); fullTextPane.setContentType("text/html"); // NOI18N fullTextPane.setToolTipText(""); fullTextPane.setFocusable(false); fullTextPane.setMinimumSize(new java.awt.Dimension(90, 40)); jScrollPane7.setViewportView(fullTextPane); javax.swing.GroupLayout viewFullDocJPanelLayout = new javax.swing.GroupLayout(viewFullDocJPanel); viewFullDocJPanel.setLayout(viewFullDocJPanelLayout); viewFullDocJPanelLayout.setHorizontalGroup(viewFullDocJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(viewFullDocJPanelLayout.createSequentialGroup().addContainerGap() .addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 1115, Short.MAX_VALUE) .addContainerGap())); viewFullDocJPanelLayout.setVerticalGroup(viewFullDocJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(viewFullDocJPanelLayout.createSequentialGroup() .addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 714, Short.MAX_VALUE) .addContainerGap())); textHunterJTabbedPane.addTab("View Full Doc", viewFullDocJPanel); tab2SQLEditorPane.setBorder(javax.swing.BorderFactory.createTitledBorder("SQL")); tab2SQLEditorPane .setText("SELECT *\n" + "FROM " + targetTableName + "\n" + "where keyObservation1 is not null"); tab2SQLEditorPane.setEnabled(false); tab2SQLEditorPane.addFocusListener(new java.awt.event.FocusAdapter() { public void focusLost(java.awt.event.FocusEvent evt) { tab2SQLEditorPaneFocusLost(evt); } }); jScrollPane8.setViewportView(tab2SQLEditorPane); crossValidateButton.setText("Build Models"); crossValidateButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { crossValidateButtonActionPerformed(evt); } }); resultsDirTextField.setText( relFilePath + File.separator + targetTableName + File.separator + "results" + File.separator); resultsDirTextField.setBorder(javax.swing.BorderFactory.createTitledBorder("Results Directory Location")); foldNoTextField.setText("10"); foldNoTextField.setBorder(javax.swing.BorderFactory.createTitledBorder("Fold Number")); trainAllButton.setText("Train With All Data"); trainAllButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { trainAllButtonActionPerformed(evt); } }); applyAllButton.setText("Apply Best Model to All Instances"); applyAllButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { applyAllButtonActionPerformed(evt); } }); xValTypeButtonGroup.add(xValQADRadioButton); xValQADRadioButton.setSelected(true); xValQADRadioButton.setText("Quick and Dirty"); xValTypeButtonGroup.add(xValSACRadioButton); xValSACRadioButton.setText("Slow and Clean"); resumePreviousCheckBox.setText("Resume previous X validation?"); resumePreviousCheckBox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { resumePreviousCheckBoxActionPerformed(evt); } }); removePrevCheckBox.setText("Remove prev?"); jLabel3.setText("Table to work on"); javax.swing.GroupLayout svmConsoleJPanelLayout = new javax.swing.GroupLayout(svmConsoleJPanel); svmConsoleJPanel.setLayout(svmConsoleJPanelLayout); svmConsoleJPanelLayout.setHorizontalGroup(svmConsoleJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(svmConsoleJPanelLayout.createSequentialGroup().addContainerGap() .addGroup(svmConsoleJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(resultsDirTextField).addComponent(jScrollPane8) .addComponent(foldNoTextField, javax.swing.GroupLayout.Alignment.TRAILING)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 380, Short.MAX_VALUE) .addComponent(crossValidateButton).addGap(18, 18, 18) .addGroup(svmConsoleJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(resumePreviousCheckBox) .addGroup(svmConsoleJPanelLayout.createSequentialGroup() .addComponent(xValQADRadioButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(xValSACRadioButton))) .addGap(320, 320, 320)) .addGroup(svmConsoleJPanelLayout.createSequentialGroup().addGroup(svmConsoleJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(svmConsoleJPanelLayout.createSequentialGroup().addGap(127, 127, 127) .addComponent(trainAllButton)) .addGroup(svmConsoleJPanelLayout.createSequentialGroup().addGap(99, 99, 99) .addGroup(svmConsoleJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(svmConsoleJPanelLayout.createSequentialGroup() .addComponent(applyAllButton).addGap(11, 11, 11) .addComponent(removePrevCheckBox)) .addGroup(svmConsoleJPanelLayout.createSequentialGroup() .addGap(239, 239, 239) .addComponent(tableToWorkOnjTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 311, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel3))))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); svmConsoleJPanelLayout.setVerticalGroup(svmConsoleJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(svmConsoleJPanelLayout.createSequentialGroup().addGap(6, 6, 6) .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 152, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(76, 76, 76) .addGroup(svmConsoleJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(svmConsoleJPanelLayout.createSequentialGroup() .addComponent(resultsDirTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(foldNoTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(36, 36, 36) .addGroup(svmConsoleJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(svmConsoleJPanelLayout.createSequentialGroup() .addComponent(trainAllButton) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(svmConsoleJPanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(applyAllButton) .addComponent(removePrevCheckBox)) .addGap(61, 61, 61)) .addGroup(svmConsoleJPanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(tableToWorkOnjTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel3)))) .addGroup(svmConsoleJPanelLayout.createSequentialGroup().addGap(41, 41, 41) .addGroup(svmConsoleJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(crossValidateButton) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, svmConsoleJPanelLayout.createSequentialGroup() .addComponent(resumePreviousCheckBox) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(svmConsoleJPanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(xValQADRadioButton) .addComponent(xValSACRadioButton)))))) .addContainerGap(195, Short.MAX_VALUE))); textHunterJTabbedPane.addTab("SVM console", svmConsoleJPanel); exportResultsButton.setText("Export Results"); exportResultsButton.setActionCommand("outputXML"); exportResultsButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { exportResultsButtonActionPerformed(evt); } }); xmlOutPutButtonGroup.add(withKeyAnnotationsRadioButton); withKeyAnnotationsRadioButton.setSelected(true); withKeyAnnotationsRadioButton.setText("With Key Annotations"); withKeyAnnotationsRadioButton.setEnabled(false); xmlOutPutButtonGroup.add(noKeyAnnotationsRadioButton); noKeyAnnotationsRadioButton.setText("No Key Annotations"); noKeyAnnotationsRadioButton.setEnabled(false); fullDocsOrContextOnlyButtonGroup.add(outputContextOnlyRadioButton); outputContextOnlyRadioButton.setSelected(true); outputContextOnlyRadioButton.setText("Context Only"); outputContextOnlyRadioButton.setEnabled(false); fullDocsOrContextOnlyButtonGroup.add(outputFullDocumentsRadioButton); outputFullDocumentsRadioButton.setText("Full Documents"); outputFullDocumentsRadioButton.setEnabled(false); outputFileChooser.setControlButtonsAreShown(false); outputFileChooser.setFileSelectionMode(javax.swing.JFileChooser.DIRECTORIES_ONLY); xmlOrTableButtonGroup.add(XMLradioButton); XMLradioButton.setText("XML"); XMLradioButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { XMLradioButtonActionPerformed(evt); } }); xmlOrTableButtonGroup.add(tableRadioButton); tableRadioButton.setSelected(true); tableRadioButton.setText("CSV table"); GATEorKnowtatorbuttonGroup.add(gateXMLjRadioButton); gateXMLjRadioButton.setSelected(true); gateXMLjRadioButton.setText("GATE XML"); gateXMLjRadioButton.setEnabled(false); GATEorKnowtatorbuttonGroup.add(knowtatorXMLjRadioButton); knowtatorXMLjRadioButton.setText("Knowtator XML"); knowtatorXMLjRadioButton.setEnabled(false); javax.swing.GroupLayout outputConsoleJPanelLayout = new javax.swing.GroupLayout(outputConsoleJPanel); outputConsoleJPanel.setLayout(outputConsoleJPanelLayout); outputConsoleJPanelLayout.setHorizontalGroup(outputConsoleJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(outputConsoleJPanelLayout.createSequentialGroup().addContainerGap() .addGroup(outputConsoleJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(outputFileChooser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(outputConsoleJPanelLayout.createSequentialGroup().addGap(169, 169, 169) .addComponent(XMLradioButton).addGap(169, 169, 169) .addComponent(tableRadioButton)) .addGroup(outputConsoleJPanelLayout.createSequentialGroup().addGap(58, 58, 58) .addGroup(outputConsoleJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(withKeyAnnotationsRadioButton) .addComponent(outputFullDocumentsRadioButton) .addComponent(gateXMLjRadioButton)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(outputConsoleJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(outputConsoleJPanelLayout.createSequentialGroup() .addGroup(outputConsoleJPanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent(outputContextOnlyRadioButton) .addComponent(noKeyAnnotationsRadioButton)) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(exportResultsButton)) .addComponent(knowtatorXMLjRadioButton)))) .addContainerGap(566, Short.MAX_VALUE))); outputConsoleJPanelLayout.setVerticalGroup(outputConsoleJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(outputConsoleJPanelLayout.createSequentialGroup().addGap(59, 59, 59) .addComponent(outputFileChooser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(outputConsoleJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(outputConsoleJPanelLayout.createSequentialGroup().addGap(31, 31, 31) .addComponent(tableRadioButton)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, outputConsoleJPanelLayout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(XMLradioButton))) .addGroup(outputConsoleJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(outputConsoleJPanelLayout.createSequentialGroup().addGap(74, 74, 74) .addComponent(exportResultsButton)) .addGroup(outputConsoleJPanelLayout.createSequentialGroup().addGap(16, 16, 16) .addGroup(outputConsoleJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(gateXMLjRadioButton) .addComponent(knowtatorXMLjRadioButton)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(outputConsoleJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(withKeyAnnotationsRadioButton) .addComponent(noKeyAnnotationsRadioButton)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(outputConsoleJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(outputFullDocumentsRadioButton) .addComponent(outputContextOnlyRadioButton)))) .addContainerGap(138, Short.MAX_VALUE))); textHunterJTabbedPane.addTab("Output console", outputConsoleJPanel); jTextPane1.setEditable(false); jTextPane1.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 2, true)); jTextPane1.setContentType("text/html"); // NOI18N jTextPane1.setText( "<html>\r\n <head>\r\n\r\n </head>\r\n <body>\r\n <p style=\"margin: 10px 5px\";align=\"justify\">\r\n<br><br>Copyright (C) 2014 Richard Jackson (richgjackson@yahoo.co.uk)\n<br><br>This program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n<br><br>This program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n<br><br>You should have received a copy of the GNU General Public License\nalong with this program. If not, see <a href=\"url\">http:www.gnu.org/licenses/</a>. \r\n </p>\r\n </body>\r\n</html>\r\n"); jScrollPane12.setViewportView(jTextPane1); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap() .addComponent(jScrollPane12, javax.swing.GroupLayout.DEFAULT_SIZE, 795, Short.MAX_VALUE) .addContainerGap())); jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout .createSequentialGroup().addContainerGap().addComponent(jScrollPane12, javax.swing.GroupLayout.PREFERRED_SIZE, 317, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(64, Short.MAX_VALUE))); javax.swing.GroupLayout licenceJPanelLayout = new javax.swing.GroupLayout(licenceJPanel); licenceJPanel.setLayout(licenceJPanelLayout); licenceJPanelLayout.setHorizontalGroup(licenceJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(licenceJPanelLayout.createSequentialGroup().addContainerGap() .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(310, Short.MAX_VALUE))); licenceJPanelLayout.setVerticalGroup(licenceJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(licenceJPanelLayout.createSequentialGroup().addContainerGap() .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(322, Short.MAX_VALUE))); textHunterJTabbedPane.addTab("Licence", licenceJPanel); getContentPane().add(textHunterJTabbedPane, new org.netbeans.lib.awtextra.AbsoluteConstraints(2, 121, 1140, 750)); textHunterJTabbedPane.getAccessibleContext().setAccessibleName("Annotate"); quitButton.setText("Quit"); quitButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { quitButtonActionPerformed(evt); } }); getContentPane().add(quitButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(1060, 10, -1, -1)); modeChangeButtonGroup.add(expressModeRadioButton); expressModeRadioButton.setSelected(true); expressModeRadioButton.setText("Express Mode"); expressModeRadioButton.setFocusable(false); expressModeRadioButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { expressModeRadioButtonActionPerformed(evt); } }); getContentPane().add(expressModeRadioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(590, 10, -1, -1)); modeChangeButtonGroup.add(advancedModeRadioButton); advancedModeRadioButton.setText("Advanced Mode"); advancedModeRadioButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { advancedModeRadioButtonActionPerformed(evt); } }); getContentPane().add(advancedModeRadioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(690, 10, -1, -1)); svmProgressBar.setEnabled(false); svmProgressBar.setFocusable(false); getContentPane().add(svmProgressBar, new org.netbeans.lib.awtextra.AbsoluteConstraints(800, 10, 150, 23)); threadCountTextField.setText(Integer.toString(Runtime.getRuntime().availableProcessors())); threadCountTextField.setBorder(javax.swing.BorderFactory .createTitledBorder(javax.swing.BorderFactory.createTitledBorder(""), "Cores used")); getContentPane().add(threadCountTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(500, 10, 80, 86)); saveProjectJButton.setText("Save Project"); saveProjectJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { saveProjectJButtonActionPerformed(evt); } }); getContentPane().add(saveProjectJButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(960, 10, -1, -1)); jLabel1.setIcon(new javax.swing.ImageIcon( getClass().getResource("/uk/ac/kcl/texthunter/resources/textHunter.jpg"))); // NOI18N jLabel1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED)); getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, -1, -1)); targetTableTextField.setEditable(false); targetTableTextField.setText("(no project loaded)"); targetTableTextField.setBorder(javax.swing.BorderFactory.createTitledBorder( javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createTitledBorder("")), "Current Project")); getContentPane().add(targetTableTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(590, 40, 320, 60)); jScrollPane2.setViewportView(infoTextPane); getContentPane().add(jScrollPane2, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 10, 300, 80)); pack(); }
From source file:edu.ku.brc.specify.tasks.subpane.wb.wbuploader.Uploader.java
public void keyPressed(KeyEvent e) { logDebug("keyPressed"); int key = e.getKeyCode(); if (key == KeyEvent.VK_ENTER || key == KeyEvent.VK_TAB || key == KeyEvent.VK_DOWN || key == KeyEvent.VK_UP || (key == KeyEvent.VK_TAB && e.isShiftDown()) || key == KeyEvent.VK_HOME || key == KeyEvent.VK_END) { editInvalidCell(e);// ww w .j a v a 2s. com e.consume(); } }