conflict_resolution
stringlengths
27
16k
<<<<<<< public ActionPropertyObjectEntity<?> getSelectorAction(FormEntity entity, Version version) { Property<P> property = propertyObject.property; GroupObjectEntity groupObject = getNFToDraw(entity, version); if(groupObject != null) { ImMap<P, ObjectEntity> groupObjects = propertyObject.mapping.filterValues(groupObject.getObjects()); // берем нижний объект в toDraw for (ObjectEntity objectInstance : groupObjects.valueIt()) { if (objectInstance.baseClass instanceof CustomClass) { ExplicitActionProperty dialogAction = objectInstance.getChangeAction(property); return new ActionPropertyObjectEntity<>(dialogAction, MapFact.singleton(dialogAction.interfaces.single(), (PropertyObjectInterfaceEntity) objectInstance)); } ======= ActionPropertyMapImplement<?, P> editActionImplement = propertyObject.property.getEditAction(actionId); return editActionImplement == null ? null : editActionImplement.mapObjects(propertyObject.mapping); } private ActionPropertyObjectEntity<?> getSelectorAction(Property<P> property, FormEntity entity) { ImMap<P, ObjectEntity> groupObjects = propertyObject.mapping.filterValues(getToDraw(entity).getObjects()); // берем нижний объект в toDraw for (ObjectEntity objectInstance : groupObjects.valueIt()) { if (objectInstance.baseClass instanceof CustomClass) { ExplicitActionProperty dialogAction = objectInstance.getChangeAction(property); return new ActionPropertyObjectEntity<>( dialogAction, MapFact.singleton(dialogAction.interfaces.single(), objectInstance) ); >>>>>>> public ActionPropertyObjectEntity<?> getSelectorAction(FormEntity entity, Version version) { Property<P> property = propertyObject.property; GroupObjectEntity groupObject = getNFToDraw(entity, version); if(groupObject != null) { ImMap<P, ObjectEntity> groupObjects = propertyObject.mapping.filterValues(groupObject.getObjects()); // берем нижний объект в toDraw for (ObjectEntity objectInstance : groupObjects.valueIt()) { if (objectInstance.baseClass instanceof CustomClass) { ExplicitActionProperty dialogAction = objectInstance.getChangeAction(property); return new ActionPropertyObjectEntity<>(dialogAction, MapFact.singleton(dialogAction.interfaces.single(), objectInstance)); }
<<<<<<< InputStream inputStream = fileData.getInputStream(); boolean done = ftpClient.storeFile(remoteFile, inputStream); ======= InputStream inputStream = new FileInputStream(file); boolean done = ftpClient.storeFile(properties.remoteFile, inputStream); >>>>>>> InputStream inputStream = fileData.getInputStream(); boolean done = ftpClient.storeFile(properties.remoteFile, inputStream);
<<<<<<< ======= import org.apache.http.client.config.RequestConfig; import org.apache.http.client.methods.*; >>>>>>> <<<<<<< ======= Integer timeout = (Integer) context.getBL().LM.timeoutHttp.read(context); HttpResponse response = readHTTP(context, connectionString, timeout, bodyUrl, rNotUsedParams.result, headers, cookies, cookieStore); HttpEntity responseEntity = response.getEntity(); >>>>>>> <<<<<<< ======= private Map<String, List<String>> getResponseHeaders(HttpResponse response) { Map<String, List<String>> responseHeaders = new HashMap<>(); for(Header header : response.getAllHeaders()) { String headerName = header.getName(); List<String> headerValues = responseHeaders.get(headerName); if (headerValues == null) { headerValues = new ArrayList<>(); responseHeaders.put(headerName, headerValues); } headerValues.add(header.getValue()); } return responseHeaders; } private String[] getResponseHeaderValues(Map<String, List<String>> responseHeaders, String[] headerNames) { String[] headerValuesArray = new String[headerNames.length]; for (int i = 0; i < headerNames.length; i++) { headerValuesArray[i] = StringUtils.join(responseHeaders.get(headerNames[i]).iterator(), ","); } return headerValuesArray; } private Map<String, String> getResponseCookies(CookieStore cookieStore) { Map<String, String> responseCookies = new HashMap<>(); for(Cookie cookie : cookieStore.getCookies()) { responseCookies.put(cookie.getName(), cookie.getValue()); } return responseCookies; } private HttpResponse readHTTP(ExecutionContext<PropertyInterface> context, String connectionString, Integer timeout, String bodyUrl, ImOrderSet<PropertyInterface> bodyParams, ImMap<String, String> headers, ImMap<String, String> cookies, CookieStore cookieStore) throws IOException { Object[] paramList = new Object[bodyParams.size()]; for (int i=0,size=bodyParams.size();i<size;i++) paramList[i] = format(context, bodyParams.get(i), null); // пока в body ничего не кодируем (так как content-type'ы другие) HttpUriRequest httpRequest; switch (method) { case GET: { httpRequest = new HttpGet(connectionString); break; } case DELETE: { httpRequest = new HttpDelete(connectionString); break; } case PUT: case POST: default: { if(method.equals(PUT)) httpRequest = new HttpPut(connectionString); else httpRequest = new HttpPost(connectionString); HttpEntity entity = ExternalUtils.getInputStreamFromList(paramList, bodyUrl, null); if (!headers.containsKey("Content-Type")) httpRequest.addHeader("Content-Type", entity.getContentType().getValue()); ((HttpEntityEnclosingRequestBase) httpRequest).setEntity(entity); break; } } for(int i=0,size=headers.size();i<size;i++) httpRequest.addHeader(headers.getKey(i), headers.getValue(i)); for(int i=0,size=cookies.size();i<size;i++) { BasicClientCookie cookie = parseRawCookie(cookies.getKey(i), cookies.getValue(i)); cookieStore.addCookie(cookie); } HttpClientBuilder requestBuilder = HttpClientBuilder.create().setDefaultCookieStore(cookieStore).useSystemProperties(); if(timeout != null) { RequestConfig.Builder configBuilder = RequestConfig.custom(); configBuilder.setConnectTimeout(timeout); configBuilder.setConnectionRequestTimeout(timeout); requestBuilder.setDefaultRequestConfig(configBuilder.build()); } return requestBuilder.build().execute(httpRequest); } private BasicClientCookie parseRawCookie(String cookieName, String rawCookie) { BasicClientCookie cookie; String[] rawCookieParams = rawCookie.split(";"); String cookieValue = rawCookieParams[0]; cookie = new BasicClientCookie(cookieName, cookieValue); for (int i = 1; i < rawCookieParams.length; i++) { String[] rawCookieParam = rawCookieParams[i].split("="); String paramName = rawCookieParam[0].trim(); if (paramName.equalsIgnoreCase("secure")) { cookie.setSecure(true); } else if (rawCookieParam.length == 2) { String paramValue = rawCookieParam[1].trim(); if (paramName.equalsIgnoreCase("expires")) { cookie.setExpiryDate(parseDate(paramValue)); } else if (paramName.equalsIgnoreCase("max-age")) { long maxAge = Long.parseLong(paramValue); Date expiryDate = new Date(System.currentTimeMillis() + maxAge); cookie.setExpiryDate(expiryDate); } else if (paramName.equalsIgnoreCase("domain")) { cookie.setDomain(paramValue); } else if (paramName.equalsIgnoreCase("path")) { cookie.setPath(paramValue); } else if (paramName.equalsIgnoreCase("comment")) { cookie.setPath(paramValue); } } } return cookie; } private Date parseDate(String value) { try { return new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ssZZZ").parse(value); } catch (java.text.ParseException e) { return null; } } >>>>>>>
<<<<<<< return BaseUtils.immutableCast(getStoredProperties().filterOrder(new SFunctionSet<Property>() { public boolean contains(Property property) { boolean recalculate; try { recalculate = reflectionLM.disableClassesTableColumn.read(dataSession, reflectionLM.tableColumnSID.readClasses(dataSession, new DataObject(property.getDBName()))) == null; } catch (SQLException | SQLHandledException e) { throw Throwables.propagate(e); } return recalculate && (property instanceof StoredDataProperty || property instanceof ClassDataProperty); ======= return BaseUtils.immutableCast(getStoredProperties().filterOrder(property -> { boolean recalculate; try { recalculate = reflectionLM.notRecalculateTableColumn.read(dataSession, reflectionLM.tableColumnSID.readClasses(dataSession, new DataObject(property.getDBName()))) == null; } catch (SQLException | SQLHandledException e) { throw Throwables.propagate(e); >>>>>>> return BaseUtils.immutableCast(getStoredProperties().filterOrder(property -> { boolean recalculate; try { recalculate = reflectionLM.disableClassesTableColumn.read(dataSession, reflectionLM.tableColumnSID.readClasses(dataSession, new DataObject(property.getDBName()))) == null; } catch (SQLException | SQLHandledException e) { throw Throwables.propagate(e);
<<<<<<< this.scrub.value = MathHelper.clamp(this.scrub.value, 0, this.scrub.max); ======= this.scrub.value = MathHelper.clamp_int(this.scrub.value, this.scrub.min, this.scrub.max); >>>>>>> this.scrub.value = MathHelper.clamp(this.scrub.value, this.scrub.min, this.scrub.max);
<<<<<<< import lsfusion.base.BaseUtils; import lsfusion.base.MutableObject; import lsfusion.base.Result; ======= import lsfusion.base.mutability.MutableObject; >>>>>>> import lsfusion.base.BaseUtils; import lsfusion.base.mutability.MutableObject; import lsfusion.base.Result;
<<<<<<< x1 = MathHelper.clamp(x1, 0, 1); x2 = MathHelper.clamp(x2, 0, 1); ======= e = h == 0 ? e : Math.max(Math.min(e, 1 / h * e), 0.00001F); x1 = MathHelper.clamp_float(x1, 0, 1); x2 = MathHelper.clamp_float(x2, 0, 1); >>>>>>> e = h == 0 ? e : Math.max(Math.min(e, 1 / h * e), 0.00001F); x1 = MathHelper.clamp(x1, 0, 1); x2 = MathHelper.clamp(x2, 0, 1);
<<<<<<< import lsfusion.server.logics.property.actions.flow.*; import lsfusion.server.logics.property.actions.integration.FormIntegrationType; import lsfusion.server.logics.property.actions.integration.IntegrationFormEntity; import lsfusion.server.logics.property.actions.integration.exporting.ExportActionProperty; import lsfusion.server.logics.property.actions.integration.exporting.hierarchy.json.ExportJSONActionProperty; import lsfusion.server.logics.property.actions.integration.exporting.hierarchy.xml.ExportXMLActionProperty; import lsfusion.server.logics.property.actions.integration.exporting.plain.csv.ExportCSVActionProperty; import lsfusion.server.logics.property.actions.integration.exporting.plain.dbf.ExportDBFActionProperty; import lsfusion.server.logics.property.actions.integration.exporting.plain.table.ExportTableActionProperty; import lsfusion.server.logics.property.actions.integration.exporting.plain.xls.ExportXLSActionProperty; import lsfusion.server.logics.property.actions.integration.importing.ImportActionProperty; import lsfusion.server.logics.property.actions.integration.importing.hierarchy.json.ImportJSONActionProperty; import lsfusion.server.logics.property.actions.integration.importing.hierarchy.xml.ImportXMLActionProperty; import lsfusion.server.logics.property.actions.integration.importing.plain.csv.ImportCSVActionProperty; import lsfusion.server.logics.property.actions.integration.importing.plain.dbf.ImportDBFActionProperty; import lsfusion.server.logics.property.actions.integration.importing.plain.table.ImportTableActionProperty; import lsfusion.server.logics.property.actions.integration.importing.plain.xls.ImportXLSActionProperty; ======= import lsfusion.server.logics.form.stat.integration.FormIntegrationType; import lsfusion.server.logics.form.stat.integration.IntegrationFormEntity; import lsfusion.server.logics.form.stat.integration.exporting.ExportActionProperty; import lsfusion.server.logics.form.stat.integration.exporting.hierarchy.json.ExportJSONActionProperty; import lsfusion.server.logics.form.stat.integration.exporting.hierarchy.xml.ExportXMLActionProperty; import lsfusion.server.logics.form.stat.integration.exporting.plain.csv.ExportCSVActionProperty; import lsfusion.server.logics.form.stat.integration.exporting.plain.dbf.ExportDBFActionProperty; import lsfusion.server.logics.form.stat.integration.exporting.plain.table.ExportTableActionProperty; import lsfusion.server.logics.form.stat.integration.exporting.plain.xls.ExportXLSActionProperty; import lsfusion.server.logics.form.stat.integration.importing.ImportActionProperty; import lsfusion.server.logics.form.stat.integration.importing.hierarchy.json.ImportJSONActionProperty; import lsfusion.server.logics.form.stat.integration.importing.hierarchy.xml.ImportXMLActionProperty; import lsfusion.server.logics.form.stat.integration.importing.plain.csv.ImportCSVActionProperty; import lsfusion.server.logics.form.stat.integration.importing.plain.dbf.ImportDBFActionProperty; import lsfusion.server.logics.form.stat.integration.importing.plain.table.ImportTableActionProperty; import lsfusion.server.logics.form.stat.integration.importing.plain.xls.ImportXLSActionProperty; >>>>>>> import lsfusion.server.logics.form.stat.integration.FormIntegrationType; import lsfusion.server.logics.form.stat.integration.IntegrationFormEntity; import lsfusion.server.logics.form.stat.integration.exporting.ExportActionProperty; import lsfusion.server.logics.form.stat.integration.exporting.hierarchy.json.ExportJSONActionProperty; import lsfusion.server.logics.form.stat.integration.exporting.hierarchy.xml.ExportXMLActionProperty; import lsfusion.server.logics.form.stat.integration.exporting.plain.csv.ExportCSVActionProperty; import lsfusion.server.logics.form.stat.integration.exporting.plain.dbf.ExportDBFActionProperty; import lsfusion.server.logics.form.stat.integration.exporting.plain.table.ExportTableActionProperty; import lsfusion.server.logics.form.stat.integration.exporting.plain.xls.ExportXLSActionProperty; import lsfusion.server.logics.form.stat.integration.importing.ImportActionProperty; import lsfusion.server.logics.form.stat.integration.importing.hierarchy.json.ImportJSONActionProperty; import lsfusion.server.logics.form.stat.integration.importing.hierarchy.xml.ImportXMLActionProperty; import lsfusion.server.logics.form.stat.integration.importing.plain.csv.ImportCSVActionProperty; import lsfusion.server.logics.form.stat.integration.importing.plain.dbf.ImportDBFActionProperty; import lsfusion.server.logics.form.stat.integration.importing.plain.table.ImportTableActionProperty; import lsfusion.server.logics.form.stat.integration.importing.plain.xls.ImportXLSActionProperty; import lsfusion.server.logics.property.actions.flow.*; import lsfusion.server.logics.property.actions.integration.FormIntegrationType; import lsfusion.server.logics.property.actions.integration.IntegrationFormEntity; import lsfusion.server.logics.property.actions.integration.exporting.ExportActionProperty; import lsfusion.server.logics.property.actions.integration.exporting.hierarchy.json.ExportJSONActionProperty; import lsfusion.server.logics.property.actions.integration.exporting.hierarchy.xml.ExportXMLActionProperty; import lsfusion.server.logics.property.actions.integration.exporting.plain.csv.ExportCSVActionProperty; import lsfusion.server.logics.property.actions.integration.exporting.plain.dbf.ExportDBFActionProperty; import lsfusion.server.logics.property.actions.integration.exporting.plain.table.ExportTableActionProperty; import lsfusion.server.logics.property.actions.integration.exporting.plain.xls.ExportXLSActionProperty; import lsfusion.server.logics.property.actions.integration.importing.ImportActionProperty; import lsfusion.server.logics.property.actions.integration.importing.hierarchy.json.ImportJSONActionProperty; import lsfusion.server.logics.property.actions.integration.importing.hierarchy.xml.ImportXMLActionProperty; import lsfusion.server.logics.property.actions.integration.importing.plain.csv.ImportCSVActionProperty; import lsfusion.server.logics.property.actions.integration.importing.plain.dbf.ImportDBFActionProperty; import lsfusion.server.logics.property.actions.integration.importing.plain.table.ImportTableActionProperty; import lsfusion.server.logics.property.actions.integration.importing.plain.xls.ImportXLSActionProperty; <<<<<<< import lsfusion.server.logics.resolving.ResolveManager; import lsfusion.server.logics.resolving.ResolvingErrors; import lsfusion.server.logics.scripted.EvalActionProperty; import lsfusion.server.logics.scripted.LazyActionProperty; import lsfusion.server.logics.scripted.MetaCodeFragment; import lsfusion.server.logics.scripted.ScriptingLogicsModule; ======= import lsfusion.server.language.resolving.ResolveManager; import lsfusion.server.language.resolving.ResolvingErrors; >>>>>>> import lsfusion.server.language.resolving.ResolveManager; import lsfusion.server.language.resolving.ResolvingErrors; import lsfusion.server.logics.resolving.ResolveManager; import lsfusion.server.logics.resolving.ResolvingErrors; import lsfusion.server.logics.scripted.EvalActionProperty; import lsfusion.server.logics.scripted.LazyActionProperty; import lsfusion.server.logics.scripted.MetaCodeFragment; import lsfusion.server.logics.scripted.ScriptingLogicsModule;
<<<<<<< package lsfusion.server.logics.scripted.proxy; import lsfusion.server.classes.DateClass; import lsfusion.server.classes.DateTimeClass; import lsfusion.server.classes.IntegralClass; import lsfusion.server.classes.TimeClass; import lsfusion.server.data.type.Type; import lsfusion.server.form.view.PropertyDrawView; import lsfusion.server.logics.PropertyUtils; import lsfusion.server.logics.i18n.LocalizedString; import javax.swing.*; import java.awt.*; import java.text.DecimalFormat; import java.text.SimpleDateFormat; public class PropertyDrawViewProxy extends ComponentViewProxy<PropertyDrawView> { public PropertyDrawViewProxy(PropertyDrawView target) { super(target); } public void setPanelCaptionAfter(boolean panelCaptionAfter) { target.panelCaptionAfter = panelCaptionAfter; } public void setEditOnSingleClick(boolean editOnSingleClick) { target.editOnSingleClick = editOnSingleClick; } public void setHide(boolean hide) { target.hide = hide; } public void setRegexp(LocalizedString regexp) { target.regexp = regexp.getSourceString(); } public void setRegexpMessage(LocalizedString regexpMessage) { target.regexpMessage = regexpMessage.getSourceString(); } public void setPattern(LocalizedString lPattern) { String pattern = lPattern.getSourceString(); Type type = target.getType(); if (type instanceof IntegralClass) { target.format = new DecimalFormat(pattern); } else if (type instanceof DateClass || type instanceof TimeClass || type instanceof DateTimeClass) { target.format = new SimpleDateFormat(pattern); } } public void setMaxValue(long maxValue) { target.maxValue = maxValue; } public void setEchoSymbols(boolean echoSymbols) { target.echoSymbols = echoSymbols; } public void setNoSort(boolean noSort) { target.noSort = noSort; } public void setDefaultCompare(String defaultCompare) { target.defaultCompare = PropertyUtils.stringToCompare(defaultCompare); } public void setValueSize(Dimension size) { target.setValueSize(size); } public void setValueHeight(int prefHeight) { if (target.valueSize == null) { target.valueSize = new Dimension(-1, prefHeight); } else { target.valueSize.height = prefHeight; } } public void setValueWidth(int prefWidth) { if (target.valueSize == null) { target.valueSize = new Dimension(prefWidth, -1); } else { target.valueSize.width = prefWidth; } } public void setNumRowHeight(int numRowHeight) { target.setNumRowHeight(numRowHeight); } public void setCharWidth(int charWidth) { target.setCharWidth(charWidth); } public void setChangeKey(KeyStroke editKey) { target.changeKey = editKey; } public void setShowChangeKey(boolean showEditKey) { target.showChangeKey = showEditKey; } public void setFocusable(Boolean focusable) { target.focusable = focusable; } public void setPanelCaptionAbove(boolean panelCaptionAbove) { target.panelCaptionAbove = panelCaptionAbove; } public void setCaption(LocalizedString caption) { target.caption = caption; } public void setClearText(boolean clearText) { target.clearText = clearText; } public void setNotSelectAll(boolean notSelectAll) { target.notSelectAll = notSelectAll; } public void setAskConfirm(boolean askConfirm) { target.entity.askConfirm = askConfirm; } public void setAskConfirmMessage(LocalizedString askConfirmMessage) { target.entity.askConfirmMessage = askConfirmMessage.getSourceString(); } public void setToolTip(LocalizedString toolTip) { target.toolTip = toolTip.getSourceString(); } public void setNotNull(boolean notNull) { target.notNull = notNull; } } ======= package lsfusion.server.logics.scripted.proxy; import lsfusion.server.classes.DateClass; import lsfusion.server.classes.DateTimeClass; import lsfusion.server.classes.IntegralClass; import lsfusion.server.classes.TimeClass; import lsfusion.server.data.type.Type; import lsfusion.server.form.view.PropertyDrawView; import lsfusion.server.logics.PropertyUtils; import lsfusion.server.logics.i18n.LocalizedString; import javax.swing.*; import java.awt.*; import java.text.DecimalFormat; import java.text.SimpleDateFormat; public class PropertyDrawViewProxy extends ComponentViewProxy<PropertyDrawView> { public PropertyDrawViewProxy(PropertyDrawView target) { super(target); } public void setPanelCaptionAfter(boolean panelCaptionAfter) { target.panelCaptionAfter = panelCaptionAfter; } public void setEditOnSingleClick(boolean editOnSingleClick) { target.editOnSingleClick = editOnSingleClick; } public void setHide(boolean hide) { target.hide = hide; } public void setRegexp(LocalizedString regexp) { target.regexp = regexp.getSourceString(); } public void setRegexpMessage(LocalizedString regexpMessage) { target.regexpMessage = regexpMessage.getSourceString(); } public void setPattern(LocalizedString lPattern) { String pattern = lPattern.getSourceString(); if(target.isCalcProperty()) { Type type = target.getType(); if (type instanceof IntegralClass) { target.format = new DecimalFormat(pattern); } else if (type instanceof DateClass || type instanceof TimeClass || type instanceof DateTimeClass) { target.format = new SimpleDateFormat(pattern); } } } public void setMaxValue(long maxValue) { target.maxValue = maxValue; } public void setEchoSymbols(boolean echoSymbols) { target.echoSymbols = echoSymbols; } public void setNoSort(boolean noSort) { target.noSort = noSort; } public void setDefaultCompare(String defaultCompare) { target.defaultCompare = PropertyUtils.stringToCompare(defaultCompare); } public void setValueSize(Dimension size) { target.setValueSize(size); } public void setValueHeight(int prefHeight) { if (target.valueSize == null) { target.valueSize = new Dimension(-1, prefHeight); } else { target.valueSize.height = prefHeight; } } public void setValueWidth(int prefWidth) { if (target.valueSize == null) { target.valueSize = new Dimension(prefWidth, -1); } else { target.valueSize.width = prefWidth; } } public void setCharWidth(int charWidth) { target.setCharWidth(charWidth); } public void setChangeKey(KeyStroke editKey) { target.changeKey = editKey; } public void setShowChangeKey(boolean showEditKey) { target.showChangeKey = showEditKey; } public void setFocusable(Boolean focusable) { target.focusable = focusable; } public void setPanelCaptionAbove(boolean panelCaptionAbove) { target.panelCaptionAbove = panelCaptionAbove; } public void setCaption(LocalizedString caption) { target.caption = caption; } public void setClearText(boolean clearText) { target.clearText = clearText; } public void setNotSelectAll(boolean notSelectAll) { target.notSelectAll = notSelectAll; } public void setAskConfirm(boolean askConfirm) { target.entity.askConfirm = askConfirm; } public void setAskConfirmMessage(LocalizedString askConfirmMessage) { target.entity.askConfirmMessage = askConfirmMessage.getSourceString(); } public void setToolTip(LocalizedString toolTip) { target.toolTip = toolTip.getSourceString(); } public void setNotNull(boolean notNull) { target.notNull = notNull; } } >>>>>>> package lsfusion.server.logics.scripted.proxy; import lsfusion.server.classes.DateClass; import lsfusion.server.classes.DateTimeClass; import lsfusion.server.classes.IntegralClass; import lsfusion.server.classes.TimeClass; import lsfusion.server.data.type.Type; import lsfusion.server.form.view.PropertyDrawView; import lsfusion.server.logics.PropertyUtils; import lsfusion.server.logics.i18n.LocalizedString; import javax.swing.*; import java.awt.*; import java.text.DecimalFormat; import java.text.SimpleDateFormat; public class PropertyDrawViewProxy extends ComponentViewProxy<PropertyDrawView> { public PropertyDrawViewProxy(PropertyDrawView target) { super(target); } public void setPanelCaptionAfter(boolean panelCaptionAfter) { target.panelCaptionAfter = panelCaptionAfter; } public void setEditOnSingleClick(boolean editOnSingleClick) { target.editOnSingleClick = editOnSingleClick; } public void setHide(boolean hide) { target.hide = hide; } public void setRegexp(LocalizedString regexp) { target.regexp = regexp.getSourceString(); } public void setRegexpMessage(LocalizedString regexpMessage) { target.regexpMessage = regexpMessage.getSourceString(); } public void setPattern(LocalizedString lPattern) { String pattern = lPattern.getSourceString(); if(target.isCalcProperty()) { Type type = target.getType(); if (type instanceof IntegralClass) { target.format = new DecimalFormat(pattern); } else if (type instanceof DateClass || type instanceof TimeClass || type instanceof DateTimeClass) { target.format = new SimpleDateFormat(pattern); } } } public void setMaxValue(long maxValue) { target.maxValue = maxValue; } public void setEchoSymbols(boolean echoSymbols) { target.echoSymbols = echoSymbols; } public void setNoSort(boolean noSort) { target.noSort = noSort; } public void setDefaultCompare(String defaultCompare) { target.defaultCompare = PropertyUtils.stringToCompare(defaultCompare); } public void setValueSize(Dimension size) { target.setValueSize(size); } public void setValueHeight(int prefHeight) { if (target.valueSize == null) { target.valueSize = new Dimension(-1, prefHeight); } else { target.valueSize.height = prefHeight; } } public void setValueWidth(int prefWidth) { if (target.valueSize == null) { target.valueSize = new Dimension(prefWidth, -1); } else { target.valueSize.width = prefWidth; } } public void setNumRowHeight(int numRowHeight) { target.setNumRowHeight(numRowHeight); } public void setCharWidth(int charWidth) { target.setCharWidth(charWidth); } public void setChangeKey(KeyStroke editKey) { target.changeKey = editKey; } public void setShowChangeKey(boolean showEditKey) { target.showChangeKey = showEditKey; } public void setFocusable(Boolean focusable) { target.focusable = focusable; } public void setPanelCaptionAbove(boolean panelCaptionAbove) { target.panelCaptionAbove = panelCaptionAbove; } public void setCaption(LocalizedString caption) { target.caption = caption; } public void setClearText(boolean clearText) { target.clearText = clearText; } public void setNotSelectAll(boolean notSelectAll) { target.notSelectAll = notSelectAll; } public void setAskConfirm(boolean askConfirm) { target.entity.askConfirm = askConfirm; } public void setAskConfirmMessage(LocalizedString askConfirmMessage) { target.entity.askConfirmMessage = askConfirmMessage.getSourceString(); } public void setToolTip(LocalizedString toolTip) { target.toolTip = toolTip.getSourceString(); } public void setNotNull(boolean notNull) { target.notNull = notNull; } }
<<<<<<< Long result = (Long) businessLogics.authenticationLM.computerHostname.read(session, new DataObject(strHostName)); if (result != null) { DataObject addObject = session.addObject(businessLogics.authenticationLM.computer); businessLogics.authenticationLM.hostnameComputer.change(strHostName, session, addObject); ======= try (DataSession session = createSession()) { Long result = (Long) businessLogics.authenticationLM.computerHostname.read(session, new DataObject(strHostName)); if (result == null) { DataObject addObject = session.addObject(businessLogics.authenticationLM.computer); businessLogics.authenticationLM.hostnameComputer.change(strHostName, session, addObject); result = (Long) addObject.object; apply(session, stack); } >>>>>>> Long result = (Long) businessLogics.authenticationLM.computerHostname.read(session, new DataObject(strHostName)); if (result == null) { DataObject addObject = session.addObject(businessLogics.authenticationLM.computer); businessLogics.authenticationLM.hostnameComputer.change(strHostName, session, addObject);
<<<<<<< import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantReadWriteLock; ======= >>>>>>> import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantReadWriteLock; <<<<<<< import android.util.SparseArray; ======= >>>>>>> import android.util.SparseArray; <<<<<<< setCachedResult(authenticationRequest, result); if (waitingRequest != null && waitingRequest.mDelagete != null) { Log.v(TAG, "Sending result to callback..."); waitingRequest.mDelagete.onSuccess(result); } removeWaitingRequest(requestId); ======= setItemToCache(authenticationRequest, result); mAuthorizationCallback.onSuccess(result); mAuthorizationCallback = null; >>>>>>> setItemToCache(authenticationRequest, result); if (waitingRequest != null && waitingRequest.mDelagete != null) { Log.v(TAG, "Sending result to callback..."); waitingRequest.mDelagete.onSuccess(result); } removeWaitingRequest(requestId); <<<<<<< private void waitingRequestOnError(final AuthenticationRequestState waitingRequest, int requestId, Exception exc) { if (waitingRequest != null && waitingRequest.mDelagete != null) { Log.v(TAG, "Sending error to callback..."); waitingRequest.mDelagete.onError(exc); } removeWaitingRequest(requestId); } private void removeWaitingRequest(int requestId) { Log.v(TAG, "Remove Waiting Request: " + requestId); writeLock.lock(); try { mDelegateMap.remove(requestId); } finally { writeLock.unlock(); } } private AuthenticationRequestState getWaitingRequest(int requestId) { Log.v(TAG, "Get Waiting Request: " + requestId); AuthenticationRequestState request = null; readLock.lock(); try { request = mDelegateMap.get(requestId); } finally { readLock.unlock(); } if (request == null && mAuthorizationCallback != null && requestId == mAuthorizationCallback.hashCode()) { // it does not have the caller callback. It will check the last // callback if set Logger.e(TAG, "Request callback is not available for requestid:" + requestId + ". It will use last callback.", "", ADALError.CALLBACK_IS_NOT_FOUND); request = new AuthenticationRequestState(0, null, mAuthorizationCallback); } return request; } private void putWaitingRequest(int requestId, AuthenticationRequestState requestState) { Log.v(TAG, "Put Waiting Request: " + requestId); if (requestId > 0 && requestState != null) { writeLock.lock(); try { mDelegateMap.put(requestId, requestState); } finally { writeLock.unlock(); } } } /** * Active authentication activity can be cancelled if it exists. It may not * be cancelled if activity is not launched yet. RequestId is the hashcode * of your AuthenticationCallback. * * @return true: if there is a valid waiting request and cancel message send * successfully. false: Request does not exist or cancel message not * send */ public boolean cancelAuthenticationActivity(int requestId) { AuthenticationRequestState request = getWaitingRequest(requestId); if (request == null || request.mDelagete == null) { // there is not any waiting callback Log.v(TAG, "Current callback is empty. There is not any active authentication."); return true; } Log.v(TAG, "Current callback is not empty. There is an active authentication."); // intent to cancel. Authentication activity registers for this message // at onCreate event. final Intent intent = new Intent(AuthenticationConstants.Browser.ACTION_CANCEL); final Bundle extras = new Bundle(); intent.putExtras(extras); intent.putExtra(AuthenticationConstants.Browser.REQUEST_ID, requestId); // send intent to cancel any active authentication activity. // it may not cancel it, if activity takes some time to launch. boolean cancelResult = LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent); if (cancelResult) { // clear callback if broadcast message was successful Log.v(TAG, "Cancel broadcast message was successful."); request.mCancelled = true; request.mDelagete.onError(new AuthenticationCancelError()); } else { // Activity is not launched yet or receiver is not registered Log.w(TAG, "Cancel broadcast message was not successful."); } return cancelResult; } private void setCachedResult(AuthenticationRequest request, AuthenticationResult result) { if (mTokenCacheStore != null) { mTokenCacheStore.setItem(new TokenCacheItem(request, result)); } } ======= >>>>>>> private void waitingRequestOnError(final AuthenticationRequestState waitingRequest, int requestId, Exception exc) { if (waitingRequest != null && waitingRequest.mDelagete != null) { Log.v(TAG, "Sending error to callback..."); waitingRequest.mDelagete.onError(exc); } removeWaitingRequest(requestId); } private void removeWaitingRequest(int requestId) { Log.v(TAG, "Remove Waiting Request: " + requestId); writeLock.lock(); try { mDelegateMap.remove(requestId); } finally { writeLock.unlock(); } } private AuthenticationRequestState getWaitingRequest(int requestId) { Log.v(TAG, "Get Waiting Request: " + requestId); AuthenticationRequestState request = null; readLock.lock(); try { request = mDelegateMap.get(requestId); } finally { readLock.unlock(); } if (request == null && mAuthorizationCallback != null && requestId == mAuthorizationCallback.hashCode()) { // it does not have the caller callback. It will check the last // callback if set Logger.e(TAG, "Request callback is not available for requestid:" + requestId + ". It will use last callback.", "", ADALError.CALLBACK_IS_NOT_FOUND); request = new AuthenticationRequestState(0, null, mAuthorizationCallback); } return request; } private void putWaitingRequest(int requestId, AuthenticationRequestState requestState) { Log.v(TAG, "Put Waiting Request: " + requestId); if (requestId > 0 && requestState != null) { writeLock.lock(); try { mDelegateMap.put(requestId, requestState); } finally { writeLock.unlock(); } } } /** * Active authentication activity can be cancelled if it exists. It may not * be cancelled if activity is not launched yet. RequestId is the hashcode * of your AuthenticationCallback. * * @return true: if there is a valid waiting request and cancel message send * successfully. false: Request does not exist or cancel message not * send */ public boolean cancelAuthenticationActivity(int requestId) { AuthenticationRequestState request = getWaitingRequest(requestId); if (request == null || request.mDelagete == null) { // there is not any waiting callback Log.v(TAG, "Current callback is empty. There is not any active authentication."); return true; } Log.v(TAG, "Current callback is not empty. There is an active authentication."); // intent to cancel. Authentication activity registers for this message // at onCreate event. final Intent intent = new Intent(AuthenticationConstants.Browser.ACTION_CANCEL); final Bundle extras = new Bundle(); intent.putExtras(extras); intent.putExtra(AuthenticationConstants.Browser.REQUEST_ID, requestId); // send intent to cancel any active authentication activity. // it may not cancel it, if activity takes some time to launch. boolean cancelResult = LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent); if (cancelResult) { // clear callback if broadcast message was successful Log.v(TAG, "Cancel broadcast message was successful."); request.mCancelled = true; request.mDelagete.onError(new AuthenticationCancelError()); } else { // Activity is not launched yet or receiver is not registered Log.w(TAG, "Cancel broadcast message was not successful."); } return cancelResult; } <<<<<<< // delegate map is used to remember callback if another // instance of authenticationContext is created for config // change or similar at client app. mAuthorizationCallback = externalCall; request.setRequestId(externalCall.hashCode()); Log.v(TAG, "Set hash code for callback:" + externalCall.hashCode()); putWaitingRequest(externalCall.hashCode(), new AuthenticationRequestState( externalCall.hashCode(), request, externalCall)); if (!startAuthenticationActivity(activity, request)) { mAuthorizationCallback.onError(new AuthenticationException( ======= // Authorization has one reference of callback // Authentication callback does not have restrictions if (mAuthorizationCallback == null) { mAuthorizationCallback = externalCall; } else { Log.e(TAG, "Webview is active for another session"); externalCall.onError(new AuthenticationException( ADALError.DEVELOPER_ONLY_ONE_LOGIN_IS_ALLOWED)); return; } // Set Activity for authorization flow setActivity(activity); setActivityDelegate(activity); // onActivityResult will process the returning url and then call // the externalcallback. if (!startAuthenticationActivity(request)) { externalCall.onError(new AuthenticationException( >>>>>>> // delegate map is used to remember callback if another // instance of authenticationContext is created for config // change or similar at client app. mAuthorizationCallback = externalCall; request.setRequestId(externalCall.hashCode()); Log.v(TAG, "Set hash code for callback:" + externalCall.hashCode()); putWaitingRequest(externalCall.hashCode(), new AuthenticationRequestState( externalCall.hashCode(), request, externalCall)); if (!startAuthenticationActivity(activity, request)) { mAuthorizationCallback.onError(new AuthenticationException(
<<<<<<< static { FontRenderer font = Minecraft.getMinecraft().fontRenderer; /* Registering per fixture panels */ PANELS.put(IdleFixture.class, new GuiIdleFixturePanel(font)); PANELS.put(PathFixture.class, new GuiPathFixturePanel(font)); PANELS.put(LookFixture.class, new GuiLookFixturePanel(font)); PANELS.put(FollowFixture.class, new GuiFollowFixturePanel(font)); PANELS.put(CircularFixture.class, new GuiCircularFixturePanel(font)); } ======= >>>>>>>
<<<<<<< import java.util.GregorianCalendar; import java.util.UUID; ======= import java.util.HashMap; >>>>>>> import java.util.GregorianCalendar; import java.util.UUID; import java.util.HashMap; <<<<<<< VALID_AUTHORITY, false, mockCache); ======= TEST_AUTHORITY, false, mockCache); >>>>>>> VALID_AUTHORITY, false, mockCache); <<<<<<< final AuthenticationContext context = new AuthenticationContext(mockContext, VALID_AUTHORITY, false, mockCache); ======= final AuthenticationContext context = new AuthenticationContext(mockContext, TEST_AUTHORITY, false, mockCache); >>>>>>> final AuthenticationContext context = new AuthenticationContext(mockContext, VALID_AUTHORITY, false, mockCache); <<<<<<< ======= // Check response in callback result assertNull("Error is null", callback.mException); assertNotNull("Cache is not empty for this request", mockCache.getItem(cachekey)); assertEquals("Cache refresh token is same as AuthenticationResult", mockCache.getItem(cachekey).getRefreshToken(), callback.mResult.getRefreshToken()); assertEquals("Cache access token is same as AuthenticationResult", mockCache.getItem(cachekey).getAccessToken(), callback.mResult.getAccessToken()); assertEquals("Cache expire time is same as AuthenticationResult", mockCache.getItem(cachekey).getExpiresOn(), callback.mResult.getExpiresOn()); assertNotNull("Token result", callback.mResult); assertEquals("Access Token is same as mock", "TokenFortestRefreshTokenPositive", callback.mResult.getAccessToken()); assertEquals("Refresh token is same as mock", "refresh112", callback.mResult.getRefreshToken()); } /** * acquire token with direct cache lookup * * @throws InterruptedException * @throws IllegalArgumentException * @throws NoSuchFieldException * @throws IllegalAccessException */ public void testAcquireTokenPositiveCacheLookup() throws InterruptedException, IllegalArgumentException, NoSuchFieldException, IllegalAccessException { MockCache cache = new MockCache(); TestMockContext mockContext = new TestMockContext(getContext()); String tokenExpected = "tokenInCache123="; TokenCacheItem tokenCacheItem = getCacheItemForLookup(tokenExpected); cache.setItem(tokenCacheItem); final AuthenticationContext context = new AuthenticationContext(mockContext, TEST_AUTHORITY, false, cache); final MockActivity testActivity = new MockActivity(); final CountDownLatch signal = new CountDownLatch(1); testActivity.mSignal = signal; MockAuthenticationCallback callback = new MockAuthenticationCallback(signal); // call acquire token which will try refresh token based on cache context.acquireToken(testActivity, "resource", "clientid", "redirectUri", "userid", callback); signal.await(CONTEXT_REQUEST_TIME_OUT, TimeUnit.MILLISECONDS); >>>>>>> <<<<<<< assertNotNull("Cache is Not empty for this item", mockCache.getItem(CacheKey.createCacheKey(VALID_AUTHORITY, "resource", "clientId"))); clearCache(context); } /** * authority and resource are case insensitive. Cache lookup will return * item from cache. * * @throws InterruptedException * @throws IllegalArgumentException * @throws NoSuchFieldException * @throws IllegalAccessException */ public void testAcquireTokenCacheLookup() throws InterruptedException, IllegalArgumentException, NoSuchFieldException, IllegalAccessException { TestMockContext mockContext = new TestMockContext(getContext()); String tokenToTest = "accessToken=" + UUID.randomUUID(); ITokenCacheStore mockCache = getValidCache(tokenToTest); final AuthenticationContext context = new AuthenticationContext(mockContext, VALID_AUTHORITY, false, mockCache); final MockActivity testActivity = new MockActivity(); final CountDownLatch signal = new CountDownLatch(1); testActivity.mSignal = signal; MockAuthenticationCallback callback = new MockAuthenticationCallback(signal); // acquire token call will return from cache context.acquireToken(testActivity, "reSourCe", "ClienTid", "redirectUri", "userid", callback); signal.await(CONTEXT_REQUEST_TIME_OUT, TimeUnit.MILLISECONDS); // Check response in callback assertNull("Error is null", callback.mException); assertEquals("Same token in response as in cache", tokenToTest, callback.mResult.getAccessToken()); clearCache(context); ======= assertNotNull("Cache is Not empty for this item", cache.getItem(CacheKey.createCacheKey(TEST_AUTHORITY, "resource", "clientid"))); assertEquals("Expires time are same before and after access", tokenCacheItem.getExpiresOn(), callback.mResult.getExpiresOn()); assertEquals("Token is same as mock", tokenCacheItem.getAccessToken(), callback.mResult.getAccessToken()); } /** * @return cache with token to test */ private TokenCacheItem getCacheItemForLookup(String tokenToTest) { Calendar timeNow = Calendar.getInstance(); timeNow.roll(Calendar.MINUTE, 20); TokenCacheItem refreshItem = new TokenCacheItem(); refreshItem.setAuthority(TEST_AUTHORITY); refreshItem.setResource("resource"); refreshItem.setClientId("clientid"); refreshItem.setAccessToken(tokenToTest); refreshItem.setRefreshToken("refreshToken="); refreshItem.setExpiresOn(timeNow.getTime()); return refreshItem; >>>>>>> assertNotNull("Cache is Not empty for this item", mockCache.getItem(CacheKey.createCacheKey(VALID_AUTHORITY, "resource", "clientId"))); clearCache(context); } /** * authority and resource are case insensitive. Cache lookup will return * item from cache. * * @throws InterruptedException * @throws IllegalArgumentException * @throws NoSuchFieldException * @throws IllegalAccessException */ public void testAcquireTokenCacheLookup() throws InterruptedException, IllegalArgumentException, NoSuchFieldException, IllegalAccessException { TestMockContext mockContext = new TestMockContext(getContext()); String tokenToTest = "accessToken=" + UUID.randomUUID(); ITokenCacheStore mockCache = getValidCache(tokenToTest); final AuthenticationContext context = new AuthenticationContext(mockContext, VALID_AUTHORITY, false, mockCache); final MockActivity testActivity = new MockActivity(); final CountDownLatch signal = new CountDownLatch(1); testActivity.mSignal = signal; MockAuthenticationCallback callback = new MockAuthenticationCallback(signal); // acquire token call will return from cache context.acquireToken(testActivity, "reSourCe", "ClienTid", "redirectUri", "userid", callback); signal.await(CONTEXT_REQUEST_TIME_OUT, TimeUnit.MILLISECONDS); // Check response in callback assertNull("Error is null", callback.mException); assertEquals("Same token in response as in cache", tokenToTest, callback.mResult.getAccessToken()); clearCache(context); <<<<<<< private ITokenCacheStore getValidCache(String token) { DefaultTokenCacheStore cache = new DefaultTokenCacheStore(getContext()); // Code response final Calendar timeAhead = new GregorianCalendar(); timeAhead.roll(Calendar.MINUTE, 10); TokenCacheItem refreshItem = new TokenCacheItem(); refreshItem.setAuthority(VALID_AUTHORITY); refreshItem.setResource("resource"); refreshItem.setClientId("clientId"); refreshItem.setAccessToken(token); refreshItem.setRefreshToken("refreshToken="); refreshItem.setExpiresOn(timeAhead.getTime()); cache.setItem(refreshItem); return cache; } private void clearCache(AuthenticationContext context) { if(context.getCache() != null){ context.getCache().removeAll(); } } ======= class MockCache implements ITokenCacheStore { private static final String TAG = "MockCache"; HashMap<String, TokenCacheItem> mCache = new HashMap<String, TokenCacheItem>(); @Override public TokenCacheItem getItem(CacheKey key) { Log.d(TAG, "Mock cache get item:" + key.toString()); return mCache.get(key.toString()); } @Override public void setItem(TokenCacheItem item) { Log.d(TAG, "Mock cache set item:" + item.toString()); mCache.put(CacheKey.createCacheKey(item).toString(), item); } @Override public void removeItem(CacheKey key) { // TODO Auto-generated method stub } @Override public void removeItem(TokenCacheItem item) { // TODO Auto-generated method stub } @Override public void removeAll() { // TODO Auto-generated method stub } } >>>>>>> private ITokenCacheStore getValidCache(String token) { DefaultTokenCacheStore cache = new DefaultTokenCacheStore(getContext()); // Code response final Calendar timeAhead = new GregorianCalendar(); timeAhead.roll(Calendar.MINUTE, 10); TokenCacheItem refreshItem = new TokenCacheItem(); refreshItem.setAuthority(VALID_AUTHORITY); refreshItem.setResource("resource"); refreshItem.setClientId("clientId"); refreshItem.setAccessToken(token); refreshItem.setRefreshToken("refreshToken="); refreshItem.setExpiresOn(timeAhead.getTime()); cache.setItem(refreshItem); return cache; } private void clearCache(AuthenticationContext context) { if (context.getCache() != null) { context.getCache().removeAll(); } } class MockCache implements ITokenCacheStore { private static final String TAG = "MockCache"; HashMap<String, TokenCacheItem> mCache = new HashMap<String, TokenCacheItem>(); @Override public TokenCacheItem getItem(CacheKey key) { Log.d(TAG, "Mock cache get item:" + key.toString()); return mCache.get(key.toString()); } @Override public void setItem(TokenCacheItem item) { Log.d(TAG, "Mock cache set item:" + item.toString()); mCache.put(CacheKey.createCacheKey(item).toString(), item); } @Override public void removeItem(CacheKey key) { // TODO Auto-generated method stub } @Override public void removeItem(TokenCacheItem item) { // TODO Auto-generated method stub } @Override public boolean contains(CacheKey key) { // TODO Auto-generated method stub return false; } @Override public void removeAll() { // TODO Auto-generated method stub } }
<<<<<<< redirectUri = checkInputParameters(resource, clientId, redirectUri, callback); final String requestId = Telemetry.registerNewRequest(); final APIEvent apiEvent = createApiEvent(mContext, clientId, requestId, EventStrings.ACQUIRE_TOKEN_1); apiEvent.setLoginHint(loginHint); final AuthenticationRequest request = new AuthenticationRequest(mAuthority, resource, clientId, redirectUri, loginHint, PromptBehavior.Auto, null, getRequestCorrelationId(), getExtendedLifetimeEnabled()); request.setUserIdentifierType(UserIdentifierType.LoginHint); request.setTelemetryRequestId(requestId); createAcquireTokenRequest(apiEvent).acquireToken(wrapActivity(activity), false, request, callback); ======= if (checkPreRequirements(resource, clientId, callback)) { redirectUri = getRedirectUri(redirectUri); final AuthenticationRequest request = new AuthenticationRequest(mAuthority, resource, clientId, redirectUri, loginHint, PromptBehavior.Auto, null, getRequestCorrelationId(), getExtendedLifetimeEnabled()); request.setUserIdentifierType(UserIdentifierType.LoginHint); createAcquireTokenRequest().acquireToken(wrapActivity(activity), false, request, callback); } >>>>>>> if (checkPreRequirements(resource, clientId, callback)) { final String requestId = Telemetry.registerNewRequest(); final APIEvent apiEvent = createApiEvent(mContext, clientId, requestId, EventStrings.ACQUIRE_TOKEN_1); apiEvent.setLoginHint(loginHint); redirectUri = getRedirectUri(redirectUri); final AuthenticationRequest request = new AuthenticationRequest(mAuthority, resource, clientId, redirectUri, loginHint, PromptBehavior.Auto, null, getRequestCorrelationId(), getExtendedLifetimeEnabled()); request.setUserIdentifierType(UserIdentifierType.LoginHint); request.setTelemetryRequestId(requestId); createAcquireTokenRequest(apiEvent).acquireToken(wrapActivity(activity), false, request, callback); } <<<<<<< redirectUri = checkInputParameters(resource, clientId, redirectUri, callback); final String requestId = Telemetry.registerNewRequest(); final APIEvent apiEvent = createApiEvent(mContext, clientId, requestId, EventStrings.ACQUIRE_TOKEN_2); apiEvent.setLoginHint(loginHint); final AuthenticationRequest request = new AuthenticationRequest(mAuthority, resource, clientId, redirectUri, loginHint, PromptBehavior.Auto, extraQueryParameters, getRequestCorrelationId(), getExtendedLifetimeEnabled()); request.setUserIdentifierType(UserIdentifierType.LoginHint); request.setTelemetryRequestId(requestId); createAcquireTokenRequest(apiEvent).acquireToken(wrapActivity(activity), false, request, callback); ======= if (checkPreRequirements(resource, clientId, callback)) { redirectUri = getRedirectUri(redirectUri); final AuthenticationRequest request = new AuthenticationRequest(mAuthority, resource, clientId, redirectUri, loginHint, PromptBehavior.Auto, extraQueryParameters, getRequestCorrelationId(), getExtendedLifetimeEnabled()); request.setUserIdentifierType(UserIdentifierType.LoginHint); createAcquireTokenRequest().acquireToken(wrapActivity(activity), false, request, callback); } >>>>>>> if (checkPreRequirements(resource, clientId, callback)) { final String requestId = Telemetry.registerNewRequest(); final APIEvent apiEvent = createApiEvent(mContext, clientId, requestId, EventStrings.ACQUIRE_TOKEN_2); apiEvent.setLoginHint(loginHint); redirectUri = getRedirectUri(redirectUri); final AuthenticationRequest request = new AuthenticationRequest(mAuthority, resource, clientId, redirectUri, loginHint, PromptBehavior.Auto, extraQueryParameters, getRequestCorrelationId(), getExtendedLifetimeEnabled()); request.setUserIdentifierType(UserIdentifierType.LoginHint); request.setTelemetryRequestId(requestId); createAcquireTokenRequest(apiEvent).acquireToken(wrapActivity(activity), false, request, callback); } <<<<<<< redirectUri = checkInputParameters(resource, clientId, redirectUri, callback); final String requestId = Telemetry.registerNewRequest(); final APIEvent apiEvent = createApiEvent(mContext, clientId, requestId, EventStrings.ACQUIRE_TOKEN_3); apiEvent.setSilentRequestPromptBehavior(prompt.toString()); final AuthenticationRequest request = new AuthenticationRequest(mAuthority, resource, clientId, redirectUri, null, prompt, null, getRequestCorrelationId(), getExtendedLifetimeEnabled()); request.setTelemetryRequestId(requestId); createAcquireTokenRequest(apiEvent).acquireToken(wrapActivity(activity), false, request, callback); ======= final AuthenticationRequest request = new AuthenticationRequest(mAuthority, resource, clientId, redirectUri, null, prompt, null, getRequestCorrelationId(), getExtendedLifetimeEnabled()); createAcquireTokenRequest().acquireToken(wrapActivity(activity), false, request, callback); } >>>>>>> final String requestId = Telemetry.registerNewRequest(); final APIEvent apiEvent = createApiEvent(mContext, clientId, requestId, EventStrings.ACQUIRE_TOKEN_3); apiEvent.setSilentRequestPromptBehavior(prompt.toString()); final AuthenticationRequest request = new AuthenticationRequest(mAuthority, resource, clientId, redirectUri, null, prompt, null, getRequestCorrelationId(), getExtendedLifetimeEnabled()); request.setTelemetryRequestId(requestId); createAcquireTokenRequest(apiEvent).acquireToken(wrapActivity(activity), false, request, callback); } <<<<<<< redirectUri = checkInputParameters(resource, clientId, redirectUri, callback); final String requestId = Telemetry.registerNewRequest(); final APIEvent apiEvent = createApiEvent(mContext, clientId, requestId, EventStrings.ACQUIRE_TOKEN_4); apiEvent.setSilentRequestPromptBehavior(prompt.toString()); final AuthenticationRequest request = new AuthenticationRequest(mAuthority, resource, clientId, redirectUri, null, prompt, extraQueryParameters, getRequestCorrelationId(), getExtendedLifetimeEnabled()); request.setTelemetryRequestId(requestId); createAcquireTokenRequest(apiEvent).acquireToken(wrapActivity(activity), false, request, callback); ======= final AuthenticationRequest request = new AuthenticationRequest(mAuthority, resource, clientId, redirectUri, null, prompt, extraQueryParameters, getRequestCorrelationId(), getExtendedLifetimeEnabled()); createAcquireTokenRequest().acquireToken(wrapActivity(activity), false, request, callback); } >>>>>>> final String requestId = Telemetry.registerNewRequest(); final APIEvent apiEvent = createApiEvent(mContext, clientId, requestId, EventStrings.ACQUIRE_TOKEN_4); apiEvent.setSilentRequestPromptBehavior(prompt.toString()); final AuthenticationRequest request = new AuthenticationRequest(mAuthority, resource, clientId, redirectUri, null, prompt, extraQueryParameters, getRequestCorrelationId(), getExtendedLifetimeEnabled()); request.setTelemetryRequestId(requestId); createAcquireTokenRequest(apiEvent).acquireToken(wrapActivity(activity), false, request, callback); } <<<<<<< redirectUri = checkInputParameters(resource, clientId, redirectUri, callback); final String requestId = Telemetry.registerNewRequest(); final APIEvent apiEvent = createApiEvent(mContext, clientId, requestId, EventStrings.ACQUIRE_TOKEN_5); apiEvent.setSilentRequestPromptBehavior(prompt.toString()); apiEvent.setLoginHint(loginHint); final AuthenticationRequest request = new AuthenticationRequest(mAuthority, resource, clientId, redirectUri, loginHint, prompt, extraQueryParameters, getRequestCorrelationId(), getExtendedLifetimeEnabled()); request.setUserIdentifierType(UserIdentifierType.LoginHint); request.setTelemetryRequestId(requestId); createAcquireTokenRequest(apiEvent).acquireToken(wrapActivity(activity), false, request, callback); ======= if (checkPreRequirements(resource, clientId, callback)) { redirectUri = getRedirectUri(redirectUri); final AuthenticationRequest request = new AuthenticationRequest(mAuthority, resource, clientId, redirectUri, loginHint, prompt, extraQueryParameters, getRequestCorrelationId(), getExtendedLifetimeEnabled()); request.setUserIdentifierType(UserIdentifierType.LoginHint); createAcquireTokenRequest().acquireToken(wrapActivity(activity), false, request, callback); } >>>>>>> if (checkPreRequirements(resource, clientId, callback)) { redirectUri = getRedirectUri(redirectUri); final String requestId = Telemetry.registerNewRequest(); final APIEvent apiEvent = createApiEvent(mContext, clientId, requestId, EventStrings.ACQUIRE_TOKEN_5); apiEvent.setSilentRequestPromptBehavior(prompt.toString()); apiEvent.setLoginHint(loginHint); final AuthenticationRequest request = new AuthenticationRequest(mAuthority, resource, clientId, redirectUri, loginHint, prompt, extraQueryParameters, getRequestCorrelationId(), getExtendedLifetimeEnabled()); request.setUserIdentifierType(UserIdentifierType.LoginHint); request.setTelemetryRequestId(requestId); createAcquireTokenRequest(apiEvent).acquireToken(wrapActivity(activity), false, request, callback); } <<<<<<< redirectUri = checkInputParameters(resource, clientId, redirectUri, callback); final String requestId = Telemetry.registerNewRequest(); final APIEvent apiEvent = createApiEvent(mContext, clientId, requestId, EventStrings.ACQUIRE_TOKEN_6); apiEvent.setSilentRequestPromptBehavior(prompt.toString()); apiEvent.setLoginHint(loginHint); final AuthenticationRequest request = new AuthenticationRequest(mAuthority, resource, clientId, redirectUri, loginHint, prompt, extraQueryParameters, getRequestCorrelationId(), getExtendedLifetimeEnabled()); request.setUserIdentifierType(UserIdentifierType.LoginHint); request.setTelemetryRequestId(requestId); createAcquireTokenRequest(apiEvent).acquireToken(fragment, false, request, callback); ======= if (checkPreRequirements(resource, clientId, callback)) { redirectUri = getRedirectUri(redirectUri); final AuthenticationRequest request = new AuthenticationRequest(mAuthority, resource, clientId, redirectUri, loginHint, prompt, extraQueryParameters, getRequestCorrelationId(), getExtendedLifetimeEnabled()); request.setUserIdentifierType(UserIdentifierType.LoginHint); createAcquireTokenRequest().acquireToken(fragment, false, request, callback); } >>>>>>> if (checkPreRequirements(resource, clientId, callback)) { redirectUri = getRedirectUri(redirectUri); final String requestId = Telemetry.registerNewRequest(); final APIEvent apiEvent = createApiEvent(mContext, clientId, requestId, EventStrings.ACQUIRE_TOKEN_6); apiEvent.setSilentRequestPromptBehavior(prompt.toString()); apiEvent.setLoginHint(loginHint); final AuthenticationRequest request = new AuthenticationRequest(mAuthority, resource, clientId, redirectUri, loginHint, prompt, extraQueryParameters, getRequestCorrelationId(), getExtendedLifetimeEnabled()); request.setUserIdentifierType(UserIdentifierType.LoginHint); request.setTelemetryRequestId(requestId); createAcquireTokenRequest(apiEvent).acquireToken(fragment, false, request, callback); } <<<<<<< redirectUri = checkInputParameters(resource, clientId, redirectUri, callback); final String requestId = Telemetry.registerNewRequest(); final APIEvent apiEvent = createApiEvent(mContext, clientId, requestId, EventStrings.ACQUIRE_TOKEN_7); apiEvent.setSilentRequestPromptBehavior(prompt.toString()); apiEvent.setLoginHint(loginHint); final AuthenticationRequest request = new AuthenticationRequest(mAuthority, resource, clientId, redirectUri, loginHint, prompt, extraQueryParameters, getRequestCorrelationId(), getExtendedLifetimeEnabled()); request.setUserIdentifierType(UserIdentifierType.LoginHint); request.setTelemetryRequestId(requestId); createAcquireTokenRequest(apiEvent).acquireToken(null, true, request, callback); ======= if (checkPreRequirements(resource, clientId, callback)) { redirectUri = getRedirectUri(redirectUri); final AuthenticationRequest request = new AuthenticationRequest(mAuthority, resource, clientId, redirectUri, loginHint, prompt, extraQueryParameters, getRequestCorrelationId(), getExtendedLifetimeEnabled()); request.setUserIdentifierType(UserIdentifierType.LoginHint); createAcquireTokenRequest().acquireToken(null, true, request, callback); } >>>>>>> if (checkPreRequirements(resource, clientId, callback)) { redirectUri = getRedirectUri(redirectUri); final String requestId = Telemetry.registerNewRequest(); final APIEvent apiEvent = createApiEvent(mContext, clientId, requestId, EventStrings.ACQUIRE_TOKEN_7); apiEvent.setSilentRequestPromptBehavior(prompt.toString()); apiEvent.setLoginHint(loginHint); final AuthenticationRequest request = new AuthenticationRequest(mAuthority, resource, clientId, redirectUri, loginHint, prompt, extraQueryParameters, getRequestCorrelationId(), getExtendedLifetimeEnabled()); request.setUserIdentifierType(UserIdentifierType.LoginHint); request.setTelemetryRequestId(requestId); createAcquireTokenRequest(apiEvent).acquireToken(null, true, request, callback); }
<<<<<<< Logger.v(TAG, "Id token is returned, parsing id token."); IdToken tokenParsed = parseIdToken(rawIdToken); if (tokenParsed != null) { tenantId = tokenParsed.mTenantId; userinfo = new UserInfo(tokenParsed); } ======= IdToken tokenParsed = new IdToken(rawIdToken); tenantId = tokenParsed.getTenantId(); userinfo = new UserInfo(tokenParsed); >>>>>>> Logger.v(TAG, "Id token is returned, parsing id token."); IdToken tokenParsed = new IdToken(rawIdToken); tenantId = tokenParsed.getTenantId(); userinfo = new UserInfo(tokenParsed);
<<<<<<< final String queryParam, final AuthenticationRequest request, UIEvent uiEvent) { ======= final AuthenticationRequest request) { >>>>>>> final AuthenticationRequest request, final UIEvent uiEvent) { <<<<<<< mQueryParam = queryParam; mUIEvent = uiEvent; ======= >>>>>>> mUIEvent = uiEvent;
<<<<<<< import java.net.MalformedURLException; import java.net.URL; import java.util.Calendar; import java.util.Date; ======= >>>>>>> import java.net.MalformedURLException; import java.net.URL; import java.util.Calendar; import java.util.Date; <<<<<<< private ITokenCacheStore mTokenCacheStore; ======= private ITokenCacheStore mTokenCacheStore; private ITokenCacheStore mCache; >>>>>>> private ITokenCacheStore mTokenCacheStore; <<<<<<< private AuthenticationCallback<AuthenticationResult> mAuthorizationCallback; ======= /** * only one authorization can happen for user. */ private AuthenticationCallback<AuthenticationResult> mAuthorizationCallback; >>>>>>> /** * only one authorization can happen for user. */ private AuthenticationCallback<AuthenticationResult> mAuthorizationCallback; <<<<<<< mAppContext = appContext; ======= mContext = appContext; >>>>>>> mContext = appContext; <<<<<<< @Override public void onError(Exception exc) { Log.e(TAG, "Instance validation returned error", exc); externalCall.onError(exc); } }); ======= setActivity(activity); setActivityDelegate(activity); if (!startAuthenticationActivity(request)) { mAuthorizationCallback = null; throw new AuthenticationException(ADALError.DEVELOPER_ONLY_ONE_LOGIN_IS_ALLOWED); >>>>>>> @Override public void onError(Exception exc) { Log.e(TAG, "Instance validation returned error", exc); externalCall.onError(exc); } });
<<<<<<< //check if the redirect URL is under SSL protected if(!url.toLowerCase(Locale.US).startsWith(AuthenticationConstants.Broker.REDIRECT_SSL_PREFIX)) { Logger.e(TAG + methodName, "The webview was redirected to an non-SSL protected URL.", "", ADALError.WEBVIEW_REDIRECTURL_NOT_SSL_PROTECTED); returnError(ADALError.WEBVIEW_REDIRECTURL_NOT_SSL_PROTECTED, "The webview was redirected to an unsafe URL."); view.stopLoading(); return true; } return false; ======= >>>>>>>
<<<<<<< import java.io.OutputStream; import java.net.HttpURLConnection; ======= import java.lang.reflect.InvocationTargetException; import java.net.HttpURLConnection; >>>>>>> import java.io.OutputStream; import java.net.HttpURLConnection; <<<<<<< ======= import com.google.gson.Gson; import com.microsoft.aad.adal.AuthenticationConstants.AAD; import android.test.suitebuilder.annotation.SmallTest; import android.util.Log; >>>>>>> <<<<<<< private static final String TAG = WebRequestHandlerTests.class.getSimpleName(); private final static String TEST_WEBAPI_URL = "https://test.api.net/api/WebRequestTest"; ======= private static final String TEST_WEBAPI_URL = "https://graphtestrun.azurewebsites.net/api/WebRequestTest"; protected static final String TAG = "WebRequestHandlerTests"; >>>>>>> private static final String TAG = WebRequestHandlerTests.class.getSimpleName(); private static final String TEST_WEBAPI_URL = "https://test.api.net/api/WebRequestTest"; <<<<<<< * * @throws IOException ======= >>>>>>> * * @throws IOException <<<<<<< assertEquals("400 error code", 400, testResponse.getStatusCode()); final String responseBody = testResponse.getBody(); ======= assertEquals("400 error code", HttpURLConnection.HTTP_BAD_REQUEST, testResponse.getStatusCode()); String responseBody = testResponse.getBody(); >>>>>>> assertEquals("400 error code", HttpURLConnection.HTTP_BAD_REQUEST, testResponse.getStatusCode()); final String responseBody = testResponse.getBody(); <<<<<<< assertTrue("status is 200", httpResponse.getStatusCode() == 200); final String responseMsg = new String(httpResponse.getBody()); ======= assertTrue("status is 200", httpResponse.getStatusCode() == HttpURLConnection.HTTP_OK); String responseMsg = new String(httpResponse.getBody()); >>>>>>> assertTrue("status is 200", httpResponse.getStatusCode() == HttpURLConnection.HTTP_OK); final String responseMsg = new String(httpResponse.getBody()); <<<<<<< assertTrue("status is 200", httpResponse.getStatusCode() == 200); final String responseMsg = new String(httpResponse.getBody()); ======= assertTrue("status is 200", httpResponse.getStatusCode() == HttpURLConnection.HTTP_OK); String responseMsg = new String(httpResponse.getBody()); >>>>>>> assertTrue("status is 200", httpResponse.getStatusCode() == HttpURLConnection.HTTP_OK); final String responseMsg = new String(httpResponse.getBody());
<<<<<<< import junit.framework.Assert; import android.annotation.SuppressLint; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.content.pm.Signature; import android.os.Build; import android.os.Bundle; import android.test.AndroidTestCase; import android.test.UiThreadTest; import android.test.suitebuilder.annotation.MediumTest; import android.test.suitebuilder.annotation.SmallTest; import android.test.suitebuilder.annotation.Suppress; import android.util.Base64; import android.util.Log; import android.util.SparseArray; ======= >>>>>>> import android.test.suitebuilder.annotation.Suppress;
<<<<<<< public AuthenticationContext(Context appContext, String authority, boolean validateAuthority, ITokenCacheStore tokenCacheStore) { mAppContext = appContext; mAuthority = authority; mValidateAuthority = validateAuthority; mCache = tokenCacheStore; ======= public AuthenticationContext(Context contextFromMainThread, String authority, boolean validateAuthority, ITokenCacheStore tokenCacheStore) { mAppContext = contextFromMainThread; mAuthority = authority; mValidateAuthority = validateAuthority; mTokenCacheStore = tokenCacheStore; >>>>>>> public AuthenticationContext(Context appContext, String authority, boolean validateAuthority, ITokenCacheStore tokenCacheStore) { mAppContext = appContext; mAuthority = authority; mValidateAuthority = validateAuthority; mTokenCacheStore = tokenCacheStore; <<<<<<< mAppContext = appContext; mAuthority = authority; mValidateAuthority = true; mCache = tokenCacheStore; ======= mAppContext = contextFromMainThread; mAuthority = authority; mValidateAuthority = true; mTokenCacheStore = tokenCacheStore; >>>>>>> mAppContext = appContext; mAuthority = authority; mValidateAuthority = true; mTokenCacheStore = tokenCacheStore;
<<<<<<< // Create the Web View to show the page ======= Logger.v(TAG, "OnCreate redirectUrl:" + mRedirectUrl); // Create the Web View to show the page >>>>>>> // Create the Web View to show the page <<<<<<< ======= // Disable hardware acceleration in WebView if needed if (!AuthenticationSettings.INSTANCE.getDisableWebViewHardwareAcceleration()) { mWebView.setLayerType(WebView.LAYER_TYPE_SOFTWARE, null); Log.d(TAG, "Hardware acceleration is disabled in WebView"); } Logger.v(TAG, "User agent:" + mWebView.getSettings().getUserAgentString()); >>>>>>> // Disable hardware acceleration in WebView if needed if (!AuthenticationSettings.INSTANCE.getDisableWebViewHardwareAcceleration()) { mWebView.setLayerType(WebView.LAYER_TYPE_SOFTWARE, null); Log.d(TAG, "Hardware acceleration is disabled in WebView"); }
<<<<<<< import org.springframework.beans.factory.NoSuchBeanDefinitionException; ======= import com.consol.citrus.message.MessageHandler; import com.consol.citrus.server.AbstractServer; import org.springframework.beans.BeansException; import org.springframework.beans.factory.*; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.core.task.SimpleAsyncTaskExecutor; import org.springframework.core.task.TaskExecutor; >>>>>>> import org.springframework.beans.factory.NoSuchBeanDefinitionException; <<<<<<< ======= /** * Sets the task executor. Usually some async task executor for test execution in * separate thread instance. * * @param taskExecutor */ public void setTaskExecutor(TaskExecutor taskExecutor) { this.taskExecutor = taskExecutor; } /** * Creates Citrus Spring bean application context with basic beans and settings for Citrus. Custom * messageHandlerContext should hold various test builder beans for later dispatching and test execution. * @throws Exception */ public void afterPropertiesSet() throws Exception { if (responseMessageHandler == null) { MessageChannelConnectingMessageHandler channelConnectingMessageHandler = new MessageChannelConnectingMessageHandler(); channelConnectingMessageHandler.setChannelName(name + AbstractServer.DEFAULT_CHANNEL_ID_SUFFIX); channelConnectingMessageHandler.setBeanFactory(applicationContext); responseMessageHandler = channelConnectingMessageHandler; } if (getMessageHandlerMapping() == null) { SpringBeanMessageHandlerMapping messageHandlerMapping = new SpringBeanMessageHandlerMapping(); messageHandlerMapping.setApplicationContext(applicationContext); setMessageHandlerMapping(messageHandlerMapping); } } /** * Injects this handlers bean name. * @param name */ public void setBeanName(String name) { this.name = name; } /** * Sets the response message handler delegate. * @param responseMessageHandler */ public void setResponseMessageHandler(MessageHandler responseMessageHandler) { this.responseMessageHandler = responseMessageHandler; } /** * Injects Spring bean application context this handler is managed by. * @param applicationContext * @throws BeansException */ public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { this.applicationContext = applicationContext; } >>>>>>>
<<<<<<< @Test public void testVarAsPrintStatement() throws Exception { parse("var print;", rule("variableStatement")); } @Test public void testPrintStatement() throws Exception { parse("print (x);", rule("statement")); } ======= @Test public void testFunctionDeclaration() throws Exception { parse("function x(){}", rule("functionDeclaration")); } >>>>>>> @Test public void testVarAsPrintStatement() throws Exception { parse("var print;", rule("variableStatement")); } @Test public void testPrintStatement() throws Exception { parse("print (x);", rule("statement")); } @Test public void testFunctionDeclaration() throws Exception { parse("function x(){}", rule("functionDeclaration")); }
<<<<<<< import io.scalecube.transport.Address; import io.scalecube.transport.Message; import io.scalecube.transport.Transport; import io.scalecube.transport.TransportConfig; import java.nio.ByteBuffer; ======= import io.scalecube.cluster.transport.api.Address; import io.scalecube.cluster.transport.api.Message; import io.scalecube.cluster.transport.api.Transport; import io.scalecube.cluster.utils.NetworkEmulatorTransport; >>>>>>> import io.scalecube.cluster.transport.api.Address; import io.scalecube.cluster.transport.api.Message; import io.scalecube.cluster.transport.api.Transport; import io.scalecube.cluster.utils.NetworkEmulatorTransport; import java.nio.ByteBuffer;
<<<<<<< import io.scalecube.transport.Address; import io.scalecube.transport.Transport; import io.scalecube.transport.TransportConfig; import java.nio.ByteBuffer; ======= import io.scalecube.cluster.transport.api.Address; import io.scalecube.cluster.transport.api.Transport; import io.scalecube.cluster.transport.api.TransportConfig; import io.scalecube.cluster.utils.NetworkEmulatorTransport; >>>>>>> import io.scalecube.cluster.transport.api.Address; import io.scalecube.cluster.transport.api.Transport; import io.scalecube.cluster.transport.api.TransportConfig; import io.scalecube.cluster.utils.NetworkEmulatorTransport; import java.nio.ByteBuffer;
<<<<<<< import io.scalecube.cluster.metadata.MetadataCodec; import io.scalecube.transport.Address; import io.scalecube.transport.MessageCodec; import io.scalecube.transport.TransportConfig; import java.nio.ByteBuffer; ======= import io.scalecube.cluster.transport.api.Address; import io.scalecube.cluster.transport.api.MessageCodec; import io.scalecube.cluster.transport.api.TransportConfig; >>>>>>> import io.scalecube.cluster.metadata.MetadataCodec; import io.scalecube.cluster.transport.api.Address; import io.scalecube.cluster.transport.api.MessageCodec; import io.scalecube.cluster.transport.api.TransportConfig; import java.nio.ByteBuffer;
<<<<<<< this.remove.drawButton(this.modifiers.editor.mc, mouseX, mouseY, partialTicks); ======= if (mouseX >= this.area.x && mouseY >= this.area.y && mouseX <= this.area.x + this.area.w && mouseY <= this.area.y + h) { this.remove.drawButton(this.modifiers.editor.mc, mouseX, mouseY); this.enable.drawButton(this.modifiers.editor.mc, mouseX, mouseY); this.moveUp.drawButton(this.modifiers.editor.mc, mouseX, mouseY); this.moveDown.drawButton(this.modifiers.editor.mc, mouseX, mouseY); } >>>>>>> if (mouseX >= this.area.x && mouseY >= this.area.y && mouseX <= this.area.x + this.area.w && mouseY <= this.area.y + h) { this.remove.drawButton(this.modifiers.editor.mc, mouseX, mouseY, partialTicks); this.enable.drawButton(this.modifiers.editor.mc, mouseX, mouseY, partialTicks); this.moveUp.drawButton(this.modifiers.editor.mc, mouseX, mouseY, partialTicks); this.moveDown.drawButton(this.modifiers.editor.mc, mouseX, mouseY, partialTicks); }
<<<<<<< @Test public void shouldCompareJSONArrays() { assertThat(readByJsonOrg("[{\"a\":1}, {\"a\":2}, {\"a\":2}]"), jsonEquals(readByJsonOrg("[{\"a\":1}, {\"a\":2}, {\"a\":2}]"))); } ======= @Test public void testEqualsResource() throws Exception { assertThat("{\"test\":1}", jsonEquals(resource("test.json"))); } >>>>>>> @Test public void shouldCompareJSONArrays() { assertThat(readByJsonOrg("[{\"a\":1}, {\"a\":2}, {\"a\":2}]"), jsonEquals(readByJsonOrg("[{\"a\":1}, {\"a\":2}, {\"a\":2}]"))); } @Test public void testEqualsResource() throws Exception { assertThat("{\"test\":1}", jsonEquals(resource("test.json"))); }
<<<<<<< @Nullable public WalletAccount getAccount(String id) { return accounts.get(id); ======= public WalletPocket getPocket(CoinType coinType) { lock.lock(); try { return checkNotNull(pockets.get(coinType), "Requested pocket does not exist"); } finally { lock.unlock(); } >>>>>>> @Nullable public WalletAccount getAccount(String id) { lock.lock(); try { return accounts.get(id); } finally { lock.unlock(); } <<<<<<< /** * Generate and add a new BIP44 account for a specific coin type */ private WalletPocketHD createAndAddAccount(CoinType coinType, @Nullable KeyParameter key) { checkState(lock.isHeldByCurrentThread()); ======= private void maybeCreatePocket(CoinType coinType, @Nullable KeyParameter key) { checkState(lock.isHeldByCurrentThread(), "Lock is held by another thread"); if (!pockets.containsKey(coinType)) { createPocket(coinType, key); } } private void createPocket(CoinType coinType, @Nullable KeyParameter key) { checkState(lock.isHeldByCurrentThread(), "Lock is held by another thread"); checkNotNull(coinType, "Attempting to create a pocket for a null coin"); checkState(!pockets.containsKey(coinType), "A coin already has a pocket"); >>>>>>> /** * Generate and add a new BIP44 account for a specific coin type */ private WalletPocketHD createAndAddAccount(CoinType coinType, @Nullable KeyParameter key) { checkState(lock.isHeldByCurrentThread(), "Lock is held by another thread"); checkNotNull(coinType, "Attempting to create a pocket for a null coin");
<<<<<<< import com.coinomi.core.coins.BurstMain; ======= import com.coinomi.core.coins.CanadaeCoinMain; >>>>>>> import com.coinomi.core.coins.BurstMain; import com.coinomi.core.coins.CanadaeCoinMain; <<<<<<< import com.coinomi.core.coins.NxtMain; import com.coinomi.core.coins.PeercoinMain; import com.coinomi.core.coins.NovacoinMain; ======= >>>>>>> import com.coinomi.core.coins.NxtMain; <<<<<<< new ServerAddress("pkb-cce-2.coinomi.net", 5035)), new CoinAddress(NxtMain.get(), new ServerAddress("176.9.65.41", 7876), new ServerAddress("176.9.65.41", 7876)), new CoinAddress(BurstMain.get(), new ServerAddress("burst-cce-1.coinomi.net", 5051), new ServerAddress("burst-cce-2.coinomi.net", 5051)) ======= new ServerAddress("pkb-cce-2.coinomi.net", 5035)), new CoinAddress(DogecoindarkMain.get(), new ServerAddress("doged-cce-1.coinomi.net", 5036), new ServerAddress("doged-cce-2.coinomi.net", 5036)), new CoinAddress(GcrMain.get(), new ServerAddress("gcr-cce-1.coinomi.net", 5038), new ServerAddress("gcr-cce-2.coinomi.net", 5038)) >>>>>>> new ServerAddress("pkb-cce-2.coinomi.net", 5035)), new CoinAddress(NxtMain.get(), new ServerAddress("176.9.65.41", 7876), new ServerAddress("176.9.65.41", 7876)), new CoinAddress(BurstMain.get(), new ServerAddress("burst-cce-1.coinomi.net", 5051), new ServerAddress("burst-cce-2.coinomi.net", 5051)), new CoinAddress(DogecoindarkMain.get(), new ServerAddress("doged-cce-1.coinomi.net", 5036), new ServerAddress("doged-cce-2.coinomi.net", 5036)), new CoinAddress(GcrMain.get(), new ServerAddress("gcr-cce-1.coinomi.net", 5038), new ServerAddress("gcr-cce-2.coinomi.net", 5038))
<<<<<<< VERTCOIN_MAIN(VertcoinMain.get()), ======= NEOSCOIN_TEST(NeoscoinTest.get()) JUMBUCKS_MAIN(JumbucksMain.get()), >>>>>>> VERTCOIN_MAIN(VertcoinMain.get()), JUMBUCKS_MAIN(JumbucksMain.get()),
<<<<<<< COINS_ICONS.put(CoinID.NXT_MAIN.getCoinType(), R.drawable.nxt); ======= COINS_ICONS.put(CoinID.JUMBUCKS_MAIN.getCoinType(), R.drawable.jumbucks); >>>>>>> COINS_ICONS.put(CoinID.NXT_MAIN.getCoinType(), R.drawable.nxt); COINS_ICONS.put(CoinID.JUMBUCKS_MAIN.getCoinType(), R.drawable.jumbucks);
<<<<<<< ======= import java.security.SignatureException; >>>>>>> import java.security.SignatureException; <<<<<<< ======= import static com.coinomi.core.Preconditions.checkArgument; >>>>>>>
<<<<<<< COINS_ICONS.put(CoinID.NOVACOIN_MAIN.getCoinType(), R.drawable.novacoin); ======= COINS_ICONS.put(CoinID.CANADAECOIN_MAIN.getCoinType(), R.drawable.canadaecoin); >>>>>>> COINS_ICONS.put(CoinID.NOVACOIN_MAIN.getCoinType(), R.drawable.novacoin); COINS_ICONS.put(CoinID.CANADAECOIN_MAIN.getCoinType(), R.drawable.canadaecoin); <<<<<<< COINS_BLOCK_EXPLORERS.put(CoinID.NOVACOIN_MAIN.getCoinType(), "http://explorer.novaco.in/tx/%s"); ======= COINS_BLOCK_EXPLORERS.put(CoinID.CANADAECOIN_MAIN.getCoinType(), "http://explorer.canadaecoin.ca/tx/%s"); >>>>>>> COINS_BLOCK_EXPLORERS.put(CoinID.NOVACOIN_MAIN.getCoinType(), "http://explorer.novaco.in/tx/%s"); COINS_BLOCK_EXPLORERS.put(CoinID.CANADAECOIN_MAIN.getCoinType(), "http://explorer.canadaecoin.ca/tx/%s");
<<<<<<< Position prev = new Position(0, 0, 0, 0, 0); Position next = new Position(0, 0, 0, 0, 0); EntityPlayer player = runner.outside.active ? runner.outside.camera : this.mc.player; ======= EntityPlayer player = runner.outside.active ? runner.outside.camera : this.mc.thePlayer; >>>>>>> EntityPlayer player = runner.outside.active ? runner.outside.camera : this.mc.player; <<<<<<< /** * Draw a line between two positions */ private void drawLine(Color color, double playerX, double playerY, double playerZ, Position prev, Position next) { GlStateManager.pushMatrix(); GlStateManager.pushAttrib(); double x = prev.point.x - playerX; double y = prev.point.y - playerY; double z = prev.point.z - playerZ; GL11.glLineWidth(4); GlStateManager.disableTexture2D(); GlStateManager.color(color.red, color.green, color.blue, 0.5F); VertexBuffer vb = Tessellator.getInstance().getBuffer(); vb.setTranslation(x, y + this.mc.player.eyeHeight, z); vb.begin(GL11.GL_LINES, DefaultVertexFormats.POSITION); vb.pos(next.point.x - prev.point.x, next.point.y - prev.point.y, next.point.z - prev.point.z).endVertex(); vb.pos(0, 0, 0).endVertex(); Tessellator.getInstance().draw(); vb.setTranslation(0, 0, 0); GlStateManager.enableTexture2D(); GlStateManager.popAttrib(); GlStateManager.popMatrix(); } ======= >>>>>>>
<<<<<<< private void check(TokenType expectedTokenType, TokenType tokenType) { if (tokenType != expectedTokenType) { throw new TagExpressionException("Syntax error. Expected %s", tokenType.toString().toLowerCase()); } } ======= >>>>>>> private void check(TokenType expectedTokenType, TokenType tokenType) { if (tokenType != expectedTokenType) { throw new TagExpressionException("Syntax error. Expected %s", tokenType.toString().toLowerCase()); } }
<<<<<<< this.value = MathHelper.clamp(this.value, this.min, this.max); ======= this.value = MathHelper.clamp_int(this.value, this.min, this.max); this.scroll = 0; this.scale = 1; >>>>>>> this.value = MathHelper.clamp(this.value, this.min, this.max); this.scroll = 0; this.scale = 1;
<<<<<<< ======= /** * Spinner for selecting the account for the transaction */ private Spinner mAccountsSpinner; /** * Spinner for selecting the account to split the transaction with */ private Spinner mSplitAccountSpinner; /** * Accounts database adapter. * Used for getting list of transactions to populate the {@link #mAccountsSpinner} */ private AccountsDbAdapter mAccountsDbAdapter; /** * Cursor adapter for {@link #mAccountsSpinner} */ private SimpleCursorAdapter mCursorAdapter; >>>>>>> <<<<<<< ======= mAccountsSpinner = (Spinner) v.findViewById(R.id.input_accounts_spinner); mSplitAccountSpinner = (Spinner) v.findViewById(R.id.input_split_accounts_spinner); >>>>>>> <<<<<<< ======= String[] from = new String[] {DatabaseHelper.KEY_NAME}; int[] to = new int[] {android.R.id.text1}; mAccountsDbAdapter = new AccountsDbAdapter(getActivity()); mCursor = mAccountsDbAdapter.fetchAllAccounts(); mCursorAdapter = new SimpleCursorAdapter(getActivity(), android.R.layout.simple_spinner_item, mCursor, from, to, 0); mCursorAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); mAccountsSpinner.setAdapter(mCursorAdapter); mAccountsSpinner.setOnItemSelectedListener(new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { String currencyCode = mAccountsDbAdapter.getCurrency(id); Currency currency = Currency.getInstance(currencyCode); mCurrencyTextView.setText(currency.getSymbol(Locale.getDefault())); } @Override public void onNothingSelected(AdapterView<?> parent) { // nothing to see here, move along } }); mSplitAccountSpinner.setAdapter(mCursorAdapter); >>>>>>> SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getActivity()); mUseDoubleEntry = sharedPrefs.getBoolean(getString(R.string.key_use_double_entry), false); if (mUseDoubleEntry == false){ getView().findViewById(R.id.layout_double_entry).setVisibility(View.GONE); // mTransferAccountSpinner.setVisibility(View.GONE); } String[] from = new String[] {DatabaseHelper.KEY_NAME}; int[] to = new int[] {android.R.id.text1}; mAccountsDbAdapter = new AccountsDbAdapter(getActivity()); long accountId = ((TransactionsActivity)getActivity()).getCurrentAccountID(); String conditions = "(" + DatabaseHelper.KEY_ROW_ID + " != " + accountId + ") AND " + "(" + DatabaseHelper.KEY_CURRENCY_CODE + " = '" + mAccountsDbAdapter.getCurrencyCode(accountId) + "')"; mCursor = mAccountsDbAdapter.fetchAccounts(conditions); mCursorAdapter = new SimpleCursorAdapter(getActivity(), android.R.layout.simple_spinner_item, mCursor, from, to, 0); mCursorAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); mTransferAccountSpinner.setAdapter(mCursorAdapter); <<<<<<< ======= final long accountId = mAccountsDbAdapter.fetchAccountWithUID(mTransaction.getAccountUID()); refreshSelectedAccount(accountId); String splitAccountUID = mTransaction.getSplitAccountUID(); if (splitAccountUID != null){ final long splitAccountId = mAccountsDbAdapter.fetchAccountWithUID(splitAccountUID); refreshSelectedSplitAccount(splitAccountId); } else { refreshSelectedSplitAccount(accountId); } >>>>>>> if (mUseDoubleEntry){ if (isInDoubleAccount()){ long accountId = mTransactionsDbAdapter.getAccountID(mTransaction.getAccountUID()); setSelectedTransferAccount(accountId); } else { long doubleAccountId = mTransactionsDbAdapter.getAccountID(mTransaction.getDoubleEntryAccountUID()); setSelectedTransferAccount(doubleAccountId); } } <<<<<<< ======= refreshSelectedAccount(accountId); refreshSelectedSplitAccount(accountId); >>>>>>> <<<<<<< ======= public void refreshSelectedAccount(long accountId){ long previousAccountId = mAccountsSpinner.getSelectedItemId(); for (int pos = 0; pos < mCursorAdapter.getCount(); pos++) { if (mCursorAdapter.getItemId(pos) == accountId){ mAccountsSpinner.setSelection(pos); break; } } //if accountId and split account Id were the same, then make them the same. //this avoid users inadvertently creating split transactions long splitAccountId = mSplitAccountSpinner.getSelectedItemId(); if (previousAccountId == splitAccountId){ refreshSelectedSplitAccount(accountId); } } public void refreshSelectedSplitAccount(long splitAccountId){ for (int pos = 0; pos < mCursorAdapter.getCount(); pos++) { if (mCursorAdapter.getItemId(pos) == splitAccountId) mSplitAccountSpinner.setSelection(pos); } } >>>>>>> <<<<<<< long accountID = ((TransactionsActivity) getSherlockActivity()).getCurrentAccountID(); //mAccountsSpinner.getSelectedItemId(); ======= long accountID = mAccountsSpinner.getSelectedItemId(); long splitAccountId = mSplitAccountSpinner.getSelectedItemId(); >>>>>>> long accountID = ((TransactionsActivity) getSherlockActivity()).getCurrentAccountID();
<<<<<<< public BudgetsDbAdapter(SQLiteDatabase db) { super(db, BudgetEntry.TABLE_NAME, new String[]{ BudgetEntry.COLUMN_NAME, BudgetEntry.COLUMN_DESCRIPTION, BudgetEntry.COLUMN_RECURRENCE_UID, BudgetEntry.COLUMN_NUM_PERIODS }); mRecurrenceDbAdapter = new RecurrenceDbAdapter(db); mBudgetAmountsDbAdapter = new BudgetAmountsDbAdapter(db); ======= public BudgetsDbAdapter(SQLiteDatabase db, BudgetAmountsDbAdapter budgetAmountsDbAdapter, RecurrenceDbAdapter recurrenceDbAdapter) { super(db, BudgetEntry.TABLE_NAME); mRecurrenceDbAdapter = recurrenceDbAdapter; mBudgetAmountsDbAdapter = budgetAmountsDbAdapter; >>>>>>> public BudgetsDbAdapter(SQLiteDatabase db, BudgetAmountsDbAdapter budgetAmountsDbAdapter, RecurrenceDbAdapter recurrenceDbAdapter) { super(db, BudgetEntry.TABLE_NAME, new String[]{ BudgetEntry.COLUMN_NAME, BudgetEntry.COLUMN_DESCRIPTION, BudgetEntry.COLUMN_RECURRENCE_UID, BudgetEntry.COLUMN_NUM_PERIODS }); mRecurrenceDbAdapter = recurrenceDbAdapter; mBudgetAmountsDbAdapter = budgetAmountsDbAdapter;
<<<<<<< /* Display flight speed */ if (this.flight.enabled) { String speed = String.format(this.stringSpeed + ": %.1f", this.flight.speed); int width = this.fontRenderer.getStringWidth(speed); int x = this.width - 10 - width; int y = this.height - 30; Gui.drawRect(x - 2, y - 2, x + width + 2, y + 9, 0x88000000); this.fontRenderer.drawStringWithShadow(speed, x, y, 0xffffff); } /* Display camera attributes */ if ((this.syncing || running) && this.displayPosition) { Position pos = running ? this.runner.getPosition() : this.position; Point point = pos.point; Angle angle = pos.angle; String[] labels = new String[] {this.stringX + ": " + point.x, this.stringY + ": " + point.y, this.stringZ + ": " + point.z, this.stringYaw + ": " + angle.yaw, this.stringPitch + ": " + angle.pitch, this.stringRoll + ": " + angle.roll, this.stringFov + ": " + angle.fov}; int i = 6; for (String label : labels) { int width = this.fontRenderer.getStringWidth(label); int y = this.height - 30 - 12 * i; Gui.drawRect(8, y - 2, 9 + width + 2, y + 9, 0x88000000); this.fontRenderer.drawStringWithShadow(label, 10, y, 0xffffff); i--; } } ======= >>>>>>>
<<<<<<< import org.gnucash.android.db.adapter.DatabaseAdapter; ======= import org.gnucash.android.db.adapter.BooksDbAdapter; import org.gnucash.android.db.adapter.CommoditiesDbAdapter; >>>>>>> import org.gnucash.android.db.adapter.BooksDbAdapter; import org.gnucash.android.db.adapter.CommoditiesDbAdapter; import org.gnucash.android.db.adapter.DatabaseAdapter; <<<<<<< Account account = mAccountsDbAdapter.getRecord(DINING_EXPENSE_ACCOUNT_UID); account.addTransaction(transaction); mTransactionsDbAdapter.addRecord(transaction, DatabaseAdapter.UpdateMethod.insert); ======= mTransactionsDbAdapter.addRecord(transaction); >>>>>>> mTransactionsDbAdapter.addRecord(transaction, DatabaseAdapter.UpdateMethod.insert); <<<<<<< Account account = mAccountsDbAdapter.getRecord(BOOKS_EXPENSE_ACCOUNT_UID); account.addTransaction(transaction); mTransactionsDbAdapter.addRecord(transaction, DatabaseAdapter.UpdateMethod.insert); ======= mTransactionsDbAdapter.addRecord(transaction); >>>>>>> mTransactionsDbAdapter.addRecord(transaction, DatabaseAdapter.UpdateMethod.insert); <<<<<<< mAccountsDbAdapter.getRecord(GIFTS_RECEIVED_INCOME_ACCOUNT_UID).addTransaction(transaction); mTransactionsDbAdapter.addRecord(transaction, DatabaseAdapter.UpdateMethod.insert); ======= mTransactionsDbAdapter.addRecord(transaction); >>>>>>> mTransactionsDbAdapter.addRecord(transaction, DatabaseAdapter.UpdateMethod.insert);
<<<<<<< import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.renderer.BufferBuilder; ======= >>>>>>> import net.minecraft.client.renderer.BufferBuilder; <<<<<<< public void update(GuiScreen screen) { super.update(screen); int x = this.area.x + this.area.w - 80; this.tick.update(x, this.area.y + 10, 80, 20); this.value.update(x, this.area.y + 35, 80, 20); int h = this.editor.height; int i = 0; this.frames.set(0, h - (h - this.duration.area.y - 25), this.editor.width, 0); this.frames.h = h - this.frames.y - 50; x = 10; for (GuiButton button : this.buttons.buttons) { if (i > 6) { break; } button.x = x; button.y = h - 45; button.width = this.font.getStringWidth(button.displayString) + 15; button.height = 20; x += button.width + 5; i += 1; } this.add.y = this.remove.y = this.x.y; this.add.height = this.remove.height = 20; this.add.width = 30; this.remove.width = 50; this.add.x = this.editor.width - 95; this.remove.x = this.add.x + this.add.width + 5; this.interp.y = this.tick.area.y; this.interp.x = this.tick.area.x - 90; this.easing.y = this.value.area.y; this.easing.x = this.value.area.x - 90; } @Override ======= >>>>>>> <<<<<<< this.editor.drawCenteredString(this.font, this.titles[this.channel], w / 2, h - 65, 0xffffff); if (this.selected != -1) { this.tick.draw(mouseX, mouseY, partialTicks); this.value.draw(mouseX, mouseY, partialTicks); this.frameButtons.draw(mouseX, mouseY, partialTicks); } this.buttons.draw(mouseX, mouseY, partialTicks); ======= this.editor.drawCenteredString(this.font, this.titles[this.channel], w / 2, h - 45, 0xffffff); >>>>>>> this.editor.drawCenteredString(this.font, this.titles[this.channel], w / 2, h - 45, 0xffffff);
<<<<<<< import org.gnucash.android.ui.util.AmountInputFormatter; import org.gnucash.android.ui.util.CalculatorKeyboard; ======= import org.gnucash.android.ui.util.CalculatorEditText; >>>>>>> import org.gnucash.android.ui.util.CalculatorEditText; import org.gnucash.android.ui.util.CalculatorKeyboard; <<<<<<< public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); initCalculatorKeyboard(); } @Override ======= public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); } @Override >>>>>>> public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); } @Override <<<<<<< initCalculatorKeyboard(); ======= >>>>>>> initCalculatorKeyboard(); <<<<<<< mAmountInputFormatter = new AmountTextWatcher(mAmountEditText); //mAmountEditText.addTextChangedListener(mAmountInputFormatter); ======= >>>>>>> <<<<<<< } else if (!mCalculatorKeyboard.isCustomKeyboardVisible()) { mCalculatorKeyboard.showCustomKeyboard(v); ======= } else if (!mAmountEditText.getCalculatorKeyboard().isCustomKeyboardVisible()) { mAmountEditText.getCalculatorKeyboard().showCustomKeyboard(v); >>>>>>> } else if (!mAmountEditText.getCalculatorKeyboard().isCustomKeyboardVisible()) { mAmountEditText.getCalculatorKeyboard().showCustomKeyboard(v); <<<<<<< BigDecimal amountBigd = new BigDecimal(mAmountEditText.getText().toString().replaceAll(",", ".").trim()); ======= BigDecimal amountBigd = mAmountEditText.getValue(); >>>>>>> BigDecimal amountBigd = mAmountEditText.getValue(); <<<<<<< * Checks if the pre-requisites for saving the transaction are fulfilled * <p>The conditions checked are that a valid amount is entered and that a transfer account is set (where applicable)</p> * @return {@code true} if the transaction can be saved, {@code false} otherwise */ private boolean canSave(){ mCalculatorKeyboard.evaluateEditTextExpression(mAmountEditText); return (mAmountEditText.getText().length() > 0 && mAmountEditText.getError() == null) || (mUseDoubleEntry && mTransferAccountSpinner.getCount() == 0); } /** ======= * Checks if the pre-requisites for saving the transaction are fulfilled * <p>The conditions checked are that a valid amount is entered and that a transfer account is set (where applicable)</p> * @return {@code true} if the transaction can be saved, {@code false} otherwise */ private boolean canSave(){ return (mAmountEditText.isInputValid()) || (mUseDoubleEntry && mTransferAccountSpinner.getCount() == 0); } /** >>>>>>> * Checks if the pre-requisites for saving the transaction are fulfilled * <p>The conditions checked are that a valid amount is entered and that a transfer account is set (where applicable)</p> * @return {@code true} if the transaction can be saved, {@code false} otherwise */ private boolean canSave(){ return (mAmountEditText.isInputValid()) || (mUseDoubleEntry && mTransferAccountSpinner.getCount() == 0); } /**
<<<<<<< public char getChar() { return delegate.getChar(); } @Override public char getChar(long index) { assert index <= Integer.MAX_VALUE; return delegate.getChar((int) index); } @Override public short getShort() { return delegate.getShort(); } @Override public short getShort(long index) { assert index <= Integer.MAX_VALUE; return delegate.getShort((int) index); } @Override ======= public short getShort() { return delegate.getShort(); } @Override public short getShort(final long index) { assert index <= Integer.MAX_VALUE; return delegate.getShort((int) index); } @Override >>>>>>> public char getChar() { return delegate.getChar(); } @Override public char getChar(long index) { assert index <= Integer.MAX_VALUE; return delegate.getChar((int) index); } @Override public short getShort() { return delegate.getShort(); } @Override public short getShort(final long index) { assert index <= Integer.MAX_VALUE; return delegate.getShort((int) index); } @Override
<<<<<<< private final Type alpha = new TypeVar("a"); private final Type beta = new TypeVar("b"); ======= >>>>>>> <<<<<<< assertEquals("[Int -> Int]", this.expr.analyze(this.env).toHaskellType()); ======= assertEquals("[Int -> Int]", this.expr.analyze(this.env).prune().toHaskellType()); >>>>>>> assertEquals("[Int -> Int]", this.expr.analyze(this.env).toHaskellType()); <<<<<<< assertNotEquals("[(String -> String)]", expr.analyze(this.env).toHaskellType()); ======= assertNotEquals("[(String -> String)]", expr.analyze(this.env).prune().toHaskellType()); } @Test public final void testValueToHaskell() throws HaskellException { final Expr v = new Value(this.integer, "10"); assertEquals(this.integer.toHaskellType(), v.analyze(new Env()).prune().toHaskellType()); assertEquals("(10)", v.toHaskell()); >>>>>>> assertNotEquals("[(String -> String)]", expr.analyze(this.env).toHaskellType()); } @Test public final void testValueToHaskell() throws HaskellException { final Expr v = new Value(this.integer, "10"); assertEquals(this.integer.toHaskellType(), v.analyze(new Env()).toHaskellType()); assertEquals("(10)", v.toHaskell());
<<<<<<< import nl.utwente.group10.ui.components.blocks.RGBBlock; import nl.utwente.group10.ui.components.blocks.SliderBlock; ======= import nl.utwente.group10.ui.components.blocks.GraphBlock; >>>>>>> import nl.utwente.group10.ui.components.blocks.RGBBlock; import nl.utwente.group10.ui.components.blocks.SliderBlock; import nl.utwente.group10.ui.components.blocks.GraphBlock; <<<<<<< MenuItem sliderBlockItem = new MenuItem("Slider Block"); sliderBlockItem.setOnAction(event -> addBlock(new SliderBlock(parent))); MenuItem rgbBlockItem = new MenuItem("RGB Block"); rgbBlockItem.setOnAction(event -> addBlock(new RGBBlock(parent))); ======= MenuItem graphBlockItem = new MenuItem("Graph Block"); graphBlockItem.setOnAction(event -> addBlock(new GraphBlock(parent))); >>>>>>> MenuItem sliderBlockItem = new MenuItem("Slider Block"); sliderBlockItem.setOnAction(event -> addBlock(new SliderBlock(parent))); MenuItem rgbBlockItem = new MenuItem("RGB Block"); rgbBlockItem.setOnAction(event -> addBlock(new RGBBlock(parent))); MenuItem graphBlockItem = new MenuItem("Graph Block"); graphBlockItem.setOnAction(event -> addBlock(new GraphBlock(parent))); <<<<<<< this.getItems().addAll(valueBlockItem, displayBlockItem, sliderBlockItem, rgbBlockItem, sep, errorItem, quitItem); ======= this.getItems().addAll(valueBlockItem, displayBlockItem, graphBlockItem, sep, errorItem, quitItem); >>>>>>> this.getItems().addAll(valueBlockItem, displayBlockItem, sliderBlockItem, rgbBlockItem, graphBlockItem, sep, errorItem, quitItem);
<<<<<<< public List<OutputAnchor> getAllOutputs() { return ImmutableList.of(this.fun); ======= public List<InputAnchor> getAllInputs() { return ImmutableList.of(); } @Override public Optional <OutputAnchor> getOutputAnchor() { return Optional.of(this.fun); >>>>>>> public List<InputAnchor> getAllInputs() { return ImmutableList.of(); } @Override public List<OutputAnchor> getAllOutputs() { return ImmutableList.of(this.fun);
<<<<<<< ======= import java.util.ArrayList; >>>>>>> import java.util.ArrayList; <<<<<<< @FXML private Pane anchorSpace; ======= @FXML protected Pane anchorSpace; >>>>>>> @FXML private Pane anchorSpace; <<<<<<< @FXML private Pane outputSpace; ======= @FXML protected Pane outputSpace; >>>>>>> @FXML private Pane outputSpace; <<<<<<< this.loadFXML("DisplayBlock"); ======= this.loadFXML(fxml); >>>>>>> this.loadFXML(fxml); <<<<<<< /** Invalidates the outputted value and triggers re-evaluation of the value. */ public final void invalidateConnectionState() { ======= /** * Invalidates the outputted value and triggers re-evaluation of the value. */ public void invalidate() { >>>>>>> /** Invalidates the outputted value and triggers re-evaluation of the value. */ public void invalidateConnectionState() {
<<<<<<< @Override public Node asNode() { return this; } @Override public ToplevelPane getToplevel() { return this; } ======= @Override public void expandToFit(Bounds bounds) { // The toplevel is large enough to fit practical everything } >>>>>>> @Override public Node asNode() { return this; } @Override public ToplevelPane getToplevel() { return this; } @Override public void expandToFit(Bounds bounds) { // The toplevel is large enough to fit practical everything }
<<<<<<< import javafx.fxml.Initializable; ======= import nl.utwente.group10.ui.CustomUIPane; import nl.utwente.group10.ui.gestures.GestureCallBack; import nl.utwente.group10.ui.gestures.UIEvent; import javafx.event.EventType; import javafx.scene.Node; >>>>>>> import javafx.fxml.Initializable; import nl.utwente.group10.ui.CustomUIPane; import nl.utwente.group10.ui.gestures.GestureCallBack; import nl.utwente.group10.ui.gestures.UIEvent; import javafx.event.EventType; import javafx.scene.Node; <<<<<<< public class Block extends StackPane implements Initializable { ======= public class Block extends StackPane implements GestureCallBack { >>>>>>> public class Block extends StackPane implements Initializable, GestureCallBack { <<<<<<< @Override public void initialize(URL location, ResourceBundle resources) { } ======= @Override public void handleCustomEvent(UIEvent event) { EventType eventType = event .getEventType(); if (eventType.equals(UIEvent.TAP)) { for(Node n : cup.getChildren()){ if(n instanceof Block){ if(((Block) n).isSelected){ ((Block) n).setSelected(false); } } } this.setSelected(true); System.out.println("Block is selected"); } else if (eventType.equals(UIEvent.TAP_HOLD)) { //TODO: open the quick-menu } } >>>>>>> @Override public void initialize(URL location, ResourceBundle resources) { } @Override public void handleCustomEvent(UIEvent event) { EventType eventType = event .getEventType(); if (eventType.equals(UIEvent.TAP)) { for(Node n : cup.getChildren()){ if(n instanceof Block){ if(((Block) n).isSelected){ ((Block) n).setSelected(false); } } } this.setSelected(true); System.out.println("Block is selected"); } else if (eventType.equals(UIEvent.TAP_HOLD)) { //TODO: open the quick-menu } }
<<<<<<< this.flight.speed += Math.copySign(0.1F, scroll); this.flight.speed = MathHelper.clamp(this.flight.speed, 0.1F, 50F); ======= float factor = 1000; boolean zoomIn = scroll > 0; if ((zoomIn && this.flight.speed <= 10) || (!zoomIn && this.flight.speed < 10)) { factor = 1; } else if ((zoomIn && this.flight.speed <= 100) || (!zoomIn && this.flight.speed < 100)) { factor = 10; } else if ((zoomIn && this.flight.speed <= 1000) || (!zoomIn && this.flight.speed < 1000)) { factor = 100; } this.flight.speed -= Math.copySign(factor, scroll); this.flight.speed = MathHelper.clamp_int(this.flight.speed, 1, 50000); >>>>>>> float factor = 1000; boolean zoomIn = scroll > 0; if ((zoomIn && this.flight.speed <= 10) || (!zoomIn && this.flight.speed < 10)) { factor = 1; } else if ((zoomIn && this.flight.speed <= 100) || (!zoomIn && this.flight.speed < 100)) { factor = 10; } else if ((zoomIn && this.flight.speed <= 1000) || (!zoomIn && this.flight.speed < 1000)) { factor = 100; } this.flight.speed -= Math.copySign(factor, scroll); this.flight.speed = MathHelper.clamp(this.flight.speed, 1, 50000);
<<<<<<< /** The output of this Block. **/ private OutputAnchor output; ======= >>>>>>> <<<<<<< /** Returns the {@link OutputAnchor} for this block. */ public final OutputAnchor getOutputAnchor() { return output; } /** Returns the parent pane of this component. */ ======= /** Returns the parent pane of this Component. */ >>>>>>> /** Returns the parent pane of this component. */ <<<<<<< /** DEBUG METHOD trigger the error state for this block */ ======= /** * Tells the block that its current state (considering connections) possibly has * changed. Default implementation does not react to a potential state * change. * * This method should only be called after the Block's constructor is done. */ public void invalidate() { } /** DEBUG METHOD trigger the error state for this Block */ >>>>>>> /** * Tells the block that its current state (considering connections) possibly has * changed. Default implementation does not react to a potential state * change. * * This method should only be called after the Block's constructor is done. */ public void invalidate() { } /** DEBUG METHOD trigger the error state for this block */
<<<<<<< /** Gesture to create Events for this FunctionBlock. **/ private CustomGesture gesture; ======= >>>>>>> <<<<<<< gesture = new CustomGesture(this, this); ======= >>>>>>> <<<<<<< public final String getName() { ======= @Override public String getName() { >>>>>>> public final String getName() {
<<<<<<< Point2D menuPos = this.wrapper.getPane().screenToLocal(new Point2D(event.getScreenX(), event.getScreenY())); this.wrapper.getPane().showFunctionMenuAt(menuPos.getX(), menuPos.getY(), true); ======= Point2D menuPos = this.wrapper.getToplevel().screenToLocal(new Point2D(event.getScreenX(), event.getScreenY())); this.wrapper.getToplevel().showFunctionMenuAt(menuPos.getX(), menuPos.getY()); >>>>>>> Point2D menuPos = this.wrapper.getToplevel().screenToLocal(new Point2D(event.getScreenX(), event.getScreenY())); this.wrapper.getToplevel().showFunctionMenuAt(menuPos.getX(), menuPos.getY(), true); <<<<<<< Point2D menuPos = this.wrapper.getPane().screenToLocal(screenPos); this.wrapper.getPane().showFunctionMenuAt(menuPos.getX(), menuPos.getY(), false); ======= Point2D menuPos = this.wrapper.getToplevel().screenToLocal(screenPos); this.wrapper.getToplevel().showFunctionMenuAt(menuPos.getX(), menuPos.getY()); >>>>>>> Point2D menuPos = this.wrapper.getToplevel().screenToLocal(screenPos); this.wrapper.getToplevel().showFunctionMenuAt(menuPos.getX(), menuPos.getY(), false);
<<<<<<< ======= import nl.utwente.group10.ui.CustomUIPane; /** * Recent versions of JavaFX ship with their own Alert dialogs, but those can't * be added to the TactilePane directly. This CustomAlert dialog can. */ >>>>>>> import nl.utwente.group10.ui.CustomUIPane; /** * Recent versions of JavaFX ship with their own Alert dialogs, but those can't * be added to the TactilePane directly. This CustomAlert dialog can. */
<<<<<<< /** * Optional for the Connection this anchor is connected to. */ private Optional<Connection> up; /** * @param block The Block this anchor is connected to. * @param pane The parent pane this Anchor resides on. * @throws IOException when the FXML definitions cannot be loaded. */ public InputAnchor(Block block, CustomUIPane pane) throws IOException { super(block, pane); up = Optional.empty(); this.addEventHandler(MouseEvent.MOUSE_CLICKED, event -> { // Create connection when first an ouput anchor is selected and then this input anchor gets selected. up.map(oldAnchor -> { return pane.getChildren().removeAll(oldAnchor); }); pane.getLastOutputAnchor().map(anchor -> { try { Connection upstream = new Connection(anchor, this); pane.getChildren().addAll(upstream); up = Optional.of(upstream); } catch (IOException e) { e.printStackTrace(); } return null; }); pane.invalidate(); }); } /** * @return The expression carried by the connection connected to this anchor. */ public final Expr asExpr() { if (up.isPresent()) { return up.get().getInputBlock().asExpr(); } else { return new Ident("undefined"); } } ======= public InputAnchor(Block block, CustomUIPane pane) throws IOException { super(block, pane); new InputAnchorHandler(pane.getConnectionCreationManager(), this); } public Expr asExpr() { if (isConnected()) { return getConnection().get().getOutputAnchor().get().getBlock() .asExpr(); } else { return new Ident("undefined"); } } @Override public Optional<Connection> createConnectionWith(ConnectionAnchor other) { if (other instanceof OutputAnchor) { return createConnectionFrom((OutputAnchor) other); } else { return Optional.empty(); } } public Optional<Connection> createConnectionFrom(OutputAnchor other) { if (!isConnected()) { new Connection(this, (OutputAnchor) other); getPane().getChildren().add(getConnection().get()); getPane().invalidate(); return getConnection(); } else { return Optional.empty(); } } @Override public String toString() { return "InputAnchor belonging to " + getBlock().getName(); } @Override public boolean canConnect() { // InputAnchors only support 1 connection; return !isConnected(); } @Override public void disconnect(Connection connection) { assert connection.equals(getConnection().get()); setConnection(null); } >>>>>>> /** * @param block The Block this anchor is connected to. * @param pane The parent pane this Anchor resides on. * @throws IOException when the FXML definitions cannot be loaded. */ public InputAnchor(Block block, CustomUIPane pane) throws IOException { super(block, pane); new InputAnchorHandler(pane.getConnectionCreationManager(), this); } /** * @return The expression carried by the connection connected to this anchor. */ public final Expr asExpr() { if (isConnected()) { return getConnection().get().getOutputAnchor().get().getBlock() .asExpr(); } else { return new Ident("undefined"); } } public Optional<Connection> createConnectionFrom(OutputAnchor other) { if (!isConnected()) { new Connection(this, other); getPane().getChildren().add(getConnection().get()); getPane().invalidate(); return getConnection(); } else { return Optional.empty(); } } @Override public void disconnect(Connection connection) { assert connection.equals(getConnection().get()); setConnection(null); } @Override public boolean canConnect() { // InputAnchors only support 1 connection; return !isConnected(); }
<<<<<<< public String getName() ======= public int getRequiredPermissionLevel() { return 0; } @Override public String getCommandName() >>>>>>> public int getRequiredPermissionLevel() { return 0; } @Override public String getName()
<<<<<<< ======= import javafx.beans.property.IntegerProperty; import javafx.beans.property.SimpleIntegerProperty; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.collections.ObservableList; >>>>>>> import javafx.beans.property.IntegerProperty; import javafx.beans.property.SimpleIntegerProperty; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.collections.ObservableList; <<<<<<< import nl.utwente.group10.haskell.type.ConstT; ======= >>>>>>> import nl.utwente.group10.haskell.hindley.GenSet; import nl.utwente.group10.haskell.type.ConstT; <<<<<<< ======= /** * @param index * The new bowtie index for this FunctionBlock. */ public final void setBowtieIndex(int index) { if (index >= 0 && index <= getAllInputs().size()) { this.bowtieIndex.set(index); }else{ throw new IndexOutOfBoundsException(); } } /** * Returns the index of the argument matched to the Anchor. * * @param anchor * The anchor to look up. * @return The index of the given Anchor in the input anchor array. */ @Override public final int getInputIndex(InputAnchor anchor) { return inputs.indexOf(anchor); } >>>>>>> /** * @param index * The new bowtie index for this FunctionBlock. */ public final void setBowtieIndex(int index) { if (index >= 0 && index <= getAllInputs().size()) { this.bowtieIndex.set(index); } else { throw new IndexOutOfBoundsException(); } } <<<<<<< ======= /** Returns the IntegerPorperty for the bowtie index of this FunctionBlock. */ public final IntegerProperty bowtieIndexProperty() { return bowtieIndex; } @Override public boolean inputsAreConnected() { return getActiveInputs().stream().allMatch(ConnectionAnchor::isConnected); } @Override public boolean inputIsConnected(int index) { return inputs.get(index).isConnected(); } >>>>>>> /** Returns the IntegerPorperty for the bowtie index of this FunctionBlock. */ public final IntegerProperty bowtieIndexProperty() { return bowtieIndex; } <<<<<<< Type type = asExpr().analyze(env).prune(); while (type instanceof ConstT && ((ConstT) type).getArgs().length == 2) { type = ((ConstT) type).getArgs()[1]; } return type; ======= return asExpr().analyze(env).prune(); >>>>>>> return asExpr().analyze(env).prune();
<<<<<<< List<InputAnchor> getInputs(); ======= public List<InputAnchor> getAllInputs(); /** * @return Only the active (as specified with the bowtie) inputs. */ public List<InputAnchor> getActiveInputs(); >>>>>>> List<InputAnchor> getAllInputs(); /** * @return Only the active (as specified with the bowtie) inputs. */ List<InputAnchor> getActiveInputs();
<<<<<<< import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Optional; import com.google.common.base.Splitter; ======= >>>>>>> import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Optional; import com.google.common.base.Splitter; <<<<<<< import javafx.scene.control.*; import javafx.scene.input.ScrollEvent; ======= >>>>>>> import javafx.scene.control.*; import javafx.scene.input.ScrollEvent; <<<<<<< ======= import javafx.scene.control.*; import javafx.scene.input.ScrollEvent; >>>>>>> <<<<<<< ======= // TODO remove once debugging is done >>>>>>> <<<<<<< utilSpace.getChildren().addAll(valBlockButton, disBlockButton, sliderBlockButton, rgbBlockButton, graphBlockButton, defBlockButton, closeButton); ======= utilSpace.getChildren().addAll( valBlockButton, disBlockButton, sliderBlockButton, rgbBlockButton, graphBlockButton, closeButton ); >>>>>>> utilSpace.getChildren().addAll(valBlockButton, disBlockButton, sliderBlockButton, rgbBlockButton, graphBlockButton, defBlockButton, closeButton); <<<<<<< FunctionBlock fb = new FunctionBlock(entry.getName(), entry.asHaskellObject(new Context()), parent); ======= FunctionBlock fb = new FunctionBlock(entry.getName(), entry.asHaskellObject(new Context()), parent); fb.setConnectionState(ConnectionCreationManager.nextConnectionState()); >>>>>>> FunctionBlock fb = new FunctionBlock(entry.getName(), entry.asHaskellObject(new Context()), parent); fb.setConnectionState(ConnectionCreationManager.nextConnectionState());
<<<<<<< this.scroll = MathHelper.clamp(this.scroll, 0, this.scrollSize - this.h); ======= this.scroll = MathHelper.clamp_int(this.scroll, 0, this.scrollSize - size); >>>>>>> this.scroll = MathHelper.clamp(this.scroll, 0, this.scrollSize - size);
<<<<<<< assertEquals(this.integer.toHaskellType(), v.analyze(new Env()).toHaskellType()); assertEquals("10", v.toHaskell()); ======= assertEquals(this.integer.toHaskellType(), v.analyze(new Env()).prune().toHaskellType()); assertEquals("(10)", v.toHaskell()); >>>>>>> assertEquals(this.integer.toHaskellType(), v.analyze(new Env()).toHaskellType()); assertEquals("(10)", v.toHaskell());
<<<<<<< * Gets the user specified plugin download directory from the CLI option and sets this in the configuration class ======= * Outputs information about plugin yaml file option selected from CLI Option * * @return plugin yaml file passed in through CLI, or null if user did not pass in a yaml file */ private File getPluginYaml() { if (pluginYaml == null) { System.out.println("No .yaml file containing list of plugins to be downloaded entered."); } else { System.out.println("Yaml file containing list of plugins to be downloaded: " + pluginYaml); } return pluginYaml; } /** * Gets the user specified plugin download directory from the CLI option and sets this in the configuration class >>>>>>> * Outputs information about plugin yaml file option selected from CLI Option * * @return plugin yaml file passed in through CLI, or null if user did not pass in a yaml file */ private File getPluginYaml() { if (pluginYaml == null) { System.out.println("No .yaml file containing list of plugins to be downloaded entered."); } else { System.out.println("Yaml file containing list of plugins to be downloaded: " + pluginYaml); } return pluginYaml; } /** * Gets the user specified plugin download directory from the CLI option and sets this in the configuration class <<<<<<< * Parses user specified plugins from CLI and .txt file; creates and returns a list of corresponding plugin objects * ======= * Parses user specified plugins from CLI, .txt file, and/or .yaml file; creates and returns a list of corresponding * plugin objects * >>>>>>> * Parses user specified plugins from CLI, .txt file, and/or .yaml file; creates and returns a list of corresponding * plugin objects * <<<<<<< private Plugin parsePluginLine(String pluginLine) { String[] pluginInfo = pluginLine.split(":", 3); String pluginName = pluginInfo[0]; String pluginVersion = "latest"; String pluginUrl = null; // "http, https, ftp" are valid UrlValidator urlValidator = new UrlValidator(); if (pluginInfo.length >= 2 && !StringUtils.isEmpty(pluginInfo[1])) { pluginVersion = pluginInfo[1]; } if (pluginInfo.length >= 3) { if (urlValidator.isValid(pluginInfo[2])) { pluginUrl = pluginInfo[2]; } else { System.out.println("Invalid URL entered, will ignore"); } } return new Plugin(pluginName, pluginVersion, pluginUrl); } ======= >>>>>>>
<<<<<<< public static final boolean debugWindow2x = true; public static final Class<?> classLoader = Main.instance.getClass(); ======= public static boolean debugWindow2x = false; >>>>>>> public static boolean debugWindow2x = false; public static final Class<?> classLoader = Main.instance.getClass();
<<<<<<< onResize = EventSubmitter.create(); onResize$ = onResize.map((newSize) -> { disp.r.size = new int[] { newSize[0], newSize[1] }; if (disp.r.size[0] <= 0) disp.r.size[0] = 1; if (disp.r.size[1] <= 0) disp.r.size[1] = 1; ======= onResize = BehaviorSubject.create(); onResize$ = onResize.doOnNext((newSize) -> { if (newSize[0] <= 0) newSize[0] = 1; if (newSize[1] <= 0) newSize[1] = 1; var oldSize = disp.r.size; disp.r.size = new int[] { newSize[0], newSize[1] }; >>>>>>> onResize = EventSubmitter.create(); onResize$ = onResize.map((newSize) -> { if (newSize[0] <= 0) newSize[0] = 1; if (newSize[1] <= 0) newSize[1] = 1; var oldSize = disp.r.size; disp.r.size = new int[] { newSize[0], newSize[1] }; <<<<<<< return newSize; ======= Graphics2D g = (Graphics2D) disp.g.getGraphics(); g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC); g.setColor(Color.BLACK); g.clearRect(0, 0, disp.r.size[0], disp.r.size[1]); double oldRatio = (double) oldSize[0] / (double) oldSize[1]; double newRatio = (double) newSize[0] / (double) newSize[1]; int newFrameWidth; int newFrameHeight = 0; if ((int) (oldRatio * 100) == (int) (newRatio * 100)) { newFrameWidth = newSize[0]; newFrameHeight = newSize[1]; } else { newFrameWidth = oldSize[0]; newFrameHeight = oldSize[1]; } g.drawImage(oldG, 0, 0, newFrameWidth, newFrameHeight, null); forceRepaint = true; display.repaint(); >>>>>>> Graphics2D g = (Graphics2D) disp.g.getGraphics(); g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC); g.setColor(Color.BLACK); g.clearRect(0, 0, disp.r.size[0], disp.r.size[1]); double oldRatio = (double) oldSize[0] / (double) oldSize[1]; double newRatio = (double) newSize[0] / (double) newSize[1]; int newFrameWidth; int newFrameHeight = 0; if ((int) (oldRatio * 100) == (int) (newRatio * 100)) { newFrameWidth = newSize[0]; newFrameHeight = newSize[1]; } else { newFrameWidth = oldSize[0]; newFrameHeight = oldSize[1]; } g.drawImage(oldG, 0, 0, newFrameWidth, newFrameHeight, null); forceRepaint = true; display.repaint(); return newSize; <<<<<<< onResize.submit(new Integer[] { c.getWidth() / mult, c.getHeight() / mult }); ======= if (windowShown) { onResize.onNext(new Integer[]{c.getWidth() / mult, c.getHeight() / mult}); } >>>>>>> if (windowShown) { onResize.submit(new Integer[] { c.getWidth() / mult, c.getHeight() / mult }); } <<<<<<< onResize.submit(new Integer[] { getWWidth(), getWHeight() }); Engine.getPlatform().getConsoleUtils().out().println(3, "Engine", "CPU", "Zoom changed"); ======= onResize.onNext(new Integer[] { getWWidth(), getWHeight() }); WarpPI.getPlatform().getConsoleUtils().out().println(3, "Engine", "CPU", "Zoom changed"); >>>>>>> onResize.submit(new Integer[] { getWWidth(), getWHeight() }); WarpPI.getPlatform().getConsoleUtils().out().println(3, "Engine", "CPU", "Zoom changed");
<<<<<<< import it.cavallium.warppi.event.TouchEndEvent; import it.cavallium.warppi.event.TouchMoveEvent; import it.cavallium.warppi.event.TouchPoint; import it.cavallium.warppi.event.TouchStartEvent; import it.cavallium.warppi.gui.graphicengine.GraphicEngine; import it.cavallium.warppi.util.EventSubmitter; import it.unimi.dsi.fastutil.objects.ObjectArrayList; ======= import it.cavallium.warppi.flow.BehaviorSubject; import it.cavallium.warppi.flow.SimpleSubject; import it.cavallium.warppi.flow.Subject; >>>>>>> import it.cavallium.warppi.util.EventSubmitter; <<<<<<< onRealResize = EventSubmitter.create(new Integer[] { (int) (StaticVars.screenSize[0] * windowZoom), (int) (StaticVars.screenSize[1] * windowZoom) }); ======= onRealResize = BehaviorSubject.create(new Integer[] { (int) (engine.getSize()[0] * windowZoom), (int) (engine.getSize()[1] * windowZoom) }); >>>>>>> onRealResize = BehaviorSubject.create(new Integer[] { (int) (engine.getSize()[0] * windowZoom), (int) (engine.getSize()[1] * windowZoom) }); <<<<<<< disp.size[0] = realSize[0] / (int) windowZoom; disp.size[1] = realSize[1] / (int) windowZoom; onResizeEvent.submit(new Integer[] { disp.size[0], disp.size[1] }); ======= engine.size[0] = realSize[0] / (int) windowZoom; engine.size[1] = realSize[1] / (int) windowZoom; onResizeEvent.onNext(new Integer[] { engine.size[0], engine.size[1] }); >>>>>>> engine.size[0] = realSize[0] / (int) windowZoom; engine.size[1] = realSize[1] / (int) windowZoom; onResizeEvent.onNext(new Integer[] { engine.size[0], engine.size[1] }); <<<<<<< StaticVars.windowZoom$.subscribe((zoom) -> { onZoom.submit(zoom); }); ======= StaticVars.windowZoom$.subscribe(onZoom::onNext); >>>>>>> StaticVars.windowZoom$.subscribe(onZoom::onNext);
<<<<<<< void create(Runnable object); EventSubscriber<Integer[]> onResize(); ======= Observable<Integer[]> onResize(); >>>>>>> EventSubscriber<Integer[]> onResize();
<<<<<<< private float calculateMaxTabSpacing(@Nullable final AbstractItem item) { float totalSpace = getArithmetics().getSize(Axis.DRAGGING_AXIS, tabContainer) - (getTabSwitcher().getLayout() == Layout.PHONE_PORTRAIT && getModel().areToolbarsShown() ? toolbar.getHeight() + tabInset : 0); ======= private float calculateMaxTabSpacing(final int count, @Nullable final TabItem tabItem) { float totalSpace = getArithmetics().getTabContainerSize(Axis.DRAGGING_AXIS, false); >>>>>>> private float calculateMaxTabSpacing(@Nullable final AbstractItem item) { float totalSpace = getArithmetics().getTabContainerSize(Axis.DRAGGING_AXIS, false); <<<<<<< private float calculateMinTabSpacing() { return calculateMaxTabSpacing(null) * MIN_TAB_SPACING_RATIO; ======= private float calculateMinTabSpacing(final int count) { return calculateMaxTabSpacing(count, null) * MIN_TAB_SPACING_RATIO; } /** * Calculates and returns the position on the dragging axis, where the distance between a tab * and its predecessor should have reached the maximum. * * @param count * The total number of tabs, which are contained by the tabs switcher, as an {@link * Integer} value * @return The position, which has been calculated, in pixels as an {@link Float} value */ private float calculateAttachedPosition(final int count) { float totalSpace = getArithmetics().getTabContainerSize(Axis.DRAGGING_AXIS, false); float attachedPosition; if (count == 3) { attachedPosition = totalSpace * 0.66f; } else if (count == 4) { attachedPosition = totalSpace * 0.6f; } else { attachedPosition = totalSpace * 0.5f; } return attachedPosition; } /** * Clips the position of a specific tab. * * @param count * The total number of tabs, which are currently contained by the tab switcher, as an * {@link Integer} value * @param index * The index of the tab, whose position should be clipped, as an {@link Integer} value * @param position * The position, which should be clipped, in pixels as a {@link Float} value * @param predecessor * The predecessor of the given tab item as an instance of the class {@link TabItem} or * null, if the tab item does not have a predecessor * @return A pair, which contains the position and state of the tab item, as an instance of the * class {@link Pair}. The pair may not be null */ @NonNull private Pair<Float, State> clipTabPosition(final int count, final int index, final float position, @Nullable final TabItem predecessor) { return clipTabPosition(count, index, position, predecessor != null ? predecessor.getTag().getState() : null); } /** * Clips the position of a specific tab. * * @param count * The total number of tabs, which are currently contained by the tab switcher, as an * {@link Integer} value * @param index * The index of the tab, whose position should be clipped, as an {@link Integer} value * @param position * The position, which should be clipped, in pixels as a {@link Float} value * @param predecessorState * The state of the predecessor of the given tab item as a value of the enum {@link * State} or null, if the tab item does not have a predecessor * @return A pair, which contains the position and state of the tab item, as an instance of the * class {@link Pair}. The pair may not be null */ private Pair<Float, State> clipTabPosition(final int count, final int index, final float position, @Nullable final State predecessorState) { Pair<Float, State> startPair = calculatePositionAndStateWhenStackedAtStart(count, index, predecessorState); float startPosition = startPair.first; if (position <= startPosition) { State state = startPair.second; return Pair.create(startPosition, state); } else { Pair<Float, State> endPair = calculatePositionAndStateWhenStackedAtEnd(index); float endPosition = endPair.first; if (position >= endPosition) { State state = endPair.second; return Pair.create(endPosition, state); } else { State state = State.FLOATING; return Pair.create(position, state); } } } /** * Calculates and returns the position and state of a specific tab, when stacked at the start. * * @param count * The total number of tabs, which are currently contained by the tab switcher, as an * {@link Integer} value * @param index * The index of the tab, whose position and state should be returned, as an {@link * Integer} value * @param predecessor * The predecessor of the given tab item as an instance of the class {@link TabItem} or * null, if the tab item does not have a predecessor * @return A pair, which contains the position and state of the given tab item, when stacked at * the start, as an instance of the class {@link Pair}. The pair may not be null */ @NonNull private Pair<Float, State> calculatePositionAndStateWhenStackedAtStart(final int count, final int index, @Nullable final TabItem predecessor) { return calculatePositionAndStateWhenStackedAtStart(count, index, predecessor != null ? predecessor.getTag().getState() : null); } /** * Calculates and returns the position and state of a specific tab, when stacked at the start. * * @param count * The total number of tabs, which are currently contained by the tab switcher, as an * {@link Integer} value * @param index * The index of the tab, whose position and state should be returned, as an {@link * Integer} value * @param predecessorState * The state of the predecessor of the given tab item as a value of the enum {@link * State} or null, if the tab item does not have a predecessor * @return A pair, which contains the position and state of the given tab item, when stacked at * the start, as an instance of the class {@link Pair}. The pair may not be null */ @NonNull private Pair<Float, State> calculatePositionAndStateWhenStackedAtStart(final int count, final int index, @Nullable final State predecessorState) { if ((count - index) <= stackedTabCount) { float position = stackedTabSpacing * (count - (index + 1)); return Pair.create(position, (predecessorState == null || predecessorState == State.FLOATING) ? State.STACKED_START_ATOP : State.STACKED_START); } else { float position = stackedTabSpacing * stackedTabCount; return Pair.create(position, (predecessorState == null || predecessorState == State.FLOATING) ? State.STACKED_START_ATOP : State.HIDDEN); } } /** * Calculates and returns the position and state of a specific tab, when stacked at the end. * * @param index * The index of the tab, whose position and state should be returned, as an {@link * Integer} value * @return A pair, which contains the position and state of the given tab item, when stacked at * the end, as an instance of the class {@link Pair}. The pair may not be null */ @NonNull private Pair<Float, State> calculatePositionAndStateWhenStackedAtEnd(final int index) { float size = getArithmetics().getTabContainerSize(Axis.DRAGGING_AXIS, false); if (index < stackedTabCount) { float position = size - tabInset - (stackedTabSpacing * (index + 1)); return Pair.create(position, State.STACKED_END); } else { float position = size - tabInset - (stackedTabSpacing * stackedTabCount); return Pair.create(position, State.HIDDEN); } } /** * The method, which is invoked on implementing subclasses in order to retrieve, whether the * tabs are overshooting at the start. * * @return True, if the tabs are overshooting at the start, false otherwise */ private boolean isOvershootingAtStart() { if (getTabSwitcher().getCount() <= 1) { return true; } else { AbstractTabItemIterator iterator = new TabItemIterator.Builder(getTabSwitcher(), viewRecycler).create(); TabItem tabItem = iterator.getItem(0); return tabItem.getTag().getState() == State.STACKED_START_ATOP; } } /** * The method, which is invoked on implementing subclasses in order to retrieve, whether the * tabs are overshooting at the end. * * @param iterator * An iterator, which allows to iterate the tabs, which are contained by the tab * switcher, as an instance of the class {@link AbstractTabItemIterator}. The iterator * may not be null * @return True, if the tabs are overshooting at the end, false otherwise */ private boolean isOvershootingAtEnd(@NonNull final AbstractTabItemIterator iterator) { if (getTabSwitcher().getCount() <= 1) { return true; } else { TabItem lastTabItem = iterator.getItem(getTabSwitcher().getCount() - 1); TabItem predecessor = iterator.getItem(getTabSwitcher().getCount() - 2); return Math.round(predecessor.getTag().getPosition()) >= Math.round(calculateMaxTabSpacing(getTabSwitcher().getCount(), lastTabItem)); } >>>>>>> private float calculateMinTabSpacing() { return calculateMaxTabSpacing(null) * MIN_TAB_SPACING_RATIO; <<<<<<< getStackedTabCount() * getStackedTabSpacing(); return Math.round(tabHeight + tabInset + toolbarHeight + stackHeight - (containerHeight - getModel().getPaddingTop() - getModel().getPaddingBottom())); ======= stackedTabCount * stackedTabSpacing; return Math.round(tabHeight + tabInset + stackHeight - containerHeight); >>>>>>> getStackedTabCount() * getStackedTabSpacing(); return Math.round(tabHeight + tabInset + stackHeight - containerHeight); <<<<<<< getArithmetics().getSize(Axis.DRAGGING_AXIS, tabContainer)); } else if (item.getIndex() > selectedTabIndex) { ======= getArithmetics().getTabContainerSize(Axis.DRAGGING_AXIS)); } else if (tabItem.getIndex() > selectedTabIndex) { >>>>>>> getArithmetics().getTabContainerSize(Axis.DRAGGING_AXIS)); } else if (item.getIndex() > selectedTabIndex) { <<<<<<< getArithmetics().getSize(Axis.DRAGGING_AXIS, getTabSwitcher()), false); } else if (item.getIndex() > selectedTabIndex) { ======= getArithmetics().getTabContainerSize(Axis.DRAGGING_AXIS), false); } else if (tabItem.getIndex() > selectedTabIndex) { >>>>>>> getArithmetics().getTabContainerSize(Axis.DRAGGING_AXIS), false); } else if (item.getIndex() > selectedTabIndex) { <<<<<<< (getArithmetics().getSize(Axis.DRAGGING_AXIS, getTabSwitcher()) - getArithmetics().getPadding(Axis.DRAGGING_AXIS, Gravity.START, getTabSwitcher()) - (getTabSwitcher().getLayout() == Layout.PHONE_PORTRAIT && getTabSwitcher().areToolbarsShown() && toolbars != null ? toolbars[TabSwitcher.PRIMARY_TOOLBAR_INDEX].getHeight() : 0)) * 0.66f; animatePeek(item, duration, interpolator, peekPosition, peekAnimation); ======= getArithmetics().getTabContainerSize(Axis.DRAGGING_AXIS, false) * 0.66f; animatePeek(tabItem, duration, interpolator, peekPosition, peekAnimation); >>>>>>> getArithmetics().getTabContainerSize(Axis.DRAGGING_AXIS, false) * 0.66f; animatePeek(item, duration, interpolator, peekPosition, peekAnimation);
<<<<<<< toolbar = (Toolbar) getTabSwitcher().findViewById(R.id.primary_toolbar); tabContainer = (ViewGroup) getTabSwitcher().findViewById(R.id.tab_container); ======= toolbar = getTabSwitcher().findViewById(R.id.primary_toolbar); >>>>>>> toolbar = getTabSwitcher().findViewById(R.id.primary_toolbar); tabContainer = getTabSwitcher().findViewById(R.id.tab_container);
<<<<<<< private View inflateChildView(@NonNull final ViewGroup parent, final int viewType) { View child = childViews.get(viewType); if (child == null) { LayoutInflater inflater = LayoutInflater.from(getContext()); child = getDecorator().onInflateView(inflater, parent, viewType); childViews.put(viewType, child); } return child; ======= private void updateView(@NonNull final TabView tabView) { Tab tab = getTab(tabView.index); int viewType = getDecorator().getViewType(tab); getDecorator() .onShowTab(getContext(), this, tabView.viewHolder.childContainer.getChildAt(0), tab, viewType); >>>>>>> private View inflateChildView(@NonNull final ViewGroup parent, final int viewType) { View child = childViews.get(viewType); if (child == null) { LayoutInflater inflater = LayoutInflater.from(getContext()); child = getDecorator().onInflateView(inflater, parent, viewType); childViews.put(viewType, child); } return child; <<<<<<< ======= private TabView addTabView(@NonNull final Tab tab, final int index) { ViewGroup view = inflateLayout(tab); view.setVisibility(View.INVISIBLE); LayoutParams layoutParams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); int borderMargin = -(tabInset + tabBorderWidth); layoutParams.leftMargin = borderMargin; layoutParams.topMargin = -(tabInset + tabTitleContainerHeight); layoutParams.rightMargin = borderMargin; layoutParams.bottomMargin = borderMargin; tabContainer.addView(view, tabContainer.getChildCount() - index, layoutParams); return new TabView(index, view); } >>>>>>> <<<<<<< if (tabView.index - 1 == selectedTabIndex) { addChildView(tabView.index - 1); } else { ======= if (tabView.index != selectedTabIndex) { >>>>>>> if (tabView.index == selectedTabIndex) { addChildView(tabView.index); } else {
<<<<<<< import java.awt.image.BufferedImage; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import net.runelite.api.Client; import net.runelite.api.DecorativeObject; import net.runelite.api.NPC; import net.runelite.api.Perspective; import net.runelite.api.Point; import net.runelite.client.game.ItemManager; import static net.runelite.client.plugins.runecraft.AbyssRifts.AIR_RIFT; import static net.runelite.client.plugins.runecraft.AbyssRifts.BLOOD_RIFT; import static net.runelite.client.plugins.runecraft.AbyssRifts.BODY_RIFT; import static net.runelite.client.plugins.runecraft.AbyssRifts.CHAOS_RIFT; import static net.runelite.client.plugins.runecraft.AbyssRifts.COSMIC_RIFT; import static net.runelite.client.plugins.runecraft.AbyssRifts.DEATH_RIFT; import static net.runelite.client.plugins.runecraft.AbyssRifts.EARTH_RIFT; import static net.runelite.client.plugins.runecraft.AbyssRifts.FIRE_RIFT; import static net.runelite.client.plugins.runecraft.AbyssRifts.LAW_RIFT; import static net.runelite.client.plugins.runecraft.AbyssRifts.MIND_RIFT; import static net.runelite.client.plugins.runecraft.AbyssRifts.NATURE_RIFT; import static net.runelite.client.plugins.runecraft.AbyssRifts.SOUL_RIFT; import static net.runelite.client.plugins.runecraft.AbyssRifts.WATER_RIFT; ======= import com.google.inject.Inject; import java.awt.Dimension; import java.awt.Graphics2D; import net.runelite.api.Client; import net.runelite.api.DecorativeObject; import net.runelite.api.NPC; import net.runelite.api.Point; >>>>>>> import net.runelite.api.Client; import net.runelite.api.DecorativeObject; import net.runelite.api.NPC; import net.runelite.api.Point; <<<<<<< private ItemManager itemManager; @Inject AbyssOverlay(final Client client, final RunecraftPlugin plugin) ======= AbyssOverlay(Client client, RunecraftPlugin plugin, RunecraftConfig config) >>>>>>> AbyssOverlay(final Client client, final RunecraftPlugin plugin) <<<<<<< if (plugin.isShowRifts()) ======= if (config.showRifts() && config.showClickBox()) >>>>>>> if (plugin.isShowRifts()) <<<<<<< if (plugin.isShowClickBox()) ======= Point mousePosition = client.getMouseCanvasPosition(); Area objectClickbox = object.getClickbox(); if (objectClickbox != null) >>>>>>> Point mousePosition = client.getMouseCanvasPosition(); Area objectClickbox = object.getClickbox(); if (objectClickbox != null) <<<<<<< } //Draw minimap BufferedImage image = getImage(rift); Point miniMapImage = Perspective.getMiniMapImageLocation(client, object.getLocalLocation(), image); if (miniMapImage != null) { graphics.drawImage(image, miniMapImage.getX(), miniMapImage.getY(), null); } } private BufferedImage getImage(AbyssRifts rift) { BufferedImage image = abyssIcons.get(rift); if (image != null) { return image; } // Since item image is too big, we must resize it first. image = itemManager.getImage(rift.getItemId()); BufferedImage resizedImage = new BufferedImage(IMAGE_SIZE.width, IMAGE_SIZE.height, BufferedImage.TYPE_INT_ARGB); Graphics2D g = resizedImage.createGraphics(); g.drawImage(image, 0, 0, IMAGE_SIZE.width, IMAGE_SIZE.height, null); g.dispose(); abyssIcons.put(rift, resizedImage); return resizedImage; } public void updateConfig() { rifts.clear(); if (plugin.isShowAir()) { rifts.add(AIR_RIFT); } if (plugin.isShowBlood()) { rifts.add(BLOOD_RIFT); } if (plugin.isShowBody()) { rifts.add(BODY_RIFT); } if (plugin.isShowChaos()) { rifts.add(CHAOS_RIFT); } if (plugin.isShowCosmic()) { rifts.add(COSMIC_RIFT); } if (plugin.isShowDeath()) { rifts.add(DEATH_RIFT); } if (plugin.isShowEarth()) { rifts.add(EARTH_RIFT); } if (plugin.isShowFire()) { rifts.add(FIRE_RIFT); } if (plugin.isShowLaw()) { rifts.add(LAW_RIFT); } if (plugin.isShowMind()) { rifts.add(MIND_RIFT); } if (plugin.isShowNature()) { rifts.add(NATURE_RIFT); } if (plugin.isShowSoul()) { rifts.add(SOUL_RIFT); } if (plugin.isShowWater()) { rifts.add(WATER_RIFT); ======= else { graphics.setColor(Color.MAGENTA); } graphics.draw(objectClickbox); graphics.setColor(new Color(255, 0, 255, 20)); graphics.fill(objectClickbox); >>>>>>> else { graphics.setColor(Color.MAGENTA); } graphics.draw(objectClickbox); graphics.setColor(new Color(255, 0, 255, 20)); graphics.fill(objectClickbox);
<<<<<<< eventBus.post(DiscordDisconnected.class, new DiscordDisconnected(errorCode, message)); ======= log.debug("Discord disconnected {}: {}", errorCode, message); eventBus.post(new DiscordDisconnected(errorCode, message)); >>>>>>> log.debug("Discord disconnected {}: {}", errorCode, message); eventBus.post(DiscordDisconnected.class, new DiscordDisconnected(errorCode, message)); <<<<<<< eventBus.post(DiscordJoinGame.class, new DiscordJoinGame(joinSecret)); ======= log.debug("Discord join game: {}", joinSecret); eventBus.post(new DiscordJoinGame(joinSecret)); >>>>>>> log.debug("Discord join game: {}", joinSecret); eventBus.post(DiscordJoinGame.class, new DiscordJoinGame(joinSecret)); <<<<<<< eventBus.post(DiscordSpectateGame.class, new DiscordSpectateGame(spectateSecret)); ======= log.debug("Discord spectate game: {}", spectateSecret); eventBus.post(new DiscordSpectateGame(spectateSecret)); >>>>>>> log.debug("Discord spectate game: {}", spectateSecret); eventBus.post(DiscordSpectateGame.class, new DiscordSpectateGame(spectateSecret)); <<<<<<< eventBus.post(DiscordJoinRequest.class, new DiscordJoinRequest( ======= log.debug("Discord join request: {}", user); eventBus.post(new DiscordJoinRequest( >>>>>>> log.debug("Discord join request: {}", user); eventBus.post(DiscordJoinRequest.class, new DiscordJoinRequest(
<<<<<<< /* Currently Minema supports client side /minema command which * record video */ if (Aperture.proxy.config.camera_minema) { ClientCommandHandler.instance.executeCommand(this.mc.player, "/minema enable"); } this.position.set(this.mc.player); ======= this.position.set(this.mc.thePlayer); >>>>>>> this.position.set(this.mc.player);
<<<<<<< ======= import java.util.Arrays; import javax.inject.Inject; >>>>>>> import java.util.Arrays; <<<<<<< @Override protected void startUp() { rightClick = false; middleClick = false; menuHasEntries = false; client.setCameraPitchRelaxerEnabled(cameraConfig.relaxCameraPitch()); keyManager.registerKeyListener(this); mouseManager.registerMouseListener(this); } @Override protected void shutDown() { client.setCameraPitchRelaxerEnabled(false); keyManager.unregisterKeyListener(this); mouseManager.unregisterMouseListener(this); controlDown = false; } ======= >>>>>>>
<<<<<<< ======= import java.awt.Color; import javax.inject.Singleton; import lombok.AccessLevel; import net.runelite.api.Player; import net.runelite.api.geometry.Geometry; >>>>>>> <<<<<<< import net.runelite.api.geometry.Geometry; ======= import net.runelite.client.Notifier; >>>>>>> import net.runelite.api.geometry.Geometry; import net.runelite.client.Notifier;
<<<<<<< ======= private void addSubscriptions() { eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged); eventBus.subscribe(PlayerDeath.class, this, this::onPlayerDeath); eventBus.subscribe(GameTick.class, this, this::onGameTick); eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged); if (config.permaBones()) { addBoneSubs(); } } >>>>>>> <<<<<<< @Subscribe private void onLocalPlayerDeath(LocalPlayerDeath death) { if (client.isInInstancedRegion()) { return; } Player lp = client.getLocalPlayer(); if (config.permaBones()) { newBoneFor(lp); } lastDeath = lp.getWorldLocation(); lastDeathWorld = client.getWorld(); lastDeathTime = Instant.now(); } @Subscribe ======= >>>>>>> @Subscribe
<<<<<<< private static final ImageIcon RESET_ICON; private static final ImageIcon RESET_ICON_FADED; private static final ImageIcon RESET_ICON_HOVER; ======= private static final ImageIcon COLLAPSE_ICON; private static final ImageIcon EXPAND_ICON; >>>>>>> private static final ImageIcon RESET_ICON; private static final ImageIcon RESET_ICON_FADED; private static final ImageIcon RESET_ICON_HOVER; private static final ImageIcon COLLAPSE_ICON; private static final ImageIcon EXPAND_ICON; <<<<<<< private final JLabel resetIcon = new JLabel(); private JComboBox dateFilterComboBox = new JComboBox<>(new Vector<LootRecordDateFilter>(Arrays.asList(LootRecordDateFilter.values()))); ======= private final JLabel collapseBtn = new JLabel(); >>>>>>> private final JLabel resetIcon = new JLabel(); private final JLabel collapseBtn = new JLabel(); private JComboBox dateFilterComboBox = new JComboBox<>(new Vector<>(Arrays.asList(LootRecordDateFilter.values()))); <<<<<<< final BufferedImage resetImg = ImageUtil.getResourceStreamFromClass(LootTrackerPlugin.class, "delete-white.png"); ======= final BufferedImage collapseImg = ImageUtil.getResourceStreamFromClass(LootTrackerPlugin.class, "collapsed.png"); final BufferedImage expandedImg = ImageUtil.getResourceStreamFromClass(LootTrackerPlugin.class, "expanded.png"); >>>>>>> final BufferedImage resetImg = ImageUtil.getResourceStreamFromClass(LootTrackerPlugin.class, "delete-white.png"); final BufferedImage collapseImg = ImageUtil.getResourceStreamFromClass(LootTrackerPlugin.class, "collapsed.png"); final BufferedImage expandedImg = ImageUtil.getResourceStreamFromClass(LootTrackerPlugin.class, "expanded.png"); <<<<<<< resetIcon.setIcon(RESET_ICON); resetIcon.setToolTipText("Resets all locally saved data (cannot be undone)"); resetIcon.addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { resetRecords(); } @Override public void mouseEntered(MouseEvent e) { resetIcon.setIcon(RESET_ICON_HOVER); } @Override public void mouseExited(MouseEvent e) { resetIcon.setIcon(records.isEmpty() ? RESET_ICON_FADED : RESET_ICON); } }); dateFilterComboBox.setSelectedItem(this.dateFilter); dateFilterComboBox.setToolTipText("Filter the displayed loot records by date"); dateFilterComboBox.setMaximumSize(new Dimension(15, 0)); dateFilterComboBox.setMaximumRowCount(3); dateFilterComboBox.addItemListener(e -> { final LootRecordDateFilter dateFilterSelected = (LootRecordDateFilter) e.getItem(); dateFilter = dateFilterSelected; rebuild(); } ); //viewControls.add(dateFilterComboBox); viewControls.add(resetIcon); ======= viewControls.add(collapseBtn); >>>>>>> resetIcon.setIcon(RESET_ICON); resetIcon.setToolTipText("Resets all locally saved data (cannot be undone)"); resetIcon.addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { resetRecords(); } @Override public void mouseEntered(MouseEvent e) { resetIcon.setIcon(RESET_ICON_HOVER); } @Override public void mouseExited(MouseEvent e) { resetIcon.setIcon(records.isEmpty() ? RESET_ICON_FADED : RESET_ICON); } }); dateFilterComboBox.setSelectedItem(this.dateFilter); dateFilterComboBox.setToolTipText("Filter the displayed loot records by date"); dateFilterComboBox.setMaximumSize(new Dimension(15, 0)); dateFilterComboBox.setMaximumRowCount(3); dateFilterComboBox.addItemListener(e -> { final LootRecordDateFilter dateFilterSelected = (LootRecordDateFilter) e.getItem(); dateFilter = dateFilterSelected; rebuild(); } ); viewControls.add(collapseBtn); //viewControls.add(dateFilterComboBox); viewControls.add(resetIcon); <<<<<<< actionsContainer.add(dateFilterComboBox); actionsContainer.add(leftTitleContainer, BorderLayout.WEST); ======= >>>>>>> actionsContainer.add(dateFilterComboBox); <<<<<<< * Clears all loaded records. This will also attempt to delete the local storage file */ private void resetRecords() { records.clear(); boxes.clear(); logsContainer.removeAll(); logsContainer.repaint(); plugin.deleteLocalRecords(); } /** ======= * Changes the collapse status of loot entries */ private void changeCollapse() { boolean isAllCollapsed = isAllCollapsed(); for (LootTrackerBox box : boxes) { if (isAllCollapsed) { box.expand(); } else if (!box.isCollapsed()) { box.collapse(); } } updateCollapseText(); } /** >>>>>>> * Clears all loaded records. This will also attempt to delete the local storage file */ private void resetRecords() { records.clear(); boxes.clear(); logsContainer.removeAll(); logsContainer.repaint(); plugin.deleteLocalRecords(); } /** * Changes the collapse status of loot entries */ private void changeCollapse() { boolean isAllCollapsed = isAllCollapsed(); for (LootTrackerBox box : boxes) { if (isAllCollapsed) { box.expand(); } else if (!box.isCollapsed()) { box.collapse(); } } updateCollapseText(); } /** <<<<<<< // Create Hide Menu item final JMenuItem hide; if (this.hideIgnoredItems) { hide = new JMenuItem("Hide " + box.getId()); } else { hide = new JMenuItem("Unhide " + box.getId()); } hide.addActionListener(e -> { this.plugin.toggleNPC(box.getId(), this.hideIgnoredItems); rebuild(); }); popupMenu.add(hide); ======= // Create collapse event box.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON1) { if (box.isCollapsed()) { box.expand(); } else { box.collapse(); } updateCollapseText(); } } }); >>>>>>> // Create collapse event box.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON1) { if (box.isCollapsed()) { box.expand(); } else { box.collapse(); } updateCollapseText(); } } }); // Create Hide Menu item final JMenuItem hide; if (this.hideIgnoredItems) { hide = new JMenuItem("Hide " + box.getId()); } else { hide = new JMenuItem("Unhide " + box.getId()); } hide.addActionListener(e -> { this.plugin.toggleNPC(box.getId(), this.hideIgnoredItems); rebuild(); }); popupMenu.add(hide);
<<<<<<< Entity getEntity1(); Entity getEntity2(); Model getModelA(); Model getModelB(); ======= /** * Gets the convex hull of the objects model. * * @return the convex hull * @see net.runelite.api.model.Jarvis */ Shape getConvexHull(); Shape getConvexHull2(); Renderable getRenderable1(); Renderable getRenderable2(); >>>>>>> Entity getEntity1(); Entity getEntity2(); Model getModelA(); Model getModelB(); /** * Gets the convex hull of the objects model. * * @return the convex hull * @see net.runelite.api.model.Jarvis */ Shape getConvexHull();
<<<<<<< /* * Copyright (C) 2012-2019 52°North Initiative for Geospatial Open Source ======= /** * Copyright (C) 2012-2020 52°North Initiative for Geospatial Open Source >>>>>>> /* * Copyright (C) 2012-2020 52°North Initiative for Geospatial Open Source
<<<<<<< @Override protected void startUp() throws Exception { eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged); eventBus.subscribe(GameTick.class, this, this::onGameTick); } @Override protected void shutDown() throws Exception { eventBus.unregister(this); } private void onGameStateChanged(GameStateChanged gameStateChanged) ======= @Override protected void startUp() { fetchXp = true; } @Subscribe public void onGameStateChanged(GameStateChanged gameStateChanged) >>>>>>> @Override protected void startUp() throws Exception { fetchXp = true; eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged); eventBus.subscribe(GameTick.class, this, this::onGameTick); } @Override protected void shutDown() throws Exception { eventBus.unregister(this); } private void onGameStateChanged(GameStateChanged gameStateChanged)
<<<<<<< name = "Clan chat info", description = "Clan Chat Information (eg. when joining a channel)", titleSection = "opaqueTitle" ======= name = "Friends chat info", description = "Friends Chat Information (eg. when joining a channel)", section = opaqueSection >>>>>>> name = "Friends chat info", description = "Friends Chat Information (eg. when joining a channel)", titleSection = "opaqueTitle" <<<<<<< name = "Clan chat info highlight", description = "Clan Chat Information highlight (used for the Raids plugin)", titleSection = "opaqueTitle" ======= name = "Friends chat info highlight", description = "Friends Chat Information highlight (used for the Raids plugin)", section = opaqueSection >>>>>>> name = "Friends chat info highlight", description = "Friends Chat Information highlight (used for the Raids plugin)", titleSection = "opaqueTitle" <<<<<<< name = "Clan chat message", description = "Color of Clan Chat Messages", titleSection = "opaqueTitle" ======= name = "Friends chat message", description = "Color of Friends chat messages", section = opaqueSection >>>>>>> name = "Friends chat message", description = "Color of Friends chat messages", titleSection = "opaqueTitle" <<<<<<< name = "Clan chat message highlight", description = "Color of highlights in Clan Chat Messages", titleSection = "opaqueTitle" ======= name = "Friends chat message highlight", description = "Color of highlights in Friends Chat messages", section = opaqueSection >>>>>>> name = "Friends chat message highlight", description = "Color of highlights in Friends Chat messages", titleSection = "opaqueTitle" <<<<<<< name = "Clan channel name", description = "Color of Clan Channel Name", titleSection = "opaqueTitle" ======= name = "Friends chat channel name", description = "Color of Friends chat channel name", section = opaqueSection >>>>>>> name = "Friends chat channel name", description = "Color of Friends chat channel name", titleSection = "opaqueTitle" <<<<<<< name = "Clan usernames", description = "Color of Usernames in Clan Chat", titleSection = "opaqueTitle" ======= name = "Friends chat usernames", description = "Color of usernames in Friends chat", section = opaqueSection >>>>>>> name = "Friends chat usernames", description = "Color of usernames in Friends chat", titleSection = "opaqueTitle" <<<<<<< name = "Clan chat info (transparent)", description = "Clan Chat Information (eg. when joining a channel) (transparent)", titleSection = "transparentTitle" ======= name = "Friends chat info (transparent)", description = "Friends chat information (eg. when joining a channel) (transparent)", section = transparentSection >>>>>>> name = "Friends chat info (transparent)", description = "Friends chat information (eg. when joining a channel) (transparent)", titleSection = "transparentTitle" <<<<<<< name = "Clan chat info highlight (transparent)", description = "Clan Chat Information highlight (used for the Raids plugin) (transparent)", titleSection = "transparentTitle" ======= name = "Friends chat info highlight (transparent)", description = "Friends chat information highlight (used for the Raids plugin) (transparent)", section = transparentSection >>>>>>> name = "Friends chat info highlight (transparent)", description = "Friends chat information highlight (used for the Raids plugin) (transparent)", titleSection = "transparentTitle" <<<<<<< name = "Clan chat message (transparent)", description = "Color of Clan Chat Messages (transparent)", titleSection = "transparentTitle" ======= name = "Friends chat message (transparent)", description = "Color of Friends chat messages (transparent)", section = transparentSection >>>>>>> name = "Friends chat message (transparent)", description = "Color of Friends chat messages (transparent)", titleSection = "transparentTitle" <<<<<<< name = "Clan chat message highlight (transparent)", description = "Color of highlights in Clan Chat Messages (transparent)", titleSection = "transparentTitle" ======= name = "Friends chat message highlight (transparent)", description = "Color of highlights in Friends chat messages (transparent)", section = transparentSection >>>>>>> name = "Friends chat message highlight (transparent)", description = "Color of highlights in Friends chat messages (transparent)", titleSection = "transparentTitle" <<<<<<< name = "Clan channel name (transparent)", description = "Color of Clan Channel Name (transparent)", titleSection = "transparentTitle" ======= name = "Friends chat channel name (transparent)", description = "Color of Friends chat channel name (transparent)", section = transparentSection >>>>>>> name = "Friends chat channel name (transparent)", description = "Color of Friends chat channel name (transparent)", titleSection = "transparentTitle" <<<<<<< name = "Clan usernames (transparent)", description = "Color of Usernames in Clan Chat (transparent)", titleSection = "transparentTitle" ======= name = "Friends chat usernames (transparent)", description = "Color of usernames in Friends chat (transparent)", section = transparentSection >>>>>>> name = "Friends chat usernames (transparent)", description = "Color of usernames in Friends chat (transparent)", titleSection = "transparentTitle"
<<<<<<< import java.net.Authenticator; import java.net.PasswordAuthentication; ======= import java.nio.file.Paths; >>>>>>> import java.net.Authenticator; import java.net.PasswordAuthentication; import java.nio.file.Paths; <<<<<<< import net.runelite.client.events.ExternalPluginsLoaded; ======= import net.runelite.client.externalplugins.ExternalPluginManager; >>>>>>> import net.runelite.client.events.ExternalPluginsLoaded; <<<<<<< import net.runelite.client.plugins.ExternalPluginManager; ======= >>>>>>> import net.runelite.client.plugins.ExternalPluginManager; <<<<<<< public static final File PLUGINS_DIR = new File(RUNELITE_DIR, "plugins"); public static final Locale SYSTEM_LOCALE = Locale.getDefault(); public static boolean allowPrivateServer = false; ======= public static final File DEFAULT_SESSION_FILE = new File(RUNELITE_DIR, "session"); public static final File DEFAULT_CONFIG_FILE = new File(RUNELITE_DIR, "settings.properties"); >>>>>>> public static final File PLUGINS_DIR = new File(RUNELITE_DIR, "plugins"); public static final File DEFAULT_CONFIG_FILE = new File(RUNELITE_DIR, "runeliteplus.properties"); public static final Locale SYSTEM_LOCALE = Locale.getDefault(); public static boolean allowPrivateServer = false; <<<<<<< parser.accepts("no-splash", "Do not show the splash screen"); final ArgumentAcceptingOptionSpec<String> proxyInfo = parser .accepts("proxy") .withRequiredArg().ofType(String.class); final ArgumentAcceptingOptionSpec<Integer> worldInfo = parser .accepts("world") .withRequiredArg().ofType(Integer.class); ======= final ArgumentAcceptingOptionSpec<File> sessionfile = parser.accepts("sessionfile", "Use a specified session file") .withRequiredArg() .withValuesConvertedBy(new ConfigFileConverter()) .defaultsTo(DEFAULT_SESSION_FILE); final ArgumentAcceptingOptionSpec<File> configfile = parser.accepts("config", "Use a specified config file") .withRequiredArg() .withValuesConvertedBy(new ConfigFileConverter()) .defaultsTo(DEFAULT_CONFIG_FILE); >>>>>>> parser.accepts("no-splash", "Do not show the splash screen"); final ArgumentAcceptingOptionSpec<String> proxyInfo = parser .accepts("proxy") .withRequiredArg().ofType(String.class); final ArgumentAcceptingOptionSpec<Integer> worldInfo = parser .accepts("world") .withRequiredArg().ofType(Integer.class); final ArgumentAcceptingOptionSpec<File> configfile = parser.accepts("config", "Use a specified config file") .withRequiredArg() .withValuesConvertedBy(new ConfigFileConverter()) .defaultsTo(DEFAULT_CONFIG_FILE); <<<<<<< final ClientLoader clientLoader = new ClientLoader(options.valueOf(updateMode)); Completable.fromAction(clientLoader::get) .subscribeOn(Schedulers.computation()) .subscribe(); ======= injector = Guice.createInjector(new RuneLiteModule( clientLoader, developerMode, options.valueOf(sessionfile), options.valueOf(configfile))); >>>>>>> final ClientLoader clientLoader = new ClientLoader(options.valueOf(updateMode)); Completable.fromAction(clientLoader::get) .subscribeOn(Schedulers.computation()) .subscribe();
<<<<<<< import net.runelite.api.Sprite; import net.runelite.api.events.ConfigChanged; ======= import net.runelite.api.SpritePixels; import net.runelite.client.events.ConfigChanged; >>>>>>> import net.runelite.api.Sprite;
<<<<<<< import javax.inject.Singleton; ======= import static net.runelite.api.AnimationID.MINING_MOTHERLODE_ADAMANT; import static net.runelite.api.AnimationID.MINING_MOTHERLODE_BLACK; import static net.runelite.api.AnimationID.MINING_MOTHERLODE_BRONZE; import static net.runelite.api.AnimationID.MINING_MOTHERLODE_CRYSTAL; import static net.runelite.api.AnimationID.MINING_MOTHERLODE_DRAGON; import static net.runelite.api.AnimationID.MINING_MOTHERLODE_DRAGON_OR; import static net.runelite.api.AnimationID.MINING_MOTHERLODE_DRAGON_UPGRADED; import static net.runelite.api.AnimationID.MINING_MOTHERLODE_INFERNAL; import static net.runelite.api.AnimationID.MINING_MOTHERLODE_IRON; import static net.runelite.api.AnimationID.MINING_MOTHERLODE_MITHRIL; import static net.runelite.api.AnimationID.MINING_MOTHERLODE_RUNE; import static net.runelite.api.AnimationID.MINING_MOTHERLODE_STEEL; import net.runelite.api.Client; import static net.runelite.api.MenuAction.RUNELITE_OVERLAY; >>>>>>> import javax.inject.Singleton; import static net.runelite.api.MenuOpcode.RUNELITE_OVERLAY; <<<<<<< ======= private static final Set<Integer> MINING_ANIMATION_IDS = ImmutableSet.of( MINING_MOTHERLODE_BRONZE, MINING_MOTHERLODE_IRON, MINING_MOTHERLODE_STEEL, MINING_MOTHERLODE_BLACK, MINING_MOTHERLODE_MITHRIL, MINING_MOTHERLODE_ADAMANT, MINING_MOTHERLODE_RUNE, MINING_MOTHERLODE_DRAGON, MINING_MOTHERLODE_DRAGON_UPGRADED, MINING_MOTHERLODE_DRAGON_OR, MINING_MOTHERLODE_INFERNAL, MINING_MOTHERLODE_CRYSTAL ); static final String MINING_RESET = "Reset"; private final Client client; >>>>>>> <<<<<<< ======= this.config = config; getMenuEntries().add(new OverlayMenuEntry(RUNELITE_OVERLAY, MINING_RESET, "Motherlode mine overlay")); >>>>>>> getMenuEntries().add(new OverlayMenuEntry(RUNELITE_OVERLAY, MINING_RESET, "Motherlode mine overlay"));
<<<<<<< import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.EnumSet; import java.util.HashMap; import java.util.List; import java.util.Map; ======= import java.text.DecimalFormat; >>>>>>> import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.text.DecimalFormat; import java.util.ArrayList; import java.util.EnumSet; import java.util.HashMap; import java.util.List; import java.util.Map; <<<<<<< ======= import net.runelite.client.externalplugins.ExternalPluginManager; import net.runelite.client.externalplugins.ExternalPluginManifest; import net.runelite.client.plugins.Plugin; >>>>>>> <<<<<<< validate(); repaint(); }); sliderValueLabel.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { spinner.setValue(slider.getValue()); subPanel.remove(sliderValueLabel); subPanel.remove(slider); subPanel.add(spinner, BorderLayout.EAST); validate(); repaint(); final JTextField tf = ((JSpinner.DefaultEditor) spinner.getEditor()).getTextField(); tf.requestFocusInWindow(); SwingUtilities.invokeLater(tf::selectAll); } }); subPanel.add(sliderValueLabel, BorderLayout.WEST); subPanel.add(slider, BorderLayout.EAST); item.add(subPanel, BorderLayout.EAST); } else { SpinnerModel model = new SpinnerNumberModel(value, min, max, 1); JSpinner spinner = new JSpinner(model); Component editor = spinner.getEditor(); JFormattedTextField spinnerTextField = ((JSpinner.DefaultEditor) editor).getTextField(); spinnerTextField.setColumns(SPINNER_FIELD_WIDTH); spinner.addChangeListener(ce -> changeConfiguration(spinner, cd, cid)); item.add(spinner, BorderLayout.EAST); } ======= Units units = cid.getUnits(); if (units != null) { DecimalFormat df = ((JSpinner.NumberEditor) spinner.getEditor()).getFormat(); df.setPositiveSuffix(units.value()); df.setNegativeSuffix(units.value()); // Force update the spinner to have it add the units initially spinnerTextField.setValue(value); } item.add(spinner, BorderLayout.EAST); >>>>>>> validate(); repaint(); }); sliderValueLabel.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { spinner.setValue(slider.getValue()); subPanel.remove(sliderValueLabel); subPanel.remove(slider); subPanel.add(spinner, BorderLayout.EAST); validate(); repaint(); final JTextField tf = ((JSpinner.DefaultEditor) spinner.getEditor()).getTextField(); tf.requestFocusInWindow(); SwingUtilities.invokeLater(tf::selectAll); } }); subPanel.add(sliderValueLabel, BorderLayout.WEST); subPanel.add(slider, BorderLayout.EAST); item.add(subPanel, BorderLayout.EAST); } else { SpinnerModel model = new SpinnerNumberModel(value, min, max, 1); JSpinner spinner = new JSpinner(model); Component editor = spinner.getEditor(); JFormattedTextField spinnerTextField = ((JSpinner.DefaultEditor) editor).getTextField(); spinnerTextField.setColumns(SPINNER_FIELD_WIDTH); spinner.addChangeListener(ce -> changeConfiguration(spinner, cd, cid)); Units units = cid.getUnits(); if (units != null) { DecimalFormat df = ((JSpinner.NumberEditor) spinner.getEditor()).getFormat(); df.setPositiveSuffix(units.value()); df.setNegativeSuffix(units.value()); // Force update the spinner to have it add the units initially spinnerTextField.setValue(value); } item.add(spinner, BorderLayout.EAST); } <<<<<<< rebuild(false); ======= // Reset non-config panel keys Plugin plugin = pluginConfig.getPlugin(); if (plugin != null) { plugin.resetConfiguration(); } rebuild(); >>>>>>> rebuild(false);
<<<<<<< TZHAAR("Tzhaar", ItemID.ENSOULED_TZHAAR_HEAD, Collections.singletonList("Tz-"), Collections.emptyList(), false), VAMPIRES("Vampires", ItemID.STAKE, asList("Vampyre", "Vyrewatch", "Vampire"), Collections.emptyList()), ======= TZHAAR("Tzhaar", ItemID.ENSOULED_TZHAAR_HEAD), UNDEAD_DRUIDS("Undead Druids", ItemID.MASK_OF_RANUL), VAMPYRES("Vampyres", ItemID.STAKE, "Vyrewatch", "Vampire"), >>>>>>> TZHAAR("Tzhaar", ItemID.ENSOULED_TZHAAR_HEAD, Collections.singletonList("Tz-"), Collections.emptyList(), false), UNDEAD_DRUIDS("Undead Druids", ItemID.MASK_OF_RANUL), VAMPIRES("Vampires", ItemID.STAKE, asList("Vampyre", "Vyrewatch", "Vampire"), Collections.emptyList()),
<<<<<<< private static final Injector injector = RuneLite.getInjector(); private static final Client client = injector.getInstance(Client.class); public static final OverlayRenderer renderer = injector.getInstance(OverlayRenderer.class); private static final OverlayManager overlayManager = injector.getInstance(OverlayManager.class); private static final GameTick GAME_TICK = GameTick.INSTANCE; private static final BeforeRender BEFORE_RENDER = BeforeRender.INSTANCE; private static final DrawFinished drawFinishedEvent = new DrawFinished(); private int mouseX = 0; private int mouseY = 0; private final Image cursor = ImageUtil.getResourceStreamFromClass(Hooks.class, "cursor.png"); ======= private static final GameTick GAME_TICK = new GameTick(); private static final BeforeRender BEFORE_RENDER = new BeforeRender(); >>>>>>> private static final GameTick GAME_TICK = GameTick.INSTANCE; private static final BeforeRender BEFORE_RENDER = BeforeRender.INSTANCE; private static final DrawFinished drawFinishedEvent = new DrawFinished(); private int mouseX = 0; private int mouseY = 0; private final Image cursor = ImageUtil.getResourceStreamFromClass(Hooks.class, "cursor.png"); <<<<<<< public static void renderDraw(Entity entity, int orientation, int pitchSin, int pitchCos, int yawSin, int yawCos, int x, int y, int z, long hash) { DrawCallbacks drawCallbacks = client.getDrawCallbacks(); if (drawCallbacks != null) { drawCallbacks.draw(entity, orientation, pitchSin, pitchCos, yawSin, yawCos, x, y, z, hash); } else { entity.draw(orientation, pitchSin, pitchCos, yawSin, yawCos, x, y, z, hash); } } public static void clearColorBuffer(int x, int y, int width, int height, int color) { BufferProvider bp = client.getBufferProvider(); int canvasWidth = bp.getWidth(); int[] pixels = bp.getPixels(); int pixelPos = y * canvasWidth + x; int pixelJump = canvasWidth - width; for (int cy = y; cy < y + height; cy++) { for (int cx = x; cx < x + width; cx++) { pixels[pixelPos++] = 0; } pixelPos += pixelJump; } } ======= >>>>>>> <<<<<<< public static boolean drawMenu() { BeforeMenuRender event = new BeforeMenuRender(); client.getCallbacks().post(BeforeMenuRender.class, event); return event.isConsumed(); } ======= @Subscribe >>>>>>>
<<<<<<< import net.runelite.api.ItemDefinition; ======= import net.runelite.api.Constants; import net.runelite.api.ItemComposition; import net.runelite.api.ItemID; >>>>>>> import net.runelite.api.ItemDefinition; import net.runelite.api.ItemID;
<<<<<<< private static HealthBarOverride healthBarOverride; @Inject private static boolean printMenuActions; @Inject @Override public void setPrintMenuActions(boolean yes) { printMenuActions = yes; } @Inject ======= >>>>>>> private static HealthBarOverride healthBarOverride; @Inject private static boolean printMenuActions; @Inject @Override public void setPrintMenuActions(boolean yes) { printMenuActions = yes; } @Inject
<<<<<<< PYRAMID_PLUNDER_SARCO_OPEN(2362), PYRAMID_PLUNDER_CHEST_OPEN(2363), ======= PYRAMID_PLUNDER_ROOM_LOCATION(2365), >>>>>>> PYRAMID_PLUNDER_SARCO_OPEN(2362), PYRAMID_PLUNDER_CHEST_OPEN(2363), PYRAMID_PLUNDER_ROOM_LOCATION(2365),
<<<<<<< @Nullable final Boolean showDate, ======= final LootTrackerPriceType priceType, final boolean showPriceType, >>>>>>> final LootTrackerPriceType priceType, final boolean showPriceType, @Nullable final Boolean showDate,
<<<<<<< import java.util.regex.Matcher; ======= import java.util.List; >>>>>>> import java.util.regex.Matcher; import java.util.List; <<<<<<< @Inject private EventBus eventBus; ======= @Inject private ConfigManager configManager; >>>>>>> @Inject private EventBus eventBus; @Inject private ConfigManager configManager; <<<<<<< addSubscriptions(); ======= cleanConfig(); >>>>>>> addSubscriptions(); cleanConfig();
<<<<<<< * Small hack to prevent plugins checking for specific messages to match * ======= * Small hack to prevent plugins checking for specific messages to match. This works because the "—" character * cannot be seen in-game. This replacement preserves wrapping on chat history messages. >>>>>>> * Small hack to prevent plugins checking for specific messages to match. This works because the "—" character * cannot be seen in-game. This replacement preserves wrapping on chat history messages. *
<<<<<<< ignoredItems = Text.fromCSV(config.getIgnoredItems()); ignoredNPCs = Text.fromCSV(config.getIgnoredNPCs()); ======= updateConfig(); ignoredItems = Text.fromCSV(this.getIgnoredItems); >>>>>>> ignoredItems = Text.fromCSV(config.getIgnoredItems()); ignoredNPCs = Text.fromCSV(config.getIgnoredNPCs()); updateConfig(); <<<<<<< if (config.saveLoot() && lootTrackerClient != null) ======= if (lootTrackerClient != null && this.saveLoot) >>>>>>> if (config.saveLoot() && lootTrackerClient != null) <<<<<<< if (config.localPersistence()) ======= if (this.localPersistence && lootTrackerClient == null) >>>>>>> if (config.localPersistence()) <<<<<<< LootRecord lootRecord = new LootRecord(chestType, client.getLocalPlayer().getName(), LootRecordType.EVENT, toGameItems(items), Instant.now()); if (lootTrackerClient != null && config.saveLoot()) ======= if (lootTrackerClient != null && this.saveLoot) >>>>>>> LootRecord lootRecord = new LootRecord(chestType, client.getLocalPlayer().getName(), LootRecordType.EVENT, toGameItems(items), Instant.now()); if (lootTrackerClient != null && config.saveLoot())
<<<<<<< ======= graphics.drawString("" + formatNumber(amount), location.getX() + (config.showIcons() ? 13 : 6), yLocation + yOffset); graphics.setColor(config.fontColor()); >>>>>>> graphics.drawString("" + formatNumber(amount), location.getX() + (config.showIcons() ? 13 : 6), yLocation + yOffset); graphics.setColor(config.fontColor()); <<<<<<< new Point(location.getX() - 1, location.getY() + graphics.getFontMetrics().getHeight() * i - 1), ======= new Point(location.getX(), location.getY() + (1 + graphics.getFontMetrics().getMaxAscent()) * i), >>>>>>> //TODO :: SEE WHAT ONE IS RIGHT? //new Point(location.getX() - 1, location.getY() + graphics.getFontMetrics().getMaxAscent() * i - 1), //image); //or //new Point(location.getX(), location.getY() + (1 + graphics.getFontMetrics().getMaxAscent()) * i), //image); new Point(location.getX(), location.getY() + (1 + graphics.getFontMetrics().getMaxAscent()) * i),
<<<<<<< import net.runelite.api.WorldType; import net.runelite.api.WallObject; ======= import net.runelite.api.coords.WorldPoint; >>>>>>> import net.runelite.api.WorldType; import net.runelite.api.WallObject; import net.runelite.api.coords.WorldPoint; <<<<<<< if (this.interactionIdle && checkInteractionIdle(waitDuration, local)) ======= if (config.movementIdle() && checkMovementIdle(waitDuration, local)) { notifier.notify("[" + local.getName() + "] has stopped moving!"); } if (config.interactionIdle() && checkInteractionIdle(waitDuration, local)) >>>>>>> if (this.movementIdle && checkMovementIdle(waitDuration, local)) { notifier.notify("[" + local.getName() + "] has stopped moving!"); } if (this.interactionIdle && checkInteractionIdle(waitDuration, local)) <<<<<<< private boolean checkOutOfItemsIdle(Duration waitDuration) { if (lastTimeItemsUsedUp == null) { return false; } if (Instant.now().compareTo(lastTimeItemsUsedUp.plus(waitDuration)) >= 0) { resetTimers(); resetOutOfItemsIdleChecks(); return true; } return false; } ======= private boolean checkMovementIdle(Duration waitDuration, Player local) { if (lastPosition == null) { lastPosition = local.getWorldLocation(); return false; } WorldPoint position = local.getWorldLocation(); if (lastPosition.equals(position)) { if (notifyPosition && local.getAnimation() == IDLE && Instant.now().compareTo(lastMoving.plus(waitDuration)) >= 0) { notifyPosition = false; // Return true only if we weren't just breaking out of an animation return lastAnimation == IDLE; } } else { notifyPosition = true; lastPosition = position; lastMoving = Instant.now(); } return false; } >>>>>>> private boolean checkOutOfItemsIdle(Duration waitDuration) { if (lastTimeItemsUsedUp == null) { return false; } if (Instant.now().compareTo(lastTimeItemsUsedUp.plus(waitDuration)) >= 0) { resetTimers(); resetOutOfItemsIdleChecks(); return true; } return false; } private boolean checkMovementIdle(Duration waitDuration, Player local) { if (lastPosition == null) { lastPosition = local.getWorldLocation(); return false; } WorldPoint position = local.getWorldLocation(); if (lastPosition.equals(position)) { if (notifyPosition && local.getAnimation() == IDLE && Instant.now().compareTo(lastMoving.plus(waitDuration)) >= 0) { notifyPosition = false; // Return true only if we weren't just breaking out of an animation return lastAnimation == IDLE; } } else { notifyPosition = true; lastPosition = position; lastMoving = Instant.now(); } return false; }
<<<<<<< @Import("VarpDefinition_get") RSVarpDefinition getVarpDefinition(int id); ======= @Construct RSTileItem newTileItem(); @Construct RSNodeDeque newNodeDeque(); @Import("updateItemPile") void updateItemPile(int localX, int localY); >>>>>>> @Import("VarpDefinition_get") RSVarpDefinition getVarpDefinition(int id); @Construct RSTileItem newTileItem(); @Construct RSNodeDeque newNodeDeque(); @Import("updateItemPile") void updateItemPile(int localX, int localY);
<<<<<<< ======= initDatabase(); >>>>>>> initDatabase(); <<<<<<< final int killCount = killCountMap.getOrDefault(eventType.toUpperCase(), -1); if (this.saveLoot) ======= if (lootTrackerClient != null && this.saveLoot) >>>>>>> if (this.saveLoot)
<<<<<<< import net.runelite.api.events.ConfigChanged; import net.runelite.api.events.ExperienceChanged; ======= >>>>>>> import net.runelite.api.events.ConfigChanged; <<<<<<< void onExperienceChanged(ExperienceChanged event) ======= @Subscribe public void onStatChanged(StatChanged statChanged) >>>>>>> void onStatChanged(StatChanged statChanged)