bugged
stringlengths
6
599k
fixed
stringlengths
6
40.8M
__index_level_0__
int64
0
3.24M
public void handleResult(Object result) { if (viewer.getState() == HiViewer.DISCARDED) return; //Async cancel. viewer.setHierarchyRoots((Set) result, false); }
public void handleResult(Object result) { if (viewer.getState() == HiViewer.DISCARDED) return; //Async cancel. viewer.setHierarchyRoots((Set) result, false, refresh); }
3,234,075
public IRubyObject initialize(IRubyObject[] args) { if (checkArgumentCount(args, 0, 2) > 0) { scanner = new StringScanner(((RubyString)args[0]).getValue()); } else { scanner = new StringScanner(); } return this; }
public IRubyObject initialize(IRubyObject[] args) { if (checkArgumentCount(args, 0, 2) > 0) { scanner = new StringScanner(((RubyString)args[0]).getValue()); } else { scanner = new StringScanner(); } return this; }
3,234,076
private void define_instance_method_for_proxy(final RubyClass proxy, List names, final RubyArray methods) { final RubyModule javaUtilities = getRuntime().getModule("JavaUtilities"); Callback method = new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { IRubyObject[] argsArray = new IRubyObject[args.length + 1]; argsArray[0] = self.callMethod("java_object"); RubyArray argsAsArray = getRuntime().newArray(); for (int j = 0; j < args.length; j++) { argsArray[j+1] = Java.ruby_to_java(proxy, args[j]); argsAsArray.append(argsArray[j+1]); } IRubyObject[] mmArgs = new IRubyObject[] {methods, argsAsArray}; IRubyObject result = javaUtilities.callMethod("matching_method", mmArgs); return Java.java_to_ruby(self, result.callMethod("invoke", argsArray)); } public Arity getArity() { return Arity.optional(); } }; for(Iterator iter = names.iterator(); iter.hasNext(); ) { String methodName = (String) iter.next(); // Do not override a built-in Ruby method. This begs a question or two... if (proxy.searchMethod(methodName) == UndefinedMethod.getInstance()) { proxy.defineMethod(methodName, method); } } }
private void define_instance_method_for_proxy(final RubyClass proxy, List names, final RubyArray methods) { final RubyModule javaUtilities = getRuntime().getModule("JavaUtilities"); Callback method = new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { IRubyObject[] argsArray = new IRubyObject[args.length + 1]; argsArray[0] = self.callMethod("java_object"); RubyArray argsAsArray = getRuntime().newArray(); for (int j = 0; j < args.length; j++) { argsArray[j+1] = Java.ruby_to_java(proxy, args[j]); argsAsArray.append(argsArray[j+1]); } IRubyObject[] mmArgs = new IRubyObject[] {methods, argsAsArray}; IRubyObject result = javaUtilities.callMethod("matching_method", mmArgs); return Java.java_to_ruby(self, result.callMethod("invoke", argsArray)); } public Arity getArity() { return Arity.optional(); } }; for(Iterator iter = names.iterator(); iter.hasNext(); ) { String methodName = (String) iter.next(); // Do not override a built-in Ruby method. This begs a question or two... if (!methodName.equals("class")) { proxy.defineMethod(methodName, method); } } }
3,234,077
public void log(Date date, String name, String level, String message, Exception e) { synchronized(_args) { _args[0] = date; _args[1] = name; _args[2] = level; _args[3] = message; if (e == null) _servletContext.log(_mf.format(_args)); else _servletContext.log(e, _mf.format(_args)); } }
public void log(Date date, String name, String level, String message, Exception e) { synchronized(_args) { _args[0] = date; _args[1] = name; _args[2] = level; _args[3] = message; if (e == null) _servletContext.log(_mf.format(_args)); else _servletContext.log(_mf.format(_args),e); } }
3,234,079
public UIComponent getEditContainer() { IWContext iwc = IWContext.getInstance(); WFResourceUtil localizer = WFResourceUtil.getResourceUtilArticle(); String ref = ARTICLE_ITEM_BEAN_ID + ".";// String bref = WFPage.CONTENT_BUNDLE + "."; WFContainer mainContainer = new WFContainer(); mainContainer.setId(ARTICLE_EDITOR_ID); WFErrorMessages em = new WFErrorMessages(); em.addErrorMessage(HEADLINE_ID); em.addErrorMessage(TEASER_ID);// em.addErrorMessage(PUBLISHED_FROM_DATE_ID);// em.addErrorMessage(PUBLISHED_TO_DATE_ID); em.addErrorMessage(SAVE_ID); mainContainer.add(em); HtmlPanelGrid p = WFPanelUtil.getPlainFormPanel(2); //Language dropdown p.getChildren().add(WFUtil.group(localizer.getTextVB("language"), WFUtil.getText(":"))); Iterator iter = ICLocaleBusiness.getListOfLocalesJAVA().iterator(); HtmlSelectOneMenu langDropdown = new HtmlSelectOneMenu(); List arrayList = new ArrayList(); while(iter.hasNext()) { Locale locale = (Locale)iter.next(); String keyStr = locale.getLanguage(); String langStr = locale.getDisplayLanguage(); SelectItem itemTemp = new SelectItem(keyStr, langStr, keyStr, false); arrayList.add(itemTemp); } UISelectItems items = new UISelectItems(); items.setValue(arrayList); langDropdown.getChildren().add(items); ValueBinding vb = WFUtil.createValueBinding("#{" + ref +"contentLanguage" + "}"); langDropdown.setValueBinding("value", vb); langDropdown.getValue(); langDropdown.addValueChangeListener(this); langDropdown.setImmediate(true); langDropdown.setOnchange("submit();"); p.getChildren().add(langDropdown); p.getChildren().add(WFUtil.group(localizer.getTextVB("headline"), WFUtil.getText(":")));// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "language"), WFUtil.getText(":"))); HtmlInputText headlineInput = WFUtil.getInputText(HEADLINE_ID, ref + "headline"); headlineInput.setSize(70); p.getChildren().add(headlineInput); //HtmlSelectOneMenu localeMenu = WFUtil.getSelectOneMenu(LOCALE_ID, ref + "allLocales", ref + "pendingLocaleId"); //localeMenu.setOnchange("document.forms[0].submit();"); //p.getChildren().add(localeMenu); p.getChildren().add(WFUtil.group(localizer.getTextVB("author"), WFUtil.getText(":"))); HtmlInputText authorInput = WFUtil.getInputText(AUTHOR_ID, ref + "author"); authorInput.setSize(70); User user = iwc.getCurrentUser(); if(user!=null){ String userName = user.getName(); getArticleItemBean().setAuthor(userName); } p.getChildren().add(authorInput); //Article body p.getChildren().add(WFUtil.group(localizer.getTextVB("body"), WFUtil.getText(":"))); HTMLArea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body", "500px", "400px"); //HTMLArea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body"); /*bodyArea.addPlugin(HTMLArea.PLUGIN_TABLE_OPERATIONS); bodyArea.addPlugin(HTMLArea.PLUGIN_DYNAMIC_CSS, "3"); bodyArea.addPlugin(HTMLArea.PLUGIN_CSS, "3"); bodyArea.addPlugin(HTMLArea.PLUGIN_CONTEXT_MENU); bodyArea.addPlugin(HTMLArea.PLUGIN_LIST_TYPE); bodyArea.addPlugin(HTMLArea.PLUGIN_CHARACTER_MAP); */ bodyArea.setAllowFontSelection(false); p.getChildren().add(WFUtil.group(bodyArea, WFUtil.getBreak())); p.getChildren().add(WFUtil.group(localizer.getTextVB("teaser"), WFUtil.getText(":"))); HtmlInputTextarea teaserArea = WFUtil.getTextArea(TEASER_ID, ref + "teaser", "500px", "60px"); p.getChildren().add(teaserArea); p.getChildren().add(WFUtil.group(localizer.getTextVB("source"), WFUtil.getText(":"))); HtmlInputText sourceArea = WFUtil.getInputText(AUTHOR_ID, ref + "source"); sourceArea.setSize(70); p.getChildren().add(sourceArea); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak()); // p = WFPanelUtil.getPlainFormPanel(1);/* p.getChildren().add(WFUtil.group(WFUtil.getHeaderTextVB(bref + "created"), WFUtil.getTextVB(ref + "creationDate") ));*/// p.getChildren().add(WFUtil.getText(" "));// UIComponent t = WFUtil.group(localizer.getHeaderTextVB("status"), WFUtil.getText(": "));// t.getChildren().add(WFUtil.getTextVB(ref + "status"));// p.getChildren().add(t); p.getChildren().add(WFUtil.group(localizer.getTextVB("status"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.getTextVB(ref + "status")); p.getChildren().add(WFUtil.group(localizer.getTextVB("current_version"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.getTextVB(ref + "versionName")); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak()); // p = WFPanelUtil.getFormPanel(2); p.getChildren().add(WFUtil.group(localizer.getTextVB("comment"), WFUtil.getText(":")));// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "attachments"), WFUtil.getText(":"))); HtmlInputTextarea commentArea = WFUtil.getTextArea(COMMENT_ID, ref + "comment", "500px", "60px"); p.getChildren().add(commentArea);// WFContainer attachmentContainer = new WFContainer();// attachmentContainer.add(WFUtil.getButtonVB(ADD_ATTACHMENT_ID, bref + "add_attachment", this));// attachmentContainer.add(WFUtil.getBreak());// attachmentContainer.add(getAttachmentList());// p.getChildren().add(attachmentContainer); // mainContainer.add(p); // p = WFPanelUtil.getFormPanel(1);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "related_content_items"), WFUtil.getText(":"))); // WFContainer contentItemContainer = new WFContainer(); // contentItemContainer.add(WFUtil.getButtonVB(ADD_RELATED_CONTENT_ITEM_ID, bref + "add_content_item", this));// contentItemContainer.add(WFUtil.getBreak());// contentItemContainer.add(getRelatedContentItemsList());// p.getChildren().add(contentItemContainer);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "publishing_date"), WFUtil.getText(":"))); // WFDateInput publishedFromInput = WFUtil.getDateInput(PUBLISHED_FROM_DATE_ID, ref + "case.publishedFromDate");// publishedFromInput.setShowTime(true);// p.getChildren().add(publishedFromInput);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "expiration_date"), WFUtil.getText(":"))); // WFDateInput publishedToInput = WFUtil.getDateInput(PUBLISHED_TO_DATE_ID, ref + "case.publishedToDate");// publishedToInput.setShowTime(true);// p.getChildren().add(publishedToInput); // mainContainer.add(p); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak());// mainContainer.add(WFUtil.getBreak());// p = WFPanelUtil.getPlainFormPanel(1);// HtmlCommandButton editCategoriesButton = WFUtil.getButtonVB(EDIT_CATEGORIES_ID, bref + "edit_categories", this);// p.getChildren().add(editCategoriesButton); //Temporary taking away folderr location/* p.getChildren().add(WFUtil.group(localizer.getTextVB("folder"), WFUtil.getText(":"))); HtmlInputText folderInput = WFUtil.getInputText(FOLDER_ID, ref + "folderLocation"); if(null==folderInput.getValue() || "".equals(folderInput.getValue())) { String FolderString = ArticleUtil.getArticleYearMonthPath();// System.out.println("Folder "+FolderString); folderInput.setValue(FolderString); } else { File file = new File(folderInput.getValue().toString()); folderInput.setValue(file.getParentFile().getParent()); } folderInput.setSize(70); p.getChildren().add(folderInput); */ p.getChildren().add(WFUtil.getBreak()); //Categories// WebDAVCategories categoriesUI = new WebDAVCategories(); ArticleItemBean articleItemBean = (ArticleItemBean) WFUtil.getBeanInstance(ARTICLE_ITEM_BEAN_ID); String resourcePath = articleItemBean.getArticleResourcePath(); categoriesUI.setResourcePath(resourcePath); p.getChildren().add(categoriesUI); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak());// WFComponentSelector cs = new WFComponentSelector();// cs.setId(BUTTON_SELECTOR_ID);// cs.setDividerText(" "); HtmlCommandButton saveButton = localizer.getButtonVB(SAVE_ID, "save", this);// HtmlCommandButton saveButton = WFUtil.getButtonVB(SAVE_ID, WFPage.CONTENT_BUNDLE + "save", this);// cs.add(saveButton);// cs.add(WFUtil.getButtonVB(FOR_REVIEW_ID, bref + "for_review", this));// cs.add(WFUtil.getButtonVB(PUBLISH_ID, bref + "publish", this));// cs.add(WFUtil.getButtonVB(REWRITE_ID, bref + "rewrite", this));// cs.add(WFUtil.getButtonVB(REJECT_ID, bref + "reject", this));// cs.add(WFUtil.getButtonVB(DELETE_ID, bref + "delete", this));// cs.add(WFUtil.getButtonVB(CANCEL_ID, bref + "cancel", this));// cs.setSelectedId(CANCEL_ID, true);// p.getChildren().add(cs); p.getChildren().add(saveButton); mainContainer.add(p); WFComponentSelector editorSelector = new WFComponentSelector(); editorSelector.setId(EDITOR_SELECTOR_ID); editorSelector.add(mainContainer); editorSelector.add(getCategoryEditContainer());// FileUploadForm f = new FileUploadForm(this, FILE_UPLOAD_ID, FILE_UPLOAD_CANCEL_ID); editorSelector.add(getRelatedContentItemsContainer()); editorSelector.setSelectedId(ARTICLE_EDITOR_ID, true); return editorSelector; }
public UIComponent getEditContainer() { IWContext iwc = IWContext.getInstance(); WFResourceUtil localizer = WFResourceUtil.getResourceUtilArticle(); String ref = ARTICLE_ITEM_BEAN_ID + ".";// String bref = WFPage.CONTENT_BUNDLE + "."; WFContainer mainContainer = new WFContainer(); mainContainer.setId(ARTICLE_EDITOR_ID); WFErrorMessages em = new WFErrorMessages(); em.addErrorMessage(HEADLINE_ID); em.addErrorMessage(TEASER_ID);// em.addErrorMessage(PUBLISHED_FROM_DATE_ID);// em.addErrorMessage(PUBLISHED_TO_DATE_ID); em.addErrorMessage(SAVE_ID); mainContainer.add(em); HtmlPanelGrid p = WFPanelUtil.getPlainFormPanel(2); //Language dropdown p.getChildren().add(WFUtil.group(localizer.getTextVB("language"), WFUtil.getText(":"))); Iterator iter = ICLocaleBusiness.getListOfLocalesJAVA().iterator(); HtmlSelectOneMenu langDropdown = new HtmlSelectOneMenu(); List arrayList = new ArrayList(); while(iter.hasNext()) { Locale locale = (Locale)iter.next(); String keyStr = locale.getLanguage(); String langStr = locale.getDisplayLanguage(); SelectItem itemTemp = new SelectItem(keyStr, langStr, keyStr, false); arrayList.add(itemTemp); } UISelectItems items = new UISelectItems(); items.setValue(arrayList); langDropdown.getChildren().add(items); ValueBinding vb = WFUtil.createValueBinding("#{" + ref +"contentLanguage" + "}"); langDropdown.setValueBinding("value", vb); langDropdown.getValue(); langDropdown.addValueChangeListener(this); langDropdown.setImmediate(true); langDropdown.setOnchange("submit();"); p.getChildren().add(langDropdown); p.getChildren().add(WFUtil.group(localizer.getTextVB("headline"), WFUtil.getText(":")));// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "language"), WFUtil.getText(":"))); HtmlInputText headlineInput = WFUtil.getInputText(HEADLINE_ID, ref + "headline"); headlineInput.setSize(70); p.getChildren().add(headlineInput); //HtmlSelectOneMenu localeMenu = WFUtil.getSelectOneMenu(LOCALE_ID, ref + "allLocales", ref + "pendingLocaleId"); //localeMenu.setOnchange("document.forms[0].submit();"); //p.getChildren().add(localeMenu); p.getChildren().add(WFUtil.group(localizer.getTextVB("author"), WFUtil.getText(":"))); HtmlInputText authorInput = WFUtil.getInputText(AUTHOR_ID, ref + "author"); authorInput.setSize(70); User user = iwc.getCurrentUser(); if(user!=null){ String userName = user.getName(); getArticleItemBean().setAuthor(userName); } p.getChildren().add(authorInput); //Article body p.getChildren().add(WFUtil.group(localizer.getTextVB("body"), WFUtil.getText(":"))); HTMLArea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body", "500px", "400px"); //HTMLArea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body"); /*bodyArea.addPlugin(HTMLArea.PLUGIN_TABLE_OPERATIONS); bodyArea.addPlugin(HTMLArea.PLUGIN_DYNAMIC_CSS, "3"); bodyArea.addPlugin(HTMLArea.PLUGIN_CSS, "3"); bodyArea.addPlugin(HTMLArea.PLUGIN_CONTEXT_MENU); bodyArea.addPlugin(HTMLArea.PLUGIN_LIST_TYPE); bodyArea.addPlugin(HTMLArea.PLUGIN_CHARACTER_MAP); */ bodyArea.setAllowFontSelection(false); p.getChildren().add(WFUtil.group(bodyArea, WFUtil.getBreak())); p.getChildren().add(WFUtil.group(localizer.getTextVB("teaser"), WFUtil.getText(":"))); HtmlInputTextarea teaserArea = WFUtil.getTextArea(TEASER_ID, ref + "teaser", "500px", "60px"); p.getChildren().add(teaserArea); p.getChildren().add(WFUtil.group(localizer.getTextVB("source"), WFUtil.getText(":"))); HtmlInputText sourceArea = WFUtil.getInputText(AUTHOR_ID, ref + "source"); sourceArea.setSize(70); p.getChildren().add(sourceArea); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak()); // p = WFPanelUtil.getPlainFormPanel(1);/* p.getChildren().add(WFUtil.group(WFUtil.getHeaderTextVB(bref + "created"), WFUtil.getTextVB(ref + "creationDate") ));*/// p.getChildren().add(WFUtil.getText(" "));// UIComponent t = WFUtil.group(localizer.getHeaderTextVB("status"), WFUtil.getText(": "));// t.getChildren().add(WFUtil.getTextVB(ref + "status"));// p.getChildren().add(t); p.getChildren().add(WFUtil.group(localizer.getTextVB("status"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.getTextVB(ref + "status")); p.getChildren().add(WFUtil.group(localizer.getTextVB("current_version"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.getTextVB(ref + "versionName")); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak()); // p = WFPanelUtil.getFormPanel(2); p.getChildren().add(WFUtil.group(localizer.getTextVB("comment"), WFUtil.getText(":")));// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "attachments"), WFUtil.getText(":"))); HtmlInputTextarea commentArea = WFUtil.getTextArea(COMMENT_ID, ref + "comment", "500px", "60px"); p.getChildren().add(commentArea);// WFContainer attachmentContainer = new WFContainer();// attachmentContainer.add(WFUtil.getButtonVB(ADD_ATTACHMENT_ID, bref + "add_attachment", this));// attachmentContainer.add(WFUtil.getBreak());// attachmentContainer.add(getAttachmentList());// p.getChildren().add(attachmentContainer); // mainContainer.add(p); // p = WFPanelUtil.getFormPanel(1);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "related_content_items"), WFUtil.getText(":"))); // WFContainer contentItemContainer = new WFContainer(); // contentItemContainer.add(WFUtil.getButtonVB(ADD_RELATED_CONTENT_ITEM_ID, bref + "add_content_item", this));// contentItemContainer.add(WFUtil.getBreak());// contentItemContainer.add(getRelatedContentItemsList());// p.getChildren().add(contentItemContainer);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "publishing_date"), WFUtil.getText(":"))); // WFDateInput publishedFromInput = WFUtil.getDateInput(PUBLISHED_FROM_DATE_ID, ref + "case.publishedFromDate");// publishedFromInput.setShowTime(true);// p.getChildren().add(publishedFromInput);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "expiration_date"), WFUtil.getText(":"))); // WFDateInput publishedToInput = WFUtil.getDateInput(PUBLISHED_TO_DATE_ID, ref + "case.publishedToDate");// publishedToInput.setShowTime(true);// p.getChildren().add(publishedToInput); // mainContainer.add(p); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak());// mainContainer.add(WFUtil.getBreak());// p = WFPanelUtil.getPlainFormPanel(1);// HtmlCommandButton editCategoriesButton = WFUtil.getButtonVB(EDIT_CATEGORIES_ID, bref + "edit_categories", this);// p.getChildren().add(editCategoriesButton); //Temporary taking away folderr location/* p.getChildren().add(WFUtil.group(localizer.getTextVB("folder"), WFUtil.getText(":"))); HtmlInputText folderInput = WFUtil.getInputText(FOLDER_ID, ref + "folderLocation"); if(null==folderInput.getValue() || "".equals(folderInput.getValue())) { String FolderString = ArticleUtil.getArticleYearMonthPath();// System.out.println("Folder "+FolderString); folderInput.setValue(FolderString); } else { File file = new File(folderInput.getValue().toString()); folderInput.setValue(file.getParentFile().getParent()); } folderInput.setSize(70); p.getChildren().add(folderInput); */ p.getChildren().add(WFUtil.getBreak()); //Categories// WebDAVCategories categoriesUI = new WebDAVCategories(); ArticleItemBean articleItemBean = (ArticleItemBean) WFUtil.getBeanInstance(ARTICLE_ITEM_BEAN_ID); String resourcePath = articleItemBean.getArticleResourcePath(); categoriesUI.setResourcePath(resourcePath); p.getChildren().add(categoriesUI); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak());// WFComponentSelector cs = new WFComponentSelector();// cs.setId(BUTTON_SELECTOR_ID);// cs.setDividerText(" "); HtmlCommandButton saveButton = localizer.getButtonVB(SAVE_ID, "save", this);// HtmlCommandButton saveButton = WFUtil.getButtonVB(SAVE_ID, WFPage.CONTENT_BUNDLE + "save", this);// cs.add(saveButton);// cs.add(WFUtil.getButtonVB(FOR_REVIEW_ID, bref + "for_review", this));// cs.add(WFUtil.getButtonVB(PUBLISH_ID, bref + "publish", this));// cs.add(WFUtil.getButtonVB(REWRITE_ID, bref + "rewrite", this));// cs.add(WFUtil.getButtonVB(REJECT_ID, bref + "reject", this));// cs.add(WFUtil.getButtonVB(DELETE_ID, bref + "delete", this));// cs.add(WFUtil.getButtonVB(CANCEL_ID, bref + "cancel", this));// cs.setSelectedId(CANCEL_ID, true);// p.getChildren().add(cs); p.getChildren().add(saveButton); mainContainer.add(p); WFComponentSelector editorSelector = new WFComponentSelector(); editorSelector.setId(EDITOR_SELECTOR_ID); editorSelector.add(mainContainer); editorSelector.add(getCategoryEditContainer());// FileUploadForm f = new FileUploadForm(this, FILE_UPLOAD_ID, FILE_UPLOAD_CANCEL_ID); editorSelector.add(getRelatedContentItemsContainer()); editorSelector.setSelectedId(ARTICLE_EDITOR_ID, true); return editorSelector; }
3,234,080
public UIComponent getEditContainer() { IWContext iwc = IWContext.getInstance(); WFResourceUtil localizer = WFResourceUtil.getResourceUtilArticle(); String ref = ARTICLE_ITEM_BEAN_ID + ".";// String bref = WFPage.CONTENT_BUNDLE + "."; WFContainer mainContainer = new WFContainer(); mainContainer.setId(ARTICLE_EDITOR_ID); WFErrorMessages em = new WFErrorMessages(); em.addErrorMessage(HEADLINE_ID); em.addErrorMessage(TEASER_ID);// em.addErrorMessage(PUBLISHED_FROM_DATE_ID);// em.addErrorMessage(PUBLISHED_TO_DATE_ID); em.addErrorMessage(SAVE_ID); mainContainer.add(em); HtmlPanelGrid p = WFPanelUtil.getPlainFormPanel(2); //Language dropdown p.getChildren().add(WFUtil.group(localizer.getTextVB("language"), WFUtil.getText(":"))); Iterator iter = ICLocaleBusiness.getListOfLocalesJAVA().iterator(); HtmlSelectOneMenu langDropdown = new HtmlSelectOneMenu(); List arrayList = new ArrayList(); while(iter.hasNext()) { Locale locale = (Locale)iter.next(); String keyStr = locale.getLanguage(); String langStr = locale.getDisplayLanguage(); SelectItem itemTemp = new SelectItem(keyStr, langStr, keyStr, false); arrayList.add(itemTemp); } UISelectItems items = new UISelectItems(); items.setValue(arrayList); langDropdown.getChildren().add(items); ValueBinding vb = WFUtil.createValueBinding("#{" + ref +"contentLanguage" + "}"); langDropdown.setValueBinding("value", vb); langDropdown.getValue(); langDropdown.addValueChangeListener(this); langDropdown.setImmediate(true); langDropdown.setOnchange("submit();"); p.getChildren().add(langDropdown); p.getChildren().add(WFUtil.group(localizer.getTextVB("headline"), WFUtil.getText(":")));// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "language"), WFUtil.getText(":"))); HtmlInputText headlineInput = WFUtil.getInputText(HEADLINE_ID, ref + "headline"); headlineInput.setSize(70); p.getChildren().add(headlineInput); //HtmlSelectOneMenu localeMenu = WFUtil.getSelectOneMenu(LOCALE_ID, ref + "allLocales", ref + "pendingLocaleId"); //localeMenu.setOnchange("document.forms[0].submit();"); //p.getChildren().add(localeMenu); p.getChildren().add(WFUtil.group(localizer.getTextVB("author"), WFUtil.getText(":"))); HtmlInputText authorInput = WFUtil.getInputText(AUTHOR_ID, ref + "author"); authorInput.setSize(70); User user = iwc.getCurrentUser(); if(user!=null){ String userName = user.getName(); getArticleItemBean().setAuthor(userName); } p.getChildren().add(authorInput); //Article body p.getChildren().add(WFUtil.group(localizer.getTextVB("body"), WFUtil.getText(":"))); HTMLArea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body", "500px", "400px"); //HTMLArea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body"); /*bodyArea.addPlugin(HTMLArea.PLUGIN_TABLE_OPERATIONS); bodyArea.addPlugin(HTMLArea.PLUGIN_DYNAMIC_CSS, "3"); bodyArea.addPlugin(HTMLArea.PLUGIN_CSS, "3"); bodyArea.addPlugin(HTMLArea.PLUGIN_CONTEXT_MENU); bodyArea.addPlugin(HTMLArea.PLUGIN_LIST_TYPE); bodyArea.addPlugin(HTMLArea.PLUGIN_CHARACTER_MAP); */ bodyArea.setAllowFontSelection(false); p.getChildren().add(WFUtil.group(bodyArea, WFUtil.getBreak())); p.getChildren().add(WFUtil.group(localizer.getTextVB("teaser"), WFUtil.getText(":"))); HtmlInputTextarea teaserArea = WFUtil.getTextArea(TEASER_ID, ref + "teaser", "500px", "60px"); p.getChildren().add(teaserArea); p.getChildren().add(WFUtil.group(localizer.getTextVB("source"), WFUtil.getText(":"))); HtmlInputText sourceArea = WFUtil.getInputText(AUTHOR_ID, ref + "source"); sourceArea.setSize(70); p.getChildren().add(sourceArea); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak()); // p = WFPanelUtil.getPlainFormPanel(1);/* p.getChildren().add(WFUtil.group(WFUtil.getHeaderTextVB(bref + "created"), WFUtil.getTextVB(ref + "creationDate") ));*/// p.getChildren().add(WFUtil.getText(" "));// UIComponent t = WFUtil.group(localizer.getHeaderTextVB("status"), WFUtil.getText(": "));// t.getChildren().add(WFUtil.getTextVB(ref + "status"));// p.getChildren().add(t); p.getChildren().add(WFUtil.group(localizer.getTextVB("status"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.getTextVB(ref + "status")); p.getChildren().add(WFUtil.group(localizer.getTextVB("current_version"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.getTextVB(ref + "versionName")); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak()); // p = WFPanelUtil.getFormPanel(2); p.getChildren().add(WFUtil.group(localizer.getTextVB("comment"), WFUtil.getText(":")));// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "attachments"), WFUtil.getText(":"))); HtmlInputTextarea commentArea = WFUtil.getTextArea(COMMENT_ID, ref + "comment", "500px", "60px"); p.getChildren().add(commentArea);// WFContainer attachmentContainer = new WFContainer();// attachmentContainer.add(WFUtil.getButtonVB(ADD_ATTACHMENT_ID, bref + "add_attachment", this));// attachmentContainer.add(WFUtil.getBreak());// attachmentContainer.add(getAttachmentList());// p.getChildren().add(attachmentContainer); // mainContainer.add(p); // p = WFPanelUtil.getFormPanel(1);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "related_content_items"), WFUtil.getText(":"))); // WFContainer contentItemContainer = new WFContainer(); // contentItemContainer.add(WFUtil.getButtonVB(ADD_RELATED_CONTENT_ITEM_ID, bref + "add_content_item", this));// contentItemContainer.add(WFUtil.getBreak());// contentItemContainer.add(getRelatedContentItemsList());// p.getChildren().add(contentItemContainer);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "publishing_date"), WFUtil.getText(":"))); // WFDateInput publishedFromInput = WFUtil.getDateInput(PUBLISHED_FROM_DATE_ID, ref + "case.publishedFromDate");// publishedFromInput.setShowTime(true);// p.getChildren().add(publishedFromInput);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "expiration_date"), WFUtil.getText(":"))); // WFDateInput publishedToInput = WFUtil.getDateInput(PUBLISHED_TO_DATE_ID, ref + "case.publishedToDate");// publishedToInput.setShowTime(true);// p.getChildren().add(publishedToInput); // mainContainer.add(p); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak());// mainContainer.add(WFUtil.getBreak());// p = WFPanelUtil.getPlainFormPanel(1);// HtmlCommandButton editCategoriesButton = WFUtil.getButtonVB(EDIT_CATEGORIES_ID, bref + "edit_categories", this);// p.getChildren().add(editCategoriesButton); //Temporary taking away folderr location/* p.getChildren().add(WFUtil.group(localizer.getTextVB("folder"), WFUtil.getText(":"))); HtmlInputText folderInput = WFUtil.getInputText(FOLDER_ID, ref + "folderLocation"); if(null==folderInput.getValue() || "".equals(folderInput.getValue())) { String FolderString = ArticleUtil.getArticleYearMonthPath();// System.out.println("Folder "+FolderString); folderInput.setValue(FolderString); } else { File file = new File(folderInput.getValue().toString()); folderInput.setValue(file.getParentFile().getParent()); } folderInput.setSize(70); p.getChildren().add(folderInput); */ p.getChildren().add(WFUtil.getBreak()); //Categories// WebDAVCategories categoriesUI = new WebDAVCategories(); ArticleItemBean articleItemBean = (ArticleItemBean) WFUtil.getBeanInstance(ARTICLE_ITEM_BEAN_ID); String resourcePath = articleItemBean.getArticleResourcePath(); categoriesUI.setResourcePath(resourcePath); p.getChildren().add(categoriesUI); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak());// WFComponentSelector cs = new WFComponentSelector();// cs.setId(BUTTON_SELECTOR_ID);// cs.setDividerText(" "); HtmlCommandButton saveButton = localizer.getButtonVB(SAVE_ID, "save", this);// HtmlCommandButton saveButton = WFUtil.getButtonVB(SAVE_ID, WFPage.CONTENT_BUNDLE + "save", this);// cs.add(saveButton);// cs.add(WFUtil.getButtonVB(FOR_REVIEW_ID, bref + "for_review", this));// cs.add(WFUtil.getButtonVB(PUBLISH_ID, bref + "publish", this));// cs.add(WFUtil.getButtonVB(REWRITE_ID, bref + "rewrite", this));// cs.add(WFUtil.getButtonVB(REJECT_ID, bref + "reject", this));// cs.add(WFUtil.getButtonVB(DELETE_ID, bref + "delete", this));// cs.add(WFUtil.getButtonVB(CANCEL_ID, bref + "cancel", this));// cs.setSelectedId(CANCEL_ID, true);// p.getChildren().add(cs); p.getChildren().add(saveButton); mainContainer.add(p); WFComponentSelector editorSelector = new WFComponentSelector(); editorSelector.setId(EDITOR_SELECTOR_ID); editorSelector.add(mainContainer); editorSelector.add(getCategoryEditContainer());// FileUploadForm f = new FileUploadForm(this, FILE_UPLOAD_ID, FILE_UPLOAD_CANCEL_ID); editorSelector.add(getRelatedContentItemsContainer()); editorSelector.setSelectedId(ARTICLE_EDITOR_ID, true); return editorSelector; }
public UIComponent getEditContainer() { IWContext iwc = IWContext.getInstance(); WFResourceUtil localizer = WFResourceUtil.getResourceUtilArticle(); String ref = ARTICLE_ITEM_BEAN_ID + ".";// String bref = WFPage.CONTENT_BUNDLE + "."; WFContainer mainContainer = new WFContainer(); mainContainer.setId(ARTICLE_EDITOR_ID); WFErrorMessages em = new WFErrorMessages(); em.addErrorMessage(HEADLINE_ID); em.addErrorMessage(TEASER_ID);// em.addErrorMessage(PUBLISHED_FROM_DATE_ID);// em.addErrorMessage(PUBLISHED_TO_DATE_ID); em.addErrorMessage(SAVE_ID); mainContainer.add(em); HtmlPanelGrid p = WFPanelUtil.getPlainFormPanel(2); //Language dropdown p.getChildren().add(WFUtil.group(localizer.getTextVB("language"), WFUtil.getText(":"))); Iterator iter = ICLocaleBusiness.getListOfLocalesJAVA().iterator(); HtmlSelectOneMenu langDropdown = new HtmlSelectOneMenu(); List arrayList = new ArrayList(); while(iter.hasNext()) { Locale locale = (Locale)iter.next(); String keyStr = locale.getLanguage(); String langStr = locale.getDisplayLanguage(); SelectItem itemTemp = new SelectItem(keyStr, langStr, keyStr, false); arrayList.add(itemTemp); } UISelectItems items = new UISelectItems(); items.setValue(arrayList); langDropdown.getChildren().add(items); ValueBinding vb = WFUtil.createValueBinding("#{" + ref +"contentLanguage" + "}"); langDropdown.setValueBinding("value", vb); langDropdown.getValue(); langDropdown.addValueChangeListener(this); langDropdown.setImmediate(true); langDropdown.setOnchange("submit();"); p.getChildren().add(langDropdown); p.getChildren().add(WFUtil.group(localizer.getTextVB("headline"), WFUtil.getText(":")));// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "language"), WFUtil.getText(":"))); HtmlInputText headlineInput = WFUtil.getInputText(HEADLINE_ID, ref + "headline"); headlineInput.setSize(70); p.getChildren().add(headlineInput); //HtmlSelectOneMenu localeMenu = WFUtil.getSelectOneMenu(LOCALE_ID, ref + "allLocales", ref + "pendingLocaleId"); //localeMenu.setOnchange("document.forms[0].submit();"); //p.getChildren().add(localeMenu); p.getChildren().add(WFUtil.group(localizer.getTextVB("author"), WFUtil.getText(":"))); HtmlInputText authorInput = WFUtil.getInputText(AUTHOR_ID, ref + "author"); authorInput.setSize(70); User user = iwc.getCurrentUser(); if(user!=null){ String userName = user.getName(); getArticleItemBean().setAuthor(userName); } p.getChildren().add(authorInput); //Article body p.getChildren().add(WFUtil.group(localizer.getTextVB("body"), WFUtil.getText(":"))); HTMLArea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body", "500px", "400px"); //HTMLArea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body"); /*bodyArea.addPlugin(HTMLArea.PLUGIN_TABLE_OPERATIONS); bodyArea.addPlugin(HTMLArea.PLUGIN_DYNAMIC_CSS, "3"); bodyArea.addPlugin(HTMLArea.PLUGIN_CSS, "3"); bodyArea.addPlugin(HTMLArea.PLUGIN_CONTEXT_MENU); bodyArea.addPlugin(HTMLArea.PLUGIN_LIST_TYPE); bodyArea.addPlugin(HTMLArea.PLUGIN_CHARACTER_MAP); */ bodyArea.setAllowFontSelection(false); p.getChildren().add(WFUtil.group(bodyArea, WFUtil.getBreak())); p.getChildren().add(WFUtil.group(localizer.getTextVB("teaser"), WFUtil.getText(":"))); HtmlInputTextarea teaserArea = WFUtil.getTextArea(TEASER_ID, ref + "teaser", "500px", "60px"); p.getChildren().add(teaserArea); p.getChildren().add(WFUtil.group(localizer.getTextVB("source"), WFUtil.getText(":"))); HtmlInputText sourceArea = WFUtil.getInputText(AUTHOR_ID, ref + "source"); sourceArea.setSize(70); p.getChildren().add(sourceArea); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak()); // p = WFPanelUtil.getPlainFormPanel(1);/* p.getChildren().add(WFUtil.group(WFUtil.getHeaderTextVB(bref + "created"), WFUtil.getTextVB(ref + "creationDate") ));*/// p.getChildren().add(WFUtil.getText(" "));// UIComponent t = WFUtil.group(localizer.getHeaderTextVB("status"), WFUtil.getText(": "));// t.getChildren().add(WFUtil.getTextVB(ref + "status"));// p.getChildren().add(t); p.getChildren().add(WFUtil.group(localizer.getTextVB("status"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.getTextVB(ref + "status")); p.getChildren().add(WFUtil.group(localizer.getTextVB("current_version"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.getTextVB(ref + "versionName")); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak()); // p = WFPanelUtil.getFormPanel(2); p.getChildren().add(WFUtil.group(localizer.getTextVB("comment"), WFUtil.getText(":")));// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "attachments"), WFUtil.getText(":"))); HtmlInputTextarea commentArea = WFUtil.getTextArea(COMMENT_ID, ref + "comment", "500px", "60px"); p.getChildren().add(commentArea);// WFContainer attachmentContainer = new WFContainer();// attachmentContainer.add(WFUtil.getButtonVB(ADD_ATTACHMENT_ID, bref + "add_attachment", this));// attachmentContainer.add(WFUtil.getBreak());// attachmentContainer.add(getAttachmentList());// p.getChildren().add(attachmentContainer); // mainContainer.add(p); // p = WFPanelUtil.getFormPanel(1);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "related_content_items"), WFUtil.getText(":"))); // WFContainer contentItemContainer = new WFContainer(); // contentItemContainer.add(WFUtil.getButtonVB(ADD_RELATED_CONTENT_ITEM_ID, bref + "add_content_item", this));// contentItemContainer.add(WFUtil.getBreak());// contentItemContainer.add(getRelatedContentItemsList());// p.getChildren().add(contentItemContainer);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "publishing_date"), WFUtil.getText(":"))); // WFDateInput publishedFromInput = WFUtil.getDateInput(PUBLISHED_FROM_DATE_ID, ref + "case.publishedFromDate");// publishedFromInput.setShowTime(true);// p.getChildren().add(publishedFromInput);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "expiration_date"), WFUtil.getText(":"))); // WFDateInput publishedToInput = WFUtil.getDateInput(PUBLISHED_TO_DATE_ID, ref + "case.publishedToDate");// publishedToInput.setShowTime(true);// p.getChildren().add(publishedToInput); // mainContainer.add(p); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak());// mainContainer.add(WFUtil.getBreak());// p = WFPanelUtil.getPlainFormPanel(1);// HtmlCommandButton editCategoriesButton = WFUtil.getButtonVB(EDIT_CATEGORIES_ID, bref + "edit_categories", this);// p.getChildren().add(editCategoriesButton); //Temporary taking away folderr location/* p.getChildren().add(WFUtil.group(localizer.getTextVB("folder"), WFUtil.getText(":"))); HtmlInputText folderInput = WFUtil.getInputText(FOLDER_ID, ref + "folderLocation"); if(null==folderInput.getValue() || "".equals(folderInput.getValue())) { String FolderString = ArticleUtil.getArticleYearMonthPath();// System.out.println("Folder "+FolderString); folderInput.setValue(FolderString); } else { File file = new File(folderInput.getValue().toString()); folderInput.setValue(file.getParentFile().getParent()); } folderInput.setSize(70); p.getChildren().add(folderInput); */ p.getChildren().add(WFUtil.getBreak()); //Categories// WebDAVCategories categoriesUI = new WebDAVCategories(); ArticleItemBean articleItemBean = (ArticleItemBean) WFUtil.getBeanInstance(ARTICLE_ITEM_BEAN_ID); String resourcePath = articleItemBean.getArticleResourcePath(); categoriesUI.setResourcePath(resourcePath); p.getChildren().add(categoriesUI); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak());// WFComponentSelector cs = new WFComponentSelector();// cs.setId(BUTTON_SELECTOR_ID);// cs.setDividerText(" "); HtmlCommandButton saveButton = localizer.getButtonVB(SAVE_ID, "save", this);// HtmlCommandButton saveButton = WFUtil.getButtonVB(SAVE_ID, WFPage.CONTENT_BUNDLE + "save", this);// cs.add(saveButton);// cs.add(WFUtil.getButtonVB(FOR_REVIEW_ID, bref + "for_review", this));// cs.add(WFUtil.getButtonVB(PUBLISH_ID, bref + "publish", this));// cs.add(WFUtil.getButtonVB(REWRITE_ID, bref + "rewrite", this));// cs.add(WFUtil.getButtonVB(REJECT_ID, bref + "reject", this));// cs.add(WFUtil.getButtonVB(DELETE_ID, bref + "delete", this));// cs.add(WFUtil.getButtonVB(CANCEL_ID, bref + "cancel", this));// cs.setSelectedId(CANCEL_ID, true);// p.getChildren().add(cs); p.getChildren().add(saveButton); mainContainer.add(p); WFComponentSelector editorSelector = new WFComponentSelector(); editorSelector.setId(EDITOR_SELECTOR_ID); editorSelector.add(mainContainer); editorSelector.add(getCategoryEditContainer());// FileUploadForm f = new FileUploadForm(this, FILE_UPLOAD_ID, FILE_UPLOAD_CANCEL_ID); editorSelector.add(getRelatedContentItemsContainer()); editorSelector.setSelectedId(ARTICLE_EDITOR_ID, true); return editorSelector; }
3,234,081
private void buildEmptyPanel() { if (emptyMessagePanel != null) return; emptyMessagePanel = new JPanel(); emptyMessagePanel.setOpaque(true); emptyMessagePanel.setBorder( BorderFactory.createLineBorder(Color.BLACK)); Rectangle r = titlePanel.getBounds(); emptyMessagePanel.setLayout(new BoxLayout(emptyMessagePanel, BoxLayout.X_AXIS)); IconManager im = IconManager.getInstance(); JLabel label = new JLabel(im.getIcon(IconManager.ERROR)); emptyMessagePanel.add(label); int w = label.getWidth(); label = new JLabel(EMPTY_MSG); int h = label.getFontMetrics(label.getFont()).getHeight(); w += getFontMetrics(getFont()).stringWidth(EMPTY_MSG); emptyMessagePanel.add(label); Insets i = emptyMessagePanel.getInsets(); h += i.top+i.bottom+2; emptyMessagePanel.setBounds(0, r.height-h, w, h); }
private void buildEmptyPanel() { if (emptyMessagePanel != null) return; emptyMessagePanel = new JPanel(); emptyMessagePanel.setOpaque(true); emptyMessagePanel.setBorder( BorderFactory.createLineBorder(Color.BLACK)); Rectangle r = titlePanel.getBounds(); emptyMessagePanel.setLayout(new BoxLayout(emptyMessagePanel, BoxLayout.X_AXIS)); IconManager im = IconManager.getInstance(); JLabel label = new JLabel(im.getIcon(IconManager.ERROR)); emptyMessagePanel.add(label); int w = label.getWidth(); label = new JLabel(EMPTY_MSG); int h = label.getFontMetrics(label.getFont()).getHeight(); w += getFontMetrics(getFont()).stringWidth(EMPTY_MSG); emptyMessagePanel.add(label); Insets i = emptyMessagePanel.getInsets(); h += i.top+i.bottom+2; emptyMessagePanel.setBounds(0, r.height-h, 3*w/2, h); }
3,234,082
private byte[] getTestPlane() { if (testPlane == null) { Integer planeSize = pixbuf.getPlaneSize(); testPlane = new byte[planeSize.intValue()]; for (int i = 0; i < planeSize; i++) { if (i % 2 == 0) testPlane[i] = -128; else testPlane[i] = 127; } byte[] md = Helper.calculateMessageDigest(testPlane); originalDigest = Helper.bytesToHex(md); } return testPlane; }
private byte[] getTestPlane() { if (testPlane == null) { Integer planeSize = pixbuf.getPlaneSize(); testPlane = new byte[planeSize.intValue()]; for (int i = 0; i < planeSize; i++) { if (i % 2 == 0) testPlane[i] = -128; else testPlane[i] = 126; } byte[] md = Helper.calculateMessageDigest(testPlane); originalDigest = Helper.bytesToHex(md); } return testPlane; }
3,234,083
protected void setUp() throws IOException { // Create set up the base fixture which sets up the database for us baseFixture = new PixbufIOFixture(); pixels = baseFixture.setUp(); // "Our" fixture which creates the planes needed for this test case. service = new PixelsService(); pixbuf = service.createPixelBuffer(pixels); }
protected void setUp() throws IOException { // Create set up the base fixture which sets up the database for us baseFixture = new PixbufIOFixture(); pixels = baseFixture.setUp(); // "Our" fixture which creates the planes needed for this test case. service = new PixelsService(PixelsService.ROOT_DEFAULT); pixbuf = service.createPixelBuffer(pixels); }
3,234,084
public ContactList() { // Load Local Preferences localPreferences = SettingsManager.getLocalPreferences(); offlineGroup = new ContactGroup("Offline Group"); JToolBar toolbar = new JToolBar(); toolbar.setFloatable(false); addContactMenu = new JMenuItem(Res.getString("menuitem.add.contact"), SparkRes.getImageIcon(SparkRes.USER1_ADD_16x16)); addContactGroupMenu = new JMenuItem(Res.getString("menuitem.add.contact.group"), SparkRes.getImageIcon(SparkRes.SMALL_ADD_IMAGE)); removeContactFromGroupMenu = new JMenuItem(Res.getString("menuitem.remove.from.group"), SparkRes.getImageIcon(SparkRes.SMALL_DELETE)); chatMenu = new JMenuItem(Res.getString("menuitem.start.a.chat"), SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_IMAGE)); renameMenu = new JMenuItem(Res.getString("menuitem.rename"), SparkRes.getImageIcon(SparkRes.DESKTOP_IMAGE)); addContactMenu.addActionListener(this); removeContactFromGroupMenu.addActionListener(this); chatMenu.addActionListener(this); renameMenu.addActionListener(this); setLayout(new BorderLayout()); addingGroupButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.ADD_CONTACT_IMAGE)); RolloverButton groupChatButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.JOIN_GROUPCHAT_IMAGE)); toolbar.add(addingGroupButton); toolbar.add(groupChatButton); addingGroupButton.addActionListener(this); mainPanel.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, false)); mainPanel.setBackground((Color)UIManager.get("List.background")); treeScroller = new JScrollPane(mainPanel); treeScroller.setBorder(BorderFactory.createEmptyBorder()); treeScroller.getVerticalScrollBar().setBlockIncrement(50); treeScroller.getVerticalScrollBar().setUnitIncrement(20); retryPanel = new RetryPanel(); workspace = SparkManager.getWorkspace(); workspace.getCardPanel().add(RETRY_PANEL, retryPanel); add(treeScroller, BorderLayout.CENTER); // Load Properties file props = new Properties(); // Save to properties file. propertiesFile = new File(new File(Spark.getUserHome(), "Spark"), "groups.properties"); try { props.load(new FileInputStream(propertiesFile)); } catch (IOException e) { // File does not exist. } // Add ActionListener(s) to menus addContactGroup(unfiledGroup); addContactGroup(offlineGroup); showHideMenu.setSelected(false); // Add KeyMappings getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("control N"), "searchContacts"); getActionMap().put("searchContacts", new AbstractAction("searchContacts") { public void actionPerformed(ActionEvent evt) { searchContacts(""); } }); // Save state on shutdown. SparkManager.getMainWindow().addMainWindowListener(new MainWindowListener() { public void shutdown() { saveState(); } public void mainWindowActivated() { } public void mainWindowDeactivated() { } }); SparkManager.getConnection().addConnectionListener(this); // Get command panel and add View Online/Offline, Add Contact StatusBar statusBar = SparkManager.getWorkspace().getStatusBar(); JPanel commandPanel = statusBar.getCommandPanel(); final RolloverButton addContactButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.USER1_ADD_16x16)); commandPanel.add(addContactButton); addContactButton.setToolTipText(Res.getString("message.add.a.contact")); addContactButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { new RosterDialog().showRosterDialog(); } }); }
public ContactList() { // Load Local Preferences localPreferences = SettingsManager.getLocalPreferences(); offlineGroup = new ContactGroup("Offline Group"); JToolBar toolbar = new JToolBar(); toolbar.setFloatable(false); addContactMenu = new JMenuItem(Res.getString("menuitem.add.contact"), SparkRes.getImageIcon(SparkRes.USER1_ADD_16x16)); addContactGroupMenu = new JMenuItem(Res.getString("menuitem.add.contact.group"), SparkRes.getImageIcon(SparkRes.SMALL_ADD_IMAGE)); removeContactFromGroupMenu = new JMenuItem(Res.getString("menuitem.remove.from.group"), SparkRes.getImageIcon(SparkRes.SMALL_DELETE)); chatMenu = new JMenuItem(Res.getString("menuitem.start.a.chat"), SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_IMAGE)); renameMenu = new JMenuItem(Res.getString("menuitem.rename"), SparkRes.getImageIcon(SparkRes.DESKTOP_IMAGE)); addContactMenu.addActionListener(this); removeContactFromGroupMenu.addActionListener(this); chatMenu.addActionListener(this); renameMenu.addActionListener(this); setLayout(new BorderLayout()); addingGroupButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.ADD_CONTACT_IMAGE)); RolloverButton groupChatButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.JOIN_GROUPCHAT_IMAGE)); toolbar.add(addingGroupButton); toolbar.add(groupChatButton); addingGroupButton.addActionListener(this); mainPanel.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, false)); mainPanel.setBackground((Color)UIManager.get("List.background")); treeScroller = new JScrollPane(mainPanel); treeScroller.setBorder(BorderFactory.createEmptyBorder()); treeScroller.getVerticalScrollBar().setBlockIncrement(50); treeScroller.getVerticalScrollBar().setUnitIncrement(20); retryPanel = new RetryPanel(); workspace = SparkManager.getWorkspace(); workspace.getCardPanel().add(RETRY_PANEL, retryPanel); add(treeScroller, BorderLayout.CENTER); // Load Properties file props = new Properties(); // Save to properties file. propertiesFile = new File(new File(Spark.getUserHome(), "Spark"), "groups.properties"); try { props.load(new FileInputStream(propertiesFile)); } catch (IOException e) { // File does not exist. } // Add ActionListener(s) to menus addContactGroup(unfiledGroup); addContactGroup(offlineGroup); showHideMenu.setSelected(false); // Add KeyMappings getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("control N"), "searchContacts"); getActionMap().put("searchContacts", new AbstractAction("searchContacts") { public void actionPerformed(ActionEvent evt) { SparkManager.getUserManager().searchContacts("", SparkManager.getWorkspace().getContactList()); } }); // Save state on shutdown. SparkManager.getMainWindow().addMainWindowListener(new MainWindowListener() { public void shutdown() { saveState(); } public void mainWindowActivated() { } public void mainWindowDeactivated() { } }); SparkManager.getConnection().addConnectionListener(this); // Get command panel and add View Online/Offline, Add Contact StatusBar statusBar = SparkManager.getWorkspace().getStatusBar(); JPanel commandPanel = statusBar.getCommandPanel(); final RolloverButton addContactButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.USER1_ADD_16x16)); commandPanel.add(addContactButton); addContactButton.setToolTipText(Res.getString("message.add.a.contact")); addContactButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { new RosterDialog().showRosterDialog(); } }); }
3,234,085
public void actionPerformed(ActionEvent evt) { searchContacts(""); }
public void actionPerformed(ActionEvent evt) { SparkManager.getUserManager().searchContacts("", SparkManager.getWorkspace().getContactList()); }
3,234,086
public void actionPerformed(ActionEvent e) { if (e.getSource() == addingGroupButton) { new RosterDialog().showRosterDialog(); } else if (e.getSource() == chatMenu) { if (activeItem != null) { activateChat(activeItem.getContactJID(), activeItem.getNickname()); } } else if (e.getSource() == addContactMenu) { RosterDialog rosterDialog = new RosterDialog(); if (activeGroup != null) { rosterDialog.setDefaultGroup(activeGroup); } rosterDialog.showRosterDialog(); } else if (e.getSource() == removeContactFromGroupMenu) { if (activeItem != null) { removeContactFromGroup(activeItem); } } else if (e.getSource() == renameMenu) { if (activeItem == null) { return; } String oldNickname = activeItem.getNickname(); String newNickname = JOptionPane.showInputDialog(this, Res.getString("label.rename.to") + ":", oldNickname); if (ModelUtil.hasLength(newNickname)) { String address = activeItem.getFullJID(); ContactGroup contactGroup = getContactGroup(activeItem.getGroupName()); ContactItem contactItem = contactGroup.getContactItemByNickname(activeItem.getNickname()); contactItem.setNickname(newNickname); final Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(address); entry.setName(newNickname); final Iterator contactGroups = groupList.iterator(); String user = StringUtils.parseBareAddress(address); while (contactGroups.hasNext()) { ContactGroup cg = (ContactGroup)contactGroups.next(); ContactItem ci = cg.getContactItemByJID(user); if (ci != null) { ci.setNickname(newNickname); } } } } }
public void actionPerformed(ActionEvent e) { if (e.getSource() == addingGroupButton) { new RosterDialog().showRosterDialog(); } else if (e.getSource() == chatMenu) { if (activeItem != null) { SparkManager.getChatManager().activateChat(activeItem.getContactJID(), activeItem.getNickname()); } } else if (e.getSource() == addContactMenu) { RosterDialog rosterDialog = new RosterDialog(); if (activeGroup != null) { rosterDialog.setDefaultGroup(activeGroup); } rosterDialog.showRosterDialog(); } else if (e.getSource() == removeContactFromGroupMenu) { if (activeItem != null) { removeContactFromGroup(activeItem); } } else if (e.getSource() == renameMenu) { if (activeItem == null) { return; } String oldNickname = activeItem.getNickname(); String newNickname = JOptionPane.showInputDialog(this, Res.getString("label.rename.to") + ":", oldNickname); if (ModelUtil.hasLength(newNickname)) { String address = activeItem.getFullJID(); ContactGroup contactGroup = getContactGroup(activeItem.getGroupName()); ContactItem contactItem = contactGroup.getContactItemByNickname(activeItem.getNickname()); contactItem.setNickname(newNickname); final Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(address); entry.setName(newNickname); final Iterator contactGroups = groupList.iterator(); String user = StringUtils.parseBareAddress(address); while (contactGroups.hasNext()) { ContactGroup cg = (ContactGroup)contactGroups.next(); ContactItem ci = cg.getContactItemByJID(user); if (ci != null) { ci.setNickname(newNickname); } } } } }
3,234,087
public void actionPerformed(ActionEvent e) { new RosterDialog().showRosterDialog(); }
public void actionPerformed(ActionEvent e) { String groupName = JOptionPane.showInputDialog(getGUI(), Res.getString("message.name.of.group") + ":", Res.getString("title.add.new.group"), JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(groupName)) { ContactGroup contactGroup = getContactGroup(groupName); if (contactGroup == null) { contactGroup = addContactGroup(groupName); contactGroup.setVisible(true); validateTree(); repaint(); } } }
3,234,088
public void actionPerformed(ActionEvent e) { String groupName = JOptionPane.showInputDialog(getGUI(), Res.getString("message.name.of.group") + ":", Res.getString("title.add.new.group"), JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(groupName)) { ContactGroup contactGroup = getContactGroup(groupName); if (contactGroup == null) { contactGroup = addContactGroup(groupName); contactGroup.setVisible(true); validateTree(); repaint(); } } }
public void actionPerformed(ActionEvent e) { String groupName = JOptionPane.showInputDialog(getGUI(), Res.getString("message.name.of.group") + ":", Res.getString("title.add.new.group"), JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(groupName)) { ContactGroup contactGroup = getContactGroup(groupName); if (contactGroup == null) { contactGroup = addContactGroup(groupName); contactGroup.setVisible(true); validateTree(); repaint(); } } }
3,234,089
public void run() { subscriptionRequest(presence.getFrom()); }
public void run() { Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(presence.getFrom()); if (entry != null) { try { removeContactItem(presence.getFrom()); roster.removeEntry(entry); } catch (XMPPException e) { Presence unsub = new Presence(Presence.Type.unsubscribed); unsub.setTo(presence.getFrom()); SparkManager.getConnection().sendPacket(unsub); Log.error(e); } } }
3,234,090
public void run() { Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(presence.getFrom()); if (entry != null) { try { removeContactItem(presence.getFrom()); roster.removeEntry(entry); } catch (XMPPException e) { Presence unsub = new Presence(Presence.Type.unsubscribed); unsub.setTo(presence.getFrom()); SparkManager.getConnection().sendPacket(unsub); Log.error(e); } } }
public void run() { Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(presence.getFrom()); if (entry != null) { try { removeContactItem(presence.getFrom()); roster.removeEntry(entry); } catch (XMPPException e) { Presence unsub = new Presence(Presence.Type.unsubscribed); unsub.setTo(presence.getFrom()); SparkManager.getConnection().sendPacket(unsub); Log.error(e); } } }
3,234,091
public void run() { Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(presence.getFrom()); if (entry != null) { try { removeContactItem(presence.getFrom()); roster.removeEntry(entry); } catch (XMPPException e) { Log.error(e); } } String jid = StringUtils.parseBareAddress(presence.getFrom()); removeContactItem(jid); }
public void run() { Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(presence.getFrom()); if (entry != null) { try { removeContactItem(presence.getFrom()); roster.removeEntry(entry); } catch (XMPPException e) { Log.error(e); } } String jid = StringUtils.parseBareAddress(presence.getFrom()); removeContactItem(jid); }
3,234,093
public void run() { Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(presence.getFrom()); if (entry != null) { try { removeContactItem(presence.getFrom()); roster.removeEntry(entry); } catch (XMPPException e) { Log.error(e); } } String jid = StringUtils.parseBareAddress(presence.getFrom()); removeContactItem(jid); }
public void run() { Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(presence.getFrom()); if (entry != null) { try { removeContactItem(presence.getFrom()); roster.removeEntry(entry); } catch (XMPPException e) { Log.error(e); } } String jid = StringUtils.parseBareAddress(presence.getFrom()); removeContactItem(jid); }
3,234,094
public void run() { SwingUtilities.invokeLater(new Runnable() { public void run() { final Iterator users = new ArrayList(initialPresences).iterator(); while (users.hasNext()) { Presence userToUpdate = (Presence)users.next(); initialPresences.remove(userToUpdate); updateUserPresence(userToUpdate); } } }); }
public void run() { SwingUtilities.invokeLater(new Runnable() { public void run() { final Iterator users = new ArrayList(initialPresences).iterator(); while (users.hasNext()) { Presence userToUpdate = (Presence)users.next(); initialPresences.remove(userToUpdate); updateUserPresence(userToUpdate); } } }); }
3,234,095
public void run() { SwingUtilities.invokeLater(new Runnable() { public void run() { final Iterator users = new ArrayList(initialPresences).iterator(); while (users.hasNext()) { Presence userToUpdate = (Presence)users.next(); initialPresences.remove(userToUpdate); updateUserPresence(userToUpdate); } } }); }
public void run() { SwingUtilities.invokeLater(new Runnable() { public void run() { final Iterator users = new ArrayList(initialPresences).iterator(); while (users.hasNext()) { Presence userToUpdate = (Presence)users.next(); initialPresences.remove(userToUpdate); updateUserPresence(userToUpdate); } } }); }
3,234,096
private void buildContactList() { XMPPConnection con = SparkManager.getConnection(); final Roster roster = con.getRoster(); roster.addRosterListener(this); for (RosterGroup group : roster.getGroups()) { ContactGroup contactGroup = addContactGroup(group.getName()); for (RosterEntry entry : group.getEntries()) { String name = entry.getName(); if (name == null) { name = entry.getUser(); } ContactItem contactItem = new ContactItem(name, entry.getUser()); contactItem.setPresence(null); if ((entry.getType() == RosterPacket.ItemType.NONE || entry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == entry.getStatus()) { // Add to contact group. contactGroup.addContactItem(contactItem); contactGroup.setVisible(true); } else { if (offlineGroup.getContactItemByJID(entry.getUser()) == null) { offlineGroup.addContactItem(contactItem); } } } } // Add Unfiled Group // addContactGroup(unfiledGroup); for (RosterEntry entry : roster.getUnfiledEntries()) { String name = entry.getName(); if (name == null) { name = entry.getUser(); } ContactItem contactItem = new ContactItem(name, entry.getUser()); offlineGroup.addContactItem(contactItem); } unfiledGroup.setVisible(false); }
private void buildContactList() { XMPPConnection con = SparkManager.getConnection(); final Roster roster = con.getRoster(); roster.addRosterListener(this); for (RosterGroup group : roster.getGroups()) { ContactGroup contactGroup = addContactGroup(group.getName()); for (RosterEntry entry : group.getEntries()) { String name = entry.getName(); if (name == null) { name = entry.getUser(); } ContactItem contactItem = new ContactItem(name, entry.getUser()); contactItem.setPresence(null); if ((entry.getType() == RosterPacket.ItemType.NONE || entry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == entry.getStatus()) { // Add to contact group. contactGroup.addContactItem(contactItem); contactGroup.setVisible(true); } else { if (offlineGroup.getContactItemByJID(entry.getUser()) == null) { offlineGroup.addContactItem(contactItem); } } } } // Add Unfiled Group // addContactGroup(unfiledGroup); for (RosterEntry entry : roster.getUnfiledEntries()) { String name = entry.getName(); if (name == null) { name = entry.getUser(); } ContactItem contactItem = new ContactItem(name, entry.getUser()); offlineGroup.addContactItem(contactItem); } unfiledGroup.setVisible(false); }
3,234,097
public void actionPerformed(ActionEvent e) { int ok = JOptionPane.showConfirmDialog(group, Res.getString("message.delete.confirmation", group.getGroupName()), Res.getString("title.confirmation"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.YES_OPTION) { String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { for (RosterEntry entry : rosterGroup.getEntries()) { try { rosterGroup.removeEntry(entry); } catch (XMPPException e1) { Log.error("Error removing entry", e1); } } } // Remove from UI removeContactGroup(group); invalidate(); repaint(); } }
public void actionPerformed(ActionEvent e) { int ok = JOptionPane.showConfirmDialog(group, Res.getString("message.delete.confirmation", group.getGroupName()), Res.getString("title.confirmation"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.YES_OPTION) { String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { for (RosterEntry entry : rosterGroup.getEntries()) { try { rosterGroup.removeEntry(entry); } catch (XMPPException e1) { Log.error("Error removing entry", e1); } } } // Remove from UI removeContactGroup(group); invalidate(); repaint(); } }
3,234,098
public void actionPerformed(ActionEvent e) { int ok = JOptionPane.showConfirmDialog(group, Res.getString("message.delete.confirmation", group.getGroupName()), Res.getString("title.confirmation"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.YES_OPTION) { String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { for (RosterEntry entry : rosterGroup.getEntries()) { try { rosterGroup.removeEntry(entry); } catch (XMPPException e1) { Log.error("Error removing entry", e1); } } } // Remove from UI removeContactGroup(group); invalidate(); repaint(); } }
public void actionPerformed(ActionEvent e) { int ok = JOptionPane.showConfirmDialog(group, Res.getString("message.delete.confirmation", group.getGroupName()), Res.getString("title.confirmation"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.YES_OPTION) { String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { for (RosterEntry entry : rosterGroup.getEntries()) { try { rosterGroup.removeEntry(entry); } catch (XMPPException e1) { Log.error("Error removing entry", e1); } } } // Remove from UI removeContactGroup(group); invalidate(); repaint(); } }
3,234,099
public void actionPerformed(ActionEvent e) { int ok = JOptionPane.showConfirmDialog(group, Res.getString("message.delete.confirmation", group.getGroupName()), Res.getString("title.confirmation"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.YES_OPTION) { String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { for (RosterEntry entry : rosterGroup.getEntries()) { try { rosterGroup.removeEntry(entry); } catch (XMPPException e1) { Log.error("Error removing entry", e1); } } } // Remove from UI removeContactGroup(group); invalidate(); repaint(); } }
public void actionPerformed(ActionEvent e) { int ok = JOptionPane.showConfirmDialog(group, Res.getString("message.delete.confirmation", group.getGroupName()), Res.getString("title.confirmation"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.YES_OPTION) { String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { for (RosterEntry entry : rosterGroup.getEntries()) { try { rosterGroup.removeEntry(entry); } catch (XMPPException e1) { Log.error("Error removing entry", e1); } } } // Remove from UI removeContactGroup(group); invalidate(); repaint(); } }
3,234,100
public void actionPerformed(ActionEvent e) { String newName = JOptionPane.showInputDialog(group, Res.getString("label.rename.to") + ":", Res.getString("title.rename.roster.group"), JOptionPane.QUESTION_MESSAGE); if (!ModelUtil.hasLength(newName)) { return; } String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { removeContactGroup(group); rosterGroup.setName(newName); } }
public void actionPerformed(ActionEvent e) { String newName = JOptionPane.showInputDialog(group, Res.getString("label.rename.to") + ":", Res.getString("title.rename.roster.group"), JOptionPane.QUESTION_MESSAGE); if (!ModelUtil.hasLength(newName)) { return; } String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { removeContactGroup(group); rosterGroup.setName(newName); } }
3,234,101
public void contactItemDoubleClicked(ContactItem item) { activeItem = item; ChatManager chatManager = SparkManager.getChatManager(); boolean handled = chatManager.fireContactItemDoubleClicked(item); if (!handled) { activateChat(item.getContactJID(), item.getNickname()); } clearSelectionList(item); }
public void contactItemDoubleClicked(ContactItem item) { activeItem = item; ChatManager chatManager = SparkManager.getChatManager(); boolean handled = chatManager.fireContactItemDoubleClicked(item); if (!handled) { chatManager.activateChat(item.getContactJID(), item.getNickname()); } clearSelectionList(item); }
3,234,102
private synchronized void handleEntriesUpdated(final Collection addresses) { SwingUtilities.invokeLater(new Runnable() { public void run() { Roster roster = SparkManager.getConnection().getRoster(); Iterator jids = addresses.iterator(); while (jids.hasNext()) { String jid = (String)jids.next(); RosterEntry rosterEntry = roster.getEntry(jid); if (rosterEntry != null) { // Check for new Roster Groups and add them if they do not exist. boolean isUnfiled = true; for (RosterGroup group : rosterEntry.getGroups()) { isUnfiled = false; // Handle if this is a new Entry in a new Group. if (getContactGroup(group.getName()) == null) { // Create group. ContactGroup contactGroup = addContactGroup(group.getName()); contactGroup.setVisible(false); contactGroup = getContactGroup(group.getName()); String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } ContactItem contactItem = new ContactItem(name, rosterEntry.getUser()); contactGroup.addContactItem(contactItem); Presence presence = roster.getPresence(jid); contactItem.setPresence(presence); if (presence != null) { contactGroup.setVisible(true); } } else { ContactGroup contactGroup = getContactGroup(group.getName()); ContactItem item = offlineGroup.getContactItemByJID(jid); if (item == null) { item = contactGroup.getContactItemByJID(jid); } // Check to see if this entry is new to a pre-existing group. if (item == null) { String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } item = new ContactItem(name, rosterEntry.getUser()); Presence presence = roster.getPresence(jid); item.setPresence(presence); if (presence != null) { contactGroup.addContactItem(item); contactGroup.fireContactGroupUpdated(); } else { offlineGroup.addContactItem(item); offlineGroup.fireContactGroupUpdated(); } } // If not, just update their presence. else { Presence presence = roster.getPresence(jid); item.setPresence(presence); updateUserPresence(presence); contactGroup.fireContactGroupUpdated(); } } } // Now check to see if groups have been modified or removed. This is used // to check if Contact Groups have been renamed or removed. final Set<String> groupSet = new HashSet<String>(); jids = addresses.iterator(); while (jids.hasNext()) { jid = (String)jids.next(); rosterEntry = roster.getEntry(jid); for (RosterGroup g : rosterEntry.getGroups()) { groupSet.add(g.getName()); } for (ContactGroup group : new ArrayList<ContactGroup>(getContactGroups())) { if (group.getContactItemByJID(jid) != null && group != unfiledGroup && group != offlineGroup) { if (!groupSet.contains(group.getGroupName())) { removeContactGroup(group); } } } } if (!isUnfiled) { return; } ContactItem unfiledItem = unfiledGroup.getContactItemByJID(jid); if (unfiledItem != null) { } else { ContactItem offlineItem = offlineGroup.getContactItemByJID(jid); if (offlineItem != null) { if ((rosterEntry.getType() == RosterPacket.ItemType.NONE || rosterEntry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == rosterEntry.getStatus()) { // Remove from offlineItem and add to unfiledItem. offlineGroup.removeContactItem(offlineItem); unfiledGroup.addContactItem(offlineItem); unfiledGroup.fireContactGroupUpdated(); unfiledGroup.setVisible(true); } } } } } } }); }
private synchronized void handleEntriesUpdated(final Collection addresses) { SwingUtilities.invokeLater(new Runnable() { public void run() { Roster roster = SparkManager.getConnection().getRoster(); Iterator jids = addresses.iterator(); while (jids.hasNext()) { String jid = (String)jids.next(); RosterEntry rosterEntry = roster.getEntry(jid); if (rosterEntry != null) { // Check for new Roster Groups and add them if they do not exist. boolean isUnfiled = true; for (RosterGroup group : rosterEntry.getGroups()) { isUnfiled = false; // Handle if this is a new Entry in a new Group. if (getContactGroup(group.getName()) == null) { // Create group. ContactGroup contactGroup = addContactGroup(group.getName()); contactGroup.setVisible(false); contactGroup = getContactGroup(group.getName()); String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } ContactItem contactItem = new ContactItem(name, rosterEntry.getUser()); contactGroup.addContactItem(contactItem); Presence presence = roster.getPresence(jid); contactItem.setPresence(presence); if (presence != null) { contactGroup.setVisible(true); } } else { ContactGroup contactGroup = getContactGroup(group.getName()); ContactItem item = offlineGroup.getContactItemByJID(jid); if (item == null) { item = contactGroup.getContactItemByJID(jid); } // Check to see if this entry is new to a pre-existing group. if (item == null) { String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } item = new ContactItem(name, rosterEntry.getUser()); Presence presence = roster.getPresence(jid); item.setPresence(presence); if (presence != null) { contactGroup.addContactItem(item); contactGroup.fireContactGroupUpdated(); } else { offlineGroup.addContactItem(item); offlineGroup.fireContactGroupUpdated(); } } // If not, just update their presence. else { Presence presence = roster.getPresence(jid); item.setPresence(presence); updateUserPresence(presence); contactGroup.fireContactGroupUpdated(); } } } // Now check to see if groups have been modified or removed. This is used // to check if Contact Groups have been renamed or removed. final Set<String> groupSet = new HashSet<String>(); jids = addresses.iterator(); while (jids.hasNext()) { jid = (String)jids.next(); rosterEntry = roster.getEntry(jid); for (RosterGroup g : rosterEntry.getGroups()) { groupSet.add(g.getName()); } for (ContactGroup group : new ArrayList<ContactGroup>(getContactGroups())) { if (group.getContactItemByJID(jid) != null && group != unfiledGroup && group != offlineGroup) { if (!groupSet.contains(group.getGroupName())) { removeContactGroup(group); } } } } if (!isUnfiled) { return; } ContactItem unfiledItem = unfiledGroup.getContactItemByJID(jid); if (unfiledItem != null) { } else { ContactItem offlineItem = offlineGroup.getContactItemByJID(jid); if (offlineItem != null) { if ((rosterEntry.getType() == RosterPacket.ItemType.NONE || rosterEntry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == rosterEntry.getStatus()) { // Remove from offlineItem and add to unfiledItem. offlineGroup.removeContactItem(offlineItem); unfiledGroup.addContactItem(offlineItem); unfiledGroup.fireContactGroupUpdated(); unfiledGroup.setVisible(true); } } } } } } }); }
3,234,103
public void run() { Roster roster = SparkManager.getConnection().getRoster(); Iterator jids = addresses.iterator(); while (jids.hasNext()) { String jid = (String)jids.next(); RosterEntry rosterEntry = roster.getEntry(jid); if (rosterEntry != null) { // Check for new Roster Groups and add them if they do not exist. boolean isUnfiled = true; for (RosterGroup group : rosterEntry.getGroups()) { isUnfiled = false; // Handle if this is a new Entry in a new Group. if (getContactGroup(group.getName()) == null) { // Create group. ContactGroup contactGroup = addContactGroup(group.getName()); contactGroup.setVisible(false); contactGroup = getContactGroup(group.getName()); String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } ContactItem contactItem = new ContactItem(name, rosterEntry.getUser()); contactGroup.addContactItem(contactItem); Presence presence = roster.getPresence(jid); contactItem.setPresence(presence); if (presence != null) { contactGroup.setVisible(true); } } else { ContactGroup contactGroup = getContactGroup(group.getName()); ContactItem item = offlineGroup.getContactItemByJID(jid); if (item == null) { item = contactGroup.getContactItemByJID(jid); } // Check to see if this entry is new to a pre-existing group. if (item == null) { String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } item = new ContactItem(name, rosterEntry.getUser()); Presence presence = roster.getPresence(jid); item.setPresence(presence); if (presence != null) { contactGroup.addContactItem(item); contactGroup.fireContactGroupUpdated(); } else { offlineGroup.addContactItem(item); offlineGroup.fireContactGroupUpdated(); } } // If not, just update their presence. else { Presence presence = roster.getPresence(jid); item.setPresence(presence); updateUserPresence(presence); contactGroup.fireContactGroupUpdated(); } } } // Now check to see if groups have been modified or removed. This is used // to check if Contact Groups have been renamed or removed. final Set<String> groupSet = new HashSet<String>(); jids = addresses.iterator(); while (jids.hasNext()) { jid = (String)jids.next(); rosterEntry = roster.getEntry(jid); for (RosterGroup g : rosterEntry.getGroups()) { groupSet.add(g.getName()); } for (ContactGroup group : new ArrayList<ContactGroup>(getContactGroups())) { if (group.getContactItemByJID(jid) != null && group != unfiledGroup && group != offlineGroup) { if (!groupSet.contains(group.getGroupName())) { removeContactGroup(group); } } } } if (!isUnfiled) { return; } ContactItem unfiledItem = unfiledGroup.getContactItemByJID(jid); if (unfiledItem != null) { } else { ContactItem offlineItem = offlineGroup.getContactItemByJID(jid); if (offlineItem != null) { if ((rosterEntry.getType() == RosterPacket.ItemType.NONE || rosterEntry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == rosterEntry.getStatus()) { // Remove from offlineItem and add to unfiledItem. offlineGroup.removeContactItem(offlineItem); unfiledGroup.addContactItem(offlineItem); unfiledGroup.fireContactGroupUpdated(); unfiledGroup.setVisible(true); } } } } } }
public void run() { Roster roster = SparkManager.getConnection().getRoster(); Iterator jids = addresses.iterator(); while (jids.hasNext()) { String jid = (String)jids.next(); RosterEntry rosterEntry = roster.getEntry(jid); if (rosterEntry != null) { // Check for new Roster Groups and add them if they do not exist. boolean isUnfiled = true; for (RosterGroup group : rosterEntry.getGroups()) { isUnfiled = false; // Handle if this is a new Entry in a new Group. if (getContactGroup(group.getName()) == null) { // Create group. ContactGroup contactGroup = addContactGroup(group.getName()); contactGroup.setVisible(false); contactGroup = getContactGroup(group.getName()); String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } ContactItem contactItem = new ContactItem(name, rosterEntry.getUser()); contactGroup.addContactItem(contactItem); Presence presence = roster.getPresence(jid); contactItem.setPresence(presence); if (presence != null) { contactGroup.setVisible(true); } } else { ContactGroup contactGroup = getContactGroup(group.getName()); ContactItem item = offlineGroup.getContactItemByJID(jid); if (item == null) { item = contactGroup.getContactItemByJID(jid); } // Check to see if this entry is new to a pre-existing group. if (item == null) { String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } item = new ContactItem(name, rosterEntry.getUser()); Presence presence = roster.getPresence(jid); item.setPresence(presence); if (presence != null) { contactGroup.addContactItem(item); contactGroup.fireContactGroupUpdated(); } else { offlineGroup.addContactItem(item); offlineGroup.fireContactGroupUpdated(); } } // If not, just update their presence. else { Presence presence = roster.getPresence(jid); item.setPresence(presence); updateUserPresence(presence); contactGroup.fireContactGroupUpdated(); } } } // Now check to see if groups have been modified or removed. This is used // to check if Contact Groups have been renamed or removed. final Set<String> groupSet = new HashSet<String>(); jids = addresses.iterator(); while (jids.hasNext()) { jid = (String)jids.next(); rosterEntry = roster.getEntry(jid); for (RosterGroup g : rosterEntry.getGroups()) { groupSet.add(g.getName()); } for (ContactGroup group : new ArrayList<ContactGroup>(getContactGroups())) { if (group.getContactItemByJID(jid) != null && group != unfiledGroup && group != offlineGroup) { if (!groupSet.contains(group.getGroupName())) { removeContactGroup(group); } } } } if (!isUnfiled) { return; } ContactItem unfiledItem = unfiledGroup.getContactItemByJID(jid); if (unfiledItem != null) { } else { ContactItem offlineItem = offlineGroup.getContactItemByJID(jid); if (offlineItem != null) { if ((rosterEntry.getType() == RosterPacket.ItemType.NONE || rosterEntry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == rosterEntry.getStatus()) { // Remove from offlineItem and add to unfiledItem. offlineGroup.removeContactItem(offlineItem); unfiledGroup.addContactItem(offlineItem); unfiledGroup.fireContactGroupUpdated(); unfiledGroup.setVisible(true); } } } } } }
3,234,104
public void actionPerformed(ActionEvent actionEvent) { SparkManager.getTransferManager().sendFileTo(item); }
public void actionPerformed(ActionEvent actionEvent) { SparkManager.getTransferManager().sendFileTo(item); }
3,234,105
public void actionPerformed(ActionEvent e) { removeContactFromRoster(item); }
public void actionPerformed(ActionEvent e) { VCardManager vcardSupport = SparkManager.getVCardManager(); String jid = item.getFullJID(); vcardSupport.viewProfile(jid, SparkManager.getWorkspace()); }
3,234,106
public void actionPerformed(ActionEvent e) { VCardManager vcardSupport = SparkManager.getVCardManager(); String jid = item.getFullJID(); vcardSupport.viewProfile(jid, SparkManager.getWorkspace()); }
public void actionPerformed(ActionEvent e) { VCardManager vcardSupport = SparkManager.getVCardManager(); String jid = item.getFullJID(); vcardSupport.viewProfile(jid, SparkManager.getWorkspace()); }
3,234,107
public void actionPerformed(ActionEvent actionEvent) { try { LastActivity activity = LastActivity.getLastActivity(SparkManager.getConnection(), item.getFullJID()); long idleTime = (activity.getIdleTime() * 1000); String time = ModelUtil.getTimeFromLong(idleTime); JOptionPane.showMessageDialog(getGUI(), Res.getString("message.idle.for", time), Res.getString("title.last.activity"), JOptionPane.INFORMATION_MESSAGE); } catch (XMPPException e1) { } }
public void actionPerformed(ActionEvent actionEvent) { try { LastActivity activity = LastActivity.getLastActivity(SparkManager.getConnection(), item.getFullJID()); long idleTime = (activity.getIdleTime() * 1000); String time = ModelUtil.getTimeFromLong(idleTime); JOptionPane.showMessageDialog(getGUI(), Res.getString("message.idle.for", time), Res.getString("title.last.activity"), JOptionPane.INFORMATION_MESSAGE); } catch (XMPPException e1) { } }
3,234,108
public void actionPerformed(ActionEvent e) { String jid = item.getFullJID(); Presence response = new Presence(Presence.Type.subscribe); response.setTo(jid); SparkManager.getConnection().sendPacket(response); }
public void actionPerformed(ActionEvent e) { String jid = item.getFullJID(); Presence response = new Presence(Presence.Type.subscribe); response.setTo(jid); SparkManager.getConnection().sendPacket(response); }
3,234,110
public void actionPerformed(ActionEvent e) { SparkManager.getWorkspace().removeAlert(layoutPanel); Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); int ok = JOptionPane.showConfirmDialog(getGUI(), Res.getString("message.add.user"), Res.getString("message.add.to.roster"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.OK_OPTION) { RosterDialog rosterDialog = new RosterDialog(); rosterDialog.setDefaultJID(UserManager.unescapeJID(jid)); rosterDialog.showRosterDialog(); } }
public void actionPerformed(ActionEvent e) { SparkManager.getWorkspace().removeAlert(layoutPanel); Presence response = new Presence(Presence.Type.unsubscribe); response.setTo(jid); SparkManager.getConnection().sendPacket(response); int ok = JOptionPane.showConfirmDialog(getGUI(), Res.getString("message.add.user"), Res.getString("message.add.to.roster"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.OK_OPTION) { RosterDialog rosterDialog = new RosterDialog(); rosterDialog.setDefaultJID(UserManager.unescapeJID(jid)); rosterDialog.showRosterDialog(); } }
3,234,111
public void actionPerformed(ActionEvent e) { SparkManager.getWorkspace().removeAlert(layoutPanel); Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); int ok = JOptionPane.showConfirmDialog(getGUI(), Res.getString("message.add.user"), Res.getString("message.add.to.roster"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.OK_OPTION) { RosterDialog rosterDialog = new RosterDialog(); rosterDialog.setDefaultJID(UserManager.unescapeJID(jid)); rosterDialog.showRosterDialog(); } }
publicvoidactionPerformed(ActionEvente){SparkManager.getWorkspace().removeAlert(layoutPanel);Presenceresponse=newPresence(Presence.Type.subscribed);response.setTo(jid);SparkManager.getConnection().sendPacket(response);intok=JOptionPane.showConfirmDialog(getGUI(),Res.getString("message.add.user"),Res.getString("message.add.to.roster"),JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE);if(ok==JOptionPane.OK_OPTION){RosterDialogrosterDialog=newRosterDialog();rosterDialog.setDefaultJID(UserManager.unescapeJID(jid));rosterDialog.showRosterDialog();}}
3,234,112
public void actionPerformed(ActionEvent e) { SparkManager.getWorkspace().removeAlert(layoutPanel); Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); int ok = JOptionPane.showConfirmDialog(getGUI(), Res.getString("message.add.user"), Res.getString("message.add.to.roster"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.OK_OPTION) { RosterDialog rosterDialog = new RosterDialog(); rosterDialog.setDefaultJID(UserManager.unescapeJID(jid)); rosterDialog.showRosterDialog(); } }
public void actionPerformed(ActionEvent e) { SparkManager.getWorkspace().removeAlert(layoutPanel); Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); int ok = JOptionPane.showConfirmDialog(getGUI(), Res.getString("message.add.user"), Res.getString("message.add.to.roster"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.OK_OPTION) { RosterDialog rosterDialog = new RosterDialog(); rosterDialog.setDefaultJID(UserManager.unescapeJID(jid)); rosterDialog.showRosterDialog(); } }
3,234,113
public void actionPerformed(ActionEvent e) { SparkManager.getWorkspace().removeAlert(layoutPanel); // Send subscribed Presence response = new Presence(Presence.Type.unsubscribe); response.setTo(jid); SparkManager.getConnection().sendPacket(response); }
public void actionPerformed(ActionEvent e) { SparkManager.getWorkspace().removeAlert(layoutPanel); // Send subscribed Presence response = new Presence(Presence.Type.unsubscribe); response.setTo(jid); SparkManager.getConnection().sendPacket(response); }
3,234,114
private void updateUserPresence(Presence presence) { if (presence == null) { return; } Roster roster = SparkManager.getConnection().getRoster(); final String bareJID = StringUtils.parseBareAddress(presence.getFrom()); RosterEntry entry = roster.getEntry(bareJID); boolean isPending = entry != null && (entry.getType() == RosterPacket.ItemType.NONE || entry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == entry.getStatus(); // If online, check to see if they are in the offline group. // If so, remove from offline group and add to all groups they // belong to. if (presence.getType() == Presence.Type.available && offlineGroup.getContactItemByJID(bareJID) != null) { changeOfflineToOnline(bareJID, entry, presence); } else if (presence.getFrom().indexOf("workgroup.") != -1) { changeOfflineToOnline(bareJID, entry, presence); } // If online, but not in offline group, update presence. else if (presence.getType() == Presence.Type.available) { final Iterator groupIterator = groupList.iterator(); while (groupIterator.hasNext()) { ContactGroup group = (ContactGroup)groupIterator.next(); ContactItem item = group.getContactItemByJID(bareJID); if (item != null) { item.setPresence(presence); group.fireContactGroupUpdated(); } } } // If not available, move to offline group. else if (presence.getType() == Presence.Type.unavailable && !isPending) { presence = roster.getPresence(bareJID); if (presence == null) { moveToOfflineGroup(bareJID); } } }
private void updateUserPresence(Presence presence) { if (presence == null) { return; } Roster roster = SparkManager.getConnection().getRoster(); final String bareJID = StringUtils.parseBareAddress(presence.getFrom()); RosterEntry entry = roster.getEntry(bareJID); boolean isPending = entry != null && (entry.getType() == RosterPacket.ItemType.NONE || entry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == entry.getStatus(); // If online, check to see if they are in the offline group. // If so, remove from offline group and add to all groups they // belong to. if (presence.getType() == Presence.Type.available && offlineGroup.getContactItemByJID(bareJID) != null) { changeOfflineToOnline(bareJID, entry, presence); } else if (presence.getFrom().indexOf("workgroup.") != -1) { changeOfflineToOnline(bareJID, entry, presence); } // If online, but not in offline group, update presence. else if (presence.getType() == Presence.Type.available) { final Iterator groupIterator = groupList.iterator(); while (groupIterator.hasNext()) { ContactGroup group = (ContactGroup)groupIterator.next(); ContactItem item = group.getContactItemByJID(bareJID); if (item != null) { item.setPresence(presence); group.fireContactGroupUpdated(); } } } // If not available, move to offline group. else if (presence.getType() == Presence.Type.unavailable && !isPending) { presence = roster.getPresence(bareJID); if (presence == null) { moveToOfflineGroup(bareJID); } } }
3,234,115
public void doMouseClicked(PInputEvent e) { if (postLinkCompletion == true) return; // we only scale if we're not drawing a link. // System.err.println("mouse clicked.."+e); //System.err.println("link state is "+linkState); if (linkState != NOT_LINKING) { if (linkState == LINKING_CANCELLATION) { //System.err.println("cancelled link. set to not linking"); linkState = NOT_LINKING; } //System.err.println("linking..."); e.setHandled(true); return; } if (postPopup == true) { //System.err.println("post popup"); postPopup = false; e.setHandled(true); return; } PNode node = e.getPickedNode(); //System.err.println("mouse clicked on .."+node); int mask = e.getModifiers() & allButtonMask; // if it's a buffered object that is not a chain. if (node instanceof BufferedObject && !(node instanceof ChainView)) { BufferedObject mod = (BufferedObject) node; PCamera camera = canvas.getCamera(); if (mask == MouseEvent.BUTTON1_MASK && e.getClickCount()==1) { //System.err.println("zooming in on node..."); PBounds b = mod.getBufferedBounds(); camera.animateViewToCenterBounds(b,true, Constants.ANIMATION_DELAY); } else if (e.isControlDown() || (mask & MouseEvent.BUTTON3_MASK)==1) { //System.err.println("canvas right click.."); evaluatePopup(e); } } // otherwise, must be a camera, or a chain. either way, zoom in/out //if (! (node instanceof PCamera)) // return; if (e.isShiftDown()) { //System.err.println("zoomed with shhift.."); PBounds b = canvas.getBufferedBounds(); canvas.getCamera().animateViewToCenterBounds(b,true,Constants.ANIMATION_DELAY); e.setHandled(true); } else { //System.err.println("zoomed witout shift..."); double scaleFactor = Constants.SCALE_FACTOR; if (e.isControlDown() || ((mask & MouseEvent.BUTTON3_MASK)==1)) { //System.err.println("but wit control..."); scaleFactor = 1/scaleFactor; } zoom(scaleFactor,e); e.setHandled(true); } }
public void doMouseClicked(PInputEvent e) { if (postLinkCompletion == true) return; // we only scale if we're not drawing a link. // System.err.println("mouse clicked.."+e); //System.err.println("link state is "+linkState); if (linkState != NOT_LINKING) { if (linkState == LINKING_CANCELLATION) { //System.err.println("cancelled link. set to not linking"); linkState = NOT_LINKING; } //System.err.println("linking..."); e.setHandled(true); return; } if (postPopup == true) { //System.err.println("post popup"); postPopup = false; e.setHandled(true); return; } PNode node = e.getPickedNode(); //System.err.println("mouse clicked on .."+node); int mask = e.getModifiers() & allButtonMask; // if it's a buffered object that is not a chain. if (node instanceof BufferedObject && !(node instanceof ChainView)) { BufferedObject mod = (BufferedObject) node; PCamera camera = canvas.getCamera(); if (mask == MouseEvent.BUTTON1_MASK && e.getClickCount()==1) { //System.err.println("zooming in on node..."); PBounds b = mod.getBufferedBounds(); camera.animateViewToCenterBounds(b,true, Constants.ANIMATION_DELAY); } else if (e.isControlDown() || (mask & MouseEvent.BUTTON3_MASK)==1) { //System.err.println("canvas right click.."); evaluatePopup(e); } } // otherwise, must be a camera, or a chain. either way, zoom in/out //if (! (node instanceof PCamera)) // return; if (e.isShiftDown()) { //System.err.println("zoomed with shhift.."); PBounds b = canvas.getBufferedBounds(); canvas.getCamera().animateViewToCenterBounds(b,true,Constants.ANIMATION_DELAY); e.setHandled(true); } else { //System.err.println("zoomed witout shift..."); double scaleFactor = Constants.SCALE_FACTOR; if (e.isControlDown() || ((mask & MouseEvent.BUTTON3_MASK)==1)) { //System.err.println("but wit control..."); scaleFactor = 1/scaleFactor; } zoom(scaleFactor,e); e.setHandled(true); } }
3,234,116
public void doMouseClicked(PInputEvent e) { if (postLinkCompletion == true) return; // we only scale if we're not drawing a link. // System.err.println("mouse clicked.."+e); //System.err.println("link state is "+linkState); if (linkState != NOT_LINKING) { if (linkState == LINKING_CANCELLATION) { //System.err.println("cancelled link. set to not linking"); linkState = NOT_LINKING; } //System.err.println("linking..."); e.setHandled(true); return; } if (postPopup == true) { //System.err.println("post popup"); postPopup = false; e.setHandled(true); return; } PNode node = e.getPickedNode(); //System.err.println("mouse clicked on .."+node); int mask = e.getModifiers() & allButtonMask; // if it's a buffered object that is not a chain. if (node instanceof BufferedObject && !(node instanceof ChainView)) { BufferedObject mod = (BufferedObject) node; PCamera camera = canvas.getCamera(); if (mask == MouseEvent.BUTTON1_MASK && e.getClickCount()==1) { //System.err.println("zooming in on node..."); PBounds b = mod.getBufferedBounds(); camera.animateViewToCenterBounds(b,true, Constants.ANIMATION_DELAY); } else if (e.isControlDown() || (mask & MouseEvent.BUTTON3_MASK)==1) { //System.err.println("canvas right click.."); evaluatePopup(e); } } // otherwise, must be a camera, or a chain. either way, zoom in/out //if (! (node instanceof PCamera)) // return; if (e.isShiftDown()) { //System.err.println("zoomed with shhift.."); PBounds b = canvas.getBufferedBounds(); canvas.getCamera().animateViewToCenterBounds(b,true,Constants.ANIMATION_DELAY); e.setHandled(true); } else { //System.err.println("zoomed witout shift..."); double scaleFactor = Constants.SCALE_FACTOR; if (e.isControlDown() || ((mask & MouseEvent.BUTTON3_MASK)==1)) { //System.err.println("but wit control..."); scaleFactor = 1/scaleFactor; } zoom(scaleFactor,e); e.setHandled(true); } }
public void doMouseClicked(PInputEvent e) { if (postLinkCompletion == true) return; // we only scale if we're not drawing a link. // System.err.println("mouse clicked.."+e); //System.err.println("link state is "+linkState); if (linkState != NOT_LINKING) { if (linkState == LINKING_CANCELLATION) { //System.err.println("cancelled link. set to not linking"); linkState = NOT_LINKING; } //System.err.println("linking..."); e.setHandled(true); return; } if (postPopup == true) { //System.err.println("post popup"); postPopup = false; e.setHandled(true); return; } PNode node = e.getPickedNode(); //System.err.println("mouse clicked on .."+node); int mask = e.getModifiers() & allButtonMask; // if it's a buffered object that is not a chain. if (node instanceof BufferedObject && !(node instanceof ChainView)) { BufferedObject mod = (BufferedObject) node; PCamera camera = canvas.getCamera(); if (mask == MouseEvent.BUTTON1_MASK && e.getClickCount()==1) { //System.err.println("zooming in on node..."); PBounds b = mod.getBufferedBounds(); camera.animateViewToCenterBounds(b,true, Constants.ANIMATION_DELAY); } else if (e.isControlDown() || (mask & MouseEvent.BUTTON3_MASK)==1) { //System.err.println("canvas right click.."); evaluatePopup(e); } } // otherwise, must be a camera, or a chain. either way, zoom in/out //if (! (node instanceof PCamera)) // return; if (e.isShiftDown()) { //System.err.println("zoomed with shhift.."); PBounds b = canvas.getBufferedBounds(); canvas.getCamera().animateViewToCenterBounds(b,true,Constants.ANIMATION_DELAY); e.setHandled(true); } else { //System.err.println("zoomed witout shift..."); double scaleFactor = Constants.SCALE_FACTOR; if (e.isControlDown() || ((mask & MouseEvent.BUTTON3_MASK)==1)) { //System.err.println("but wit control..."); scaleFactor = 1/scaleFactor; } zoom(scaleFactor,e); e.setHandled(true); } }
3,234,117
public void doMouseClicked(PInputEvent e) { if (postLinkCompletion == true) return; // we only scale if we're not drawing a link. // System.err.println("mouse clicked.."+e); //System.err.println("link state is "+linkState); if (linkState != NOT_LINKING) { if (linkState == LINKING_CANCELLATION) { //System.err.println("cancelled link. set to not linking"); linkState = NOT_LINKING; } //System.err.println("linking..."); e.setHandled(true); return; } if (postPopup == true) { //System.err.println("post popup"); postPopup = false; e.setHandled(true); return; } PNode node = e.getPickedNode(); //System.err.println("mouse clicked on .."+node); int mask = e.getModifiers() & allButtonMask; // if it's a buffered object that is not a chain. if (node instanceof BufferedObject && !(node instanceof ChainView)) { BufferedObject mod = (BufferedObject) node; PCamera camera = canvas.getCamera(); if (mask == MouseEvent.BUTTON1_MASK && e.getClickCount()==1) { //System.err.println("zooming in on node..."); PBounds b = mod.getBufferedBounds(); camera.animateViewToCenterBounds(b,true, Constants.ANIMATION_DELAY); } else if (e.isControlDown() || (mask & MouseEvent.BUTTON3_MASK)==1) { //System.err.println("canvas right click.."); evaluatePopup(e); } } // otherwise, must be a camera, or a chain. either way, zoom in/out //if (! (node instanceof PCamera)) // return; if (e.isShiftDown()) { //System.err.println("zoomed with shhift.."); PBounds b = canvas.getBufferedBounds(); canvas.getCamera().animateViewToCenterBounds(b,true,Constants.ANIMATION_DELAY); e.setHandled(true); } else { //System.err.println("zoomed witout shift..."); double scaleFactor = Constants.SCALE_FACTOR; if (e.isControlDown() || ((mask & MouseEvent.BUTTON3_MASK)==1)) { //System.err.println("but wit control..."); scaleFactor = 1/scaleFactor; } zoom(scaleFactor,e); e.setHandled(true); } }
public void doMouseClicked(PInputEvent e) { if (postLinkCompletion == true) return; // we only scale if we're not drawing a link. // System.err.println("mouse clicked.."+e); //System.err.println("link state is "+linkState); if (linkState != NOT_LINKING) { if (linkState == LINKING_CANCELLATION) { //System.err.println("cancelled link. set to not linking"); linkState = NOT_LINKING; } //System.err.println("linking..."); e.setHandled(true); return; } if (postPopup == true) { //System.err.println("post popup"); postPopup = false; e.setHandled(true); return; } PNode node = e.getPickedNode(); //System.err.println("mouse clicked on .."+node); int mask = e.getModifiers() & allButtonMask; // if it's a buffered object that is not a chain. if (node instanceof BufferedObject && !(node instanceof ChainView)) { BufferedObject mod = (BufferedObject) node; PCamera camera = canvas.getCamera(); if (mask == MouseEvent.BUTTON1_MASK && e.getClickCount()==1) { //System.err.println("zooming in on node..."); PBounds b = mod.getBufferedBounds(); camera.animateViewToCenterBounds(b,true, Constants.ANIMATION_DELAY); } else if (e.isControlDown() || (mask & MouseEvent.BUTTON3_MASK)==1) { //System.err.println("canvas right click.."); evaluatePopup(e); } } // otherwise, must be a camera, or a chain. either way, zoom in/out //if (! (node instanceof PCamera)) // return; if (e.isShiftDown()) { //System.err.println("zoomed with shhift.."); PBounds b = canvas.getBufferedBounds(); canvas.getCamera().animateViewToCenterBounds(b,true,Constants.ANIMATION_DELAY); e.setHandled(true); } else { //System.err.println("zoomed witout shift..."); double scaleFactor = Constants.SCALE_FACTOR; if (e.isControlDown() || ((mask & MouseEvent.BUTTON3_MASK)==1)) { //System.err.println("but wit control..."); scaleFactor = 1/scaleFactor; } zoom(scaleFactor,e); e.setHandled(true); } }
3,234,118
private void finishModuleTargetLink(ModuleLinkTarget n) { //first, if input and output are the same, barf. if (n.getModuleView() == moduleLinkOriginTarget.getModuleView()) { showSelfLinkError(); cancelModuleTargetLink(); return; } else if (n.isInputLinkTarget() && moduleLinkOriginTarget.isInputLinkTarget()) { canvas.setStatusLabel(NO_INPUT_INPUT_LINKS); cancelModuleTargetLink(); return; } else if (n.isOutputLinkTarget() && moduleLinkOriginTarget.isOutputLinkTarget()) { canvas.setStatusLabel(NO_OUTPUT_OUTPUT_LINKS); cancelModuleTargetLink(); return; } // System.err.println("finishing module target link"); // ok. now, create links and make sure we have no cycles. // get inputs & get outputs Collection params1 = moduleLinkOriginTarget.getParameters(); Collection params2 = n.getParameters(); // set other end point of link. moduleLink.setTarget(n); if (finishModuleTargetLink(params1,params2) == false) { cancelModuleTargetLink(); return; } if (foundCycle() == true) { canvas.setStatusLabel(NO_CYCLES); cancelModuleTargetLink(); } else { cleanUpModuleTargetLink(); } moduleLinkOriginTarget = null; linkState = NOT_LINKING; }
private void finishModuleTargetLink(ModuleLinkTarget n) { //first, if input and output are the same, barf. if (n.getModuleView() == moduleLinkOriginTarget.getModuleView()) { showSelfLinkError(); cancelModuleTargetLink(); return; } else if (n.isInputLinkTarget() && moduleLinkOriginTarget.isInputLinkTarget()) { canvas.setStatusLabel(NO_INPUT_INPUT_LINKS); cancelModuleTargetLink(); return; } else if (n.isOutputLinkTarget() && moduleLinkOriginTarget.isOutputLinkTarget()) { canvas.setStatusLabel(NO_OUTPUT_OUTPUT_LINKS); cancelModuleTargetLink(); return; } // System.err.println("finishing module target link"); // ok. now, create links and make sure we have no cycles. // get inputs & get outputs Collection params1 = moduleLinkOriginTarget.getParameters(); Collection params2 = n.getParameters(); // set other end point of link. moduleLink.setTarget(n); if (finishModuleTargetLink(params1,params2) == false) { cancelModuleTargetLink(); return; } if (foundCycle() == true) { canvas.setStatusLabel(NO_CYCLES); cancelModuleTargetLink(); } else { cleanUpModuleTargetLink(); } moduleLinkOriginTarget = null; linkState = NOT_LINKING; }
3,234,122
private void finishModuleTargetLink(ModuleLinkTarget n) { //first, if input and output are the same, barf. if (n.getModuleView() == moduleLinkOriginTarget.getModuleView()) { showSelfLinkError(); cancelModuleTargetLink(); return; } else if (n.isInputLinkTarget() && moduleLinkOriginTarget.isInputLinkTarget()) { canvas.setStatusLabel(NO_INPUT_INPUT_LINKS); cancelModuleTargetLink(); return; } else if (n.isOutputLinkTarget() && moduleLinkOriginTarget.isOutputLinkTarget()) { canvas.setStatusLabel(NO_OUTPUT_OUTPUT_LINKS); cancelModuleTargetLink(); return; } // System.err.println("finishing module target link"); // ok. now, create links and make sure we have no cycles. // get inputs & get outputs Collection params1 = moduleLinkOriginTarget.getParameters(); Collection params2 = n.getParameters(); // set other end point of link. moduleLink.setTarget(n); if (finishModuleTargetLink(params1,params2) == false) { cancelModuleTargetLink(); return; } if (foundCycle() == true) { canvas.setStatusLabel(NO_CYCLES); cancelModuleTargetLink(); } else { cleanUpModuleTargetLink(); } moduleLinkOriginTarget = null; linkState = NOT_LINKING; }
privatevoidfinishModuleTargetLink(ModuleLinkTargetn){ //first,ifinputandoutputarethesame,barf. if(n.getModuleView()==moduleLinkOriginTarget.getModuleView()){ showSelfLinkError(); cancelModuleTargetLink(); return; } elseif(n.isInputLinkTarget()&& moduleLinkOriginTarget.isInputLinkTarget()){ canvas.setStatusLabel(NO_INPUT_INPUT_LINKS); cancelModuleTargetLink(); return; } elseif(n.isOutputLinkTarget()&& moduleLinkOriginTarget.isOutputLinkTarget()){ canvas.setStatusLabel(NO_OUTPUT_OUTPUT_LINKS); cancelModuleTargetLink(); return; } // System.err.println("finishingmoduletargetlink"); //ok.now,createlinksandmakesurewehavenocycles. //getinputs&getoutputs Collectionparams1=moduleLinkOriginTarget.getParameters(); Collectionparams2=n.getParameters(); //setotherendpointoflink. moduleLink.setTarget(n); if(finishModuleTargetLink(params1,params2)==false){ cancelModuleTargetLink(); return; } if(foundCycle()==true){ canvas.setStatusLabel(NO_CYCLES); cancelModuleTargetLink(); } else{ cleanUpModuleTargetLink(); } moduleLinkOriginTarget=null; linkState=NOT_LINKING; }
3,234,123
public void mouseEntered(PInputEvent e) { PNode node = e.getPickedNode(); if (node instanceof FormalParameter) { lastParameterEntered = (FormalParameter) node; //System.err.println("mouse entered last entered.."+ if (linkState == NOT_LINKING) { // turn on params for this parameter lastParameterEntered.setParamsHighlighted(true); // set all modules of this same type to be highlighted. ModuleView mod = lastParameterEntered.getModuleView(); mod.setModulesHighlighted(true); } e.setHandled(true); } else if (node instanceof ModuleLinkTarget && linkState == NOT_LINKING) { ((ModuleLinkTarget) node).setParametersHighlighted(true); //ModuleView mod = ((ModuleLinkTarget) node).getModuleView(); //mod.setAllHighlights(true); e.setHandled(true); } else if (node instanceof ModuleView && linkState == NOT_LINKING) { ModuleView mod = (ModuleView) node; // highlight all matching params.. mod.setModulesHighlighted(true); mod.setAllHighlights(true); e.setHandled(true); } else { super.mouseEntered(e); } }
public void mouseEntered(PInputEvent e) { PNode node = e.getPickedNode(); if (node instanceof FormalParameter) { lastParameterEntered = (FormalParameter) node; //System.err.println("mouse entered last entered.."+ if (linkState == NOT_LINKING) { // turn on params for this parameter lastParameterEntered.setParamsHighlighted(true); // set all modules of this same type to be highlighted. ModuleView mod = lastParameterEntered.getModuleView(); mod.setModulesHighlighted(true); } e.setHandled(true); } else if (node instanceof ModuleLinkTarget && linkState == NOT_LINKING) { ((ModuleLinkTarget) node).setParametersHighlighted(true); //ModuleView mod = ((ModuleLinkTarget) node).getModuleView(); //mod.setAllHighlights(true); e.setHandled(true); } else if (node instanceof ModuleView && linkState == NOT_LINKING) { ModuleView mod = (ModuleView) node; // highlight all matching params.. mod.setModulesHighlighted(true); mod.setAllHighlights(true); e.setHandled(true); } else { super.mouseEntered(e); } }
3,234,124
public void mouseEntered(PInputEvent e) { PNode node = e.getPickedNode(); if (node instanceof FormalParameter) { lastParameterEntered = (FormalParameter) node; //System.err.println("mouse entered last entered.."+ if (linkState == NOT_LINKING) { // turn on params for this parameter lastParameterEntered.setParamsHighlighted(true); // set all modules of this same type to be highlighted. ModuleView mod = lastParameterEntered.getModuleView(); mod.setModulesHighlighted(true); } e.setHandled(true); } else if (node instanceof ModuleLinkTarget && linkState == NOT_LINKING) { ((ModuleLinkTarget) node).setParametersHighlighted(true); //ModuleView mod = ((ModuleLinkTarget) node).getModuleView(); //mod.setAllHighlights(true); e.setHandled(true); } else if (node instanceof ModuleView && linkState == NOT_LINKING) { ModuleView mod = (ModuleView) node; // highlight all matching params.. mod.setModulesHighlighted(true); mod.setAllHighlights(true); e.setHandled(true); } else { super.mouseEntered(e); } }
public void mouseEntered(PInputEvent e) { PNode node = e.getPickedNode(); if (node instanceof FormalParameter) { lastParameterEntered = (FormalParameter) node; //System.err.println("mouse entered last entered.."+ if (linkState == NOT_LINKING) { // turn on params for this parameter lastParameterEntered.setParamsHighlighted(true); // set all modules of this same type to be highlighted. ModuleView mod = lastParameterEntered.getModuleView(); mod.setModulesHighlighted(true); } e.setHandled(true); } else if (node instanceof ModuleLinkTarget && linkState == NOT_LINKING) { ((ModuleLinkTarget) node).setParametersHighlighted(true); //ModuleView mod = ((ModuleLinkTarget) node).getModuleView(); //mod.setAllHighlights(true); e.setHandled(true); } else if (node instanceof ModuleView && linkState == NOT_LINKING) { ModuleView mod = (ModuleView) node; // highlight all matching params.. mod.setModulesHighlighted(true); mod.setAllHighlights(true); e.setHandled(true); } else { super.mouseEntered(e); } }
3,234,125
public void mouseExited(PInputEvent e) { PNode node = e.getPickedNode(); //System.err.println("exiting..."+node); lastParameterEntered = null; //System.err.println("last parameter entered cleared"); if (node instanceof FormalParameter) { FormalParameter param = (FormalParameter) node; if (linkState == NOT_LINKING) { param.setParamsHighlighted(false); ModuleView mod = param.getModuleView(); mod.setAllHighlights(false); } e.setHandled(true); } else if (node instanceof ModuleLinkTarget && linkState == NOT_LINKING) { //ModuleView mod = ((ModuleLinkTarget) node).getModuleView(); //mod.setAllHighlights(false); ((ModuleLinkTarget) node).setParametersHighlighted(false); e.setHandled(true); } else if (node instanceof ModuleView && linkState == NOT_LINKING) { ModuleView mod = (ModuleView) node; mod.setAllHighlights(false); e.setHandled(true); } else super.mouseExited(e); }
publicvoidmouseExited(PInputEvente){ PNodenode=e.getPickedNode(); //System.err.println("exiting..."+node); lastParameterEntered=null; //System.err.println("lastparameterenteredcleared"); if(nodeinstanceofFormalParameter){ FormalParameterparam=(FormalParameter)node; if(linkState==NOT_LINKING){ param.setParamsHighlighted(false); ModuleViewmod=param.getModuleView(); mod.setAllHighlights(false); } e.setHandled(true); } elseif(nodeinstanceofModuleLinkTarget&&linkState==NOT_LINKING){ //ModuleViewmod=((ModuleLinkTarget)node).getModuleView(); //mod.setAllHighlights(false); ((ModuleLinkTarget)node).setParametersHighlighted(false); e.setHandled(true); } elseif(nodeinstanceofModuleView&&linkState==NOT_LINKING){ ModuleViewmod=(ModuleView)node; mod.setAllHighlights(false); e.setHandled(true); } else super.mouseExited(e); }
3,234,126
public void mouseExited(PInputEvent e) { PNode node = e.getPickedNode(); //System.err.println("exiting..."+node); lastParameterEntered = null; //System.err.println("last parameter entered cleared"); if (node instanceof FormalParameter) { FormalParameter param = (FormalParameter) node; if (linkState == NOT_LINKING) { param.setParamsHighlighted(false); ModuleView mod = param.getModuleView(); mod.setAllHighlights(false); } e.setHandled(true); } else if (node instanceof ModuleLinkTarget && linkState == NOT_LINKING) { //ModuleView mod = ((ModuleLinkTarget) node).getModuleView(); //mod.setAllHighlights(false); ((ModuleLinkTarget) node).setParametersHighlighted(false); e.setHandled(true); } else if (node instanceof ModuleView && linkState == NOT_LINKING) { ModuleView mod = (ModuleView) node; mod.setAllHighlights(false); e.setHandled(true); } else super.mouseExited(e); }
public void mouseExited(PInputEvent e) { PNode node = e.getPickedNode(); //System.err.println("exiting..."+node); lastParameterEntered = null; //System.err.println("last parameter entered cleared"); if (node instanceof FormalParameter) { FormalParameter param = (FormalParameter) node; if (linkState == NOT_LINKING) { param.setParamsHighlighted(false); ModuleView mod = param.getModuleView(); mod.setAllHighlights(false); } e.setHandled(true); } else if (node instanceof ModuleLinkTarget && linkState == NOT_LINKING) { //ModuleView mod = ((ModuleLinkTarget) node).getModuleView(); //mod.setAllHighlights(false); ((ModuleLinkTarget) node).setParametersHighlighted(false); e.setHandled(true); } else if (node instanceof ModuleView && linkState == NOT_LINKING) { ModuleView mod = (ModuleView) node; mod.setAllHighlights(false); e.setHandled(true); } else super.mouseExited(e); }
3,234,127
private void mousePressedLinkingModuleTargets(PNode node,PInputEvent e) { //System.err.println("mouse pressed linking module targets "+e); PNode n = e.getPickedNode(); //System.err.println("on node..."+n); if (e.getClickCount() ==2) { cancelModuleTargetLink(); //System.err.println("mouse pressed linking params. setting to linking cancellation"); linkState = LINKING_CANCELLATION; postLinkCompletion = true; } else if (!(n instanceof ModuleLinkTarget)) { // we're on canvas. Point2D pos = e.getPosition(); // System.err.println("...adding intermediate point to module links.."); moduleLink.setIntermediatePoint((float) pos.getX(),(float) pos.getY()); } else if (moduleLinkOriginTarget != null) { //System.err.println("... finishing modulelinkorigintarget..."); finishModuleTargetLink((ModuleLinkTarget) n); postLinkCompletion = true; } e.setHandled(true); }
privatevoidmousePressedLinkingModuleTargets(PNodenode,PInputEvente){ //System.err.println("mousepressedlinkingmoduletargets"+e); PNoden=e.getPickedNode(); //System.err.println("onnode..."+n); if(e.getClickCount()==2){ cancelModuleTargetLink(); //System.err.println("mousepressedlinkingparams.settingtolinkingcancellation"); linkState=LINKING_CANCELLATION; postLinkCompletion=true; } elseif(!(ninstanceofModuleLinkTarget)){//we'reoncanvas. Point2Dpos=e.getPosition(); // System.err.println("...addingintermediatepointtomodulelinks.."); moduleLink.setIntermediatePoint((float)pos.getX(),(float)pos.getY()); } elseif(moduleLinkOriginTarget!=null){ //System.err.println("...finishingmodulelinkorigintarget..."); finishModuleTargetLink((ModuleLinkTarget)n); postLinkCompletion=true; } e.setHandled(true); }
3,234,128
private void mousePressedLinkingModuleTargets(PNode node,PInputEvent e) { //System.err.println("mouse pressed linking module targets "+e); PNode n = e.getPickedNode(); //System.err.println("on node..."+n); if (e.getClickCount() ==2) { cancelModuleTargetLink(); //System.err.println("mouse pressed linking params. setting to linking cancellation"); linkState = LINKING_CANCELLATION; postLinkCompletion = true; } else if (!(n instanceof ModuleLinkTarget)) { // we're on canvas. Point2D pos = e.getPosition(); // System.err.println("...adding intermediate point to module links.."); moduleLink.setIntermediatePoint((float) pos.getX(),(float) pos.getY()); } else if (moduleLinkOriginTarget != null) { //System.err.println("... finishing modulelinkorigintarget..."); finishModuleTargetLink((ModuleLinkTarget) n); postLinkCompletion = true; } e.setHandled(true); }
privatevoidmousePressedLinkingModuleTargets(PNodenode,PInputEvente){ //System.err.println("mousepressedlinkingmoduletargets"+e); PNoden=e.getPickedNode(); //System.err.println("onnode..."+n); if(e.getClickCount()==2){ cancelModuleTargetLink(); //System.err.println("mousepressedlinkingparams.settingtolinkingcancellation"); linkState=LINKING_CANCELLATION; postLinkCompletion=true; } elseif(!(ninstanceofModuleLinkTarget)){//we'reoncanvas. Point2Dpos=e.getPosition(); // System.err.println("...addingintermediatepointtomodulelinks.."); moduleLink.setIntermediatePoint((float)pos.getX(),(float)pos.getY()); } elseif(moduleLinkOriginTarget!=null){ //System.err.println("...finishingmodulelinkorigintarget..."); finishModuleTargetLink((ModuleLinkTarget)n); postLinkCompletion=true; } e.setHandled(true); }
3,234,129
private void mousePressedLinkingModuleTargets(PNode node,PInputEvent e) { //System.err.println("mouse pressed linking module targets "+e); PNode n = e.getPickedNode(); //System.err.println("on node..."+n); if (e.getClickCount() ==2) { cancelModuleTargetLink(); //System.err.println("mouse pressed linking params. setting to linking cancellation"); linkState = LINKING_CANCELLATION; postLinkCompletion = true; } else if (!(n instanceof ModuleLinkTarget)) { // we're on canvas. Point2D pos = e.getPosition(); // System.err.println("...adding intermediate point to module links.."); moduleLink.setIntermediatePoint((float) pos.getX(),(float) pos.getY()); } else if (moduleLinkOriginTarget != null) { //System.err.println("... finishing modulelinkorigintarget..."); finishModuleTargetLink((ModuleLinkTarget) n); postLinkCompletion = true; } e.setHandled(true); }
privatevoidmousePressedLinkingModuleTargets(PNodenode,PInputEvente){ //System.err.println("mousepressedlinkingmoduletargets"+e); PNoden=e.getPickedNode(); //System.err.println("onnode..."+n); if(e.getClickCount()==2){ cancelModuleTargetLink(); //System.err.println("mousepressedlinkingparams.settingtolinkingcancellation"); linkState=LINKING_CANCELLATION; postLinkCompletion=true; } elseif(!(ninstanceofModuleLinkTarget)){//we'reoncanvas. Point2Dpos=e.getPosition(); // System.err.println("...addingintermediatepointtomodulelinks.."); moduleLink.setIntermediatePoint((float)pos.getX(),(float)pos.getY()); } elseif(moduleLinkOriginTarget!=null){ //System.err.println("...finishingmodulelinkorigintarget..."); finishModuleTargetLink((ModuleLinkTarget)n); postLinkCompletion=true; } e.setHandled(true); }
3,234,130
ClassifierView() { super(); setProperties(); }
ClassifierView() { super(ClassifierFactory.getOwner()); setProperties(); }
3,234,132
public String[][] getLockChecks( Class<? extends IObject> klass ) { if ( klass == null ) throw new ApiUsageException( "Cannot proceed with null klass." ); Holder h = classNameHolder.get( klass.getName() ); if ( h == null ) throw new ApiUsageException( "Metadata not found for: " +klass.getName()); return h.getLockChecks( ); }
public String[][] getLockChecks( Class<? extends IObject> klass ) { if ( klass == null ) throw new ApiUsageException( "Cannot proceed with null klass." ); Holder h = classNameHolder.get( klass.getName() ); if ( h == null ) throw new ApiUsageException( "Metadata not found for: " +klass.getName()); return h.getLockChecks( ); }
3,234,133
public String[][] getLockChecks( Class<? extends IObject> klass ) { if ( klass == null ) throw new ApiUsageException( "Cannot proceed with null klass." ); Holder h = classNameHolder.get( klass.getName() ); if ( h == null ) throw new ApiUsageException( "Metadata not found for: " +klass.getName()); return h.getLockChecks( ); }
public String[][] getLockChecks( Class<? extends IObject> klass ) { if ( klass == null ) throw new ApiUsageException( "Cannot proceed with null klass." ); Holder h = classNameHolder.get( klass.getName() ); if ( h == null ) throw new ApiUsageException( "Metadata not found for: " +klass.getName()); return h.getLockChecks( ); }
3,234,134
public String[][] getLockChecks( Class<? extends IObject> klass ) { if ( klass == null ) throw new ApiUsageException( "Cannot proceed with null klass." ); Holder h = classNameHolder.get( klass.getName() ); if ( h == null ) throw new ApiUsageException( "Metadata not found for: " +klass.getName()); return h.getLockChecks( ); }
public String[][] getLockChecks( Class<? extends IObject> klass ) { if ( klass == null ) throw new ApiUsageException( "Cannot proceed with null klass." ); Holder h = classNameHolder.get( klass.getName() ); if ( h == null ) throw new ApiUsageException( "Metadata not found for: " +klass.getName()); return h.getLockChecks( ); }
3,234,135
public RubyArray nesting() { IRuby runtime = getRuntime(); RubyModule object = runtime.getObject(); RubyModule receiver = runtime.getCurrentContext().getLastRubyClass(); RubyArray result = runtime.newArray(); for (RubyModule current = receiver; current != object; current = current.getParent()) { result.append(current); } return result; }
public RubyArray nesting() { IRuby runtime = getRuntime(); RubyModule object = runtime.getObject(); SinglyLinkedList base = runtime.getCurrentContext().peekCRef(); RubyArray result = runtime.newArray(); for (RubyModule current = receiver; current != object; current = current.getParent()) { result.append(current); } return result; }
3,234,136
public RubyArray nesting() { IRuby runtime = getRuntime(); RubyModule object = runtime.getObject(); RubyModule receiver = runtime.getCurrentContext().getLastRubyClass(); RubyArray result = runtime.newArray(); for (RubyModule current = receiver; current != object; current = current.getParent()) { result.append(current); } return result; }
public RubyArray nesting() { IRuby runtime = getRuntime(); RubyModule object = runtime.getObject(); RubyModule receiver = runtime.getCurrentContext().getLastRubyClass(); RubyArray result = runtime.newArray(); for (RubyModule current = receiver; current != object; current = current.getParent()) { result.append(current); } return result; }
3,234,137
private void addInstrumentationToArchive(ZipInputStream archive, ZipOutputStream output) throws Exception { ZipEntry entry; while ((entry = archive.getNextEntry()) != null) { try { ZipEntry outputEntry = new ZipEntry(entry.getName()); output.putNextEntry(outputEntry); // Read current entry byte[] entryBytes = IOUtil .createByteArrayFromInputStream(archive); // Check if we have class file if (isClass(entry)) { // Instrument class ClassReader cr = new ClassReader(entryBytes); ClassWriter cw = new ClassWriter(true); ClassInstrumenter cv = new ClassInstrumenter(projectData, cw, ignoreRegexes); cr.accept(cv, CustomAttribute.getExtraAttributes(), false); // If class was instrumented, get bytes that define the // class if (cv.isInstrumented()) { logger.debug("Putting instrumeted entry: " + entry.getName()); entryBytes = cw.toByteArray(); } } // Add entry to the output output.write(entryBytes); output.closeEntry(); archive.closeEntry(); } catch (Exception e) { logger.warn("Problems with archive entry: " + entry); throw e; } output.flush(); } }
private void addInstrumentationToArchive(ZipInputStream archive, ZipOutputStream output) throws Exception { ZipEntry entry; while ((entry = archive.getNextEntry()) != null) { try { ZipEntry outputEntry = new ZipEntry(entry.getName()); output.putNextEntry(outputEntry); // Read current entry byte[] entryBytes = IOUtil .createByteArrayFromInputStream(archive); // Check if we have class file if (isClass(entry)) { // Instrument class ClassReader cr = new ClassReader(entryBytes); ClassWriter cw = new ClassWriter(true); ClassInstrumenter cv = new ClassInstrumenter(projectData, cw, ignoreRegexes); cr.accept(cv, CustomAttribute.getExtraAttributes(), false); // If class was instrumented, get bytes that define the // class if (cv.isInstrumented()) { logger.debug("Putting instrumeted entry: " + entry.getName()); entryBytes = cw.toByteArray(); } } // Add entry to the output output.write(entryBytes); output.closeEntry(); archive.closeEntry(); } catch (Exception e) { logger.warn("Problems with archive entry: " + entry); throw e; } output.flush(); } }
3,234,138
XYPlane(byte[] data, PlaneDef pDef, int sizeX, int sizeY, int bytesPerPixel, BytesConverter strategy) { super(data, pDef, sizeX, sizeY, bytesPerPixel, strategy); }
XYPlane(byte[] data, PlaneDef pDef, int sizeX, int sizeY, int bytesPerPixel, BytesConverter strategy) { super(data, pDef, sizeX, sizeY, bytesPerPixel, strategy); }
3,234,141
XYPlane(byte[] data, PlaneDef pDef, int sizeX, int sizeY, int bytesPerPixel, BytesConverter strategy) { super(data, pDef, sizeX, sizeY, bytesPerPixel, strategy); }
XYPlane(byte[] data, PlaneDef pDef, int sizeX, int sizeY, int bytesPerPixel, BytesConverter strategy) { super(data, pDef, sizeX, sizeY, bytesPerPixel, strategy); }
3,234,142
private boolean hasNewLocalVariables(IRubyParserResult result) { int newSize = 0; if (result.getLocalVariables() != null) { newSize = result.getLocalVariables().size(); } int oldSize = 0; if (runtime.getScope().getLocalNames() != null) { oldSize = runtime.getScope().getLocalNames().size(); } return newSize > oldSize; }
private boolean hasNewLocalVariables(IRubyParserResult result) { int newSize = 0; if (result.getLocalVariables() != null) { newSize = result.getLocalVariables().size(); } int oldSize = 0; if (runtime.getScope().hasLocalVariables()) { oldSize = runtime.getScope().getLocalNames().size(); } return newSize > oldSize; }
3,234,143
public final void write(FastWriter out, Context data) throws IOException { try { if (_content == null) { parse(); } } catch (Exception e) { _log.error("Template: Unable to read template: " + this, e); out.write("<!--\n Template failed to read. Reason: "); out.write(e.toString()); out.write(" \n-->"); } try { _content.write(out,data); } catch (PropertyException e) { String warning = "Template: Missing data in Map passed to template " + this; _log.warning(warning,e); out.write("<!--\n Could not interpret template. Reason: "); out.write(warning); out.write(e.toString()); out.write(" \n-->"); } }
public final void write(FastWriter out, Context data) throws IOException { try { if (_content == null) { parse(); } } catch (Exception e) { _log.error("Template: Unable to read template: " + this, e); out.write("<!--\n Template failed to read. Reason: "); out.write(e.toString()); out.write(" \n-->"); } try { _content.write(out,data); } catch (PropertyException e) { String warning = "Template: Missing data in Map passed to template " + this; _log.warning(warning,e); out.write("<!--\n Could not interpret template. Reason: "); out.write(warning); out.write(e.toString()); out.write(" \n-->"); } }
3,234,144
public final void write(FastWriter out, Context data) throws IOException { try { if (_content == null) { parse(); } } catch (Exception e) { _log.error("Template: Unable to read template: " + this, e); out.write("<!--\n Template failed to read. Reason: "); out.write(e.toString()); out.write(" \n-->"); } try { _content.write(out,data); } catch (PropertyException e) { String warning = "Template: Missing data in Map passed to template " + this; _log.warning(warning,e); out.write("<!--\n Could not interpret template. Reason: "); out.write(warning); out.write(e.toString()); out.write(" \n-->"); } }
public final void write(FastWriter out, Context data) throws IOException { try { if (_content == null) { parse(); } } catch (Exception e) { _log.error("Template: Unable to read template: " + this, e); out.write("<!--\n Template failed to read. Reason: "); out.write(e.toString()); out.write(" \n-->"); } try { _content.write(out,data); } catch (PropertyException e) { String warning = "Template: Missing data in Context passed to template " + this; _log.warning(warning,e); out.write("<!--\n Could not interpret template. Reason: "); out.write(warning); out.write(e.toString()); out.write(" \n-->"); } }
3,234,145
public void closeActiveRoom() { ChatRoom room = null; try { room = getActiveChatRoom(); } catch (ChatRoomNotFoundException e1) { // AgentLog.logError("Chat room not found", e1); } // Confirm end session boolean isGroupChat = room.getChatType() == Message.Type.GROUP_CHAT; String message = "Would you like to end this session?"; if (true) { room.closeChatRoom(); return; } else { if (!room.isActive()) { room.closeChatRoom(); return; } } final int ok = JOptionPane.showConfirmDialog(SparkManager.getMainWindow(), message, "Confirmation", JOptionPane.YES_NO_OPTION); if (ok == JOptionPane.OK_OPTION) { room.closeChatRoom(); return; } }
public void closeActiveRoom() { ChatRoom room = null; try { room = getActiveChatRoom(); } catch (ChatRoomNotFoundException e1) { // AgentLog.logError("Chat room not found", e1); } // Confirm end session boolean isGroupChat = room.getChatType() == Message.Type.GROUP_CHAT; String message = "Would you like to end this session?"; if (true) { room.closeChatRoom(); return; } else { if (!room.isActive()) { room.closeChatRoom(); return; } } final int ok = JOptionPane.showConfirmDialog(SparkManager.getMainWindow(), message, "Confirmation", JOptionPane.YES_NO_OPTION); if (ok == JOptionPane.OK_OPTION) { room.closeChatRoom(); return; } }
3,234,146
public void closeActiveRoom() { ChatRoom room = null; try { room = getActiveChatRoom(); } catch (ChatRoomNotFoundException e1) { // AgentLog.logError("Chat room not found", e1); } // Confirm end session boolean isGroupChat = room.getChatType() == Message.Type.GROUP_CHAT; String message = "Would you like to end this session?"; if (true) { room.closeChatRoom(); return; } else { if (!room.isActive()) { room.closeChatRoom(); return; } } final int ok = JOptionPane.showConfirmDialog(SparkManager.getMainWindow(), message, "Confirmation", JOptionPane.YES_NO_OPTION); if (ok == JOptionPane.OK_OPTION) { room.closeChatRoom(); return; } }
public void closeActiveRoom() { ChatRoom room = null; try { room = getActiveChatRoom(); } catch (ChatRoomNotFoundException e1) { // AgentLog.logError("Chat room not found", e1); } // Confirm end session boolean isGroupChat = room.getChatType() == Message.Type.GROUP_CHAT; String message = "Would you like to end this session?"; if (true) { room.closeChatRoom(); return; } else { if (!room.isActive()) { room.closeChatRoom(); return; } } final int ok = JOptionPane.showConfirmDialog(SparkManager.getMainWindow(), message, "Confirmation", JOptionPane.YES_NO_OPTION); if (ok == JOptionPane.OK_OPTION) { room.closeChatRoom(); return; } }
3,234,147
public ExtendedMetadata( SessionFactory sessionFactory ) { if ( sessionFactory == null ) throw new ApiUsageException( "SessionFactory may not be null." ); Map<String,ClassMetadata> m = sessionFactory.getAllClassMetadata(); for (String key : m.keySet()) { ClassMetadata cm = m.get(key); Type[] types = cm.getPropertyTypes(); classNameHolder.put(key, new Holder( cm, locksFields(types), lockedByFields(key,m) )); } }
public ExtendedMetadata( SessionFactory sessionFactory ) { if ( sessionFactory == null ) throw new ApiUsageException( "SessionFactory may not be null." ); Map<String,ClassMetadata> m = sessionFactory.getAllClassMetadata(); for (String key : m.keySet()) { ClassMetadata cm = m.get(key); Type[] types = cm.getPropertyTypes(); classNameHolder.put(key, new Holder( cm, locksFields(types), lockedByFields(key,m) )); } }
3,234,149
private JPanel buildBody() { JPanel p = new JPanel(); p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS)); p.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); p.add(classifierUI); p.add(new JSeparator()); p.add(buildToolBar()); return p; }
private JPanel buildBody() { JPanel p = new JPanel(); p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS)); p.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); p.add(classifierUI); p.add(new JSeparator()); JPanel bars = new JPanel(); bars.setLayout(new BoxLayout(bars, BoxLayout.X_AXIS)); bars.add(buildSelectToolBar()); bars.add(buildControlsToolBar()); p.add(bars); return p; }
3,234,151
public void addClassData(ClassData classData) { if (children.containsKey(classData.getBaseName())) throw new IllegalArgumentException("Source file " + this.name + " already contains a class with the name " + classData.getBaseName()); // Each key is a class basename, stored as an String object. // Each value is information about the class, stored as a ClassData object. children.put(classData.getBaseName(), classData); }
public void addClassData(ClassData classData) { if (children.containsKey(classData.getBaseName())) throw new IllegalArgumentException("Source file " + this.name + " already contains a class with the name " + classData.getBaseName()); // Each key is a class basename, stored as an String object. // Each value is information about the class, stored as a ClassData object. children.put(classData.getBaseName(), classData); }
3,234,154
protected void onStateChange() { int state = model.getState(); if (state == Browser.READY) { //if (model.getBrowserType() == Browser.IMAGES_EXPLORER) setEnabled(true); // else onDisplayChange(model.getLastSelectedDisplay()); } else setEnabled(false); }
protected void onStateChange() { int state = model.getState(); if (state == Browser.READY) { //if (model.getBrowserType() == Browser.IMAGES_EXPLORER) setEnabled(true); // else onDisplayChange(model.getLastSelectedDisplay()); } else setEnabled(false); }
3,234,155
private void beforeUpdate( Object argument, UpdateFilter filter ) { if ( argument == null ) throw new IllegalArgumentException( "Argument to save cannot be null."); if ( logger.isDebugEnabled() ) logger.debug( " Saving event before merge. " ); // Save event before we enter. Event currentEvent = securitySystem.getCurrentEvent(); Event mergedEvent = (Event) internalSave( currentEvent, filter ); securitySystem.setCurrentEvent( mergedEvent ); }
private void beforeUpdate( Object argument, UpdateFilter filter ) { if ( argument == null ) throw new IllegalArgumentException( "Argument to save cannot be null."); if ( logger.isDebugEnabled() ) logger.debug( " Saving event before merge. " ); // Save event before we enter. Event currentEvent = securitySystem.getCurrentEvent(); Event mergedEvent = (Event) internalSave( currentEvent, filter ); securitySystem.setCurrentEvent( mergedEvent ); }
3,234,156
private <T> T doAction( T graph, UpdateAction<T> action ) { T retVal; UpdateFilter filter = new UpdateFilter( securitySystem, localQuery ); Event currentEvent = securitySystem.getCurrentEvent(); try { beforeUpdate( graph, filter ); retVal = action.run( graph, filter ); afterUpdate( currentEvent, filter ); } finally { // Return the previous event. securitySystem.setCurrentEvent( currentEvent ); } return retVal; }
private <T> T doAction( T graph, UpdateAction<T> action ) { T retVal; UpdateFilter filter = new UpdateFilter( ); Event currentEvent = securitySystem.getCurrentEvent(); try { beforeUpdate( graph, filter ); retVal = action.run( graph, filter ); afterUpdate( currentEvent, filter ); } finally { // Return the previous event. securitySystem.setCurrentEvent( currentEvent ); } return retVal; }
3,234,157
private void buildGUI() { setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 10)); GridBagLayout gridbag = new GridBagLayout(); setLayout(gridbag); GridBagConstraints c = new GridBagConstraints(); JLabel label = new JLabel(" Wavelength"); c.ipadx = RenderingAgt.H_SPACE; c.weightx = 0.5; c.gridx = 0; c.gridy = 0; c.fill = GridBagConstraints.HORIZONTAL; gridbag.setConstraints(label, c); add(label); c.gridy = 1; label = new JLabel(" Map"); gridbag.setConstraints(label, c); add(label); c.gridy = 2; gridbag.setConstraints(gammaLabel, c); add(gammaLabel); c.gridy = 3; label = new JLabel(" Resolution"); gridbag.setConstraints(label, c); add(label); c.gridy = 4; label = new JLabel(" Histogram"); gridbag.setConstraints(label, c); add(label); c.gridx = 1; c.gridy = 0; JPanel wp = buildComponentPanel(wavelengths); gridbag.setConstraints(wp, c); add(wp); c.gridy = 1; wp = buildComponentPanel(transformations); gridbag.setConstraints(wp, c); add(wp); c.gridy = 2; c.weightx = 1.0; c.ipadx = 5; JPanel gp = buildSliderPanel(gamma); gridbag.setConstraints(gp, c); add(gp); c.gridy = 3; JPanel brp = buildSliderPanel(bitResolution); gridbag.setConstraints(brp, c); add(brp); c.gridy = 4; c.weightx = 0.0; c.ipadx = 0; JPanel hp = buildComponentPanel(histogram); gridbag.setConstraints(hp, c); add(hp); }
private void buildGUI() { setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 10)); GridBagLayout gridbag = new GridBagLayout(); setLayout(gridbag); GridBagConstraints c = new GridBagConstraints(); JLabel label = new JLabel(" Wavelength"); c.ipadx = RenderingAgt.H_SPACE; c.weightx = 0.5; c.gridx = 0; c.gridy = 0; c.fill = GridBagConstraints.HORIZONTAL; gridbag.setConstraints(label, c); add(label); c.gridy = 1; label = new JLabel(" Map"); gridbag.setConstraints(label, c); add(label); c.gridy = 2; gridbag.setConstraints(gammaLabel, c); add(gammaLabel); c.gridy = 3; label = new JLabel(" Resolution"); gridbag.setConstraints(label, c); add(label); c.gridy = 4; label = new JLabel(" Histogram"); gridbag.setConstraints(label, c); add(label); c.gridx = 1; c.gridy = 0; JPanel wp = buildComponentPanel(wavelengths); gridbag.setConstraints(wp, c); add(wp); c.gridy = 1; wp = buildComponentPanel(transformations); gridbag.setConstraints(wp, c); add(wp); c.gridy = 2; c.weightx = 1.0; c.ipadx = 5; JPanel gp = buildSliderPanel(gamma); gridbag.setConstraints(gp, c); add(gp); c.gridy = 3; JPanel brp = buildSliderPanel(bitResolution); gridbag.setConstraints(brp, c); add(brp); c.gridy = 4; c.weightx = 0.0; c.ipadx = 0; JPanel hp = buildComponentPanel(histogram); gridbag.setConstraints(hp, c); add(hp); }
3,234,158
private JPanel buildSliderPanel(JSlider slider) { JPanel p = new JPanel(); //p.setLayout(null); p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS)); //slider.setPreferredSize(DIM_SLIDER); //slider.setSize(DIM_SLIDER); //p.setPreferredSize(DIM_SLIDER); //p.setSize(DIM_SLIDER); p.add(slider); return p; }
private JPanel buildSliderPanel(JSlider slider) { JPanel p = new JPanel(); //p.setLayout(null); p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS)); //slider.setPreferredSize(DIM_SLIDER); //slider.setSize(DIM_SLIDER); //p.setPreferredSize(DIM_SLIDER); //p.setSize(DIM_SLIDER); p.add(slider); return p; }
3,234,159
private void initButton(Registry registry) { IconManager IM = IconManager.getInstance(registry); histogram = new JButton(IM.getIcon(IconManager.HISTOGRAM)); histogram.setToolTipText( UIUtilities.formatToolTipText("Bring the histogram dialog.")); histogram.setBorder(null); }
private void initButton(Registry registry) { IconManager IM = IconManager.getInstance(registry); histogram = new JButton(IM.getIcon(IconManager.HISTOGRAM)); histogram.setToolTipText( UIUtilities.formatToolTipText("Bring the histogram dialog.")); histogram.setBorder(null); }
3,234,160
private void initLabel() { gammaLabel = new JLabel(" Gamma: "+qDef.curveCoefficient); }
private void initLabel() { gammaLabel = new JLabel(" Gamma: "+qDef.curveCoefficient); }
3,234,161
private void initSliders() { int k = (int) (qDef.curveCoefficient*10); gamma = new JSlider(JSlider.HORIZONTAL, MIN, MAX, k); if (qDef.family == QuantumFactory.LINEAR || qDef.family == QuantumFactory.LOGARITHMIC) gamma.setEnabled(false); else gamma.setEnabled(true); Integer br = ((Integer) uiBR.get(new Integer(qDef.bitResolution))); int resolution = DEPTH_END; if (br != null) resolution = br.intValue(); bitResolution = new JSlider(JSlider.HORIZONTAL, DEPTH_START, DEPTH_END, resolution); }
private void initSliders() { int k = (int) (qDef.curveCoefficient*10); gamma = new JSlider(JSlider.HORIZONTAL, MIN, MAX, k); if (qDef.family == QuantumFactory.LINEAR || qDef.family == QuantumFactory.LOGARITHMIC) gamma.setEnabled(false); else gamma.setEnabled(true); Integer br = ((Integer) uiBR.get(new Integer(qDef.bitResolution))); int resolution = DEPTH_END; if (br != null) resolution = br.intValue(); bitResolution = new JSlider(JSlider.HORIZONTAL, DEPTH_START, DEPTH_END, resolution); }
3,234,162
void setGammaText(double v) { String txt = " Gamma: "+v; gammaLabel.setText(txt); }
void setGammaText(double v) { String txt = " Gamma: "+v; gammaLabel.setText(txt); }
3,234,163
public static RubySymbol unmarshalFrom(UnmarshalStream input) throws java.io.IOException { return RubySymbol.newSymbol(input.getRuntime(), input.unmarshalString()); }
public static RubySymbol unmarshalFrom(UnmarshalStream input) throws java.io.IOException { RubySymbol result = RubySymbol.newSymbol(input.getRuntime(), input.unmarshalString()); input.register(result); return result; }
3,234,164
static Pattern createCaseInsensitivePattern(String regEx) { return Pattern.compile(regEx, Pattern.CASE_INSENSITIVE); }
public static Pattern createCaseInsensitivePattern(String regEx) { return Pattern.compile(regEx, Pattern.CASE_INSENSITIVE); }
3,234,165
public static RubyFixnum unmarshalFrom(UnmarshalStream input) throws java.io.IOException { return RubyFixnum.newFixnum(input.getRuby(), input.unmarshalInt()); }
public static RubyFixnum unmarshalFrom(UnmarshalStream input) throws java.io.IOException { return RubyFixnum.newFixnum(input.getRuntime(), input.unmarshalInt()); }
3,234,166
private void buildGUI() { setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED)); add(properties); add(annotate); add(createClassifySubMenu()); add(new JSeparator(SwingConstants.HORIZONTAL)); add(view); add(zoomIn); add(zoomOut); add(zoomFit); }
private void buildGUI() { setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED)); add(properties); add(annotate); add(createClassifySubMenu()); add(new JSeparator(SwingConstants.HORIZONTAL)); add(view); add(zoomIn); add(zoomOut); add(zoomFit); }
3,234,167
protected String createDiscoveryPathName(String uri, String localName) { if (uri == null || uri.length() == 0) { return localName; } // TODO proper encoding required // lets replace any dodgy characters return uri.replaceAll("://", "/").replace(':', '/').replace(' ', '_') + "/" + localName; }
protected String createDiscoveryPathName(String uri, String localName) { if (uri == null || uri.length() == 0) { return localName; } // TODO proper encoding required // lets replace any dodgy characters return uri.replaceAll("://", "/").replace(':', '/').replace(' ', '_') + "/" + localName; }
3,234,168
protected MappingMetaData findNamespaceProperties(String namespaceURI, String localName) { // lets look for the magic prefix if (namespaceURI != null && namespaceURI.startsWith(JAVA_PACKAGE_PREFIX)) { String packageName = namespaceURI.substring(JAVA_PACKAGE_PREFIX.length()); return new MappingMetaData(packageName); } String uri = "META-INF/services/org/xbean/spring/" + createDiscoveryPathName(namespaceURI, localName); // lets try the thread context class loader first InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(uri); if (in == null) { in = getClass().getClassLoader().getResourceAsStream(uri); if (in == null) { logger.warn("Could not find resource: " + uri); return null; } } // lets load the file try { Properties properties = new Properties(); properties.load(in); return new MappingMetaData(properties); } catch (IOException e) { log.warn("Failed to load resource from uri: " + uri, e); return null; } }
protected MappingMetaData findNamespaceProperties(String namespaceURI, String localName) { // lets look for the magic prefix if (namespaceURI != null && namespaceURI.startsWith(JAVA_PACKAGE_PREFIX)) { String packageName = namespaceURI.substring(JAVA_PACKAGE_PREFIX.length()); return new MappingMetaData(packageName); } String uri = META_INF_PREFIX + createDiscoveryPathName(namespaceURI, localName); InputStream in = loadResource(uri); if (in == null) { in = loadResource(META_INF_PREFIX + createDiscoveryPathName(namespaceURI)); } // lets try the thread context class loader first InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(uri); if (in == null) { in = getClass().getClassLoader().getResourceAsStream(uri); if (in == null) { logger.warn("Could not find resource: " + uri); return null; } } // lets load the file try { Properties properties = new Properties(); properties.load(in); return new MappingMetaData(properties); } catch (IOException e) { log.warn("Failed to load resource from uri: " + uri, e); return null; } }
3,234,169
protected MappingMetaData findNamespaceProperties(String namespaceURI, String localName) { // lets look for the magic prefix if (namespaceURI != null && namespaceURI.startsWith(JAVA_PACKAGE_PREFIX)) { String packageName = namespaceURI.substring(JAVA_PACKAGE_PREFIX.length()); return new MappingMetaData(packageName); } String uri = "META-INF/services/org/xbean/spring/" + createDiscoveryPathName(namespaceURI, localName); // lets try the thread context class loader first InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(uri); if (in == null) { in = getClass().getClassLoader().getResourceAsStream(uri); if (in == null) { logger.warn("Could not find resource: " + uri); return null; } } // lets load the file try { Properties properties = new Properties(); properties.load(in); return new MappingMetaData(properties); } catch (IOException e) { log.warn("Failed to load resource from uri: " + uri, e); return null; } }
protected MappingMetaData findNamespaceProperties(String namespaceURI, String localName) { // lets look for the magic prefix if (namespaceURI != null && namespaceURI.startsWith(JAVA_PACKAGE_PREFIX)) { String packageName = namespaceURI.substring(JAVA_PACKAGE_PREFIX.length()); return new MappingMetaData(packageName); } String uri = "META-INF/services/org/xbean/spring/" + createDiscoveryPathName(namespaceURI, localName); // lets try the thread context class loader first InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(uri); if (in == null) { in = getClass().getClassLoader().getResourceAsStream(uri); if (in == null) { logger.warn("Could not find resource: " + uri); return null; } } // lets load the file try { Properties properties = new Properties(); properties.load(in); return new MappingMetaData(properties); } catch (IOException e) { log.warn("Failed to load resource from uri: " + uri, e); return null; } }
3,234,170
protected MappingMetaData findNamespaceProperties(String namespaceURI, String localName) { // lets look for the magic prefix if (namespaceURI != null && namespaceURI.startsWith(JAVA_PACKAGE_PREFIX)) { String packageName = namespaceURI.substring(JAVA_PACKAGE_PREFIX.length()); return new MappingMetaData(packageName); } String uri = "META-INF/services/org/xbean/spring/" + createDiscoveryPathName(namespaceURI, localName); // lets try the thread context class loader first InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(uri); if (in == null) { in = getClass().getClassLoader().getResourceAsStream(uri); if (in == null) { logger.warn("Could not find resource: " + uri); return null; } } // lets load the file try { Properties properties = new Properties(); properties.load(in); return new MappingMetaData(properties); } catch (IOException e) { log.warn("Failed to load resource from uri: " + uri, e); return null; } }
protected MappingMetaData findNamespaceProperties(String namespaceURI, String localName) { // lets look for the magic prefix if (namespaceURI != null && namespaceURI.startsWith(JAVA_PACKAGE_PREFIX)) { String packageName = namespaceURI.substring(JAVA_PACKAGE_PREFIX.length()); return new MappingMetaData(packageName); } String uri = "META-INF/services/org/xbean/spring/" + createDiscoveryPathName(namespaceURI, localName); // lets try the thread context class loader first InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(uri); if (in == null) { in = getClass().getClassLoader().getResourceAsStream(uri); if (in == null) { logger.warn("Could not find resource: " + uri); return null; } } // lets load the file try { Properties properties = new Properties(); properties.load(in); return new MappingMetaData(properties); } catch (IOException e) { log.warn("Failed to load resource from uri: " + uri, e); return null; } }
3,234,171
protected int parseBeanDefinitions(Element root) throws BeanDefinitionStoreException { NodeList nl = root.getChildNodes(); int beanDefinitionCount = 0; for (int i = 0; i < nl.getLength(); i++) { Node node = nl.item(i); if (node instanceof Element) { Element ele = (Element) node; if (IMPORT_ELEMENT.equals(node.getNodeName())) { importBeanDefinitionResource(ele); } else if (ALIAS_ELEMENT.equals(node.getNodeName())) { String name = ele.getAttribute(NAME_ATTRIBUTE); String alias = ele.getAttribute(ALIAS_ATTRIBUTE); getBeanDefinitionReader().getBeanFactory().registerAlias(name, alias); } else if (BEAN_ELEMENT.equals(node.getNodeName())) { beanDefinitionCount++; BeanDefinitionHolder bdHolder = parseBeanDefinitionElement(ele, false); BeanDefinitionReaderUtils.registerBeanDefinition(bdHolder, getBeanDefinitionReader().getBeanFactory()); } else { BeanDefinitionHolder bdHolder = parseBeanFromExtensionElement(ele); if (bdHolder != null) { beanDefinitionCount++; } else { log.debug("Ignoring unknown element namespace: " + ele.getNamespaceURI() + " localName: " + ele.getLocalName()); } BeanDefinitionReaderUtils.registerBeanDefinition(bdHolder, getBeanDefinitionReader().getBeanFactory()); } } } return beanDefinitionCount; }
protected int parseBeanDefinitions(Element root) throws BeanDefinitionStoreException { NodeList nl = root.getChildNodes(); int beanDefinitionCount = 0; for (int i = 0; i < nl.getLength(); i++) { Node node = nl.item(i); if (node instanceof Element) { Element ele = (Element) node; if (IMPORT_ELEMENT.equals(node.getNodeName())) { importBeanDefinitionResource(ele); } else if (ALIAS_ELEMENT.equals(node.getNodeName())) { String name = ele.getAttribute(NAME_ATTRIBUTE); String alias = ele.getAttribute(ALIAS_ATTRIBUTE); getBeanDefinitionReader().getBeanFactory().registerAlias(name, alias); } else if (BEAN_ELEMENT.equals(node.getNodeName())) { beanDefinitionCount++; BeanDefinitionHolder bdHolder = parseBeanDefinitionElement(ele, false); } else { BeanDefinitionHolder bdHolder = parseBeanFromExtensionElement(ele); if (bdHolder != null) { beanDefinitionCount++; } else { log.debug("Ignoring unknown element namespace: " + ele.getNamespaceURI() + " localName: " + ele.getLocalName()); } } } } return beanDefinitionCount; }
3,234,172
PixelsStatsEntry[] getChannelStats(int w) { return eventManager.getChannelStats(w); }
PixelsStatsEntry[] getChannelStats(int w) { return eventManager.getChannelStats(w); }
3,234,173
int getChannelWindowEnd(int w) { return (int) eventManager.getChannelWindowEnd(w); }
int getChannelWindowEnd(int w) { return (int) eventManager.getChannelWindowEnd(w); }
3,234,174
int getChannelWindowStart(int w) { return (int) eventManager.getChannelWindowStart(w); }
int getChannelWindowStart(int w) { return (int) eventManager.getChannelWindowStart(w); }
3,234,175
int getGlobalChannelWindowEnd(int w) { return (int) eventManager.getGlobalChannelWindowEnd(w); }
int getGlobalChannelWindowEnd(int w) { return (int) eventManager.getGlobalChannelWindowEnd(w); }
3,234,176
int getGlobalChannelWindowStart(int w) { return (int) eventManager.getGlobalChannelWindowStart(w); }
int getGlobalChannelWindowStart(int w) { return (int) eventManager.getGlobalChannelWindowStart(w); }
3,234,177
void setChannelWindowEnd(int value) { int w = view.getDomainPane().getWavelengths().getSelectedIndex(); eventManager.setChannelWindowEnd(w, value); }
void setChannelWindowEnd(int value) { int w = view.getDomainPane().getWavelengths().getSelectedIndex(); eventManager.setChannelWindowEnd(w, value); }
3,234,178
void setChannelWindowStart(int value) { int w = view.getDomainPane().getWavelengths().getSelectedIndex(); eventManager.setChannelWindowStart(w, value); }
void setChannelWindowStart(int value) { int w = view.getDomainPane().getWavelengths().getSelectedIndex(); eventManager.setChannelWindowStart(w, value); }
3,234,179
void setCodomainMap(CodomainMapContext ctx, boolean selected, int id) { if (id == CodomainPaneManager.RI) updateGraphic(selected); if (selected) eventManager.addCodomainMap(ctx); else eventManager.removeCodomainMap(ctx); }
void setCodomainMap(CodomainMapContext ctx, boolean selected, int id) { if (id == CodomainPaneManager.RI) updateGraphic(selected); if (selected) eventManager.addCodomainMap(ctx); else eventManager.removeCodomainMap(ctx); }
3,234,180
void setQuantumStrategy(double k, int family, int resolution, int id) { if (id == DomainPaneManager.FAMILY) updateGraphic(family); else if (id == DomainPaneManager.GAMMA) updateGraphic((int) (k*10), family); //for graphic *10 eventManager.setQuantumStrategy(k, family, resolution); }
void setQuantumStrategy(double k, int family, int resolution, int id) { if (id == DomainPaneManager.FAMILY) updateGraphic(family); else if (id == DomainPaneManager.GAMMA) updateGraphic((int) (k*10), family); //for graphic *10 eventManager.setQuantumStrategy(k, family, resolution); }
3,234,181
void setWavelength(int w) { view.getGRPane().removeAll(); GraphicsRepresentation gr = view.getGRepresentation(); gr = null; int mini = (int) eventManager.getGlobalChannelWindowStart(w); int maxi = (int) eventManager.getGlobalChannelWindowEnd(w); int s = (int) eventManager.getChannelWindowStart(w); int e = (int) eventManager.getChannelWindowEnd(w); QuantumDef qDef = getQuantumDef(); gr = new GraphicsRepresentation(this, qDef.family, qDef.curveCoefficient, qDef.cdStart, qDef.cdEnd, mini, maxi); gr.setReverseIntensity(view.getCodomainPane().getRI().isSelected()); if (qDef.family == QuantumFactory.EXPONENTIAL) gr.setDefaultExponential(s, e); else gr.setDefaultLinear(s, e); view.setGRepresentation(gr); view.buildGRPane(); eventManager.setMappingPane(); }
void setWavelength(int w) { view.getGRPane().removeAll(); GraphicsRepresentation gr = view.getGRepresentation(); gr = null; int mini = (int) eventManager.getGlobalChannelWindowStart(w); int maxi = (int) eventManager.getGlobalChannelWindowEnd(w); int s = (int) eventManager.getChannelWindowStart(w); int e = (int) eventManager.getChannelWindowEnd(w); QuantumDef qDef = getQuantumDef(); gr = new GraphicsRepresentation(this, qDef.family, qDef.curveCoefficient, qDef.cdStart, qDef.cdEnd, mini, maxi); gr.setReverseIntensity(view.getCodomainPane().getRI().isSelected()); if (qDef.family == QuantumFactory.EXPONENTIAL) gr.setDefaultExponential(s, e); else gr.setDefaultLinear(s, e); view.setGRepresentation(gr); view.buildGRPane(); eventManager.setMappingPane(); }
3,234,182
void updateCodomainMap(CodomainMapContext ctx) { eventManager.updateCodomainMap(ctx); }
void updateCodomainMap(CodomainMapContext ctx) { eventManager.updateCodomainMap(ctx); }
3,234,183
private void updateGraphic(int coefficient, int family) { if (family == QuantumFactory.POLYNOMIAL) view.getGRepresentation().setControlLocation(coefficient); else if (family == QuantumFactory.EXPONENTIAL) view.getGRepresentation().setControlAndEndLocation(coefficient); }
private void updateGraphic(int coefficient, int family) { if (family == QuantumFactory.POLYNOMIAL) view.getGRepresentation().setControlLocation(coefficient); else if (family == QuantumFactory.EXPONENTIAL) view.getGRepresentation().setControlAndEndLocation(coefficient); }
3,234,184
void disposeDialogs() { if (histogramDialog != null) histogramDialog.dispose(); histogramDialog = null; }
void disposeDialogs() { if (histogramDialog != null) histogramDialog.dispose(); histogramDialog = null; }
3,234,185
void resetDefaults() { resetDefaultGamma(); resetDefaultBitResolution(); resetDefaultComboBox(view.getTransformations(), QuantumFactory.LINEAR); resetDefaultComboBox(view.getWavelengths(), 0); histogramDialog = null; }
void resetDefaults() { resetDefaultGamma(); resetDefaultBitResolution(); resetDefaultComboBox(view.getTransformations(), QuantumFactory.LINEAR); resetDefaultComboBox(view.getWavelengths(), 0); histogramDialog = null; }
3,234,186
void setInputWindowEnd(int value) { if (histogramDialog != null) histogramDialog.getManager().setInputWindowEnd(value); }
void setInputWindowEnd(int value) { if (histogramDialog != null) histogramDialog.getManager().setInputWindowEnd(value); }
3,234,187