conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
=======
>>>>>>>
<<<<<<<
=======
>>>>>>>
<<<<<<<
List<VariantAnnotation> variantAnnotationList = runAnnotationProcess(normalizedVariantList);
return generateCellBaseDataResultList(variantList, normalizedVariantList, startTime);
=======
runAnnotationProcess(normalizedVariantList);
return generateQueryResultList(variantList, normalizedVariantList, startTime);
>>>>>>>
List<VariantAnnotation> variantAnnotationList = runAnnotationProcess(normalizedVariantList);
return generateCellBaseDataResultList(variantList, normalizedVariantList, startTime);
<<<<<<<
private Variant getPreferredVariant(CellBaseDataResult<Variant> variantCellBaseDataResult) {
if (variantCellBaseDataResult.getNumResults() > 1
&& variantCellBaseDataResult.first().getAnnotation().getPopulationFrequencies() == null) {
for (int i = 1; i < variantCellBaseDataResult.getResults().size(); i++) {
if (variantCellBaseDataResult.getResults().get(i).getAnnotation().getPopulationFrequencies() != null) {
return variantCellBaseDataResult.getResults().get(i);
=======
private Variant getPreferredVariant(QueryResult<Variant> variantQueryResult) {
if (variantQueryResult.getNumResults() > 1
&& variantQueryResult.first().getAnnotation().getPopulationFrequencies() == null) {
for (int i = 1; i < variantQueryResult.getResult().size(); i++) {
if (variantQueryResult.getResult().get(i).getAnnotation().getPopulationFrequencies() != null) {
return variantQueryResult.getResult().get(i);
>>>>>>>
private Variant getPreferredVariant(CellBaseDataResult<Variant> variantCellBaseDataResult) {
if (variantCellBaseDataResult.getNumResults() > 1
&& variantCellBaseDataResult.first().getAnnotation().getPopulationFrequencies() == null) {
for (int i = 1; i < variantCellBaseDataResult.getResults().size(); i++) {
if (variantCellBaseDataResult.getResults().get(i).getAnnotation().getPopulationFrequencies() != null) {
return variantCellBaseDataResult.getResults().get(i);
<<<<<<<
Future<List<CellBaseDataResult<Variant>>> variationFuture = null;
=======
Future<List<QueryResult<Variant>>> variationFuture = null;
List<Gene> batchGeneList = getBatchGeneList(normalizedVariantList);
>>>>>>>
Future<List<CellBaseDataResult<Variant>>> variationFuture = null;
List<Gene> batchGeneList = getBatchGeneList(normalizedVariantList);
<<<<<<<
List<CellBaseDataResult<Variant>> clinicalCellBaseDataResultList = clinicalDBAdaptor.getByVariant(variantList, queryOptions);
=======
List<QueryResult<Variant>> clinicalQueryResultList = clinicalDBAdaptor.getByVariant(variantList,
batchGeneList,
queryOptions);
>>>>>>>
List<CellBaseDataResult<Variant>> clinicalCellBaseDataResultList = clinicalDBAdaptor.getByVariant(variantList,
batchGeneList,
queryOptions); |
<<<<<<<
QueryOptions options = new QueryOptions("include", "chromosome,start,reference,alternate,type");
List<ParallelTaskRunner.Task<Variant, Variant>> variantAnnotatorTaskList = getVariantTaskList();
ParallelTaskRunner.Config config = new ParallelTaskRunner.Config(numThreads, batchSize, QUEUE_CAPACITY, false);
=======
QueryOptions options = new QueryOptions("include", "chromosome,start,reference,alternate,type");
List<ParallelTaskRunner.TaskWithException<Variant, Variant, Exception>> variantAnnotatorTaskList
= getVariantTaskList(false);
ParallelTaskRunner.Config config = new ParallelTaskRunner.Config(numThreads, batchSize, QUEUE_CAPACITY, false);
for (String chromosome : chromosomeList) {
logger.info("Annotating chromosome {}", chromosome);
Query query = new Query("chromosome", chromosome);
DataReader dataReader =
new VariationDataReader(dbAdaptorFactory.getVariationDBAdaptor(species), query, options);
DataWriter dataWriter = getDataWriter(output.toString() + "/"
+ VARIATION_ANNOTATION_FILE_PREFIX + chromosome + ".json.gz");
ParallelTaskRunner<Variant, Variant> runner =
new ParallelTaskRunner<Variant, Variant>(dataReader, variantAnnotatorTaskList, dataWriter, config);
runner.run();
}
}
}
>>>>>>>
QueryOptions options = new QueryOptions("include", "chromosome,start,reference,alternate,type");
List<ParallelTaskRunner.TaskWithException<Variant, Variant, Exception>> variantAnnotatorTaskList
= getVariantTaskList();
ParallelTaskRunner.Config config = new ParallelTaskRunner.Config(numThreads, batchSize, QUEUE_CAPACITY, false);
<<<<<<<
private List<ParallelTaskRunner.Task<String, Variant>> getStringTaskList() throws IOException {
List<ParallelTaskRunner.Task<String, Variant>> variantAnnotatorTaskList = new ArrayList<>(numThreads);
=======
private List<ParallelTaskRunner.TaskWithException<String, Variant, Exception>> getStringTaskList(boolean normalize) throws IOException {
List<ParallelTaskRunner.TaskWithException<String, Variant, Exception>> variantAnnotatorTaskList = new ArrayList<>(numThreads);
>>>>>>>
private List<ParallelTaskRunner.TaskWithException<String, Variant, Exception>> getStringTaskList() throws IOException {
List<ParallelTaskRunner.TaskWithException<String, Variant, Exception>> variantAnnotatorTaskList = new ArrayList<>(numThreads);
<<<<<<<
private List<ParallelTaskRunner.Task<Variant, Variant>> getVariantTaskList() throws IOException {
List<ParallelTaskRunner.Task<Variant, Variant>> variantAnnotatorTaskList = new ArrayList<>(numThreads);
=======
private List<ParallelTaskRunner.TaskWithException<Variant, Variant, Exception>> getVariantTaskList(boolean normalize)
throws IOException {
List<ParallelTaskRunner.TaskWithException<Variant, Variant, Exception>> variantAnnotatorTaskList
= new ArrayList<>(numThreads);
>>>>>>>
private List<ParallelTaskRunner.TaskWithException<Variant, Variant, Exception>> getVariantTaskList()
throws IOException {
List<ParallelTaskRunner.TaskWithException<Variant, Variant, Exception>> variantAnnotatorTaskList
= new ArrayList<>(numThreads); |
<<<<<<<
private void parseQueryParam(QueryOptions queryOptions) {
// We process include and exclude query options to know which annotators to use.
// Include parameter has preference over exclude.
annotatorSet = getAnnotatorSet(queryOptions);
logger.debug("Annotators to use: {}", annotatorSet.toString());
// This field contains all the fields to be returned by overlapping genes
includeGeneFields = getIncludedGeneFields(annotatorSet);
// Default behaviour no normalization
normalize = (queryOptions.get("normalize") != null && queryOptions.get("normalize").equals("true"));
// Default behaviour use cache
useCache = (queryOptions.get("useCache") != null ? queryOptions.get("useCache").equals("true") : true);
}
=======
private void mergeAnnotation(Variant destinationVariant, VariantAnnotation origin) {
if (destinationVariant.getAnnotation() == null) {
destinationVariant.setAnnotation(origin);
} else {
destinationVariant.getAnnotation().setId(origin.getId());
destinationVariant.getAnnotation().setChromosome(origin.getChromosome());
destinationVariant.getAnnotation().setStart(origin.getStart());
destinationVariant.getAnnotation().setReference(origin.getReference());
destinationVariant.getAnnotation().setAlternate(origin.getAlternate());
destinationVariant.getAnnotation().setDisplayConsequenceType(origin.getDisplayConsequenceType());
destinationVariant.getAnnotation().setConsequenceTypes(origin.getConsequenceTypes());
destinationVariant.getAnnotation().setConservation(origin.getConservation());
destinationVariant.getAnnotation().setGeneExpression(origin.getGeneExpression());
destinationVariant.getAnnotation().setGeneTraitAssociation(origin.getGeneTraitAssociation());
destinationVariant.getAnnotation().setGeneDrugInteraction(origin.getGeneDrugInteraction());
destinationVariant.getAnnotation().setVariantTraitAssociation(origin.getVariantTraitAssociation());
destinationVariant.getAnnotation().setFunctionalScore(origin.getFunctionalScore());
}
}
>>>>>>>
private void parseQueryParam(QueryOptions queryOptions) {
// We process include and exclude query options to know which annotators to use.
// Include parameter has preference over exclude.
annotatorSet = getAnnotatorSet(queryOptions);
logger.debug("Annotators to use: {}", annotatorSet.toString());
// This field contains all the fields to be returned by overlapping genes
includeGeneFields = getIncludedGeneFields(annotatorSet);
// Default behaviour no normalization
normalize = (queryOptions.get("normalize") != null && queryOptions.get("normalize").equals("true"));
// Default behaviour use cache
useCache = (queryOptions.get("useCache") != null ? queryOptions.get("useCache").equals("true") : true);
}
private void mergeAnnotation(Variant destinationVariant, VariantAnnotation origin) {
if (destinationVariant.getAnnotation() == null) {
destinationVariant.setAnnotation(origin);
} else {
destinationVariant.getAnnotation().setId(origin.getId());
destinationVariant.getAnnotation().setChromosome(origin.getChromosome());
destinationVariant.getAnnotation().setStart(origin.getStart());
destinationVariant.getAnnotation().setReference(origin.getReference());
destinationVariant.getAnnotation().setAlternate(origin.getAlternate());
destinationVariant.getAnnotation().setDisplayConsequenceType(origin.getDisplayConsequenceType());
destinationVariant.getAnnotation().setConsequenceTypes(origin.getConsequenceTypes());
destinationVariant.getAnnotation().setConservation(origin.getConservation());
destinationVariant.getAnnotation().setGeneExpression(origin.getGeneExpression());
destinationVariant.getAnnotation().setGeneTraitAssociation(origin.getGeneTraitAssociation());
destinationVariant.getAnnotation().setGeneDrugInteraction(origin.getGeneDrugInteraction());
destinationVariant.getAnnotation().setVariantTraitAssociation(origin.getVariantTraitAssociation());
destinationVariant.getAnnotation().setFunctionalScore(origin.getFunctionalScore());
}
} |
<<<<<<<
clinvarJsonObjectWriter = jsonObjectMapper.writer();
jsonObjectMapper.configure(MapperFeature.REQUIRE_SETTERS_FOR_GETTERS, true);
=======
jsonObjectMapper.configure(MapperFeature.REQUIRE_SETTERS_FOR_GETTERS, requireGettersForSetters);
>>>>>>>
clinvarJsonObjectWriter = jsonObjectMapper.writer();
jsonObjectMapper.configure(MapperFeature.REQUIRE_SETTERS_FOR_GETTERS, requireGettersForSetters); |
<<<<<<<
import org.opencb.cellbase.core.api.TranscriptDBAdaptor;
import org.opencb.cellbase.core.api.VariationDBAdaptor;
=======
import org.opencb.cellbase.core.api.VariantDBAdaptor;
>>>>>>>
import org.opencb.cellbase.core.api.TranscriptDBAdaptor;
import org.opencb.cellbase.core.api.VariantDBAdaptor;
<<<<<<<
query.append(VariationDBAdaptor.QueryParams.ID.key(), queryCommandOptions.id);
Iterator iterator = variationDBAdaptor.nativeIterator(query, queryOptions);
=======
query.append(GeneDBAdaptor.QueryParams.ID.key(), queryCommandOptions.id);
Iterator iterator = variantDBAdaptor.nativeIterator(query, queryOptions);
>>>>>>>
query.append(GeneDBAdaptor.QueryParams.ID.key(), queryCommandOptions.id);
Iterator iterator = variantDBAdaptor.nativeIterator(query, queryOptions); |
<<<<<<<
import org.n52.sos.ds.hibernate.dao.observation.series.AbstractSeriesValueDAO;
import org.n52.sos.ds.hibernate.dao.observation.series.AbstractSeriesValueTimeDAO;
import org.n52.sos.ds.hibernate.entities.observation.legacy.AbstractValuedLegacyObservation;
=======
import org.n52.sos.ds.hibernate.dao.series.AbstractSeriesValueDAO;
import org.n52.sos.ds.hibernate.dao.series.AbstractSeriesValueTimeDAO;
import org.n52.sos.ds.hibernate.entities.series.values.SeriesValue;
import org.n52.sos.ds.hibernate.entities.values.AbstractValue;
>>>>>>>
import org.n52.sos.ds.hibernate.dao.observation.series.AbstractSeriesValueDAO;
import org.n52.sos.ds.hibernate.dao.observation.series.AbstractSeriesValueTimeDAO;
import org.n52.sos.ds.hibernate.entities.observation.legacy.AbstractValuedLegacyObservation;
<<<<<<<
protected Set<Long> series = Sets.newHashSet();
=======
protected long series;
private boolean duplicated;
>>>>>>>
protected Set<Long> series = Sets.newHashSet();
private boolean duplicated;
<<<<<<<
public HibernateSeriesStreamingValue(AbstractObservationRequest request, long series) throws CodedException {
=======
public HibernateSeriesStreamingValue(GetObservationRequest request, long series, boolean duplicated) throws CodedException {
>>>>>>>
public HibernateSeriesStreamingValue(AbstractObservationRequest request, long series, boolean duplicated) throws CodedException {
<<<<<<<
this.series.add(series);
this.seriesValueDAO = DaoFactory.getInstance().getValueDAO();
this.seriesValueTimeDAO = DaoFactory.getInstance().getValueTimeDAO();
=======
this.series = series;
this.duplicated = duplicated;
this.seriesValueDAO = (AbstractSeriesValueDAO) DaoFactory.getInstance().getValueDAO();
this.seriesValueTimeDAO = (AbstractSeriesValueTimeDAO) DaoFactory.getInstance().getValueTimeDAO();
>>>>>>>
this.series.add(series);
this.duplicated = duplicated;
this.seriesValueDAO = DaoFactory.getInstance().getValueDAO();
this.seriesValueTimeDAO = DaoFactory.getInstance().getValueTimeDAO();
<<<<<<<
protected Set<Long> getSeries() {
return series;
}
@Override
public void mergeValue(StreamingValue<AbstractValuedLegacyObservation<?>> streamingValue) {
if (streamingValue instanceof HibernateSeriesStreamingValue) {
series.addAll(((HibernateSeriesStreamingValue) streamingValue).getSeries());
}
}
=======
protected boolean checkValue(AbstractValue value) {
if (isDuplicated()) {
return value.getOfferings() != null && value.getOfferings().size() == 1;
}
return true;
}
protected boolean isDuplicated() {
return duplicated;
}
>>>>>>>
protected Set<Long> getSeries() {
return series;
}
@Override
public void mergeValue(StreamingValue<AbstractValuedLegacyObservation<?>> streamingValue) {
if (streamingValue instanceof HibernateSeriesStreamingValue) {
series.addAll(((HibernateSeriesStreamingValue) streamingValue).getSeries());
}
}
protected boolean checkValue(AbstractValuedLegacyObservation<?> value) {
if (isDuplicated()) {
return value.getOfferings() != null && value.getOfferings().size() == 1;
}
return true;
}
protected boolean isDuplicated() {
return duplicated;
} |
<<<<<<<
import org.opencb.cellbase.lib.EtlCommons;
=======
>>>>>>>
import org.opencb.cellbase.lib.EtlCommons; |
<<<<<<<
private boolean flexibleGTFParsing;
private CellBaseConfiguration.SpeciesProperties.Species species;
=======
private Species species;
>>>>>>>
private boolean flexibleGTFParsing;
private Species species; |
<<<<<<<
java.util.Scanner scanner = new java.util.Scanner(execFile, Constants.UTF8.name());
=======
java.util.Scanner scanner = new java.util.Scanner(new File(execFile), UTF_8.name());
>>>>>>>
java.util.Scanner scanner = new java.util.Scanner(execFile, UTF_8.name()); |
<<<<<<<
import io.vertx.core.impl.VertxInternal;
=======
import io.vertx.core.WorkerExecutor;
import io.vertx.core.impl.ContextInternal;
>>>>>>>
import io.vertx.core.WorkerExecutor;
import io.vertx.core.impl.ContextInternal;
<<<<<<<
new JDBCExecute(vertx, conn, context, timeout, sql).execute(resultHandler);
=======
new JDBCExecute(vertx, conn, executor, sql).execute(resultHandler);
>>>>>>>
new JDBCExecute(vertx, conn, executor, timeout, sql).execute(resultHandler);
<<<<<<<
new JDBCQuery(vertx, conn, context, timeout, sql, null).execute(resultHandler);
=======
new JDBCQuery(vertx, conn, executor, sql, null).execute(resultHandler);
>>>>>>>
new JDBCQuery(vertx, conn, executor, timeout, sql, null).execute(resultHandler);
<<<<<<<
new JDBCQuery(vertx, conn, context, timeout, sql, params).execute(resultHandler);
=======
new JDBCQuery(vertx, conn, executor, sql, params).execute(resultHandler);
>>>>>>>
new JDBCQuery(vertx, conn, executor, timeout, sql, params).execute(resultHandler);
<<<<<<<
new JDBCUpdate(vertx, conn, context, timeout, sql, null).execute(resultHandler);
=======
new JDBCUpdate(vertx, conn, executor, sql, null).execute(resultHandler);
>>>>>>>
new JDBCUpdate(vertx, conn, executor, timeout, sql, null).execute(resultHandler);
<<<<<<<
new JDBCUpdate(vertx, conn, context, timeout, sql, params).execute(resultHandler);
=======
new JDBCUpdate(vertx, conn, executor, sql, params).execute(resultHandler);
>>>>>>>
new JDBCUpdate(vertx, conn, executor, timeout, sql, params).execute(resultHandler);
<<<<<<<
new JDBCCallable(vertx, conn, context, timeout, sql, null, null).execute(resultHandler);
=======
new JDBCCallable(vertx, conn, executor, sql, null, null).execute(resultHandler);
>>>>>>>
new JDBCCallable(vertx, conn, executor, timeout, sql, null, null).execute(resultHandler);
<<<<<<<
new JDBCCallable(vertx, conn, context, timeout, sql, params, outputs).execute(resultHandler);
=======
new JDBCCallable(vertx, conn, executor, sql, params, outputs).execute(resultHandler);
>>>>>>>
new JDBCCallable(vertx, conn, executor, timeout, sql, params, outputs).execute(resultHandler); |
<<<<<<<
/*
* Freeplane - mind map editor
* Copyright (C) 2008 Joerg Mueller, Daniel Polansky, Christian Foltin, Dimitry Polivaev
*
* This file is modified by Dimitry Polivaev in 2008.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.freeplane.features.url.mindmapmode;
import java.awt.event.ActionEvent;
import java.io.File;
import java.net.URI;
import java.net.URL;
import javax.swing.JOptionPane;
import org.freeplane.core.ui.AFreeplaneAction;
import org.freeplane.core.util.TextUtils;
import org.freeplane.features.link.LinkController;
import org.freeplane.features.link.NodeLinks;
import org.freeplane.features.link.mindmapmode.MLinkController;
import org.freeplane.features.map.MapModel;
import org.freeplane.features.map.NodeModel;
import org.freeplane.features.map.mindmapmode.MMapController;
import org.freeplane.features.mode.Controller;
import org.freeplane.features.mode.ModeController;
import org.freeplane.features.url.UrlManager;
/**
* This is exactly the opposite of exportBranch.
*/
class ImportLinkedBranchWithoutRootAction extends AFreeplaneAction {
/**
*
*/
private static final long serialVersionUID = 1L;
public ImportLinkedBranchWithoutRootAction() {
super("ImportLinkedBranchWithoutRootAction");
}
public void actionPerformed(final ActionEvent e) {
final MapModel map = Controller.getCurrentController().getMap();
final ModeController modeController = Controller.getCurrentModeController();
final NodeModel selected = modeController.getMapController().getSelectedNode();
if (selected == null || NodeLinks.getLink(selected) == null) {
JOptionPane.showMessageDialog(Controller.getCurrentController().getViewController().getMapView(), TextUtils
.getText("import_linked_branch_no_link"));
return;
}
try {
final URI uri = NodeLinks.getLink(selected);
final URL url = map.getURL();
final File file = uri.isAbsolute() && !uri.isOpaque() ? new File(uri) : new File(new URL(url, uri
.getPath()).getFile());
final NodeModel node = ((MFileManager) UrlManager.getController()).loadTree(map, file);
map.setURL(url);
for (final NodeModel child : Controller.getCurrentModeController().getMapController().childrenUnfolded(node)) {
((MMapController) modeController.getMapController()).insertNode(child, selected);
}
((MLinkController) LinkController.getController()).setLink(selected, (URI) null, LinkController.LINK_ABSOLUTE);
}
catch (final Exception ex) {
UrlManager.getController().handleLoadingException(ex);
}
}
}
=======
/*
* Freeplane - mind map editor
* Copyright (C) 2008 Joerg Mueller, Daniel Polansky, Christian Foltin, Dimitry Polivaev
*
* This file is modified by Dimitry Polivaev in 2008.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.freeplane.features.url.mindmapmode;
import java.awt.event.ActionEvent;
import java.io.File;
import java.net.URI;
import java.net.URL;
import javax.swing.JOptionPane;
import org.freeplane.core.ui.AFreeplaneAction;
import org.freeplane.core.util.TextUtils;
import org.freeplane.features.link.LinkController;
import org.freeplane.features.link.NodeLinks;
import org.freeplane.features.link.mindmapmode.MLinkController;
import org.freeplane.features.map.MapModel;
import org.freeplane.features.map.NodeModel;
import org.freeplane.features.map.mindmapmode.MMapController;
import org.freeplane.features.mode.Controller;
import org.freeplane.features.mode.ModeController;
import org.freeplane.features.url.UrlManager;
/**
* This is exactly the opposite of exportBranch.
*/
class ImportLinkedBranchWithoutRootAction extends AFreeplaneAction {
/**
*
*/
private static final long serialVersionUID = 1L;
public ImportLinkedBranchWithoutRootAction() {
super("ImportLinkedBranchWithoutRootAction");
}
public void actionPerformed(final ActionEvent e) {
final MapModel map = Controller.getCurrentController().getMap();
final ModeController modeController = Controller.getCurrentModeController();
final NodeModel selected = modeController.getMapController().getSelectedNode();
if (selected == null || NodeLinks.getLink(selected) == null) {
JOptionPane.showMessageDialog(Controller.getCurrentController().getMapViewManager().getMapViewComponent(), TextUtils
.getText("import_linked_branch_no_link"));
return;
}
try {
final URI uri = NodeLinks.getLink(selected);
final URL url = map.getURL();
final File file = uri.isAbsolute() && !uri.isOpaque() ? new File(uri) : new File(new URL(url, uri
.getPath()).getFile());
final NodeModel node = ((MFileManager) UrlManager.getController()).loadTree(map, file);
map.setURL(url);
for (final NodeModel child : Controller.getCurrentModeController().getMapController().childrenUnfolded(node)) {
((MMapController) modeController.getMapController()).insertNode(child, selected);
}
((MLinkController) LinkController.getController()).setLink(selected, (URI) null, false);
}
catch (final Exception ex) {
UrlManager.getController().handleLoadingException(ex);
}
}
}
>>>>>>>
/*
* Freeplane - mind map editor
* Copyright (C) 2008 Joerg Mueller, Daniel Polansky, Christian Foltin, Dimitry Polivaev
*
* This file is modified by Dimitry Polivaev in 2008.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.freeplane.features.url.mindmapmode;
import java.awt.event.ActionEvent;
import java.io.File;
import java.net.URI;
import java.net.URL;
import javax.swing.JOptionPane;
import org.freeplane.core.ui.AFreeplaneAction;
import org.freeplane.core.util.TextUtils;
import org.freeplane.features.link.LinkController;
import org.freeplane.features.link.NodeLinks;
import org.freeplane.features.link.mindmapmode.MLinkController;
import org.freeplane.features.map.MapModel;
import org.freeplane.features.map.NodeModel;
import org.freeplane.features.map.mindmapmode.MMapController;
import org.freeplane.features.mode.Controller;
import org.freeplane.features.mode.ModeController;
import org.freeplane.features.url.UrlManager;
/**
* This is exactly the opposite of exportBranch.
*/
class ImportLinkedBranchWithoutRootAction extends AFreeplaneAction {
/**
*
*/
private static final long serialVersionUID = 1L;
public ImportLinkedBranchWithoutRootAction() {
super("ImportLinkedBranchWithoutRootAction");
}
public void actionPerformed(final ActionEvent e) {
final MapModel map = Controller.getCurrentController().getMap();
final ModeController modeController = Controller.getCurrentModeController();
final NodeModel selected = modeController.getMapController().getSelectedNode();
if (selected == null || NodeLinks.getLink(selected) == null) {
JOptionPane.showMessageDialog(Controller.getCurrentController().getMapViewManager().getMapViewComponent(), TextUtils
.getText("import_linked_branch_no_link"));
return;
}
try {
final URI uri = NodeLinks.getLink(selected);
final URL url = map.getURL();
final File file = uri.isAbsolute() && !uri.isOpaque() ? new File(uri) : new File(new URL(url, uri
.getPath()).getFile());
final NodeModel node = ((MFileManager) UrlManager.getController()).loadTree(map, file);
map.setURL(url);
for (final NodeModel child : Controller.getCurrentModeController().getMapController().childrenUnfolded(node)) {
((MMapController) modeController.getMapController()).insertNode(child, selected);
}
((MLinkController) LinkController.getController()).setLink(selected, (URI) null, LinkController.LINK_ABSOLUTE);
}
catch (final Exception ex) {
UrlManager.getController().handleLoadingException(ex);
}
}
} |
<<<<<<<
import javax.swing.JComponent;
import org.freeplane.core.modecontroller.ModeController;
=======
>>>>>>>
import org.freeplane.core.modecontroller.ModeController;
<<<<<<<
boolean checkNode(ModeController modeController, NodeModel node);
public JComponent getListCellRendererComponent();
void toXml(XMLElement element);
=======
boolean checkNode(NodeModel node);
>>>>>>>
boolean checkNode(ModeController modeController, NodeModel node); |
<<<<<<<
import org.freeplane.core.util.TextUtils;
import org.freeplane.features.mode.Controller;
import org.freeplane.features.mode.ModeController;
=======
import org.freeplane.core.util.LogUtils;
>>>>>>>
import org.freeplane.core.util.TextUtils;
import org.freeplane.features.mode.Controller;
import org.freeplane.features.mode.ModeController;
import org.freeplane.core.util.LogUtils; |
<<<<<<<
=======
import org.freeplane.core.modecontroller.ModeController;
import org.freeplane.core.resources.FpStringUtils;
>>>>>>> |
<<<<<<<
import org.freeplane.core.filter.condition.ICondition;
import org.freeplane.core.modecontroller.ModeController;
=======
import org.freeplane.core.filter.condition.ISelectableCondition;
>>>>>>>
import org.freeplane.core.modecontroller.ModeController;
import org.freeplane.core.filter.condition.ISelectableCondition; |
<<<<<<<
=======
import org.freeplane.core.modecontroller.IMapChangeListener;
import org.freeplane.core.modecontroller.MapChangeEvent;
import org.freeplane.core.modecontroller.ModeController;
import org.freeplane.core.model.MapModel;
import org.freeplane.core.model.NodeModel;
import org.freeplane.core.resources.FpStringUtils;
>>>>>>>
<<<<<<<
if (controller.selectMode(mode)) {
String fileName = token.nextToken("").substring(1);
if (PORTABLE_APP && fileName.startsWith(":") && USER_DRIVE.endsWith(":")) {
fileName = USER_DRIVE + fileName.substring(1);
}
controller.getModeController().getMapController().newMap(Compat.fileToUrl(new File(fileName)));
=======
controller.selectMode(mode);
String fileName = token.nextToken("").substring(1);
if (PORTABLE_APP && fileName.startsWith(":") && USER_DRIVE.endsWith(":")) {
fileName = USER_DRIVE + fileName.substring(1);
>>>>>>>
controller.selectMode(mode);
String fileName = token.nextToken("").substring(1);
if (PORTABLE_APP && fileName.startsWith(":") && USER_DRIVE.endsWith(":")) {
fileName = USER_DRIVE + fileName.substring(1);
<<<<<<<
remove(restoreable);
UITools.errorMessage("An error occured on opening the file: " + restoreable + ".");
LogUtils.warn(ex);
=======
final String message = FpStringUtils.format("remove_file_from_list_on_error", restoreable);
final Frame frame = UITools.getFrame();
final Window[] ownedWindows = frame.getOwnedWindows();
for (int i = 0; i < ownedWindows.length; i++) {
final Window window = ownedWindows[i];
if (window.getClass().equals(FreeplaneSplashModern.class) && window.isVisible()) {
window.setVisible(false);
}
}
final int remove = JOptionPane.showConfirmDialog(frame, message, "Freeplane", JOptionPane.YES_NO_OPTION);
if (remove == JOptionPane.YES_OPTION) {
remove(restoreable);
}
LogTool.warn(ex);
>>>>>>>
final String message = TextUtils.format("remove_file_from_list_on_error", restoreable);
final Frame frame = UITools.getFrame();
final Window[] ownedWindows = frame.getOwnedWindows();
for (int i = 0; i < ownedWindows.length; i++) {
final Window window = ownedWindows[i];
if (window.getClass().equals(FreeplaneSplashModern.class) && window.isVisible()) {
window.setVisible(false);
}
}
final int remove = JOptionPane.showConfirmDialog(frame, message, "Freeplane", JOptionPane.YES_NO_OPTION);
if (remove == JOptionPane.YES_OPTION) {
remove(restoreable);
}
LogUtils.warn(ex); |
<<<<<<<
/*
* Freeplane - mind map editor
* Copyright (C) 2008 Joerg Mueller, Daniel Polansky, Christian Foltin, Dimitry Polivaev
*
* This file is modified by Dimitry Polivaev in 2008.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.freeplane.features.url.mindmapmode;
import java.awt.event.ActionEvent;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import javax.swing.JOptionPane;
import org.freeplane.core.ui.AFreeplaneAction;
import org.freeplane.core.ui.components.UITools;
import org.freeplane.core.util.LogUtils;
import org.freeplane.core.util.TextUtils;
import org.freeplane.features.link.LinkController;
import org.freeplane.features.link.NodeLinks;
import org.freeplane.features.link.mindmapmode.MLinkController;
import org.freeplane.features.map.MapModel;
import org.freeplane.features.map.NodeModel;
import org.freeplane.features.map.mindmapmode.MMapController;
import org.freeplane.features.mode.Controller;
import org.freeplane.features.mode.ModeController;
import org.freeplane.features.mode.PersistentNodeHook;
import org.freeplane.features.ui.ViewController;
import org.freeplane.features.url.UrlManager;
class ImportLinkedBranchAction extends AFreeplaneAction {
/**
*
*/
private static final long serialVersionUID = 1L;
public ImportLinkedBranchAction() {
super("ImportLinkedBranchAction");
}
public void actionPerformed(final ActionEvent e) {
final MapModel map = Controller.getCurrentController().getMap();
final ModeController modeController = Controller.getCurrentModeController();
final NodeModel selected = modeController.getMapController().getSelectedNode();
final ViewController viewController = Controller.getCurrentController().getViewController();
if (selected == null || NodeLinks.getLink(selected) == null) {
JOptionPane.showMessageDialog((viewController.getMapView()), TextUtils
.getText("import_linked_branch_no_link"));
return;
}
final URI uri = NodeLinks.getLink(selected);
try {
final File file = uri.isAbsolute() && !uri.isOpaque() ? new File(uri) : new File(new URL(map.getURL(), uri
.getPath()).getFile());
final NodeModel node = ((MFileManager) UrlManager.getController()).loadTree(map, file);
PersistentNodeHook.removeMapExtensions(node);
((MMapController) modeController.getMapController()).insertNode(node, selected);
((MLinkController) LinkController.getController()).setLink(selected, (URI) null, LinkController.LINK_ABSOLUTE);
((MLinkController) LinkController.getController()).setLink(node, (URI) null, LinkController.LINK_ABSOLUTE);
}
catch (final MalformedURLException ex) {
UITools.errorMessage(TextUtils.format("invalid_url_msg", uri.toString()));
LogUtils.warn(ex);
return;
}
catch (final IllegalArgumentException ex) {
UITools.errorMessage(TextUtils.format("invalid_file_msg", uri.toString()));
LogUtils.warn(ex);
return;
}
catch (final Exception ex) {
UrlManager.getController().handleLoadingException(ex);
}
}
}
=======
/*
* Freeplane - mind map editor
* Copyright (C) 2008 Joerg Mueller, Daniel Polansky, Christian Foltin, Dimitry Polivaev
*
* This file is modified by Dimitry Polivaev in 2008.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.freeplane.features.url.mindmapmode;
import java.awt.event.ActionEvent;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import javax.swing.JOptionPane;
import org.freeplane.core.ui.AFreeplaneAction;
import org.freeplane.core.ui.components.UITools;
import org.freeplane.core.util.LogUtils;
import org.freeplane.core.util.TextUtils;
import org.freeplane.features.link.LinkController;
import org.freeplane.features.link.NodeLinks;
import org.freeplane.features.link.mindmapmode.MLinkController;
import org.freeplane.features.map.MapModel;
import org.freeplane.features.map.NodeModel;
import org.freeplane.features.map.mindmapmode.MMapController;
import org.freeplane.features.mode.Controller;
import org.freeplane.features.mode.ModeController;
import org.freeplane.features.mode.PersistentNodeHook;
import org.freeplane.features.ui.IMapViewManager;
import org.freeplane.features.url.UrlManager;
class ImportLinkedBranchAction extends AFreeplaneAction {
/**
*
*/
private static final long serialVersionUID = 1L;
public ImportLinkedBranchAction() {
super("ImportLinkedBranchAction");
}
public void actionPerformed(final ActionEvent e) {
final MapModel map = Controller.getCurrentController().getMap();
final ModeController modeController = Controller.getCurrentModeController();
final NodeModel selected = modeController.getMapController().getSelectedNode();
final IMapViewManager viewController = Controller.getCurrentController().getMapViewManager();
if (selected == null || NodeLinks.getLink(selected) == null) {
JOptionPane.showMessageDialog((viewController.getMapViewComponent()), TextUtils
.getText("import_linked_branch_no_link"));
return;
}
final URI uri = NodeLinks.getLink(selected);
try {
final File file = uri.isAbsolute() && !uri.isOpaque() ? new File(uri) : new File(new URL(map.getURL(), uri
.getPath()).getFile());
final NodeModel node = ((MFileManager) UrlManager.getController()).loadTree(map, file);
PersistentNodeHook.removeMapExtensions(node);
((MMapController) modeController.getMapController()).insertNode(node, selected);
((MLinkController) LinkController.getController()).setLink(selected, (URI) null, false);
((MLinkController) LinkController.getController()).setLink(node, (URI) null, false);
}
catch (final MalformedURLException ex) {
UITools.errorMessage(TextUtils.format("invalid_url_msg", uri.toString()));
LogUtils.warn(ex);
return;
}
catch (final IllegalArgumentException ex) {
UITools.errorMessage(TextUtils.format("invalid_file_msg", uri.toString()));
LogUtils.warn(ex);
return;
}
catch (final Exception ex) {
UrlManager.getController().handleLoadingException(ex);
}
}
}
>>>>>>>
/*
* Freeplane - mind map editor
* Copyright (C) 2008 Joerg Mueller, Daniel Polansky, Christian Foltin, Dimitry Polivaev
*
* This file is modified by Dimitry Polivaev in 2008.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.freeplane.features.url.mindmapmode;
import java.awt.event.ActionEvent;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import javax.swing.JOptionPane;
import org.freeplane.core.ui.AFreeplaneAction;
import org.freeplane.core.ui.components.UITools;
import org.freeplane.core.util.LogUtils;
import org.freeplane.core.util.TextUtils;
import org.freeplane.features.link.LinkController;
import org.freeplane.features.link.NodeLinks;
import org.freeplane.features.link.mindmapmode.MLinkController;
import org.freeplane.features.map.MapModel;
import org.freeplane.features.map.NodeModel;
import org.freeplane.features.map.mindmapmode.MMapController;
import org.freeplane.features.mode.Controller;
import org.freeplane.features.mode.ModeController;
import org.freeplane.features.mode.PersistentNodeHook;
import org.freeplane.features.ui.IMapViewManager;
import org.freeplane.features.ui.ViewController;
import org.freeplane.features.url.UrlManager;
class ImportLinkedBranchAction extends AFreeplaneAction {
/**
*
*/
private static final long serialVersionUID = 1L;
public ImportLinkedBranchAction() {
super("ImportLinkedBranchAction");
}
public void actionPerformed(final ActionEvent e) {
final MapModel map = Controller.getCurrentController().getMap();
final ModeController modeController = Controller.getCurrentModeController();
final NodeModel selected = modeController.getMapController().getSelectedNode();
final IMapViewManager viewController = Controller.getCurrentController().getMapViewManager();
if (selected == null || NodeLinks.getLink(selected) == null) {
JOptionPane.showMessageDialog((viewController.getMapViewComponent()), TextUtils
.getText("import_linked_branch_no_link"));
return;
}
final URI uri = NodeLinks.getLink(selected);
try {
final File file = uri.isAbsolute() && !uri.isOpaque() ? new File(uri) : new File(new URL(map.getURL(), uri
.getPath()).getFile());
final NodeModel node = ((MFileManager) UrlManager.getController()).loadTree(map, file);
PersistentNodeHook.removeMapExtensions(node);
((MMapController) modeController.getMapController()).insertNode(node, selected);
((MLinkController) LinkController.getController()).setLink(selected, (URI) null, LinkController.LINK_ABSOLUTE);
((MLinkController) LinkController.getController()).setLink(node, (URI) null, LinkController.LINK_ABSOLUTE);
}
catch (final MalformedURLException ex) {
UITools.errorMessage(TextUtils.format("invalid_url_msg", uri.toString()));
LogUtils.warn(ex);
return;
}
catch (final IllegalArgumentException ex) {
UITools.errorMessage(TextUtils.format("invalid_file_msg", uri.toString()));
LogUtils.warn(ex);
return;
}
catch (final Exception ex) {
UrlManager.getController().handleLoadingException(ex);
}
}
} |
<<<<<<<
if(textController instanceof MTextController){
((MTextController) textController).stopEditing();
}
=======
modeController.startTransaction();
try{
((MTextController) TextController.getController(modeController)).stopEditing();
}
finally{
modeController.commit();
}
>>>>>>>
if(textController instanceof MTextController){
modeController.startTransaction();
try{
((MTextController) TextController.getController(modeController)).stopEditing();
}
finally{
modeController.commit();
}
} |
<<<<<<<
setSaved(newModel, true);
return true;
=======
// FIXME: removed to be able to set state in MFileManager
// setSaved(newModel, true);
>>>>>>>
// FIXME: removed to be able to set state in MFileManager
// setSaved(newModel, true);
return true; |
<<<<<<<
private class PasswordOptionCreator extends PropertyCreator {
@Override
public IPropertyControlCreator getCreator(final String name, final XMLElement data) {
//TODO: define XML structure
// final int min = Integer.parseInt(data.getAttribute("min", "1"));
// final int step = Integer.parseInt(data.getAttribute("step", "1"));
// final int max = Integer.parseInt(data.getAttribute("max", MAX_INT));
return createPasswordOptionCreator(name);
}
}
private class RadioButtonCreator extends PropertyCreator {
@Override
public IPropertyControlCreator getCreator(final String name, final XMLElement data) {
String enabled = data.getAttribute("enabled", name);
return createRadioButtonOptionCreator(name, enabled);
}
}
private class ActionCreator extends PropertyCreator{
@Override
public IPropertyControlCreator getCreator(final String name, final XMLElement data) {
String actionCommand = data.getAttribute("actionCommand", name);
return createActionOptionCreator(name, actionCommand);
}
}
=======
private class UriLinkCreator extends PropertyCreator {
@Override
public IPropertyControlCreator getCreator(final String name, final XMLElement data) {
URI uri = URI.create(data.getAttribute("uri", null));
String label = data.getAttribute("label", null);
return createUriLinkCreator(name, label, uri);
}
}
>>>>>>>
private class PasswordOptionCreator extends PropertyCreator {
@Override
public IPropertyControlCreator getCreator(final String name, final XMLElement data) {
//TODO: define XML structure
// final int min = Integer.parseInt(data.getAttribute("min", "1"));
// final int step = Integer.parseInt(data.getAttribute("step", "1"));
// final int max = Integer.parseInt(data.getAttribute("max", MAX_INT));
return createPasswordOptionCreator(name);
}
}
private class UriLinkCreator extends PropertyCreator {
@Override
public IPropertyControlCreator getCreator(final String name, final XMLElement data) {
URI uri = URI.create(data.getAttribute("uri", null));
String label = data.getAttribute("label", null);
return createUriLinkCreator(name, label, uri);
}
}
private class RadioButtonCreator extends PropertyCreator {
@Override
public IPropertyControlCreator getCreator(final String name, final XMLElement data) {
String enabled = data.getAttribute("enabled", name);
return createRadioButtonOptionCreator(name, enabled);
}
}
private class ActionCreator extends PropertyCreator{
@Override
public IPropertyControlCreator getCreator(final String name, final XMLElement data) {
String actionCommand = data.getAttribute("actionCommand", name);
return createActionOptionCreator(name, actionCommand);
}
}
<<<<<<<
private IPropertyControlCreator createPathPropertyCreator(final String name, final boolean isDir,
final boolean showHidden, final String[] suffixes) {
=======
private IPropertyControlCreator createPathPropertyCreator(
final String name, final boolean isDir, final String[] suffixes) {
>>>>>>>
private IPropertyControlCreator createPathPropertyCreator(final String name, final boolean isDir,
final boolean showHidden, final String[] suffixes) {
<<<<<<<
public IPropertyControlCreator getCreator(final String name, final XMLElement data) {
final boolean isDir = Boolean.parseBoolean(data.getAttribute("dir", "false"));
final boolean showHidden = Boolean.parseBoolean(data.getAttribute("showhidden", "false"));
final String[] suffixes = parseCSV(data.getAttribute("suffixes", null));
return createPathPropertyCreator(name, isDir, showHidden, suffixes);
=======
public IPropertyControlCreator getCreator(final String name,
final XMLElement data) {
final boolean isDir = Boolean.parseBoolean(data.getAttribute("dir",
"false"));
final String[] suffixes = parseCSV(data
.getAttribute("suffixes", ""));
return createPathPropertyCreator(name, isDir, suffixes);
>>>>>>>
public IPropertyControlCreator getCreator(final String name, final XMLElement data) {
final boolean isDir = Boolean.parseBoolean(data.getAttribute("dir", "false"));
final boolean showHidden = Boolean.parseBoolean(data.getAttribute("showhidden", "false"));
final String[] suffixes = parseCSV(data.getAttribute("suffixes", ""));
return createPathPropertyCreator(name, isDir, showHidden, suffixes);
<<<<<<<
private IPropertyControlCreator createActionOptionCreator(final String name) {
return createActionOptionCreator(name, name);
}
private IPropertyControlCreator createActionOptionCreator(final String name, final String actionCommand) {
return new IPropertyControlCreator() {
public IPropertyControl createControl() {
return new ActionProperty(name, actionCommand);
}
};
}
private IPropertyControlCreator createPasswordOptionCreator(final String name) {
return new IPropertyControlCreator() {
public IPropertyControl createControl() {
return new PasswordProperty(name);
}
};
}
private IPropertyControlCreator createRadioButtonOptionCreator(final String name,final String enabled) {
return new IPropertyControlCreator() {
public IPropertyControl createControl() {
return new RadioButtonProperty(name, enabled);
}
};
}
=======
private IPropertyControlCreator createUriLinkCreator(final String name, final String label, final URI uri) {
return new IPropertyControlCreator() {
public IPropertyControl createControl() {
return new UriLink(name, label, uri);
}
};
}
>>>>>>>
private IPropertyControlCreator createActionOptionCreator(final String name) {
return createActionOptionCreator(name, name);
}
private IPropertyControlCreator createActionOptionCreator(final String name, final String actionCommand) {
return new IPropertyControlCreator() {
public IPropertyControl createControl() {
return new ActionProperty(name, actionCommand);
}
};
}
private IPropertyControlCreator createUriLinkCreator(final String name, final String label, final URI uri) {
return new IPropertyControlCreator() {
public IPropertyControl createControl() {
return new UriLink(name, label, uri);
}
};
}
private IPropertyControlCreator createPasswordOptionCreator(final String name) {
return new IPropertyControlCreator() {
public IPropertyControl createControl() {
return new PasswordProperty(name);
}
};
}
private IPropertyControlCreator createRadioButtonOptionCreator(final String name,final String enabled) {
return new IPropertyControlCreator() {
public IPropertyControl createControl() {
return new RadioButtonProperty(name, enabled);
}
};
}
<<<<<<<
readManager.addElementHandler("action", new ActionCreator());
readManager.addElementHandler("password", new PasswordOptionCreator());
readManager.addElementHandler("radiobutton", new RadioButtonCreator());
=======
readManager.addElementHandler("uri", new UriLinkCreator());
>>>>>>>
readManager.addElementHandler("action", new ActionCreator());
readManager.addElementHandler("password", new PasswordOptionCreator());
readManager.addElementHandler("radiobutton", new RadioButtonCreator());
readManager.addElementHandler("uri", new UriLinkCreator()); |
<<<<<<<
final Enumeration<XMLAttribute> enumeration = attributes.elements();
=======
if (fullName == null) {
throw new IllegalArgumentException("fullName must not be null");
}
final Enumeration enumeration = attributes.elements();
>>>>>>>
if (fullName == null) {
throw new IllegalArgumentException("fullName must not be null");
}
final Enumeration<XMLAttribute> enumeration = attributes.elements();
<<<<<<<
final Enumeration<XMLAttribute> enumeration = attributes.elements();
=======
if (name == null) {
throw new IllegalArgumentException("name must not be null");
}
final Enumeration enumeration = attributes.elements();
>>>>>>>
if (name == null) {
throw new IllegalArgumentException("name must not be null");
}
final Enumeration<XMLAttribute> enumeration = attributes.elements(); |
<<<<<<<
latexExtension.setEquation(element.getAttribute("EQUATION", null));
Controller.getCurrentModeController().getMapController().nodeChanged(node);
=======
String equation = element.getAttribute("EQUATION");
if(equation == null){
// error: do not create anything
return null;
}
latexExtension.setEquation(equation);
getModeController().getMapController().nodeChanged(node);
>>>>>>>
String equation = element.getAttribute("EQUATION");
if(equation == null){
// error: do not create anything
return null;
}
latexExtension.setEquation(equation);
Controller.getCurrentModeController().getMapController().nodeChanged(node); |
<<<<<<<
import org.freeplane.core.util.HtmlUtils;
import org.freeplane.core.util.TextUtils;
=======
import org.freeplane.core.url.UrlManager;
import org.freeplane.core.util.HtmlTools;
>>>>>>>
import org.freeplane.core.util.HtmlUtils;
import org.freeplane.core.util.TextUtils;
<<<<<<<
import org.freeplane.features.common.map.MapModel;
import org.freeplane.features.common.map.ModeController;
import org.freeplane.features.common.map.NodeModel;
import org.freeplane.features.common.url.UrlManager;
=======
>>>>>>>
import org.freeplane.features.common.map.MapModel;
import org.freeplane.features.common.map.ModeController;
import org.freeplane.features.common.map.NodeModel;
import org.freeplane.features.common.url.UrlManager;
<<<<<<<
final IViewerFactory factory = getViewerFactory(absoluteUri);
if (factory == null) {
=======
if (absoluteUri == null) {
return new JLabel(uri.toString());
}
final IViewerFactory factory = getViewerFactory(absoluteUri);
if (factory == null) {
>>>>>>>
if (absoluteUri == null) {
return new JLabel(uri.toString());
}
final IViewerFactory factory = getViewerFactory(absoluteUri);
if (factory == null) {
<<<<<<<
try {
viewer = factory.createViewer(model, absoluteUri);
}
catch (final Exception e) {
final String info = HtmlUtils.combineTextWithExceptionInfo(uri.toString(), e);
=======
try {
viewer = factory.createViewer(model, absoluteUri);
}
catch (final Exception e) {
final String info = HtmlTools.combineTextWithExceptionInfo(uri.toString(), e);
>>>>>>>
try {
viewer = factory.createViewer(model, absoluteUri);
}
catch (final Exception e) {
final String info = HtmlUtils.combineTextWithExceptionInfo(uri.toString(), e); |
<<<<<<<
import java.net.URL;
import java.util.Collections;
import java.util.HashSet;
=======
>>>>>>>
import java.net.URL; |
<<<<<<<
import org.freeplane.plugin.script.ScriptEditorProperty.IScriptEditorStarter;
=======
import org.freeplane.plugin.script.ScriptingConfiguration.ScriptMetaData;
>>>>>>>
import org.freeplane.plugin.script.ScriptEditorProperty.IScriptEditorStarter;
import org.freeplane.plugin.script.ScriptingConfiguration.ScriptMetaData;
<<<<<<<
class ScriptingRegistration {
/** create scripts submenu if there are more scripts than this number. */
private static final int MINIMAL_SCRIPT_COUNT_FOR_SUBMENU = 1;
private static final String MENU_BAR_SCRIPTING_PARENT_LOCATION = "/menu_bar/extras/first";
private static final String MENU_BAR_SCRIPTING_LOCATION = MENU_BAR_SCRIPTING_PARENT_LOCATION + "/scripting";
=======
class ScriptingRegistration implements IExternalPatternAction {
static final String MENU_BAR_SCRIPTING_LOCATION = "/menu_bar/extras/first/scripting";
>>>>>>>
class ScriptingRegistration {
/** create scripts submenu if there are more scripts than this number. */
private static final int MINIMAL_SCRIPT_COUNT_FOR_SUBMENU = 1;
private static final String MENU_BAR_SCRIPTING_PARENT_LOCATION = "/menu_bar/extras/first";
static final String MENU_BAR_SCRIPTING_LOCATION = MENU_BAR_SCRIPTING_PARENT_LOCATION + "/scripting";
<<<<<<<
=======
public void act(final NodeModel node, final Pattern pattern) {
if (pattern.getPatternScript() == null){
return;
}
final String script = pattern.getPatternScript().getValue();
if( script == null) {
return;
}
ScriptingEngine.executeScript(node, script, modeController, new IErrorHandler() {
public void gotoLine(final int pLineNumber) {
}
}, System.out, getScriptCookies());
}
>>>>>>> |
<<<<<<<
=======
import org.freeplane.core.modecontroller.MapChangeEvent;
import org.freeplane.core.modecontroller.MapController;
import org.freeplane.core.modecontroller.ModeController;
import org.freeplane.core.modecontroller.NodeChangeEvent;
import org.freeplane.core.model.INodeView;
import org.freeplane.core.model.NodeModel;
import org.freeplane.core.model.NodeModel.NodeChangeType;
>>>>>>> |
<<<<<<<
uri = LinkController.toLinkTypeDependantURI(map.getFile(), input);
final ExternalResource preview = new ExternalResource();
preview.setUri(uri);
=======
if (useRelativeUri) {
uri = LinkController.toRelativeURI(map.getFile(), input);
}
final ExternalResource preview = new ExternalResource(uri);
>>>>>>>
uri = LinkController.toLinkTypeDependantURI(map.getFile(), input);
final ExternalResource preview = new ExternalResource(uri);
<<<<<<<
final ExternalResource preview = new ExternalResource();
preview.setUri(uri);
=======
final ExternalResource preview = new ExternalResource(uri);
>>>>>>>
final ExternalResource preview = new ExternalResource(uri); |
<<<<<<<
import org.freeplane.features.common.addins.styles.MapStyle;
import org.freeplane.features.common.addins.styles.MapStyleModel;
import org.freeplane.features.common.addins.styles.MapViewLayout;
=======
import org.freeplane.core.resources.ResourceController;
import org.freeplane.features.common.addins.mapstyle.MapStyle;
import org.freeplane.features.common.addins.mapstyle.MapStyleModel;
import org.freeplane.features.common.addins.mapstyle.MapViewLayout;
>>>>>>>
import org.freeplane.features.common.addins.styles.MapStyle;
import org.freeplane.features.common.addins.styles.MapViewLayout; |
<<<<<<<
DocearController.getController().getDocearEventLogger().appendToLog(this, DocearLogEvent.MAP_CLOSED, f);
=======
DocearController.getController().getDocearEventLogger().write(this, DocearLogEvent.MAP_CLOSED, f);
touchFileForAutoSaveBug(f);
>>>>>>>
DocearController.getController().getDocearEventLogger().appendToLog(this, DocearLogEvent.MAP_CLOSED, f);
touchFileForAutoSaveBug(f); |
<<<<<<<
import org.freeplane.features.common.addins.misc.NextNodeAction;
import org.freeplane.features.common.addins.misc.NextNodeAction.Direction;
import org.freeplane.features.common.addins.styles.MapStyle;
=======
import org.freeplane.features.common.addins.mapstyle.MapStyle;
>>>>>>>
import org.freeplane.features.common.addins.styles.MapStyle;
<<<<<<<
FreeplaneToolBar toolBar = new FreeplaneToolBar("main_toolbar", SwingConstants.HORIZONTAL);
toolBar.putClientProperty(ViewController.VISIBLE_PROPERTY_KEY, "toolbarVisible");
userInputListenerFactory.addToolBar("/main_toolbar",ViewController.TOP, toolBar);
userInputListenerFactory.addToolBar("/filter_toolbar", ViewController.TOP, FilterController.getController(controller).getFilterToolbar());
userInputListenerFactory.addToolBar("/status",ViewController.BOTTOM, controller.getViewController().getStatusBar());
=======
userInputListenerFactory.addMainToolBar("/main_toolbar", new FreeplaneToolBar());
userInputListenerFactory.addMainToolBar("/filter_toolbar", FilterController.getController(controller)
.getFilterToolbar());
>>>>>>>
FreeplaneToolBar toolBar = new FreeplaneToolBar("main_toolbar", SwingConstants.HORIZONTAL);
toolBar.putClientProperty(ViewController.VISIBLE_PROPERTY_KEY, "toolbarVisible");
userInputListenerFactory.addToolBar("/main_toolbar",ViewController.TOP, toolBar);
userInputListenerFactory.addToolBar("/filter_toolbar", ViewController.TOP, FilterController.getController(controller).getFilterToolbar());
userInputListenerFactory.addToolBar("/status",ViewController.BOTTOM, controller.getViewController().getStatusBar()); |
<<<<<<<
public void destroy() {
Controller.getCurrentController().shutdown();
=======
synchronized public void destroy() {
controller.shutdown();
>>>>>>>
synchronized public void destroy() {
Controller.getCurrentController().shutdown();
<<<<<<<
appletViewController.init(controller);
=======
appletResourceController.setPropertyByParameter(this, "browsemode_initial_map");
appletViewController.init();
>>>>>>>
appletResourceController.setPropertyByParameter(this, "browsemode_initial_map");
appletViewController.init(controller); |
<<<<<<<
=======
import org.freeplane.core.modecontroller.MapController;
import org.freeplane.core.modecontroller.ModeController;
import org.freeplane.core.model.NodeModel;
import org.freeplane.core.ui.IMouseListener;
>>>>>>>
import org.freeplane.core.ui.IMouseListener;
<<<<<<<
public class MNodeMotionListener extends DefaultNodeMotionListener {
=======
public class MNodeMotionListener extends MouseAdapter implements IMouseListener {
final private ModeController c;
>>>>>>>
public class MNodeMotionListener extends MouseAdapter implements IMouseListener { |
<<<<<<<
import org.freeplane.features.common.addins.styles.MapViewLayout;
=======
import org.freeplane.features.common.addins.mapstyle.MapViewLayout;
import org.freeplane.features.common.addins.misc.HierarchicalIcons;
>>>>>>>
import org.freeplane.features.common.addins.styles.MapViewLayout;
import org.freeplane.features.common.addins.misc.HierarchicalIcons; |
<<<<<<<
package org.docear.plugin.bibtex.actions;
import java.awt.event.ActionEvent;
import java.net.URI;
import java.util.Collection;
import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.JTabbedPane;
import net.sf.jabref.BasePanel;
import net.sf.jabref.BibtexEntry;
import net.sf.jabref.BibtexEntryType;
import net.sf.jabref.EntryTypeDialog;
import net.sf.jabref.export.DocearSaveDatabaseAction;
import org.docear.plugin.bibtex.ReferencesController;
import org.docear.plugin.bibtex.jabref.JabRefCommons;
import org.docear.plugin.bibtex.jabref.JabrefWrapper;
import org.freeplane.core.ui.AFreeplaneAction;
import org.freeplane.core.ui.components.UITools;
import org.freeplane.core.util.LogUtils;
import org.freeplane.core.util.TextUtils;
import org.freeplane.features.link.NodeLinks;
import org.freeplane.features.map.MapModel;
import org.freeplane.features.map.NodeModel;
import org.freeplane.features.mode.Controller;
import org.freeplane.plugin.workspace.WorkspaceUtils;
public class AddNewReferenceAction extends AFreeplaneAction {
/**
*
*/
private static final long serialVersionUID = 1L;
public AddNewReferenceAction(String key) {
super(key);
}
public void actionPerformed(ActionEvent e) {
Collection<NodeModel> nodes = Controller.getCurrentModeController().getMapController().getSelectedNodes();
if (e.getActionCommand().equals(DocearSaveDatabaseAction.JABREF_DATABASE_SAVE_SUCCESS)) {
addCreatedReference(e);
return;
}
else if (e.getActionCommand().equals(DocearSaveDatabaseAction.JABREF_DATABASE_SAVE_FAILED)) {
return;
}
else {
createNewReference(nodes);
}
}
private void createNewReference(Collection<NodeModel> nodes) {
BibtexEntry entry = null;
URI link = null;
String name = null;
for (NodeModel node : nodes) {
try {
URI tempLink = NodeLinks.getLink(node);
String tempName = WorkspaceUtils.resolveURI(tempLink, node.getMap()).getName();
if (link == null) {
link = tempLink;
name = tempName;
}
if (!tempName.equals(name)) {
JOptionPane.showMessageDialog(UITools.getFrame(), TextUtils.getText("docear.add_new_reference.error.conflicting_pdf_files"), TextUtils.getText("docear.add_new_reference.error.title"),
JOptionPane.WARNING_MESSAGE);
return;
}
}
catch (NullPointerException ex) {
}
}
JabrefWrapper jabrefWrapper = ReferencesController.getController().getJabrefWrapper();
MapModel map = Controller.getCurrentController().getMap();
if (link != null && link.getPath().toLowerCase().endsWith(".pdf")) {
String path = WorkspaceUtils.resolveURI(link, map).getAbsolutePath();
JabRefCommons.addNewRefenceEntry(new String[] { path }, jabrefWrapper.getJabrefFrame(), jabrefWrapper.getJabrefFrame().basePanel());
// PdfImporter pdfImporter = new PdfImporter(jabrefWrapper.getJabrefFrame(), jabrefWrapper.getJabrefFrame().basePanel(), null, 0);
// pdfImporter.importPdfFiles(new String[] { path }, Controller.getCurrentController().getViewController().getFrame(), true);
// entry = pdfImporter.getNewEntry();
}
else {
BasePanel basePanel = jabrefWrapper.getBasePanel();
EntryTypeDialog dialog = new EntryTypeDialog(jabrefWrapper.getJabrefFrame());
dialog.setVisible(true);
BibtexEntryType bet = dialog.getChoice();
if (bet == null) {
return;
}
String thisType = bet.getName();
entry = basePanel.newEntry(BibtexEntryType.getType(thisType));
}
showJabRefTab();
if (entry != null) {
String nodeIds = "";
for (NodeModel node : nodes) {
nodeIds += node.getID()+",";
}
entry.setField("docear_add_to_node", nodeIds);
ReferencesController.getController().setInAdd(map);
}
}
private void addCreatedReference(ActionEvent e) {
BibtexEntry entry;
try {
entry = (BibtexEntry) e.getSource();
String s = entry.getField("docear_add_to_node");
if (s != null) {
String[] nodeIDs = s.split(",");
for (String nodeID : nodeIDs) {
NodeModel node = Controller.getCurrentModeController().getMapController().getNodeFromID(nodeID);
ReferencesController.getController().getJabRefAttributes().setReferenceToNode(entry, node);
}
}
}
catch (Exception ex) {
ex.printStackTrace();
}
return;
}
private void showJabRefTab() {
final JComponent toolBar = Controller.getCurrentModeController().getUserInputListenerFactory().getToolBar("/format");
toolBar.setVisible(true);
((JComponent) toolBar.getParent()).revalidate();
final String propertyName = Controller.getCurrentController().getViewController().completeVisiblePropertyKey(toolBar);
try {
Controller.getCurrentController().getResourceController().setProperty(propertyName, true);
}
catch(Exception e) {
LogUtils.warn(this.getClass().getName()+".showJabRefTab: "+e.getMessage());
}
JTabbedPane tabbedPane = (JTabbedPane) toolBar.getComponent(1);
tabbedPane.setSelectedComponent(ReferencesController.getController().getJabrefWrapper().getJabrefFrame());
}
}
=======
package org.docear.plugin.bibtex.actions;
import java.awt.event.ActionEvent;
import java.net.URI;
import java.util.Collection;
import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.JTabbedPane;
import net.sf.jabref.BasePanel;
import net.sf.jabref.BibtexEntry;
import net.sf.jabref.BibtexEntryType;
import net.sf.jabref.EntryTypeDialog;
import net.sf.jabref.export.DocearSaveDatabaseAction;
import org.docear.plugin.bibtex.ReferencesController;
import org.docear.plugin.bibtex.jabref.JabRefCommons;
import org.docear.plugin.bibtex.jabref.JabrefWrapper;
import org.freeplane.core.ui.AFreeplaneAction;
import org.freeplane.core.ui.components.UITools;
import org.freeplane.core.util.TextUtils;
import org.freeplane.features.link.NodeLinks;
import org.freeplane.features.map.MapModel;
import org.freeplane.features.map.NodeModel;
import org.freeplane.features.mode.Controller;
import org.freeplane.features.url.UrlManager;
public class AddNewReferenceAction extends AFreeplaneAction {
/**
*
*/
private static final long serialVersionUID = 1L;
public AddNewReferenceAction(String key) {
super(key);
}
public void actionPerformed(ActionEvent e) {
Collection<NodeModel> nodes = Controller.getCurrentModeController().getMapController().getSelectedNodes();
if (e.getActionCommand().equals(DocearSaveDatabaseAction.JABREF_DATABASE_SAVE_SUCCESS)) {
addCreatedReference(e);
return;
}
else if (e.getActionCommand().equals(DocearSaveDatabaseAction.JABREF_DATABASE_SAVE_FAILED)) {
return;
}
else {
createNewReference(nodes);
}
}
private void createNewReference(Collection<NodeModel> nodes) {
BibtexEntry entry = null;
URI link = null;
String name = null;
for (NodeModel node : nodes) {
try {
URI tempLink = NodeLinks.getLink(node);
String tempName = UrlManager.getController().getAbsoluteFile(node.getMap(), tempLink).getName();
if (link == null) {
link = tempLink;
name = tempName;
}
if (!tempName.equals(name)) {
JOptionPane.showMessageDialog(UITools.getFrame(), TextUtils.getText("docear.add_new_reference.error.conflicting_pdf_files"), TextUtils.getText("docear.add_new_reference.error.title"),
JOptionPane.WARNING_MESSAGE);
return;
}
}
catch (NullPointerException ex) {
}
}
JabrefWrapper jabrefWrapper = ReferencesController.getController().getJabrefWrapper();
MapModel map = Controller.getCurrentController().getMap();
if (link != null && link.getPath().toLowerCase().endsWith(".pdf")) {
String path = UrlManager.getController().getAbsoluteFile(map, link).getAbsolutePath();
JabRefCommons.addNewRefenceEntry(new String[] { path }, jabrefWrapper.getJabrefFrame(), jabrefWrapper.getJabrefFrame().basePanel());
// PdfImporter pdfImporter = new PdfImporter(jabrefWrapper.getJabrefFrame(), jabrefWrapper.getJabrefFrame().basePanel(), null, 0);
// pdfImporter.importPdfFiles(new String[] { path }, Controller.getCurrentController().getViewController().getFrame(), true);
// entry = pdfImporter.getNewEntry();
}
else {
BasePanel basePanel = jabrefWrapper.getBasePanel();
EntryTypeDialog dialog = new EntryTypeDialog(jabrefWrapper.getJabrefFrame());
dialog.setVisible(true);
BibtexEntryType bet = dialog.getChoice();
if (bet == null) {
return;
}
String thisType = bet.getName();
entry = basePanel.newEntry(BibtexEntryType.getType(thisType));
}
showJabRefTab();
if (entry != null) {
String nodeIds = "";
for (NodeModel node : nodes) {
nodeIds += node.getID()+",";
}
entry.setField("docear_add_to_node", nodeIds);
ReferencesController.getController().setInAdd(map);
}
}
private void addCreatedReference(ActionEvent e) {
BibtexEntry entry;
try {
entry = (BibtexEntry) e.getSource();
String s = entry.getField("docear_add_to_node");
if (s != null) {
String[] nodeIDs = s.split(",");
for (String nodeID : nodeIDs) {
NodeModel node = Controller.getCurrentModeController().getMapController().getNodeFromID(nodeID);
ReferencesController.getController().getJabRefAttributes().setReferenceToNode(entry, node);
}
}
}
catch (Exception ex) {
ex.printStackTrace();
}
return;
}
private void showJabRefTab() {
final JComponent toolBar = Controller.getCurrentModeController().getUserInputListenerFactory().getToolBar("/format");
toolBar.setVisible(true);
((JComponent) toolBar.getParent()).revalidate();
final String propertyName = Controller.getCurrentController().getViewController().completeVisiblePropertyKey(toolBar);
Controller.getCurrentController().getResourceController().setProperty(propertyName, true);
JTabbedPane tabbedPane = (JTabbedPane) toolBar.getComponent(1);
tabbedPane.setSelectedComponent(ReferencesController.getController().getJabrefWrapper().getJabrefFrame());
}
}
>>>>>>>
package org.docear.plugin.bibtex.actions;
import java.awt.event.ActionEvent;
import java.net.URI;
import java.util.Collection;
import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.JTabbedPane;
import net.sf.jabref.BasePanel;
import net.sf.jabref.BibtexEntry;
import net.sf.jabref.BibtexEntryType;
import net.sf.jabref.EntryTypeDialog;
import net.sf.jabref.export.DocearSaveDatabaseAction;
import org.docear.plugin.bibtex.ReferencesController;
import org.docear.plugin.bibtex.jabref.JabRefCommons;
import org.docear.plugin.bibtex.jabref.JabrefWrapper;
import org.freeplane.core.ui.AFreeplaneAction;
import org.freeplane.core.ui.components.UITools;
import org.freeplane.core.util.LogUtils;
import org.freeplane.core.util.TextUtils;
import org.freeplane.features.link.NodeLinks;
import org.freeplane.features.map.MapModel;
import org.freeplane.features.map.NodeModel;
import org.freeplane.features.mode.Controller;
import org.freeplane.features.url.UrlManager;
public class AddNewReferenceAction extends AFreeplaneAction {
/**
*
*/
private static final long serialVersionUID = 1L;
public AddNewReferenceAction(String key) {
super(key);
}
public void actionPerformed(ActionEvent e) {
Collection<NodeModel> nodes = Controller.getCurrentModeController().getMapController().getSelectedNodes();
if (e.getActionCommand().equals(DocearSaveDatabaseAction.JABREF_DATABASE_SAVE_SUCCESS)) {
addCreatedReference(e);
return;
}
else if (e.getActionCommand().equals(DocearSaveDatabaseAction.JABREF_DATABASE_SAVE_FAILED)) {
return;
}
else {
createNewReference(nodes);
}
}
private void createNewReference(Collection<NodeModel> nodes) {
BibtexEntry entry = null;
URI link = null;
String name = null;
for (NodeModel node : nodes) {
try {
URI tempLink = NodeLinks.getLink(node);
String tempName = UrlManager.getController().getAbsoluteFile(node.getMap(), tempLink).getName();
if (link == null) {
link = tempLink;
name = tempName;
}
if (!tempName.equals(name)) {
JOptionPane.showMessageDialog(UITools.getFrame(), TextUtils.getText("docear.add_new_reference.error.conflicting_pdf_files"), TextUtils.getText("docear.add_new_reference.error.title"),
JOptionPane.WARNING_MESSAGE);
return;
}
}
catch (NullPointerException ex) {
}
}
JabrefWrapper jabrefWrapper = ReferencesController.getController().getJabrefWrapper();
MapModel map = Controller.getCurrentController().getMap();
if (link != null && link.getPath().toLowerCase().endsWith(".pdf")) {
String path = UrlManager.getController().getAbsoluteFile(map, link).getAbsolutePath();
JabRefCommons.addNewRefenceEntry(new String[] { path }, jabrefWrapper.getJabrefFrame(), jabrefWrapper.getJabrefFrame().basePanel());
// PdfImporter pdfImporter = new PdfImporter(jabrefWrapper.getJabrefFrame(), jabrefWrapper.getJabrefFrame().basePanel(), null, 0);
// pdfImporter.importPdfFiles(new String[] { path }, Controller.getCurrentController().getViewController().getFrame(), true);
// entry = pdfImporter.getNewEntry();
}
else {
BasePanel basePanel = jabrefWrapper.getBasePanel();
EntryTypeDialog dialog = new EntryTypeDialog(jabrefWrapper.getJabrefFrame());
dialog.setVisible(true);
BibtexEntryType bet = dialog.getChoice();
if (bet == null) {
return;
}
String thisType = bet.getName();
entry = basePanel.newEntry(BibtexEntryType.getType(thisType));
}
showJabRefTab();
if (entry != null) {
String nodeIds = "";
for (NodeModel node : nodes) {
nodeIds += node.getID()+",";
}
entry.setField("docear_add_to_node", nodeIds);
ReferencesController.getController().setInAdd(map);
}
}
private void addCreatedReference(ActionEvent e) {
BibtexEntry entry;
try {
entry = (BibtexEntry) e.getSource();
String s = entry.getField("docear_add_to_node");
if (s != null) {
String[] nodeIDs = s.split(",");
for (String nodeID : nodeIDs) {
NodeModel node = Controller.getCurrentModeController().getMapController().getNodeFromID(nodeID);
ReferencesController.getController().getJabRefAttributes().setReferenceToNode(entry, node);
}
}
}
catch (Exception ex) {
ex.printStackTrace();
}
return;
}
private void showJabRefTab() {
final JComponent toolBar = Controller.getCurrentModeController().getUserInputListenerFactory().getToolBar("/format");
toolBar.setVisible(true);
((JComponent) toolBar.getParent()).revalidate();
final String propertyName = Controller.getCurrentController().getViewController().completeVisiblePropertyKey(toolBar);
try {
Controller.getCurrentController().getResourceController().setProperty(propertyName, true);
}
catch(Exception e) {
LogUtils.warn(this.getClass().getName()+".showJabRefTab: "+e.getMessage());
}
JTabbedPane tabbedPane = (JTabbedPane) toolBar.getComponent(1);
tabbedPane.setSelectedComponent(ReferencesController.getController().getJabrefWrapper().getJabrefFrame());
}
} |
<<<<<<<
initJSyntaxPane(context);
=======
>>>>>>> |
<<<<<<<
import org.freeplane.core.util.TextUtils;
import org.freeplane.features.common.map.ModeController;
import org.freeplane.features.common.map.NodeModel;
=======
import org.freeplane.core.modecontroller.ModeController;
import org.freeplane.core.model.NodeModel;
import org.freeplane.core.resources.ResourceBundles;
import org.freeplane.features.common.clipboard.ClipboardController;
>>>>>>>
import org.freeplane.core.util.TextUtils;
import org.freeplane.features.common.clipboard.ClipboardController;
import org.freeplane.features.common.map.ModeController;
import org.freeplane.features.common.map.NodeModel; |
<<<<<<<
=======
import javax.swing.event.ChangeEvent;
>>>>>>>
import javax.swing.event.ChangeEvent;
<<<<<<<
import org.freeplane.features.common.map.NodeModel;
import org.freeplane.features.mindmapmode.MModeController;
=======
>>>>>>>
import org.freeplane.features.common.map.NodeModel;
import org.freeplane.features.mindmapmode.MModeController; |
<<<<<<<
// // final private Controller controller;
private JScrollPane noteScrollPane;
private JLabel noteViewer;
=======
final private Controller controller;
private JScrollPane noteScrollPane;
private JEditorPane noteViewer;
>>>>>>>
private JScrollPane noteScrollPane;
private JEditorPane noteViewer; |
<<<<<<<
import org.freeplane.view.swing.map.NodeView;
=======
import org.freeplane.features.styles.mindmapmode.SetBooleanMapPropertyAction;
>>>>>>>
import org.freeplane.view.swing.map.NodeView;
import org.freeplane.features.styles.mindmapmode.SetBooleanMapPropertyAction;
<<<<<<<
if (NodeView.isModifyModelWithoutRepaint()) {
return;
}
setStateIcon(model);
=======
>>>>>>>
if (NodeView.isModifyModelWithoutRepaint()) {
return;
} |
<<<<<<<
import org.freeplane.core.filter.condition.ICondition;
import org.freeplane.core.modecontroller.ModeController;
=======
import org.freeplane.core.filter.condition.ISelectableCondition;
>>>>>>>
import org.freeplane.core.modecontroller.ModeController;
import org.freeplane.core.filter.condition.ISelectableCondition; |
<<<<<<<
final NodeModel target = modeController.getMapController().getSelectedNode();
final TextController textController = TextController.getController(modeController);
if(textController instanceof MTextController){
((MTextController) textController).stopEditing();
}
=======
final MMapController mapController = (MMapController) modeController.getMapController();
final NodeModel target = mapController.getSelectedNode();
((MTextController) TextController.getController(modeController)).stopEditing();
>>>>>>>
final TextController textController = TextController.getController(modeController);
if(textController instanceof MTextController){
((MTextController) textController).stopEditing();
}
final MMapController mapController = (MMapController) modeController.getMapController();
final NodeModel target = mapController.getSelectedNode();
if(textController instanceof MTextController){
((MTextController) textController).stopEditing();
} |
<<<<<<<
private void createUser(String name, String password, Integer type, String email, Integer birthYear, Boolean newsLetter, Boolean isMale)
throws DocearServiceException, URISyntaxException {
final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
queryParams.add("userName", name);
queryParams.add("password", password);
queryParams.add("retypedPassword", password);
queryParams.add("userType", "" + type);
queryParams.add("eMail", email);
queryParams.add("firstName", null);
queryParams.add("middleName", null);
queryParams.add("lastName", null);
queryParams.add("birthYear", birthYear == null ? null : birthYear.toString());
queryParams.add("generalNewsLetter", newsLetter == null ? null : newsLetter.toString());
queryParams.add("isMale", isMale == null ? null : isMale.toString());
WebResource res = CommunicationsController.getController().getServiceResource().path("/user/" + name);
ClientResponse response = CommunicationsController.getController().post(res, queryParams);
try {
if (response.getClientResponseStatus() != Status.OK) {
throw new DocearServiceException(CommunicationsController.getErrorMessageString(response));
=======
private void createUser(final String name, final String password, final Integer type, final String email, final Integer birthYear, final Boolean newsLetter, final Boolean isMale)
throws DocearServiceException {
final TaskState state= new TaskState();
Future<TaskState> future = Executors.newSingleThreadExecutor().submit(new Runnable() {
public void run() {
final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
queryParams.add("userName", name);
queryParams.add("password", password);
queryParams.add("retypedPassword", password);
queryParams.add("userType", "" + type);
queryParams.add("eMail", email);
queryParams.add("firstName", null);
queryParams.add("middleName", null);
queryParams.add("lastName", null);
queryParams.add("birthYear", birthYear == null ? null : birthYear.toString());
queryParams.add("generalNewsLetter", newsLetter == null ? null : newsLetter.toString());
queryParams.add("isMale", isMale == null ? null : isMale.toString());
WebResource res = CommunicationsController.getController().getServiceResource().path("/user/" + name);
ClientResponse response = CommunicationsController.getController().post(res, queryParams);
try {
if (response.getClientResponseStatus() != Status.OK) {
throw new DocearServiceException(response.getEntity(String.class));
}
}
finally {
response.close();
}
>>>>>>>
private void createUser(final String name, final String password, final Integer type, final String email, final Integer birthYear, final Boolean newsLetter, final Boolean isMale)
throws DocearServiceException {
final TaskState state= new TaskState();
Future<TaskState> future = Executors.newSingleThreadExecutor().submit(new Runnable() {
public void run() {
final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
queryParams.add("userName", name);
queryParams.add("password", password);
queryParams.add("retypedPassword", password);
queryParams.add("userType", "" + type);
queryParams.add("eMail", email);
queryParams.add("firstName", null);
queryParams.add("middleName", null);
queryParams.add("lastName", null);
queryParams.add("birthYear", birthYear == null ? null : birthYear.toString());
queryParams.add("generalNewsLetter", newsLetter == null ? null : newsLetter.toString());
queryParams.add("isMale", isMale == null ? null : isMale.toString());
WebResource res = CommunicationsController.getController().getServiceResource().path("/user/" + name);
ClientResponse response = CommunicationsController.getController().post(res, queryParams);
try {
if (response.getClientResponseStatus() != Status.OK) {
throw new DocearServiceException(CommunicationsController.getErrorMessageString(response));
}
}
finally {
response.close();
} |
<<<<<<<
import org.freeplane.core.util.HtmlUtils;
import org.freeplane.core.util.TextUtils;
import org.freeplane.features.common.filter.FilterConditionEditor;
import org.freeplane.features.common.filter.FilterController;
import org.freeplane.features.common.filter.condition.ISelectableCondition;
import org.freeplane.features.common.map.NodeModel;
=======
import org.freeplane.core.util.HtmlTools;
import org.freeplane.features.common.text.TextController.Direction;
>>>>>>>
import org.freeplane.core.util.HtmlUtils;
import org.freeplane.core.util.TextUtils;
import org.freeplane.features.common.filter.FilterConditionEditor;
import org.freeplane.features.common.filter.FilterController;
import org.freeplane.features.common.filter.condition.ISelectableCondition;
import org.freeplane.features.common.map.NodeModel;
import org.freeplane.features.common.text.TextController.Direction;
<<<<<<<
final int run = UITools.showConfirmDialog(getController(), selected, editor, TextUtils
=======
final int run = UITools.showConfirmDialog(getController(), start, editor, ResourceBundles
>>>>>>>
final int run = UITools.showConfirmDialog(getController(), start, editor, TextUtils
<<<<<<<
final boolean found = find(getModeController().getMapController().getSelectedNode());
searchTerm = condition.toString();
if (!found) {
final String messageText = TextUtils.getText("no_found_from");
UITools.informationMessage(getController().getViewController().getFrame(), messageText.replaceAll("\\$1",
Matcher.quoteReplacement(searchTerm)).replaceAll("\\$2", Matcher.quoteReplacement(getFindFromText())));
searchTerm = null;
}
=======
findNext();
>>>>>>>
findNext();
<<<<<<<
while (!nodes.isEmpty()) {
final NodeModel node = (NodeModel) nodes.removeFirst();
for (final ListIterator i = getModeController().getMapController().childrenUnfolded(node); i.hasNext();) {
nodes.addLast(i.next());
}
if (!node.isVisible()) {
continue;
}
findNodeQueue = nodes;
final boolean found = condition.checkNode(getModeController(), node);
if (found) {
displayNode(node, findNodesUnfoldedByLastFind);
getModeController().getMapController().select(node);
return true;
}
=======
NodeModel next = textController.findNext(start, Direction.FORWARD, null);
if (next == null) {
displayNotFoundMessage(start);
return;
>>>>>>>
NodeModel next = textController.findNext(start, Direction.FORWARD, null);
if (next == null) {
displayNotFoundMessage(start);
return;
<<<<<<<
public String getFindFromText() {
final String plainNodeText = HtmlUtils.htmlToPlain(findFromNode.toString()).replaceAll("\n", " ");
=======
private void displayNotFoundMessage(NodeModel start) {
final String messageText = ResourceBundles.getText("no_more_found_from");
UITools.informationMessage(getController().getViewController().getFrame(), messageText.replaceAll("\\$1",
Matcher.quoteReplacement(condition.toString())).replaceAll("\\$2", Matcher.quoteReplacement(getFindFromText(start))));
}
public String getFindFromText(NodeModel node) {
final String plainNodeText = HtmlTools.htmlToPlain(node.toString()).replaceAll("\n", " ");
>>>>>>>
private void displayNotFoundMessage(NodeModel start) {
final String messageText = TextUtils.getText("no_more_found_from");
UITools.informationMessage(getController().getViewController().getFrame(), messageText.replaceAll("\\$1",
Matcher.quoteReplacement(condition.toString())).replaceAll("\\$2", Matcher.quoteReplacement(getFindFromText(start))));
}
public String getFindFromText(NodeModel node) {
final String plainNodeText = HtmlUtils.htmlToPlain(node.toString()).replaceAll("\n", " "); |
<<<<<<<
protected String getPropertyKeyPrefix(){
return propertyKeyPrefix ;
}
=======
public static void setLookAndFeel(final String lookAndFeel) {
try {
if (lookAndFeel.equals("default")) {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
else {
UIManager.setLookAndFeel(lookAndFeel);
}
}
catch (final Exception ex) {
LogTool.warn("Error while setting Look&Feel" + lookAndFeel, ex);
}
}
>>>>>>>
protected String getPropertyKeyPrefix(){
return propertyKeyPrefix ;
}
public static void setLookAndFeel(final String lookAndFeel) {
try {
if (lookAndFeel.equals("default")) {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
else {
UIManager.setLookAndFeel(lookAndFeel);
}
}
catch (final Exception ex) {
LogTool.warn("Error while setting Look&Feel" + lookAndFeel, ex);
}
} |
<<<<<<<
import org.apache.accumulo.core.sample.impl.SamplerConfigurationImpl;
=======
import org.apache.accumulo.core.util.LocalityGroupUtil;
>>>>>>>
import org.apache.accumulo.core.sample.impl.SamplerConfigurationImpl;
import org.apache.accumulo.core.util.LocalityGroupUtil;
<<<<<<<
import com.google.common.annotations.VisibleForTesting;
=======
import com.google.common.base.Preconditions;
>>>>>>>
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions; |
<<<<<<<
public String testSaveLocationExists(){
if (fileManager.testSaveLocationExists())
return "SD Card available";
else
return "SD Card unavailable";
}
public String testDirOrFileExists(String file){
if (fileManager.isDirtoryOrFileExists(file))
return "File exists";
else
return "No this file";
}
public String deleteDirectory (String dir){
if (fileManager.deleteDir(dir))
return "Completed";
else
return "Not completed";
}
public String deleteFile (String file){
if (fileManager.deleteFile(file))
return "Completed";
else
return "Not completed";
}
public String createDirectory(String dir){
if (fileManager.createDirectory(dir))
return "Completed";
else
return "Not completed";
}
=======
/**
* AUDIO
* TODO: Basic functions done but needs more work on error handling and call backs, remove record hack
*/
AudioHandler audio = new AudioHandler("/sdcard/tmprecording.mp3");
public void startRecordingAudio(String file)
{
/* for this to work the recording needs to be specified in the constructor,
* a hack to get around this, I'm moving the recording after it's complete
*/
audio.startRecording(file);
}
public void stopRecordingAudio()
{
audio.stopRecording();
}
public void startPlayingAudio(String file)
{
audio.startPlaying(file);
}
public void stopPlayingAudio()
{
audio.stopPlaying();
}
public long getCurrentPositionAudio()
{
System.out.println(audio.getCurrentPosition());
return(audio.getCurrentPosition());
}
public long getDurationAudio(String file)
{
System.out.println(audio.getDuration(file));
return(audio.getDuration(file));
}
>>>>>>>
public String testSaveLocationExists(){
if (fileManager.testSaveLocationExists())
return "SD Card available";
else
return "SD Card unavailable";
}
public String testDirOrFileExists(String file){
if (fileManager.isDirtoryOrFileExists(file))
return "File exists";
else
return "No this file";
}
public String deleteDirectory (String dir){
if (fileManager.deleteDir(dir))
return "Completed";
else
return "Not completed";
}
public String deleteFile (String file){
if (fileManager.deleteFile(file))
return "Completed";
else
return "Not completed";
}
public String createDirectory(String dir){
if (fileManager.createDirectory(dir))
return "Completed";
else
return "Not completed";
}
/**
* AUDIO
* TODO: Basic functions done but needs more work on error handling and call backs, remove record hack
*/
AudioHandler audio = new AudioHandler("/sdcard/tmprecording.mp3");
public void startRecordingAudio(String file)
{
/* for this to work the recording needs to be specified in the constructor,
* a hack to get around this, I'm moving the recording after it's complete
*/
audio.startRecording(file);
}
public void stopRecordingAudio()
{
audio.stopRecording();
}
public void startPlayingAudio(String file)
{
audio.startPlaying(file);
}
public void stopPlayingAudio()
{
audio.stopPlaying();
}
public long getCurrentPositionAudio()
{
System.out.println(audio.getCurrentPosition());
return(audio.getCurrentPosition());
}
public long getDurationAudio(String file)
{
System.out.println(audio.getDuration(file));
return(audio.getDuration(file));
} |
<<<<<<<
import net.sourceforge.subsonic.service.AdService;
import net.sourceforge.subsonic.service.MediaFileService;
import net.sourceforge.subsonic.service.RatingService;
=======
import net.sourceforge.subsonic.service.MusicFileService;
import net.sourceforge.subsonic.service.MusicInfoService;
>>>>>>>
import net.sourceforge.subsonic.service.MediaFileService;
import net.sourceforge.subsonic.service.RatingService;
<<<<<<<
private RatingService ratingService;
private MediaFileService mediaFileService;
private AdService adService;
=======
private MusicInfoService musicInfoService;
private MusicFileService musicFileService;
>>>>>>>
private RatingService ratingService;
private MediaFileService mediaFileService;
<<<<<<<
public void setAdService(AdService adService) {
this.adService = adService;
}
public void setMediaFileService(MediaFileService mediaFileService) {
this.mediaFileService = mediaFileService;
}
=======
>>>>>>> |
<<<<<<<
if (this == MEMBER)
{
=======
if (this.value == MEMBER.value)
>>>>>>>
if (this == MEMBER)
<<<<<<<
}
else if (this == ALLY)
{
=======
else if (this.value == ALLY.value)
>>>>>>>
else if (this == ALLY)
<<<<<<<
}
else if (this == NEUTRAL)
{
=======
else if (this.value == NEUTRAL.value)
>>>>>>>
else if (this == NEUTRAL) |
<<<<<<<
* @see InteractsWithApps#resetApp().
*/
@Override public void resetApp() {
execute(MobileCommand.RESET);
}
/**
* @see InteractsWithApps#isAppInstalled(String).
*/
@Override public boolean isAppInstalled(String bundleId) {
Response response = execute(IS_APP_INSTALLED, ImmutableMap.of("bundleId", bundleId));
return Boolean.parseBoolean(response.getValue().toString());
}
/**
* @see InteractsWithApps#installApp(String).
*/
@Override public void installApp(String appPath) {
execute(INSTALL_APP, ImmutableMap.of("appPath", appPath));
}
/**
* @see InteractsWithApps#removeApp(String).
*/
@Override public void removeApp(String bundleId) {
execute(REMOVE_APP, ImmutableMap.of("bundleId", bundleId));
}
/**
* @see InteractsWithApps#launchApp().
*/
@Override public void launchApp() {
execute(LAUNCH_APP);
}
/**
* @see InteractsWithApps#closeApp().
*/
@Override public void closeApp() {
execute(CLOSE_APP);
}
/**
* @see InteractsWithApps#runAppInBackground(int).
*/
@Override public void runAppInBackground(int seconds) {
execute(RUN_APP_IN_BACKGROUND, ImmutableMap.of("seconds", seconds));
}
/**
* @see DeviceActionShortcuts#getDeviceTime().
*/
@Override public String getDeviceTime() {
Response response = execute(GET_DEVICE_TIME);
return response.getValue().toString();
}
/**
* @see DeviceActionShortcuts#hideKeyboard().
*/
@Override public void hideKeyboard() {
execute(HIDE_KEYBOARD);
}
/**
* @see InteractsWithFiles#pullFile(String).
*/
@Override public byte[] pullFile(String remotePath) {
Response response = execute(PULL_FILE, ImmutableMap.of("path", remotePath));
String base64String = response.getValue().toString();
return DatatypeConverter.parseBase64Binary(base64String);
}
/**
* @see InteractsWithFiles#pullFolder(String).
*/
@Override
public byte[] pullFolder(String remotePath) {
Response response = execute(PULL_FOLDER, ImmutableMap.of("path", remotePath));
String base64String = response.getValue().toString();
return DatatypeConverter.parseBase64Binary(base64String);
}
/**
* @see PerformsTouchActions#performTouchAction(TouchAction).
*/
@SuppressWarnings("rawtypes")
@Override public TouchAction performTouchAction(
TouchAction touchAction) {
ImmutableMap<String, ImmutableList> parameters = touchAction.getParameters();
execute(PERFORM_TOUCH_ACTION, parameters);
return touchAction;
}
/**
* @see PerformsTouchActions#performMultiTouchAction(MultiTouchAction).
*/
@Override
@SuppressWarnings({"rawtypes"})
public void performMultiTouchAction(
MultiTouchAction multiAction) {
ImmutableMap<String, ImmutableList> parameters = multiAction.getParameters();
execute(PERFORM_MULTI_TOUCH, parameters);
}
/**
* @see TouchableElement#tap(int, WebElement, int).
=======
* @see TouchShortcuts#tap(int, WebElement, int).
>>>>>>>
* @see TouchableElement#tap(int, WebElement, int). |
<<<<<<<
@Test
public void ignoreUnimportantViews() {
driver.ignoreUnimportantViews(true);
boolean ignoreViews = driver.getSettings().get(AppiumSetting.IGNORE_UNIMPORTANT_VIEWS.toString()).getAsBoolean();
assertTrue(ignoreViews);
driver.ignoreUnimportantViews(false);
ignoreViews = driver.getSettings().get(AppiumSetting.IGNORE_UNIMPORTANT_VIEWS.toString()).getAsBoolean();
assertFalse(ignoreViews);
}
=======
@Test
public void startActivityInThisAppTest(){
driver.startActivity("io.appium.android.apis", ".accessibility.AccessibilityNodeProviderActivity", null, null);
String activity = driver.currentActivity();
assertTrue(activity.contains("Node"));
}
@Test
public void startActivityInAnotherAppTest(){
driver.startActivity("com.android.contacts", ".ContactsListActivity", null, null);
String activity = driver.currentActivity();
assertTrue(activity.contains("Contact"));
}
>>>>>>>
@Test
public void ignoreUnimportantViews() {
driver.ignoreUnimportantViews(true);
boolean ignoreViews = driver.getSettings().get(AppiumSetting.IGNORE_UNIMPORTANT_VIEWS.toString()).getAsBoolean();
assertTrue(ignoreViews);
driver.ignoreUnimportantViews(false);
ignoreViews = driver.getSettings().get(AppiumSetting.IGNORE_UNIMPORTANT_VIEWS.toString()).getAsBoolean();
assertFalse(ignoreViews);
}
@Test
public void startActivityInThisAppTest(){
driver.startActivity("io.appium.android.apis", ".accessibility.AccessibilityNodeProviderActivity", null, null);
String activity = driver.currentActivity();
assertTrue(activity.contains("Node"));
}
@Test
public void startActivityInAnotherAppTest(){
driver.startActivity("com.android.contacts", ".ContactsListActivity", null, null);
String activity = driver.currentActivity();
assertTrue(activity.contains("Contact"));
} |
<<<<<<<
public List<TabletStats> getOnlineTabletsForTable(TServerInstance tserver, Table.ID tableId) throws ThriftSecurityException, TException {
=======
public List<TabletStats> getOnlineTabletsForTable(TServerInstance tserver, String tableId)
throws ThriftSecurityException, TException {
>>>>>>>
public List<TabletStats> getOnlineTabletsForTable(TServerInstance tserver, Table.ID tableId)
throws ThriftSecurityException, TException {
<<<<<<<
public List<TabletStats> getOnlineTabletsForTable(TServerInstance tserver, Table.ID tableId) throws ThriftSecurityException, TException {
=======
public List<TabletStats> getOnlineTabletsForTable(TServerInstance tserver, String tableId)
throws ThriftSecurityException, TException {
>>>>>>>
public List<TabletStats> getOnlineTabletsForTable(TServerInstance tserver, Table.ID tableId)
throws ThriftSecurityException, TException {
<<<<<<<
EasyMock.expect(inst.getInstanceID()).andReturn(UUID.nameUUIDFromBytes(new byte[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 0}).toString()).anyTimes();
EasyMock.expect(inst.getZooKeepers()).andReturn("10.0.0.1:1234").anyTimes();
EasyMock.expect(inst.getZooKeepersSessionTimeOut()).andReturn(30_000).anyTimes();
=======
EasyMock.expect(inst.getInstanceID())
.andReturn(UUID.nameUUIDFromBytes(new byte[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 0}).toString())
.anyTimes();
>>>>>>>
EasyMock.expect(inst.getInstanceID())
.andReturn(UUID.nameUUIDFromBytes(new byte[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 0}).toString())
.anyTimes();
EasyMock.expect(inst.getZooKeepers()).andReturn("10.0.0.1:1234").anyTimes();
EasyMock.expect(inst.getZooKeepersSessionTimeOut()).andReturn(30_000).anyTimes(); |
<<<<<<<
=======
if (isARMDevice()) {
primaryStage.setFullScreen(true);
primaryStage.setFullScreenExitHint("");
}
if (Platform.isSupported(ConditionalFeature.INPUT_TOUCH)) {
scene.setCursor(Cursor.NONE);
}
>>>>>>> |
<<<<<<<
lr.setMessage(LogManager.formatter.format(lr));
lr.setParameters(new Object[] {param});
if (logger == null)
{
logger = LogManager.getLogger();
}
=======
lr.setMessage(TCLogManager.formatter.format(lr));
lr.setParameters(new Object[]{ param });
if (logger == null) logger = TCLogManager.getLogger();
>>>>>>>
lr.setMessage(LogManager.formatter.format(lr));
lr.setParameters(new Object[]{ param });
if (logger == null) logger = LogManager.getLogger();
<<<<<<<
lr.setMessage(LogManager.formatter.format(lr));
if (logger == null)
{
logger = LogManager.getLogger();
}
=======
lr.setMessage(TCLogManager.formatter.format(lr));
if (logger == null) logger = TCLogManager.getLogger();
>>>>>>>
lr.setMessage(LogManager.formatter.format(lr));
if (logger == null) logger = LogManager.getLogger(); |
<<<<<<<
import com.khorn.terraincontrol.LocalBiome;
import com.khorn.terraincontrol.LocalWorld;
import com.khorn.terraincontrol.TerrainControl;
import com.khorn.terraincontrol.bukkit.generator.BiomeCacheWrapper;
import com.khorn.terraincontrol.bukkit.generator.TCChunkGenerator;
import com.khorn.terraincontrol.bukkit.generator.TCWorldChunkManager;
import com.khorn.terraincontrol.bukkit.generator.TCWorldProvider;
import com.khorn.terraincontrol.bukkit.generator.structures.*;
=======
import net.minecraft.server.v1_7_R1.WorldGenMegaTree;
import net.minecraft.server.v1_7_R1.WorldGenAcaciaTree;
import net.minecraft.server.v1_7_R1.WorldGenForestTree;
import net.minecraft.server.v1_7_R1.WorldGenJungleTree;
import com.khorn.terraincontrol.*;
import com.khorn.terraincontrol.biomegenerators.BiomeGenerator;
import com.khorn.terraincontrol.biomegenerators.OldBiomeGenerator;
import com.khorn.terraincontrol.biomegenerators.OutputType;
import com.khorn.terraincontrol.bukkit.structuregens.*;
>>>>>>>
import com.khorn.terraincontrol.LocalBiome;
import com.khorn.terraincontrol.LocalWorld;
import com.khorn.terraincontrol.TerrainControl;
import com.khorn.terraincontrol.bukkit.generator.BiomeCacheWrapper;
import com.khorn.terraincontrol.bukkit.generator.TCChunkGenerator;
import com.khorn.terraincontrol.bukkit.generator.TCWorldChunkManager;
import com.khorn.terraincontrol.bukkit.generator.TCWorldProvider;
import com.khorn.terraincontrol.bukkit.generator.structures.*;
<<<<<<<
import com.khorn.terraincontrol.generator.biome.BiomeGenerator;
import com.khorn.terraincontrol.generator.biome.OldBiomeGenerator;
import com.khorn.terraincontrol.generator.biome.OutputType;
import com.khorn.terraincontrol.util.NamedBinaryTag;
import com.khorn.terraincontrol.util.minecraftTypes.DefaultBiome;
import com.khorn.terraincontrol.util.minecraftTypes.DefaultMaterial;
import com.khorn.terraincontrol.util.minecraftTypes.TreeType;
import net.minecraft.server.v1_6_R3.*;
import org.bukkit.craftbukkit.v1_6_R3.CraftWorld;
=======
import com.khorn.terraincontrol.generator.resourcegens.TreeType;
import net.minecraft.server.v1_7_R1.*;
import org.bukkit.craftbukkit.v1_7_R1.CraftWorld;
>>>>>>>
import com.khorn.terraincontrol.generator.biome.BiomeGenerator;
import com.khorn.terraincontrol.generator.biome.OldBiomeGenerator;
import com.khorn.terraincontrol.generator.biome.OutputType;
import com.khorn.terraincontrol.util.NamedBinaryTag;
import com.khorn.terraincontrol.util.minecraftTypes.DefaultBiome;
import com.khorn.terraincontrol.util.minecraftTypes.DefaultMaterial;
import com.khorn.terraincontrol.util.minecraftTypes.TreeType;
import net.minecraft.server.v1_7_R1.*;
import org.bukkit.craftbukkit.v1_7_R1.CraftWorld;
<<<<<<<
// TODO do something with that when bukkit allow custom world height.
private int worldHeight = 256;
private int heightBits = 8;
// Need for compatibility with old configs. It is start index for custom biomes count used only for isle biomes.
=======
>>>>>>>
// Need for compatibility with old configs. It is start index for custom biomes count used only for isle biomes.
<<<<<<<
if (this.settings.worldConfig.strongholdsEnabled)
this.strongholdGen.prepare(this.world, chunkX, chunkZ, chunkArray);
if (this.settings.worldConfig.mineshaftsEnabled)
this.mineshaftGen.prepare(this.world, chunkX, chunkZ, chunkArray);
if (this.settings.worldConfig.villagesEnabled && dry)
this.villageGen.prepare(this.world, chunkX, chunkZ, chunkArray);
if (this.settings.worldConfig.rareBuildingsEnabled)
this.pyramidsGen.prepare(this.world, chunkX, chunkZ, chunkArray);
if (this.settings.worldConfig.netherFortressesEnabled)
this.netherFortress.prepare(this.world, chunkX, chunkZ, chunkArray);
=======
if (this.settings.strongholdsEnabled)
this.strongholdGen.prepare(this.world, chunkX, chunkZ);
if (this.settings.mineshaftsEnabled)
this.mineshaftGen.prepare(this.world, chunkX, chunkZ);
if (this.settings.villagesEnabled && dry)
this.villageGen.prepare(this.world, chunkX, chunkZ);
if (this.settings.rareBuildingsEnabled)
this.pyramidsGen.prepare(this.world, chunkX, chunkZ);
if (this.settings.netherFortressesEnabled)
this.netherFortress.prepare(this.world, chunkX, chunkZ);
>>>>>>>
if (this.settings.worldConfig.strongholdsEnabled)
this.strongholdGen.prepare(this.world, chunkX, chunkZ);
if (this.settings.worldConfig.mineshaftsEnabled)
this.mineshaftGen.prepare(this.world, chunkX, chunkZ);
if (this.settings.worldConfig.villagesEnabled && dry)
this.villageGen.prepare(this.world, chunkX, chunkZ);
if (this.settings.worldConfig.rareBuildingsEnabled)
this.pyramidsGen.prepare(this.world, chunkX, chunkZ);
if (this.settings.worldConfig.netherFortressesEnabled)
this.netherFortress.prepare(this.world, chunkX, chunkZ);
<<<<<<<
byte[] ChunkBiomes = this.chunkCache[0].m();
for (int i = 0; i < ChunkBiomes.length; i++)
ChunkBiomes[i] = (byte) (this.settings.ReplaceBiomesMatrix[ChunkBiomes[i] & 0xFF] & 0xFF);
=======
// Like all other populators, this populator uses an offset of 8
// blocks from the chunk start.
// This is what happens when the top left chunk has it's biome
// replaced:
// +--------+--------+ . = no changes in biome for now
// |........|........| # = biome is replaced
// |....####|####....|
// |....####|####....| The top left chunk is saved as chunk 0
// +--------+--------+ in the cache, the top right chunk as 1,
// |....####|####....| the bottom left as 2 and the bottom
// |....####|####....| right chunk as 3.
// |........|........|
// +--------+--------+
replaceBiomes(this.chunkCache[0].m(), 8, 8);
replaceBiomes(this.chunkCache[1].m(), 0, 8);
replaceBiomes(this.chunkCache[2].m(), 8, 0);
replaceBiomes(this.chunkCache[3].m(), 0, 0);
>>>>>>>
// Like all other populators, this populator uses an offset of 8
// blocks from the chunk start.
// This is what happens when the top left chunk has it's biome
// replaced:
// +--------+--------+ . = no changes in biome for now
// |........|........| # = biome is replaced
// |....####|####....|
// |....####|####....| The top left chunk is saved as chunk 0
// +--------+--------+ in the cache, the top right chunk as 1,
// |....####|####....| the bottom left as 2 and the bottom
// |....####|####....| right chunk as 3.
// |........|........|
// +--------+--------+
replaceBiomes(this.chunkCache[0].m(), 8, 8);
replaceBiomes(this.chunkCache[1].m(), 0, 8);
replaceBiomes(this.chunkCache[2].m(), 8, 0);
replaceBiomes(this.chunkCache[3].m(), 0, 0);
<<<<<<<
Chunk chunk = this.getChunk(x, 0, z);
if (chunk == null)
return -1;
z &= 0xF;
x &= 0xF;
for (int y = worldHeight - 1; y > 0; y--)
=======
for (int y = getHighestBlockYAt(x, z) - 1; y > 0; y--)
>>>>>>>
for (int y = getHighestBlockYAt(x, z) - 1; y > 0; y--)
<<<<<<<
* <p/>
*
* @param baseFolder The folder the WorldConfig is in.
=======
*
>>>>>>>
*
<<<<<<<
* Enables/reloads this BukkitWorld. If you are reloading,
* don't forget to set the new settings first using
* {@link #setSettings(WorldConfig)}.
* <p/>
*
=======
* Enables/reloads this BukkitWorld. If you are reloading, don't forget to
* set the new settings first using {@link #setSettings(WorldConfig)}.
*
>>>>>>>
* Enables/reloads this BukkitWorld. If you are reloading, don't forget to
* set the new settings first using {@link #setSettings(WorldConfig)}.
*
<<<<<<<
TerrainControl.log(Level.CONFIG, "Skipping tile entity with id {0}, cannot be placed at {1},{2},{3} on id {4}", new Object[]{nmsTag.getString("id"), x, y, z, world.getTypeId(x, y, z)});
=======
TerrainControl.log(Level.CONFIG, "Skipping tile entity with id {0}, cannot be placed at {1},{2},{3} on id {4}", new Object[] {nmsTag.getString("id"), x, y, z, world.getTypeId(x, y, z)});
>>>>>>>
TerrainControl.log(Level.CONFIG, "Skipping tile entity with id {0}, cannot be placed at {1},{2},{3} on id {4}", new Object[] {nmsTag.getString("id"), x, y, z, world.getTypeId(x, y, z)}); |
<<<<<<<
public int ResourceCount = 0;
public Resource[] ResourceSequence = new Resource[256];
=======
public List<Resource> resourceSequence = new ArrayList<Resource>();
>>>>>>>
public List<Resource> resourceSequence = new ArrayList<Resource>();
<<<<<<<
=======
>>>>>>>
<<<<<<<
=======
public DefaultBiomeSettings defaultSettings;
>>>>>>>
public DefaultBiomeSettings defaultSettings;
<<<<<<<
this.correctSettings();
if (!file.exists())
this.createDefaultResources();
=======
this.correctSettings();
// Add default resources when needed
if (!file.exists())
{
this.resourceSequence.addAll(defaultSettings.createDefaultResources(this));
}
if (config.SettingsMode != WorldConfig.ConfigMode.WriteDisable)
this.writeSettingsFile(config.SettingsMode == WorldConfig.ConfigMode.WriteAll);
>>>>>>>
this.correctSettings();
// Add default resources when needed
if (!file.exists())
{
this.resourceSequence.addAll(defaultSettings.createDefaultResources(this));
}
<<<<<<<
String key = entry.getKey();
int start = key.indexOf("(");
int end = key.lastIndexOf(")");
ConfigFunction<BiomeConfig> resource = null;
if (start != -1 && end != -1)
=======
for (Map.Entry<String, String> entry : this.settingsCache.entrySet())
>>>>>>>
String key = entry.getKey();
int start = key.indexOf("(");
int end = key.lastIndexOf(")");
ConfigFunction<BiomeConfig> resource = null;
if (start != -1 && end != -1)
<<<<<<<
return null;
=======
this.resourceSequence.add((Resource) res);
>>>>>>>
return null;
<<<<<<<
protected String defaultExtends = "";
protected boolean defaultWaterLakes = true;
protected int defaultTrees = 1;
protected int defaultFlowers = 2;
protected int defaultGrass = 10;
protected int defaultDeadBrush = 0;
protected int defaultMushroom = 0;
protected int defaultReed = 0;
protected int defaultCactus = 0;
protected int defaultClay = 1;
protected Object[] defaultWell;
protected float defaultBiomeSurface = 0.1F;
protected float defaultBiomeVolatility = 0.3F;
protected byte defaultSurfaceBlock = (byte) DefaultMaterial.GRASS.id;
protected byte defaultGroundBlock = (byte) DefaultMaterial.DIRT.id;
protected float defaultBiomeTemperature = 0.5F;
protected float defaultBiomeWetness = 0.5F;
protected ArrayList<String> defaultIsle = new ArrayList<String>();
protected ArrayList<String> defaultBorder = new ArrayList<String>();
protected ArrayList<String> defaultNotBorderNear = new ArrayList<String>();
protected String defaultRiverBiome = DefaultBiome.RIVER.Name;
protected int defaultSize = 4;
protected int defaultRarity = 100;
protected String defaultColor = "0x000000";
protected int defaultWaterLily = 0;
protected String defaultWaterColorMultiplier = "0xFFFFFF";
protected String defaultGrassColor = "0xFFFFFF";
protected String defaultFoliageColor = "0xFFFFFF";
protected boolean defaultStrongholds = true;
protected VillageType defaultVillageType = VillageType.disabled;
protected RareBuildingType defaultRareBuildingType = RareBuildingType.disabled;
protected void initDefaults()
{
this.defaultBiomeSurface = this.Biome.getSurfaceHeight();
this.defaultBiomeVolatility = this.Biome.getSurfaceVolatility();
this.defaultSurfaceBlock = this.Biome.getSurfaceBlock();
this.defaultGroundBlock = this.Biome.getGroundBlock();
this.defaultBiomeTemperature = this.Biome.getTemperature();
this.defaultBiomeWetness = this.Biome.getWetness();
switch (this.Biome.getId())
{
case 0: // Ocean
this.defaultColor = "0x3333FF";
this.defaultStrongholds = false;
this.defaultRiverBiome = "";
break;
case 1: // Plains
this.defaultTrees = 0;
this.defaultFlowers = 4;
this.defaultGrass = 100;
this.defaultColor = "0x999900";
this.defaultStrongholds = false;
this.defaultVillageType = VillageType.wood;
break;
case 2: // Desert
this.defaultWaterLakes = false;
this.defaultTrees = 0;
this.defaultDeadBrush = 4;
this.defaultGrass = 0;
this.defaultReed = 10;
this.defaultCactus = 10;
this.defaultColor = "0xFFCC33";
this.defaultWell = new Object[]
{
DefaultMaterial.SANDSTONE, DefaultMaterial.STEP + ":1", DefaultMaterial.WATER, 1, 0.1, 2, worldConfig.WorldHeight, DefaultMaterial.SAND
};
this.defaultVillageType = VillageType.sandstone;
this.defaultRareBuildingType = RareBuildingType.desertPyramid;
break;
case 3: // Extreme hills
this.defaultColor = "0x333300";
break;
case 4: // Forest
this.defaultTrees = 10;
this.defaultGrass = 15;
this.defaultColor = "0x00FF00";
break;
case 5: // Taiga
this.defaultTrees = 10;
this.defaultGrass = 10;
this.defaultColor = "0x007700";
break;
case 6: // Swampland
this.defaultTrees = 2;
this.defaultFlowers = -999;
this.defaultDeadBrush = 1;
this.defaultMushroom = 8;
this.defaultReed = 10;
this.defaultClay = 1;
this.defaultWaterLily = 1;
this.defaultColor = "0x99CC66";
this.defaultWaterColorMultiplier = "0xe0ffae";
this.defaultGrassColor = "0x7E6E7E";
this.defaultFoliageColor = "0x7E6E7E";
this.defaultRareBuildingType = RareBuildingType.swampHut;
break;
case 7: // River
this.defaultSize = 8;
this.defaultRarity = 95;
this.defaultIsle.add(DefaultBiome.SWAMPLAND.Name);
this.defaultColor = "0x00CCCC";
this.defaultStrongholds = false;
case 8: // Hell
case 9: // Sky
break;
case 10: // FrozenOcean
this.defaultColor = "0xFFFFFF";
this.defaultStrongholds = false;
this.defaultRiverBiome = "";
break;
case 11: // FrozenRiver
this.defaultColor = "0x66FFFF";
this.defaultStrongholds = false;
break;
case 12: // Ice Plains
this.defaultColor = "0xCCCCCC";
if (worldConfig.readModSettings(TCDefaultValues.FrozenRivers, true))
{
// Only make river frozen if there isn't some old setting
// that prevents it
this.defaultRiverBiome = DefaultBiome.FROZEN_RIVER.Name;
}
break;
case 13: // Ice Mountains
this.defaultColor = "0xCC9966";
if (worldConfig.readModSettings(TCDefaultValues.FrozenRivers, true))
{
// Only make river frozen if there isn't some old setting
// that prevents it
this.defaultRiverBiome = DefaultBiome.FROZEN_RIVER.Name;
}
break;
case 14: // MushroomIsland
this.defaultSurfaceBlock = (byte) DefaultMaterial.MYCEL.id;
this.defaultMushroom = 1;
this.defaultGrass = 0;
this.defaultFlowers = 0;
this.defaultTrees = 0;
this.defaultRarity = 1;
this.defaultRiverBiome = "";
this.defaultSize = 6;
this.defaultIsle.add(DefaultBiome.OCEAN.Name);
this.defaultColor = "0xFF33CC";
this.defaultWaterLily = 1;
this.defaultStrongholds = false;
break;
case 15: // MushroomIslandShore
this.defaultRiverBiome = "";
this.defaultSize = 9;
this.defaultBorder.add(DefaultBiome.MUSHROOM_ISLAND.Name);
this.defaultColor = "0xFF9999";
this.defaultStrongholds = false;
break;
case 16: // Beach
this.defaultTrees = 0;
this.defaultSize = 8;
this.defaultBorder.add(DefaultBiome.OCEAN.Name);
this.defaultNotBorderNear.add(DefaultBiome.RIVER.Name);
this.defaultNotBorderNear.add(DefaultBiome.SWAMPLAND.Name);
this.defaultNotBorderNear.add(DefaultBiome.EXTREME_HILLS.Name);
this.defaultNotBorderNear.add(DefaultBiome.MUSHROOM_ISLAND.Name);
this.defaultColor = "0xFFFF00";
this.defaultStrongholds = false;
break;
case 17: // DesertHills
this.defaultWaterLakes = false;
this.defaultSize = 6;
this.defaultRarity = 97;
this.defaultIsle.add(DefaultBiome.DESERT.Name);
this.defaultTrees = 0;
this.defaultDeadBrush = 4;
this.defaultGrass = 0;
this.defaultReed = 50;
this.defaultCactus = 10;
this.defaultColor = "0x996600";
this.defaultWell = new Object[]
{
DefaultMaterial.SANDSTONE, DefaultMaterial.STEP + ":1", DefaultMaterial.WATER, 1, 0.1, 2, worldConfig.WorldHeight, DefaultMaterial.SAND
};
this.defaultVillageType = VillageType.sandstone;
this.defaultRareBuildingType = RareBuildingType.desertPyramid;
break;
case 18: // ForestHills
this.defaultSize = 6;
this.defaultRarity = 97;
this.defaultIsle.add(DefaultBiome.FOREST.Name);
this.defaultTrees = 10;
this.defaultGrass = 15;
this.defaultColor = "0x009900";
break;
case 19: // TaigaHills
this.defaultSize = 6;
this.defaultRarity = 97;
this.defaultIsle.add(DefaultBiome.TAIGA.Name);
this.defaultTrees = 10;
this.defaultGrass = 10;
this.defaultColor = "0x003300";
this.defaultRiverBiome = DefaultBiome.FROZEN_RIVER.Name;
break;
case 20: // Extreme Hills Edge
this.defaultSize = 8;
this.defaultBorder.add(DefaultBiome.EXTREME_HILLS.Name);
this.defaultColor = "0x666600";
break;
case 21: // Jungle
this.defaultTrees = 50;
this.defaultGrass = 25;
this.defaultFlowers = 4;
this.defaultColor = "0xCC6600";
this.defaultRareBuildingType = RareBuildingType.jungleTemple;
break;
case 22: // JungleHills
this.defaultTrees = 50;
this.defaultGrass = 25;
this.defaultFlowers = 4;
this.defaultColor = "0x663300";
this.defaultIsle.add(DefaultBiome.JUNGLE.Name);
this.defaultRareBuildingType = RareBuildingType.jungleTemple;
break;
}
}
=======
>>>>>>> |
<<<<<<<
public WorldConfig(SettingsReader settingsReader, BiomeGroupManager biomeGroupManager, LocalWorld world)
=======
public WorldConfig(SettingsReader settingsReader, LocalWorld world, CustomObjectCollection customObjects)
>>>>>>>
public WorldConfig(SettingsReader settingsReader, BiomeGroupManager biomeGroupManager, LocalWorld world,
CustomObjectCollection customObjects)
<<<<<<<
this.biomeGroupManager = biomeGroupManager;
=======
this.worldObjects = customObjects;
this.customObjects = customObjects.getAll();
>>>>>>>
this.biomeGroupManager = biomeGroupManager;
this.worldObjects = customObjects;
this.customObjects = customObjects.getAll(); |
<<<<<<<
/**
* The name of this class is a relic from when it could only
* be used for singleplayer. Shortly after Terrain Control
* was converted to use Forge instead of ModLoader, it also
* worked on multiplayer. However, the name was unchanged.
* A better name would be ForgeWorld.
*
*/
=======
>>>>>>>
<<<<<<<
=======
@Override
public boolean canBiomeManagerGenerateUnzoomed()
{
if(this.biomeManager != null)
return biomeManager.canGenerateUnZoomed();
return true;
}
>>>>>>>
@Override
public boolean canBiomeManagerGenerateUnzoomed()
{
if(this.biomeManager != null)
return biomeManager.canGenerateUnZoomed();
return true;
} |
<<<<<<<
synchronized (this) {
Iterator<Session> iter = sessions.values().iterator();
while (iter.hasNext()) {
Session session = iter.next();
long configuredIdle = maxIdle;
if (session instanceof UpdateSession) {
configuredIdle = maxUpdateIdle;
}
long idleTime = System.currentTimeMillis() - session.lastAccessTime;
if (idleTime > configuredIdle && !session.reserved) {
log.info("Closing idle session from user={}, client={}, idle={}ms", session.getUser(), session.client, idleTime);
iter.remove();
sessionsToCleanup.add(session);
=======
Iterator<Session> iter = sessions.values().iterator();
while (iter.hasNext()) {
Session session = iter.next();
synchronized (session) {
if (session.state == State.UNRESERVED) {
long configuredIdle = maxIdle;
if (session instanceof UpdateSession) {
configuredIdle = maxUpdateIdle;
}
long idleTime = System.currentTimeMillis() - session.lastAccessTime;
if (idleTime > configuredIdle) {
log.info("Closing idle session from user=" + session.getUser() + ", client=" + session.client + ", idle=" + idleTime + "ms");
iter.remove();
sessionsToCleanup.add(session);
session.state = State.REMOVED;
}
>>>>>>>
Iterator<Session> iter = sessions.values().iterator();
while (iter.hasNext()) {
Session session = iter.next();
synchronized (session) {
if (session.state == State.UNRESERVED) {
long configuredIdle = maxIdle;
if (session instanceof UpdateSession) {
configuredIdle = maxUpdateIdle;
}
long idleTime = System.currentTimeMillis() - session.lastAccessTime;
if (idleTime > configuredIdle) {
log.info("Closing idle session from user={}, client={}, idle={}ms", session.getUser(), session.client, idleTime);
iter.remove();
sessionsToCleanup.add(session);
session.state = State.REMOVED;
}
<<<<<<<
Session sessionToCleanup = null;
synchronized (SessionManager.this) {
Session session2 = sessions.get(sessionId);
if (session2 != null && session2.lastAccessTime == removeTime && !session2.reserved) {
log.info("Closing not accessed session from user={}, client={}, duration={}ms", session2.getUser(), session2.client, delay);
=======
Session session2 = sessions.get(sessionId);
if (session2 != null) {
boolean shouldRemove = false;
synchronized (session2) {
if (session2.lastAccessTime == removeTime && session2.state == State.UNRESERVED) {
session2.state = State.REMOVED;
shouldRemove = true;
}
}
if (shouldRemove) {
log.info("Closing not accessed session from user=" + session2.getUser() + ", client=" + session2.client + ", duration=" + delay + "ms");
>>>>>>>
Session session2 = sessions.get(sessionId);
if (session2 != null) {
boolean shouldRemove = false;
synchronized (session2) {
if (session2.lastAccessTime == removeTime && session2.state == State.UNRESERVED) {
session2.state = State.REMOVED;
shouldRemove = true;
}
}
if (shouldRemove) {
log.info("Closing not accessed session from user=" + session2.getUser() + ", client=" + session2.client + ", duration=" + delay + "ms");
<<<<<<<
public synchronized Map<Table.ID,MapCounter<ScanRunState>> getActiveScansPerTable() {
Map<Table.ID,MapCounter<ScanRunState>> counts = new HashMap<>();
=======
public Map<String,MapCounter<ScanRunState>> getActiveScansPerTable() {
Map<String,MapCounter<ScanRunState>> counts = new HashMap<>();
>>>>>>>
public Map<Table.ID,MapCounter<ScanRunState>> getActiveScansPerTable() {
Map<Table.ID,MapCounter<ScanRunState>> counts = new HashMap<>(); |
<<<<<<<
import com.khorn.terraincontrol.configuration.WorldSettings;
import com.khorn.terraincontrol.generator.biome.OutputType;
=======
import com.khorn.terraincontrol.generator.noise.NoiseGeneratorNewOctaves;
>>>>>>>
import com.khorn.terraincontrol.configuration.WorldSettings;
import com.khorn.terraincontrol.generator.biome.OutputType;
import com.khorn.terraincontrol.generator.noise.NoiseGeneratorNewOctaves;
<<<<<<<
if (worldSettings.worldConfig.improvedRivers)
this.riverArray = this.localWorld.getBiomesUnZoomed(this.riverArray, chunkX * 4 - maxSmoothRadius, chunkZ * 4 - maxSmoothRadius, noise_xSize + maxSmoothDiameter, noise_zSize + maxSmoothDiameter, OutputType.ONLY_RIVERS);
=======
if (worldSettings.improvedRivers)
this.riverArray = this.localWorld.getBiomesUnZoomed(this.riverArray, chunkX * 4 - maxSmoothRadius, chunkZ * 4 - maxSmoothRadius, NOISE_MAX_X + maxSmoothDiameter, NOISE_MAX_Z + maxSmoothDiameter, OutputType.ONLY_RIVERS);
>>>>>>>
if (worldSettings.worldConfig.improvedRivers)
this.riverArray = this.localWorld.getBiomesUnZoomed(this.riverArray, chunkX * 4 - maxSmoothRadius, chunkZ * 4 - maxSmoothRadius, NOISE_MAX_X + maxSmoothDiameter, NOISE_MAX_Z + maxSmoothDiameter, OutputType.ONLY_RIVERS);
<<<<<<<
blockId = biomeConfigs[biomeId].StoneBlock;
=======
blockId = this.worldSettings.biomeConfigs[biomeId].stoneBlock;
>>>>>>>
blockId = this.worldSettings.biomeConfigs[biomeId].stoneBlock;
<<<<<<<
this.noise4 = this.noiseGen4.Noise3D(this.noise4, chunkX * 16, chunkZ * 16, 0, 16, 16, 1, d1 * 2.0D, d1 * 2.0D, d1 * 2.0D);
final float[] temperatureArray = this.localWorld.getTemperatures(chunkX * 16, chunkZ * 16, 16, 16);
WorldConfig worldConfig = this.worldSettings.worldConfig;
=======
this.noise4 = this.noiseGen4.a(this.noise4, chunkX * CHUNK_MAX_X, chunkZ * CHUNK_MAX_Z, CHUNK_MAX_X, CHUNK_MAX_Z, d1 * 2.0D, d1 * 2.0D, 1.0D);
>>>>>>>
this.noise4 = this.noiseGen4.a(this.noise4, chunkX * CHUNK_MAX_X, chunkZ * CHUNK_MAX_Z, CHUNK_MAX_X, CHUNK_MAX_Z, d1 * 2.0D, d1 * 2.0D, 1.0D);
WorldConfig worldConfig = this.worldSettings.worldConfig;
<<<<<<<
blocksArray[(z * 16 + x) * this.height + this.heightMinusOne - 1] = (byte) worldConfig.bedrockBlock;
=======
blocksArray[(z * 16 + x) * CHUNK_MAX_Y + this.heightCap - 2] = (byte) this.worldSettings.bedrockBlock;
>>>>>>>
blocksArray[(z * 16 + x) * CHUNK_MAX_Y + this.heightCap - 2] = (byte) worldConfig.bedrockBlock;
<<<<<<<
if (worldConfig.improvedRivers)
this.biomeFactorWithRivers(x, z, max_X, max_Y, noiseHeight);
=======
if (this.worldSettings.improvedRivers)
this.biomeFactorWithRivers(x, z, usedYSections, noiseHeight);
>>>>>>>
if (worldConfig.improvedRivers)
this.biomeFactorWithRivers(x, z, usedYSections, noiseHeight);
<<<<<<<
final int biomeId = this.biomeArray[(x + this.maxSmoothRadius + (z + this.maxSmoothRadius) * (max_X + this.maxSmoothDiameter))];
this.volatilityFactor = (1.0D - biomeConfigs[biomeId].BiomeTemperature * biomeConfigs[biomeId].BiomeWetness);
=======
final int biomeId = this.biomeArray[(x + this.maxSmoothRadius + (z + this.maxSmoothRadius) * (NOISE_MAX_X + this.maxSmoothDiameter))];
this.volatilityFactor = (1.0D - Math.min(1, this.worldSettings.biomeConfigs[biomeId].biomeTemperature) * this.worldSettings.biomeConfigs[biomeId].biomeWetness);
>>>>>>>
final int biomeId = this.biomeArray[(x + this.maxSmoothRadius + (z + this.maxSmoothRadius) * (NOISE_MAX_X + this.maxSmoothDiameter))];
this.volatilityFactor = (1.0D - Math.min(1, biomeConfigs[biomeId].biomeTemperature) * biomeConfigs[biomeId].biomeWetness);
<<<<<<<
final BiomeConfig[] biomeConfigs = this.worldSettings.biomeConfigs;
final int biomeId = this.biomeArray[(x + this.maxSmoothRadius + (z + this.maxSmoothRadius) * (max_X + this.maxSmoothDiameter))];
final int lookRadius = biomeConfigs[biomeId].SmoothRadius;
=======
final int biomeId = this.biomeArray[(x + this.maxSmoothRadius + (z + this.maxSmoothRadius) * (NOISE_MAX_X + this.maxSmoothDiameter))];
final int lookRadius = this.worldSettings.biomeConfigs[biomeId].SmoothRadius;
>>>>>>>
final BiomeConfig[] biomeConfigs = this.worldSettings.biomeConfigs;
final int biomeId = this.biomeArray[(x + this.maxSmoothRadius + (z + this.maxSmoothRadius) * (NOISE_MAX_X + this.maxSmoothDiameter))];
final int lookRadius = biomeConfigs[biomeId].SmoothRadius;
<<<<<<<
this.waterLevelRaw[x * max_X + z] = (byte) biomeConfigs[biomeId].waterLevelMax;
=======
this.waterLevelRaw[x * NOISE_MAX_X + z] = (byte) this.worldSettings.biomeConfigs[biomeId].waterLevelMax;
>>>>>>>
this.waterLevelRaw[x * NOISE_MAX_X + z] = (byte) biomeConfigs[biomeId].waterLevelMax;
<<<<<<<
final BiomeConfig[] biomeConfigs = this.worldSettings.biomeConfigs;
final int biomeId = this.biomeArray[(x + this.maxSmoothRadius + (z + this.maxSmoothRadius) * (max_X + this.maxSmoothDiameter))];
=======
final int biomeId = this.biomeArray[(x + this.maxSmoothRadius + (z + this.maxSmoothRadius) * (NOISE_MAX_X + this.maxSmoothDiameter))];
>>>>>>>
final BiomeConfig[] biomeConfigs = this.worldSettings.biomeConfigs;
final int biomeId = this.biomeArray[(x + this.maxSmoothRadius + (z + this.maxSmoothRadius) * (NOISE_MAX_X + this.maxSmoothDiameter))];
<<<<<<<
nextBiomeConfig = biomeConfigs[this.biomeArray[(x + nextX + this.maxSmoothRadius + (z + nextZ + this.maxSmoothRadius) * (max_X + this.maxSmoothDiameter))]];
=======
nextBiomeConfig = this.worldSettings.biomeConfigs[this.biomeArray[(x + nextX + this.maxSmoothRadius + (z + nextZ + this.maxSmoothRadius) * (NOISE_MAX_X + this.maxSmoothDiameter))]];
>>>>>>>
nextBiomeConfig = biomeConfigs[this.biomeArray[(x + nextX + this.maxSmoothRadius + (z + nextZ + this.maxSmoothRadius) * (NOISE_MAX_X + this.maxSmoothDiameter))]];
<<<<<<<
int waterLevelSum = this.riverFound ? biomeConfigs[biomeId].riverWaterLevel : biomeConfigs[biomeId].waterLevelMax;
this.waterLevelRaw[x * max_X + z] = (byte) waterLevelSum;
=======
int waterLevelSum = this.riverFound ? this.worldSettings.biomeConfigs[biomeId].riverWaterLevel : this.worldSettings.biomeConfigs[biomeId].waterLevelMax;
this.waterLevelRaw[x * NOISE_MAX_X + z] = (byte) waterLevelSum;
>>>>>>>
int waterLevelSum = this.riverFound ? biomeConfigs[biomeId].riverWaterLevel : biomeConfigs[biomeId].waterLevelMax;
this.waterLevelRaw[x * NOISE_MAX_X + z] = (byte) waterLevelSum; |
<<<<<<<
=======
import com.khorn.terraincontrol.DefaultMaterial;
import com.khorn.terraincontrol.LocalBiome;
>>>>>>>
import com.khorn.terraincontrol.configuration.standard.WorldStandardValues;
import com.khorn.terraincontrol.LocalBiome;
<<<<<<<
import com.khorn.terraincontrol.configuration.WorldSettings;
import com.khorn.terraincontrol.configuration.standard.WorldStandardValues;
import com.khorn.terraincontrol.generator.resource.Resource;
import com.khorn.terraincontrol.util.minecraftTypes.DefaultMaterial;
=======
import com.khorn.terraincontrol.configuration.TCDefaultValues;
import com.khorn.terraincontrol.configuration.WorldConfig;
import com.khorn.terraincontrol.generator.noise.NoiseGeneratorNewOctaves;
import com.khorn.terraincontrol.generator.resourcegens.Resource;
>>>>>>>
import com.khorn.terraincontrol.configuration.WorldSettings;
import com.khorn.terraincontrol.generator.noise.NoiseGeneratorNewOctaves;
import com.khorn.terraincontrol.generator.resource.Resource;
import com.khorn.terraincontrol.util.minecraftTypes.DefaultMaterial;
<<<<<<<
BiomeConfig biomeConfig = worldSettings.biomeConfigs[world.getBiomeId(blockToFreezeX, blockToFreezeZ)];
if (biomeConfig != null && biomeConfig.BiomeTemperature < WorldStandardValues.snowAndIceMaxTemp.floatValue())
=======
freezeColumn(blockToFreezeX, blockToFreezeZ);
}
}
}
protected void freezeColumn(int x, int z)
{
// Using the calculated biome id so that ReplaceToBiomeName can't mess up the ids
BiomeConfig biomeConfig = world.getSettings().biomeConfigs[world.getBiomeId(x, z)];
if (biomeConfig != null)
{
LocalBiome biome = biomeConfig.Biome;
int blockToFreezeY = world.getHighestBlockYAt(x, z);
if (blockToFreezeY > 0 && biome.getTemperatureAt(x, blockToFreezeY, z) < TCDefaultValues.snowAndIceMaxTemp.floatValue())
{
// Ice has to be placed one block in the world
if (DefaultMaterial.getMaterial(world.getTypeId(x, blockToFreezeY - 1, z)).isLiquid())
{
world.setBlock(x, blockToFreezeY - 1, z, biomeConfig.iceBlock, 0);
} else
>>>>>>>
freezeColumn(blockToFreezeX, blockToFreezeZ);
}
}
}
protected void freezeColumn(int x, int z)
{
// Using the calculated biome id so that ReplaceToBiomeName can't mess up the ids
BiomeConfig biomeConfig = world.getSettings().biomeConfigs[world.getBiomeId(x, z)];
if (biomeConfig != null)
{
LocalBiome biome = biomeConfig.Biome;
int blockToFreezeY = world.getHighestBlockYAt(x, z);
if (blockToFreezeY > 0 && biome.getTemperatureAt(x, blockToFreezeY, z) < WorldStandardValues.snowAndIceMaxTemp.floatValue())
{
// Ice has to be placed one block in the world
if (DefaultMaterial.getMaterial(world.getTypeId(x, blockToFreezeY - 1, z)).isLiquid())
{
world.setBlock(x, blockToFreezeY - 1, z, biomeConfig.iceBlock, 0);
} else |
<<<<<<<
import com.khorn.terraincontrol.util.NamedBinaryTag;
=======
import com.khorn.terraincontrol.configuration.Tag;
import net.minecraft.nbt.*;
>>>>>>>
import com.khorn.terraincontrol.util.NamedBinaryTag;
import net.minecraft.nbt.*;
<<<<<<<
NBTBase nmsChildTag = (NBTBase) nmsChildTags.get(nmsChildTagName);
NamedBinaryTag.Type type = NamedBinaryTag.Type.values()[nmsChildTag.getId()];
=======
NBTBase nmsChildTag = entry.getValue();
Tag.Type type = Tag.Type.values()[nmsChildTag.getId()];
>>>>>>>
NBTBase nmsChildTag = entry.getValue();
NamedBinaryTag.Type type = NamedBinaryTag.Type.values()[nmsChildTag.getId()];
<<<<<<<
private static NamedBinaryTag getNBTFromNMSTagList(NBTTagList nmsListTag)
=======
private static Tag getNBTFromNMSTagList(String name, NBTTagList nmsListTag)
>>>>>>>
private static NamedBinaryTag getNBTFromNMSTagList(String name, NBTTagList nmsListTag)
<<<<<<<
NamedBinaryTag.Type listType = NamedBinaryTag.Type.values()[nmsListTag.tagAt(0).getId()];
NamedBinaryTag listTag = new NamedBinaryTag(nmsListTag.getName(), listType);
=======
Tag.Type listType = Tag.Type.values()[nmsListTag.func_150303_d()];
Tag listTag = new Tag(name, listType);
>>>>>>>
NamedBinaryTag.Type listType = NamedBinaryTag.Type.values()[nmsListTag.func_150303_d()];
NamedBinaryTag listTag = new NamedBinaryTag(name, listType);
<<<<<<<
NBTTagCompound nmsTag = new NBTTagCompound(compoundTag.getName());
NamedBinaryTag[] childTags = (NamedBinaryTag[]) compoundTag.getValue();
for (NamedBinaryTag tag : childTags)
=======
NBTTagCompound nmsTag = new NBTTagCompound();
Tag[] childTags = (Tag[]) compoundTag.getValue();
for (Tag tag : childTags)
>>>>>>>
NBTTagCompound nmsTag = new NBTTagCompound();
NamedBinaryTag[] childTags = (NamedBinaryTag[]) compoundTag.getValue();
for (NamedBinaryTag tag : childTags)
<<<<<<<
NBTTagList nmsTag = new NBTTagList(listTag.getName());
NamedBinaryTag[] childTags = (NamedBinaryTag[]) listTag.getValue();
for (NamedBinaryTag tag : childTags)
=======
NBTTagList nmsTag = new NBTTagList();
Tag[] childTags = (Tag[]) listTag.getValue();
for (Tag tag : childTags)
>>>>>>>
NBTTagList nmsTag = new NBTTagList();
NamedBinaryTag[] childTags = (NamedBinaryTag[]) listTag.getValue();
for (NamedBinaryTag tag : childTags)
<<<<<<<
private static NBTBase createTagNms(NamedBinaryTag.Type type, String name, Object value)
=======
private static NBTBase createTagNms(Tag.Type type, Object value)
>>>>>>>
private static NBTBase createTagNms(NamedBinaryTag.Type type, Object value) |
<<<<<<<
import com.khorn.terraincontrol.configuration.Tag;
import com.khorn.terraincontrol.configuration.WorldSettings;
=======
import com.khorn.terraincontrol.configuration.WorldConfig;
>>>>>>>
import com.khorn.terraincontrol.configuration.WorldSettings; |
<<<<<<<
=======
// Must be simple array for fast access.
// Beware! Some ids may contain null values;
public BiomeConfig[] biomeConfigs;
public int biomesCount; // Overall biome count in this world.
public byte[] ReplaceMatrixBiomes = new byte[256];
>>>>>>>
<<<<<<<
world.setHeightBits(this.worldHeightBits);
}
/**
* Creates an empty WorldConfig with no settings initialized.
* Used to read the WorldConfig from the TC network packet.
* @param world The LocalWorld instance.
*/
public WorldConfig(LocalWorld world)
{
super(world.getName(), null);
this.settingsDir = null;
=======
File biomeFolder = new File(settingsDir, TCDefaultValues.WorldBiomeConfigDirectoryName.stringValue());
if (!biomeFolder.exists())
{
if (!biomeFolder.mkdir())
{
TerrainControl.log(Level.WARNING, "Error creating biome configs directory, working with defaults");
return;
}
}
ArrayList<LocalBiome> localBiomes = new ArrayList<LocalBiome>(world.getDefaultBiomes());
// Add custom biomes to world
for (String biomeName : this.CustomBiomes)
{
if (checkOnly)
localBiomes.add(world.getNullBiome(biomeName));
else
localBiomes.add(world.AddBiome(biomeName, this.CustomBiomeIds.get(biomeName)));
}
// Build biome replace matrix
for (int i = 0; i < this.ReplaceMatrixBiomes.length; i++)
this.ReplaceMatrixBiomes[i] = (byte) i;
this.biomeConfigs = new BiomeConfig[world.getMaxBiomesCount()];
this.biomesCount = 0;
String LoadedBiomeNames = "";
for (LocalBiome localBiome : localBiomes)
{
BiomeConfig config = new BiomeConfig(biomeFolder, localBiome, this);
if (checkOnly)
continue;
if (!config.ReplaceBiomeName.equals(""))
{
this.HaveBiomeReplace = true;
this.ReplaceMatrixBiomes[config.Biome.getId()] = (byte) world.getBiomeIdByName(config.ReplaceBiomeName);
}
if (this.NormalBiomes.contains(config.name))
this.normalBiomesRarity += config.BiomeRarity;
if (this.IceBiomes.contains(config.name))
this.iceBiomesRarity += config.BiomeRarity;
if (!this.BiomeConfigsHaveReplacement)
this.BiomeConfigsHaveReplacement = config.ReplaceCount > 0;
if (this.maxSmoothRadius < config.SmoothRadius)
this.maxSmoothRadius = config.SmoothRadius;
if (biomesCount != 0)
LoadedBiomeNames += ", ";
LoadedBiomeNames += localBiome.getName();
// Add biome to the biome array
if (this.biomeConfigs[localBiome.getId()] == null)
{
// Only if it won't overwrite another biome in the array
biomesCount++;
} else
{
TerrainControl.log(Level.SEVERE, "Duplicate biome id {0} ({1} and {2})!", new Object[] {localBiome.getId(), this.biomeConfigs[localBiome.getId()].name, config.name});
TerrainControl.log(Level.SEVERE, "This may cause serious issues in your world and other worlds on the server.");
TerrainControl.log(Level.INFO, "If you are updating an old pre-Minecraft 1.7 world, please read this wiki page:");
TerrainControl.log(Level.INFO, "https://github.com/Wickth/TerrainControl/wiki/Upgrading-an-old-map-to-Minecraft-1.7");
}
this.biomeConfigs[localBiome.getId()] = config;
if (this.biomeMode == TerrainControl.getBiomeModeManager().FROM_IMAGE)
{
if (this.biomeColorMap == null)
this.biomeColorMap = new HashMap<Integer, Integer>();
try
{
int color = Integer.decode(config.BiomeColor);
if (color <= 0xFFFFFF)
{
Integer previousBiome = this.biomeColorMap.put(color, config.Biome.getId());
if (previousBiome != null)
{
TerrainControl.log(Level.WARNING, "The biome {0} has the same BiomeColor value as the biome {1}.", new Object[] {config.name, this.biomeConfigs[previousBiome].name});
TerrainControl.log(Level.WARNING, "It is unpredictable which biome will spawn when using the color {0}", new Object[] {config.BiomeColor});
}
}
} catch (NumberFormatException ex)
{
TerrainControl.log(Level.WARNING, "Wrong color in " + config.Biome.getName());
}
}
}
TerrainControl.log(Level.INFO, "Loaded {0} biomes", new Object[] {biomesCount});
TerrainControl.log(Level.CONFIG, LoadedBiomeNames);
>>>>>>>
}
/**
* Creates an empty WorldConfig with no settings initialized.
* Used to read the WorldConfig from the TC network packet.
* @param world The LocalWorld instance.
*/
public WorldConfig(LocalWorld world)
{
super(world.getName(), null);
this.settingsDir = null;
<<<<<<<
renameOldSetting("WaterLevel", WorldStandardValues.WaterLevelMax);
renameOldSetting("ModeTerrain", WorldStandardValues.TerrainMode);
renameOldSetting("ModeBiome", WorldStandardValues.BiomeMode);
renameOldSetting("NetherFortressEnabled", WorldStandardValues.NetherFortressesEnabled);
renameOldSetting("PyramidsEnabled", WorldStandardValues.RareBuildingsEnabled);
=======
renameOldSetting("WaterLevel", TCDefaultValues.WaterLevelMax);
renameOldSetting("ModeTerrain", TCDefaultValues.TerrainMode);
renameOldSetting("ModeBiome", TCDefaultValues.BiomeMode);
renameOldSetting("NetherFortressEnabled", TCDefaultValues.NetherFortressesEnabled);
renameOldSetting("PyramidsEnabled", TCDefaultValues.RareBuildingsEnabled);
// WorldHeightBits was split into two different settings
renameOldSetting("WorldHeightBits", TCDefaultValues.WorldHeightScaleBits);
renameOldSetting("WorldHeightBits", TCDefaultValues.WorldHeightCapBits);
>>>>>>>
renameOldSetting("WaterLevel", WorldStandardValues.WaterLevelMax);
renameOldSetting("ModeTerrain", WorldStandardValues.TerrainMode);
renameOldSetting("ModeBiome", WorldStandardValues.BiomeMode);
renameOldSetting("NetherFortressEnabled", WorldStandardValues.NetherFortressesEnabled);
renameOldSetting("PyramidsEnabled", WorldStandardValues.RareBuildingsEnabled);
// WorldHeightBits was split into two different settings
renameOldSetting("WorldHeightBits", WorldStandardValues.WorldHeightScaleBits);
renameOldSetting("WorldHeightBits", WorldStandardValues.WorldHeightCapBits);
<<<<<<<
this.worldHeightBits = readSettings(WorldStandardValues.WorldHeightBits);
this.worldHeightBits = applyBounds(this.worldHeightBits, 5, 8);
this.WorldHeight = 1 << worldHeightBits;
this.waterLevelMax = WorldHeight / 2 - 1;
=======
this.worldHeightScaleBits = readSettings(TCDefaultValues.WorldHeightScaleBits);
this.worldHeightScaleBits = applyBounds(this.worldHeightScaleBits, 5, 8);
this.worldScale = 1 << this.worldHeightScaleBits;
this.worldHeightCapBits = readSettings(TCDefaultValues.WorldHeightCapBits);
this.worldHeightCapBits = applyBounds(this.worldHeightCapBits, this.worldHeightScaleBits, 8);
this.worldHeightCap = 1 << this.worldHeightCapBits;
this.waterLevelMax = worldHeightCap / 2 - 1;
>>>>>>>
this.worldHeightScaleBits = readSettings(WorldStandardValues.WorldHeightScaleBits);
this.worldHeightScaleBits = applyBounds(this.worldHeightScaleBits, 5, 8);
this.worldScale = 1 << this.worldHeightScaleBits;
this.worldHeightCapBits = readSettings(WorldStandardValues.WorldHeightCapBits);
this.worldHeightCapBits = applyBounds(this.worldHeightCapBits, this.worldHeightScaleBits, 8);
this.worldHeightCap = 1 << this.worldHeightCapBits;
this.waterLevelMax = worldHeightCap / 2 - 1;
<<<<<<<
writeComment("How many bits the generator uses for the height, from 5 to 8, inclusive.");
writeComment("This setting allows you to generate terrain above y=128.");
writeComment("Affects the height of the whole world.");
writeComment("7 bits gives 2^7 = 128 blocks and 8 gives 2^8 = 256 blocks.");
writeValue(WorldStandardValues.WorldHeightBits, this.worldHeightBits);
=======
writeComment("Scales the height of the world. Adding 1 to this doubles the");
writeComment("height of the terrain, substracting 1 to this halves the height");
writeComment("of the terrain. Values must be between 5 and 8, inclusive.");
writeValue(TCDefaultValues.WorldHeightScaleBits, this.worldHeightScaleBits);
writeComment("Height cap of the base terrain. Setting this to 7 makes no terrain");
writeComment("generate above y = 2 ^ 7 = 128. Doesn't affect resources (trees, objects, etc.).");
writeComment("Values must be between 5 and 8, inclusive. Values may not be lower");
writeComment("than WorldHeightScaleBits.");
writeValue(TCDefaultValues.WorldHeightCapBits, this.worldHeightCapBits);
>>>>>>>
writeComment("Scales the height of the world. Adding 1 to this doubles the");
writeComment("height of the terrain, substracting 1 to this halves the height");
writeComment("of the terrain. Values must be between 5 and 8, inclusive.");
writeValue(WorldStandardValues.WorldHeightScaleBits, this.worldHeightScaleBits);
writeComment("Height cap of the base terrain. Setting this to 7 makes no terrain");
writeComment("generate above y = 2 ^ 7 = 128. Doesn't affect resources (trees, objects, etc.).");
writeComment("Values must be between 5 and 8, inclusive. Values may not be lower");
writeComment("than WorldHeightScaleBits.");
writeValue(WorldStandardValues.WorldHeightCapBits, this.worldHeightCapBits); |
<<<<<<<
protected final File settingsDir;
private final Comparator<Entry<String,Integer>> CBV = new Comparator<Entry<String, Integer>>() {
@Override
public int compare(Entry<String, Integer> o1, Entry<String, Integer> o2)
{
return o1.getValue().compareTo(o2.getValue());
}
};
public Map<String, Integer> CustomBiomeIds = new HashMap<String, Integer>();
=======
public final File settingsDir;
public ArrayList<String> CustomBiomes = new ArrayList<String>();
public HashMap<String, Integer> CustomBiomeIds = new HashMap<String, Integer>();
>>>>>>>
public final File settingsDir;
private final Comparator<Entry<String,Integer>> CBV = new Comparator<Entry<String, Integer>>() {
@Override
public int compare(Entry<String, Integer> o1, Entry<String, Integer> o2)
{
return o1.getValue().compareTo(o2.getValue());
}
};
public Map<String, Integer> CustomBiomeIds = new HashMap<String, Integer>();
<<<<<<<
this.biomeConfigManager = new BiomeConfigManager(settingsDir, world, this, CustomBiomeIds, checkOnly);
=======
File biomeFolder = new File(settingsDir, TCDefaultValues.WorldBiomeConfigDirectoryName.stringValue());
if (!biomeFolder.exists())
{
if (!biomeFolder.mkdir())
{
TerrainControl.log(Level.WARNING, "Error creating biome configs directory, working with defaults");
return;
}
}
ArrayList<LocalBiome> localBiomes = new ArrayList<LocalBiome>(world.getDefaultBiomes());
// Add custom biomes to world
for (String biomeName : this.CustomBiomes)
{
if (checkOnly)
localBiomes.add(world.getNullBiome(biomeName));
else
localBiomes.add(world.AddBiome(biomeName, this.CustomBiomeIds.get(biomeName)));
}
// Build biome replace matrix
for (int i = 0; i < this.ReplaceMatrixBiomes.length; i++)
this.ReplaceMatrixBiomes[i] = (byte) i;
this.biomeConfigs = new BiomeConfig[world.getMaxBiomesCount()];
this.biomesCount = 0;
String LoadedBiomeNames = "";
for (LocalBiome localBiome : localBiomes)
{
BiomeConfig config = new BiomeConfig(biomeFolder, localBiome, this);
if (checkOnly)
continue;
if (!config.ReplaceBiomeName.equals(""))
{
this.HaveBiomeReplace = true;
this.ReplaceMatrixBiomes[config.Biome.getId()] = (byte) world.getBiomeIdByName(config.ReplaceBiomeName);
}
if (this.NormalBiomes.contains(config.name))
this.normalBiomesRarity += config.BiomeRarity;
if (this.IceBiomes.contains(config.name))
this.iceBiomesRarity += config.BiomeRarity;
if (!this.BiomeConfigsHaveReplacement)
this.BiomeConfigsHaveReplacement = config.ReplaceCount > 0;
if (this.maxSmoothRadius < config.SmoothRadius)
this.maxSmoothRadius = config.SmoothRadius;
if (biomesCount != 0)
LoadedBiomeNames += ", ";
LoadedBiomeNames += localBiome.getName();
// Add biome to the biome array
if (this.biomeConfigs[localBiome.getId()] == null)
{
// Only if it won't overwrite another biome in the array
biomesCount++;
} else
{
TerrainControl.log(Level.WARNING, "Duplicate biome id {0} ({1} and {2})!", new Object[]{localBiome.getId(), this.biomeConfigs[localBiome.getId()].name, config.name});
}
this.biomeConfigs[localBiome.getId()] = config;
if (this.biomeMode == TerrainControl.getBiomeModeManager().FROM_IMAGE)
{
if (this.biomeColorMap == null)
this.biomeColorMap = new HashMap<Integer, Integer>();
try
{
int color = Integer.decode(config.BiomeColor);
if (color <= 0xFFFFFF)
this.biomeColorMap.put(color, config.Biome.getId());
} catch (NumberFormatException ex)
{
TerrainControl.log(Level.WARNING, "Wrong color in " + config.Biome.getName());
}
}
}
TerrainControl.log(Level.INFO, "Loaded {0} biomes", new Object[]{biomesCount});
TerrainControl.logIfLevel(Level.ALL, Level.CONFIG, LoadedBiomeNames);
>>>>>>>
this.biomeConfigManager = new BiomeConfigManager(settingsDir, world, this, CustomBiomeIds, checkOnly); |
<<<<<<<
=======
if (biome.isCustom() && !biome.isVirtual())
biome.setEffects(this);
>>>>>>> |
<<<<<<<
import com.khorn.terraincontrol.configuration.BiomeGroupManager;
=======
import com.khorn.terraincontrol.configuration.ConfigProvider;
>>>>>>>
import com.khorn.terraincontrol.configuration.BiomeGroupManager;
import com.khorn.terraincontrol.configuration.ConfigProvider; |
<<<<<<<
lr.setMessage(LogManager.formatter.format(lr));
lr.setParameters(new Object[]
{
param
});
if (logger == null)
{
logger = LogManager.getLogger();
}
=======
lr.setMessage(TCLogManager.formatter.format(lr));
lr.setParameters(new Object[]{ param });
if (logger == null) logger = TCLogManager.getLogger();
>>>>>>>
lr.setMessage(LogManager.formatter.format(lr));
lr.setParameters(new Object[]{ param });
if (logger == null) logger = LogManager.getLogger();
<<<<<<<
lr.setMessage(LogManager.formatter.format(lr));
=======
>>>>>>>
<<<<<<<
if (logger == null)
{
logger = LogManager.getLogger();
}
=======
lr.setMessage(TCLogManager.formatter.format(lr));
if (logger == null) logger = TCLogManager.getLogger();
>>>>>>>
lr.setMessage(LogManager.formatter.format(lr));
if (logger == null) logger = LogManager.getLogger(); |
<<<<<<<
=======
private Logger logger;
>>>>>>>
private Logger logger;
<<<<<<<
String formattedMessage = TCLogManager.FORMATTER.format(logRecord);
if (level == Level.SEVERE) {
=======
String formattedMessage = TCLogManager.formatter.format(logRecord);
if (level == Level.SEVERE)
{
>>>>>>>
String formattedMessage = TCLogManager.FORMATTER.format(logRecord);
if (level == Level.SEVERE)
{ |
<<<<<<<
import com.khorn.terraincontrol.util.NamedBinaryTag;
=======
import com.khorn.terraincontrol.configuration.Tag;
import net.minecraft.server.v1_7_R1.*;
>>>>>>>
import com.khorn.terraincontrol.util.NamedBinaryTag;
import net.minecraft.server.v1_7_R1.*;
<<<<<<<
NBTBase nmsChildTag = (NBTBase) nmsChildTags.get(nmsChildTagName);
NamedBinaryTag.Type type = NamedBinaryTag.Type.values()[nmsChildTag.getTypeId()];
=======
NBTBase nmsChildTag = entry.getValue();
Tag.Type type = Tag.Type.values()[nmsChildTag.getTypeId()];
>>>>>>>
NBTBase nmsChildTag = entry.getValue();
NamedBinaryTag.Type type = NamedBinaryTag.Type.values()[nmsChildTag.getTypeId()];
<<<<<<<
private static NamedBinaryTag getNBTFromNMSTagList(NBTTagList nmsListTag)
=======
private static Tag getNBTFromNMSTagList(String name, NBTTagList nmsListTag)
>>>>>>>
private static NamedBinaryTag getNBTFromNMSTagList(String name, NBTTagList nmsListTag)
<<<<<<<
NamedBinaryTag.Type listType = NamedBinaryTag.Type.values()[nmsListTag.get(0).getTypeId()];
NamedBinaryTag listTag = new NamedBinaryTag(nmsListTag.getName(), listType);
=======
Tag.Type listType = Tag.Type.values()[nmsListTag.get(0).getTypeId()];
Tag listTag = new Tag(name, listType);
>>>>>>>
NamedBinaryTag.Type listType = NamedBinaryTag.Type.values()[nmsListTag.get(0).getTypeId()];
NamedBinaryTag listTag = new NamedBinaryTag(name, listType);
<<<<<<<
NBTTagCompound nmsTag = new NBTTagCompound(compoundTag.getName());
NamedBinaryTag[] childTags = (NamedBinaryTag[]) compoundTag.getValue();
for (NamedBinaryTag tag : childTags)
=======
NBTTagCompound nmsTag = new NBTTagCompound();
Tag[] childTags = (Tag[]) compoundTag.getValue();
for (Tag tag : childTags)
>>>>>>>
NBTTagCompound nmsTag = new NBTTagCompound();
NamedBinaryTag[] childTags = (NamedBinaryTag[]) compoundTag.getValue();
for (NamedBinaryTag tag : childTags)
<<<<<<<
NBTTagList nmsTag = new NBTTagList(listTag.getName());
NamedBinaryTag[] childTags = (NamedBinaryTag[]) listTag.getValue();
for (NamedBinaryTag tag : childTags)
=======
NBTTagList nmsTag = new NBTTagList();
Tag[] childTags = (Tag[]) listTag.getValue();
for (Tag tag : childTags)
>>>>>>>
NBTTagList nmsTag = new NBTTagList();
NamedBinaryTag[] childTags = (NamedBinaryTag[]) listTag.getValue();
for (NamedBinaryTag tag : childTags)
<<<<<<<
private static NBTBase createTagNms(NamedBinaryTag.Type type, String name, Object value)
=======
private static NBTBase createTagNms(Tag.Type type, Object value)
>>>>>>>
private static NBTBase createTagNms(NamedBinaryTag.Type type, Object value) |
<<<<<<<
public Tuple2<MutRrbt<E>,MutRrbt<E>> split(int splitIndex) {
if ( (splitIndex < 1) || (splitIndex > size) ) {
throw new IndexOutOfBoundsException(
"Constraint violation failed: 1 <= splitIndex <= size");
=======
public Tuple2<MutableRrbt<E>,MutableRrbt<E>> split(int splitIndex) {
if (splitIndex < 1) {
if (splitIndex == 0) {
return Tuple2.of(emptyMutable(), this);
} else {
throw new IndexOutOfBoundsException(
"Constraint violation failed: 1 <= splitIndex <= size");
}
} else if (splitIndex >= size) {
if (splitIndex == size) {
return Tuple2.of(this, emptyMutable());
} else {
throw new IndexOutOfBoundsException(
"Constraint violation failed: 1 <= splitIndex <= size");
}
>>>>>>>
public Tuple2<MutRrbt<E>,MutRrbt<E>> split(int splitIndex) {
if (splitIndex < 1) {
if (splitIndex == 0) {
return Tuple2.of(emptyMutable(), this);
} else {
throw new IndexOutOfBoundsException(
"Constraint violation failed: 1 <= splitIndex <= size");
}
} else if (splitIndex >= size) {
if (splitIndex == size) {
return Tuple2.of(this, emptyMutable());
} else {
throw new IndexOutOfBoundsException(
"Constraint violation failed: 1 <= splitIndex <= size");
} |
<<<<<<<
@SuppressWarnings("rawtypes") // Need raw types here.
static int hash(@NotNull Iterable is) {
=======
static int hash(Iterable<?> is) {
if (is == null) { throw new IllegalArgumentException("Can't have a null iteratable."); }
>>>>>>>
static int hash(@NotNull Iterable<?> is) {
<<<<<<<
static @NotNull String toString(@NotNull String name, @NotNull Iterable iterable) {
=======
static String toString(String name, Iterable<?> iterable) {
if (name == null) { throw new IllegalArgumentException("Can't have a null name."); }
if (iterable == null) {
throw new IllegalArgumentException("Can't have a null iteratable.");
}
>>>>>>>
static @NotNull String toString(@NotNull String name, @NotNull Iterable<?> iterable) { |
<<<<<<<
=======
import java.io.Serializable;
>>>>>>>
import java.io.Serializable;
<<<<<<<
import org.junit.Test;
import org.organicdesign.fp.FunctionUtils;
import org.organicdesign.fp.tuple.Tuple2;
=======
import org.junit.Test;
import org.organicdesign.fp.FunctionUtils;
import org.organicdesign.fp.TestUtilities;
>>>>>>>
import org.junit.Test;
import org.organicdesign.fp.FunctionUtils;
import org.organicdesign.fp.tuple.Tuple2;
import org.organicdesign.fp.TestUtilities; |
<<<<<<<
int blockSize = (int) aconf.getAsBytes(Property.TABLE_FILE_BLOCK_SIZE);
try (Writer small = new RFile.Writer(new CachableBlockFile.Writer(fs, new Path(smallName), "gz", null, conf, aconf), blockSize);
Writer large = new RFile.Writer(new CachableBlockFile.Writer(fs, new Path(largeName), "gz", null, conf, aconf), blockSize)) {
=======
int blockSize = (int) aconf.getMemoryInBytes(Property.TABLE_FILE_BLOCK_SIZE);
try (
Writer small = new RFile.Writer(
new CachableBlockFile.Writer(fs, new Path(smallName), "gz", null, conf, aconf),
blockSize);
Writer large = new RFile.Writer(
new CachableBlockFile.Writer(fs, new Path(largeName), "gz", null, conf, aconf),
blockSize)) {
>>>>>>>
int blockSize = (int) aconf.getAsBytes(Property.TABLE_FILE_BLOCK_SIZE);
try (
Writer small = new RFile.Writer(
new CachableBlockFile.Writer(fs, new Path(smallName), "gz", null, conf, aconf),
blockSize);
Writer large = new RFile.Writer(
new CachableBlockFile.Writer(fs, new Path(largeName), "gz", null, conf, aconf),
blockSize)) { |
<<<<<<<
import android.provider.Settings;
=======
import android.os.Handler;
import android.os.Looper;
>>>>>>>
import android.os.Handler;
import android.os.Looper;
import android.provider.Settings; |
<<<<<<<
private Boolean create = true;
=======
private String roleArn;
>>>>>>>
private Boolean create = true;
private String roleArn;
<<<<<<<
public Boolean getCreate() {
return create;
}
@DataBoundSetter
public void setCreate(Boolean create) {
this.create = create;
}
@Extension
=======
public String getRoleArn() {
return roleArn;
}
@DataBoundSetter
public void setRoleArn(String roleArn) {
this.roleArn = roleArn;
}
@Extension
>>>>>>>
public Boolean getCreate() {
return create;
}
@DataBoundSetter
public void setCreate(Boolean create) {
this.create = create;
}
public String getRoleArn() {
return roleArn;
}
@DataBoundSetter
public void setRoleArn(String roleArn) {
this.roleArn = roleArn;
}
@Extension
<<<<<<<
final Boolean create = this.step.getCreate();
=======
final String roleArn = this.step.getRoleArn();
>>>>>>>
final String roleArn = this.step.getRoleArn();
final Boolean create = this.step.getCreate();
<<<<<<<
cfnStack.update(Execution.this.readTemplate(file), url, parameters, tags, Execution.this.step.getPollInterval());
} else if (create){
cfnStack.create(Execution.this.readTemplate(file), url, params, tags, timeoutInMinutes, Execution.this.step.getPollInterval());
} else {
Execution.this.listener.getLogger().println("No stack found with the name and skipped creation due to configuration.");
}
=======
cfnStack.update(Execution.this.readTemplate(file), url, parameters, tags, Execution.this.step.getPollInterval(), roleArn);
} else {
cfnStack.create(Execution.this.readTemplate(file), url, params, tags, timeoutInMinutes, Execution.this.step.getPollInterval(), roleArn);
}
>>>>>>>
cfnStack.update(Execution.this.readTemplate(file), url, parameters, tags, Execution.this.step.getPollInterval(), roleArn);
} else if (create){
cfnStack.create(Execution.this.readTemplate(file), url, params, tags, timeoutInMinutes, Execution.this.step.getPollInterval(), roleArn);
} else {
Execution.this.listener.getLogger().println("No stack found with the name and skipped creation due to configuration.");
} |
<<<<<<<
void updateChat(String key) {
Log.d(TAG, "updating chat");
chat.updateChat(toxSingleton.mDbHelper.getMessageList(key));
};
=======
>>>>>>>
void updateChat(String key) {
Log.d(TAG, "updating chat");
chat.updateChat(toxSingleton.mDbHelper.getMessageList(key));
}; |
<<<<<<<
=======
import java.io.File;
>>>>>>>
import java.io.File; |
<<<<<<<
import android.app.FragmentManager;
=======
import android.app.ActivityManager;
>>>>>>>
import android.app.FragmentManager;
import android.app.ActivityManager;
<<<<<<<
private FriendsListAdapter adapter;
private SlidingPaneLayout pane;
private ChatFragment chat;
=======
/**
* Stores all friend details and used by the adapter for displaying
*/
private String[][] friends;
/**
* Stores the friends list returned by ToxService to feed into String[][] friends
*/
private String friendNames;
>>>>>>>
private FriendsListAdapter adapter;
private SlidingPaneLayout pane;
private ChatFragment chat;
/**
* Stores all friend details and used by the adapter for displaying
*/
private String[][] friends;
/**
* Stores the friends list returned by ToxService to feed into String[][] friends
*/
private String friendNames;
<<<<<<<
=======
if(friendNames != null) {
friends = new String[friendNames.length()][3];
for(int i = 0; i < friendNames.length(); i++) {
//0 - offline, 1 - online, 2 - away, 3 - busy
//Default offline until we check
friends[i][0] = "0";
//Friends name
friends[i][1] = friendNames;
//Default blank status
friends[i][2] = "";
}
} else {
friends = new String[1][3];
friends[0][0] = "0";
friends[0][1] = "You have no friends";
friends[0][2] = "Why not try adding some?";
}
/* Go through status strings and set appropriate resource image */
FriendsList friends_list[] = new FriendsList[friends.length];
for (int i = 0; i < friends.length; i++) {
if (friends[i][0].equals("1"))
friends_list[i] = new FriendsList(R.drawable.ic_status_online,
friends[i][1], friends[i][2]);
else if (friends[i][0].equals("0"))
friends_list[i] = new FriendsList(R.drawable.ic_status_offline,
friends[i][1], friends[i][2]);
else if (friends[i][0].equals("2"))
friends_list[i] = new FriendsList(R.drawable.ic_status_away,
friends[i][1], friends[i][2]);
else if (friends[i][0].equals("3"))
friends_list[i] = new FriendsList(R.drawable.ic_status_busy,
friends[i][1], friends[i][2]);
}
adapter = new FriendsListAdapter(this, R.layout.main_list_item,
friends_list);
>>>>>>>
if(friendNames != null) {
friends = new String[friendNames.length()][3];
for(int i = 0; i < friendNames.length(); i++) {
//0 - offline, 1 - online, 2 - away, 3 - busy
//Default offline until we check
friends[i][0] = "0";
//Friends name
friends[i][1] = friendNames;
//Default blank status
friends[i][2] = "";
}
} else {
friends = new String[1][3];
friends[0][0] = "0";
friends[0][1] = "You have no friends";
friends[0][2] = "Why not try adding some?";
}
/* Go through status strings and set appropriate resource image */
FriendsList friends_list[] = new FriendsList[friends.length];
for (int i = 0; i < friends.length; i++) {
if (friends[i][0].equals("1"))
friends_list[i] = new FriendsList(R.drawable.ic_status_online,
friends[i][1], friends[i][2]);
else if (friends[i][0].equals("0"))
friends_list[i] = new FriendsList(R.drawable.ic_status_offline,
friends[i][1], friends[i][2]);
else if (friends[i][0].equals("2"))
friends_list[i] = new FriendsList(R.drawable.ic_status_away,
friends[i][1], friends[i][2]);
else if (friends[i][0].equals("3"))
friends_list[i] = new FriendsList(R.drawable.ic_status_busy,
friends[i][1], friends[i][2]);
}
adapter = new FriendsListAdapter(this, R.layout.main_list_item,
friends_list);
<<<<<<<
=======
friendListView
.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
// .toString() overridden in FriendsList.java to return
// the friend name
String friendName = parent.getItemAtPosition(position)
.toString();
chatIntent.putExtra(EXTRA_MESSAGE, friendName);
if(!friendName.equals("You have no friends"))
startActivity(chatIntent);
}
>>>>>>>
friendListView
.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
// .toString() overridden in FriendsList.java to return
// the friend name
String friendName = parent.getItemAtPosition(position)
.toString();
chatIntent.putExtra(EXTRA_MESSAGE, friendName);
if(!friendName.equals("You have no friends"))
startActivity(chatIntent);
} |
<<<<<<<
private static List<FileRef> getTabletFiles(ClientContext context, KeyExtent ke) throws IOException {
=======
private static List<FileRef> getTabletFiles(ClientContext context, String tableId, KeyExtent ke)
throws IOException {
>>>>>>>
private static List<FileRef> getTabletFiles(ClientContext context, KeyExtent ke)
throws IOException {
<<<<<<<
readers.add(FileOperations.getInstance().newReaderBuilder().forFile(file.path().toString(), ns, ns.getConf())
.withTableConfiguration(aconf.getSystemConfiguration()).build());
=======
readers.add(FileOperations.getInstance().newReaderBuilder()
.forFile(file.path().toString(), ns, ns.getConf())
.withTableConfiguration(aconf.getConfiguration()).build());
>>>>>>>
readers.add(FileOperations.getInstance().newReaderBuilder()
.forFile(file.path().toString(), ns, ns.getConf())
.withTableConfiguration(aconf.getSystemConfiguration()).build());
<<<<<<<
reader = createScanIterator(ke, readers, auths, new byte[] {}, new HashSet<>(), emptyIterinfo, emptySsio, useTableIterators, tconf);
=======
reader = createScanIterator(ke, readers, auths, new byte[] {}, new HashSet<Column>(),
emptyIterinfo, emptySsio, useTableIterators, tconf);
>>>>>>>
reader = createScanIterator(ke, readers, auths, new byte[] {}, new HashSet<>(), emptyIterinfo,
emptySsio, useTableIterators, tconf); |
<<<<<<<
import java.util.ArrayList;
=======
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.SimpleTimeZone;
import java.util.TimeZone;
>>>>>>>
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.SimpleTimeZone;
import java.util.TimeZone;
import java.util.ArrayList; |
<<<<<<<
=======
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
>>>>>>>
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements; |
<<<<<<<
Model model = document.getModel();
if (yaml != null && model != null) {
errors.addAll(validateAgainstSchema(
new ErrorProcessor(yaml, document.getSchema().getRootType().getContent()), document));
errors.addAll(validateModel(model));
=======
if (yaml != null) {
errors.addAll(getSchemaValidator().validate(document));
errors.addAll(validateModel(document.getModel()));
>>>>>>>
Model model = document.getModel();
if (yaml != null && model != null) {
errors.addAll(getSchemaValidator().validate(document));
errors.addAll(validateModel(document.getModel()));
<<<<<<<
errors.addAll(referenceValidator.validate(baseURI, document, model));
=======
errors.addAll(getReferenceValidator().validate(baseURI, document));
>>>>>>>
errors.addAll(getReferenceValidator().validate(baseURI, document, model)); |
<<<<<<<
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.reprezen.swagedit.core.assist.ProposalBuilder;
=======
import com.reprezen.swagedit.core.assist.Proposal;
>>>>>>>
import com.reprezen.swagedit.core.assist.ProposalBuilder;
<<<<<<<
private static final Map<String, List<ProposalBuilder>> values = ImmutableMap.<String, List<ProposalBuilder>> builder()
.put("boolean", ImmutableList.<ProposalBuilder> of()) //
.put("array", ImmutableList.<ProposalBuilder> of()) //
.put("object", ImmutableList.<ProposalBuilder> of()) //
.put("null", ImmutableList.<ProposalBuilder> of()) //
.put("integer",
ImmutableList.of( //
new ProposalBuilder("int32").replacementString("int32").type("string"), //
new ProposalBuilder("int64").replacementString("int64").type("string"))) //
.put("number",
ImmutableList.of( //
new ProposalBuilder("float").replacementString("float").type("string"), //
new ProposalBuilder("double").replacementString("double").type("string"))) //
.put("string",
ImmutableList.of( //
new ProposalBuilder("byte").replacementString("byte").type("string"), //
new ProposalBuilder("binary").replacementString("binary").type("string"), //
new ProposalBuilder("date").replacementString("date").type("string"), //
new ProposalBuilder("date-time").replacementString("date-time").type("string"), //
new ProposalBuilder("password").replacementString("password").type("string"), //
new ProposalBuilder("").replacementString("").type("string")))
.build();
=======
private static final Map<String, List<Proposal>> values = Collections.unmodifiableMap(Stream
.of(//
new SimpleEntry<>("boolean", asList()), //
new SimpleEntry<>("array", asList()), //
new SimpleEntry<>("object", asList()), //
new SimpleEntry<>("null", asList()), //
new SimpleEntry<>("integer",
asList( //
new Proposal("int32", "int32", null, "string"), //
new Proposal("int64", "int64", null, "string"))), //
new SimpleEntry<>("number",
asList( //
new Proposal("float", "float", null, "string"), //
new Proposal("double", "double", null, "string"))), //
new SimpleEntry<>("string",
asList( //
new Proposal("byte", "byte", null, "string"), //
new Proposal("binary", "binary", null, "string"), //
new Proposal("date", "date", null, "string"), //
new Proposal("date-time", "date-time", null, "string"), //
new Proposal("password", "password", null, "string"), //
new Proposal("", "", null, "string")))) //
.collect(Collectors.toMap((e) -> e.getKey(), (e) -> (List<Proposal>) e.getValue())));
>>>>>>>
private static final Map<String, List<ProposalBuilder>> values = Collections.unmodifiableMap(Stream
.of(//
new SimpleEntry<>("boolean", asList()), //
new SimpleEntry<>("array", asList()), //
new SimpleEntry<>("object", asList()), //
new SimpleEntry<>("null", asList()), //
new SimpleEntry<>("integer",
asList( //
new ProposalBuilder("int32").replacementString("int32").type("string"), //
new ProposalBuilder("int64").replacementString("int64").type("string"))), //
new SimpleEntry<>("number",
asList( //
new ProposalBuilder("float").replacementString("float").type("string"), //
new ProposalBuilder("double").replacementString("double").type("string"))), //
new SimpleEntry<>("string",
asList( //
new ProposalBuilder("byte").replacementString("byte").type("string"), //
new ProposalBuilder("binary").replacementString("binary").type("string"), //
new ProposalBuilder("date").replacementString("date").type("string"), //
new ProposalBuilder("date-time").replacementString("date-time").type("string"), //
new ProposalBuilder("password").replacementString("password").type("string"), //
new ProposalBuilder("").replacementString("").type("string"))))
.collect(Collectors.toMap((e) -> e.getKey(), (e) -> (List<ProposalBuilder>) e.getValue())));
<<<<<<<
public Collection<ProposalBuilder> getProposals(TypeDefinition type, AbstractNode node, String prefix) {
List<ProposalBuilder> proposals = Lists.newArrayList();
=======
public Collection<Proposal> getProposals(TypeDefinition type, AbstractNode node, String prefix) {
List<Proposal> proposals = new ArrayList<>();
>>>>>>>
public Collection<ProposalBuilder> getProposals(TypeDefinition type, AbstractNode node, String prefix) {
List<ProposalBuilder> proposals = new ArrayList<>(); |
<<<<<<<
@Override
protected void doSetInput(IEditorInput input) throws CoreException {
super.doSetInput(input);
getDocumentProvider().getDocument(getEditorInput()).addDocumentListener(changeListener);
=======
public ProjectionViewer getProjectionViewer() {
return (ProjectionViewer) getSourceViewer();
>>>>>>>
@Override
protected void doSetInput(IEditorInput input) throws CoreException {
super.doSetInput(input);
getDocumentProvider().getDocument(getEditorInput()).addDocumentListener(changeListener);
}
public ProjectionViewer getProjectionViewer() {
return (ProjectionViewer) getSourceViewer();
<<<<<<<
protected void validateSwagger(IFile file, SwaggerDocument document) {
final List<SwaggerError> errors = validator.validate(document);
=======
protected void checkErrors() {
final IFile file = ((IFileEditorInput) getEditorInput()).getFile();
final IDocument document = getDocumentProvider().getDocument(getEditorInput());
final Set<SwaggerError> errors = validator.validate((SwaggerDocument) document);
>>>>>>>
protected void validateSwagger(IFile file, SwaggerDocument document) {
final Set<SwaggerError> errors = validator.validate(document);
<<<<<<<
@Override
protected void handleEditorInputChanged() {
super.handleEditorInputChanged();
}
=======
>>>>>>> |
<<<<<<<
import com.google.common.collect.Lists;
import com.reprezen.swagedit.core.assist.ProposalBuilder;
=======
import com.reprezen.swagedit.core.assist.Proposal;
>>>>>>>
import com.reprezen.swagedit.core.assist.ProposalBuilder;
<<<<<<<
public Collection<ProposalBuilder> getProposals(TypeDefinition type, AbstractNode node, String prefix) {
return Lists.newArrayList( //
new ProposalBuilder("query").replacementString("query").description(description).type("string"),
new ProposalBuilder("header").replacementString("header").description(description).type("string"),
new ProposalBuilder("path").replacementString("path").description(description).type("string"),
new ProposalBuilder("cookie").replacementString("cookie").description(description).type("string"));
=======
public Collection<Proposal> getProposals(TypeDefinition type, AbstractNode node, String prefix) {
return Arrays.asList( //
new Proposal("query", "query", description, "string"),
new Proposal("header", "header", description, "string"),
new Proposal("path", "path", description, "string"),
new Proposal("cookie", "cookie", description, "string"));
>>>>>>>
public Collection<ProposalBuilder> getProposals(TypeDefinition type, AbstractNode node, String prefix) {
return Arrays.asList( //
new ProposalBuilder("query").replacementString("query").description(description).type("string"),
new ProposalBuilder("header").replacementString("header").description(description).type("string"),
new ProposalBuilder("path").replacementString("path").description(description).type("string"),
new ProposalBuilder("cookie").replacementString("cookie").description(description).type("string")); |
<<<<<<<
final List<ProposalBuilder> proposals = Lists.newArrayList();
=======
final List<Proposal> proposals = new ArrayList<>();
>>>>>>>
final List<ProposalBuilder> proposals = new ArrayList<>(); |
<<<<<<<
import com.google.common.collect.Lists;
import com.reprezen.swagedit.core.assist.ProposalBuilder;
=======
import com.reprezen.swagedit.core.assist.Proposal;
>>>>>>>
import com.reprezen.swagedit.core.assist.ProposalBuilder;
<<<<<<<
public Collection<ProposalBuilder> getProposals(TypeDefinition type, AbstractNode node, String prefix) {
return Lists.newArrayList( //
new ProposalBuilder("x-:").replacementString("x-").type("specificationExtension"));
=======
public Collection<Proposal> getProposals(TypeDefinition type, AbstractNode node, String prefix) {
return Arrays.asList( //
new Proposal("x-:", "x-", null, "specificationExtension"));
>>>>>>>
public Collection<ProposalBuilder> getProposals(TypeDefinition type, AbstractNode node, String prefix) {
return Arrays.asList( //
new ProposalBuilder("x-:").replacementString("x-").type("specificationExtension")); |
<<<<<<<
private final PredefinedShelfUtils predefinedShelfUtils;
=======
private final PredefinedShelfService predefinedShelfService;
>>>>>>>
private final PredefinedShelfService predefinedShelfService;
<<<<<<<
BookGrid(PredefinedShelfUtils predefinedShelfUtils, CustomShelfService customShelfService, BookService bookService) {
=======
BookGrid(CustomShelfService customShelfService,
PredefinedShelfService predefinedShelfService) {
>>>>>>>
BookGrid(CustomShelfService customShelfService,
PredefinedShelfService predefinedShelfService, BookService bookService) {
<<<<<<<
this.bookService = bookService;
=======
this.predefinedShelfService = predefinedShelfService;
>>>>>>>
this.bookService = bookService;
this.predefinedShelfService = predefinedShelfService;
<<<<<<<
private Shelf findShelf(String chosenShelf) {
if (isAllBooksShelf(chosenShelf)) { return null; }
=======
private Set<Book> getBooks(String chosenShelf) {
if (isAllBooksShelf(chosenShelf)) {
return predefinedShelfService.getBooksInAllPredefinedShelves();
}
>>>>>>>
private Shelf findShelf(String chosenShelf) {
if (isAllBooksShelf(chosenShelf)) {
return null;
} |
<<<<<<<
import com.karankumar.bookproject.backend.entity.Shelf;
import com.karankumar.bookproject.backend.service.BookService;
import com.karankumar.bookproject.backend.utils.CustomShelfUtils;
import com.karankumar.bookproject.backend.utils.PredefinedShelfUtils;
=======
import com.karankumar.bookproject.backend.util.CustomShelfUtils;
import com.karankumar.bookproject.backend.util.PredefinedShelfUtils;
>>>>>>>
import com.karankumar.bookproject.backend.entity.Shelf;
import com.karankumar.bookproject.backend.service.BookService;
import com.karankumar.bookproject.backend.util.CustomShelfUtils;
import com.karankumar.bookproject.backend.util.PredefinedShelfUtils;
<<<<<<<
=======
private List<Book> filterShelf(Set<Book> books, BookFilters bookFilters) {
return books.stream()
.filter(bookFilters::applyFilter)
.collect(Collectors.toList());
}
>>>>>>> |
<<<<<<<
import lombok.extern.java.Log;
=======
import javax.annotation.PostConstruct;
import java.time.LocalDate;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
import java.util.logging.Level;
import java.util.stream.Collectors;
import java.util.stream.Stream;
>>>>>>>
import lombok.extern.java.Log;
import javax.annotation.PostConstruct;
import java.time.LocalDate;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
import java.util.logging.Level;
import java.util.stream.Collectors;
import java.util.stream.Stream;
<<<<<<<
// return shelfRepository.findPredefinedShelfByShelfName(shelfName);
=======
>>>>>>>
<<<<<<<
"Harry Potter and the Deathly Hallows"
)
.map(title -> {
int min = 300;
int max = 1000;
int range = (max - min) + 1;
int pages = (int) (Math.random() * range);
int series = (int) (1 + Math.random() * 10);
Author author = authors.get(random.nextInt(authors.size()));
Book book = new Book(title, author);
Genre genre = Genre.values()[random.nextInt(Genre.values().length)];
List<String> recommendedBy = Arrays.asList("John", "Thomas", "Christina", "Luke", "Sally");
String recommender = recommendedBy.get(random.nextInt(recommendedBy.size()));
Tag tag = tags.get(random.nextInt(tags.size()));
book.setTags(new HashSet<>(Collections.singletonList(tag)));
book.setGenre(genre);
book.setSeriesPosition(series);
book.setNumberOfPages(pages);
book.setBookRecommendedBy(recommender);
return book;
}).collect(Collectors.toList())
);
=======
"Harry Potter and the Deathly Hallows")
.map(title -> {
int min = 300;
int max = 1000;
int pages = (threadLocalRandom.nextInt(min, max + 1));
int series = (threadLocalRandom.nextInt(1, 10 + 1));
Author author = authors.get(threadLocalRandom.nextInt(authors.size()));
Book book = new Book(title, author);
Genre genre = Genre.values()[threadLocalRandom.nextInt(Genre.values().length)];
List<String> recommendedBy =
Arrays.asList("John", "Thomas", "Christina", "Luke", "Sally");
String recommender = recommendedBy.get(threadLocalRandom.nextInt(recommendedBy.size()));
book.setGenre(genre);
book.setSeriesPosition(series);
book.setBookReview("Must Read Book. Really Enjoyed it");
book.setNumberOfPages(pages);
book.setBookRecommendedBy(recommender);
return book;
}).collect(Collectors.toList()));
>>>>>>>
"Harry Potter and the Deathly Hallows"
)
.map(title -> {
int min = 300;
int max = 1000;
int pages = (threadLocalRandom.nextInt(min, max + 1));
int series = (threadLocalRandom.nextInt(1, 10 + 1));
Author author = authors.get(threadLocalRandom.nextInt(authors.size()));
Book book = new Book(title, author);
Genre genre = Genre.values()[threadLocalRandom.nextInt(Genre.values().length)];
List<String> recommendedBy =
Arrays.asList("John", "Thomas", "Christina", "Luke", "Sally");
String recommender = recommendedBy.get(threadLocalRandom.nextInt(recommendedBy.size()));
Tag tag = tags.get(random.nextInt(tags.size()));
book.setTags(new HashSet<>(Collections.singletonList(tag)));
book.setGenre(genre);
book.setSeriesPosition(series);
book.setBookReview("Must Read Book. Really Enjoyed it");
book.setNumberOfPages(pages);
book.setBookRecommendedBy(recommender);
return book;
}).collect(Collectors.toList()));
<<<<<<<
.map(b -> {
PredefinedShelf shelf = new PredefinedShelf(b);
shelf.setBooks(new HashSet<>(books));
return shelf;
}).collect(Collectors.toList())
);
}
private void populateTagRepository() {
tagRepository.saveAll(
Stream.of(
"Adventure",
"Interesting",
"Tolkien",
"Pokemon"
).map(Tag::new).collect(Collectors.toList())
);
=======
.map(book -> {
PredefinedShelf shelf = new PredefinedShelf(book);
shelf.setBooks(new HashSet<>(books));
return shelf;
}).collect(Collectors.toList()));
>>>>>>>
.map(book -> {
PredefinedShelf shelf = new PredefinedShelf(book);
shelf.setBooks(new HashSet<>(books));
return shelf;
}).collect(Collectors.toList())
);
}
private void populateTagRepository() {
tagRepository.saveAll(
Stream.of(
"Adventure",
"Interesting",
"Tolkien",
"Pokemon"
).map(Tag::new).collect(Collectors.toList())
);
<<<<<<<
book.setRating(
RatingScale.values()[random.nextInt(RatingScale.values().length)]
);
=======
book.setRating(RatingScale.values()[threadLocalRandom.nextInt(RatingScale.values().length)]);
>>>>>>>
book.setRating(RatingScale.values()[threadLocalRandom.nextInt(RatingScale.values().length)]); |
<<<<<<<
import org.springframework.security.test.context.support.WithMockUser;
=======
import org.springframework.test.annotation.DirtiesContext;
>>>>>>>
import org.springframework.security.test.context.support.WithMockUser;
import org.springframework.test.annotation.DirtiesContext;
<<<<<<<
@WithMockUser(TEST_USER_NAME)
=======
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.AUTO_CONFIGURED)
>>>>>>>
@WithMockUser(TEST_USER_NAME)
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.AUTO_CONFIGURED) |
<<<<<<<
=======
import static com.google.common.base.Charsets.UTF_8;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.UnknownHostException;
>>>>>>>
import static com.google.common.base.Charsets.UTF_8; |
<<<<<<<
/*
* The book project lets a user keep track of different books they would like to read, are currently
* reading, have read or did not finish. Copyright (C) 2020 Karan Kumar This program is free
* software: you can redistribute it and/or modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation, either version 3 of the License, or (at
* your option) any later version. This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received
* a copy of the GNU General Public License along with this program. If not, see
* <https://www.gnu.org/licenses/>.
*/
=======
/*
The book project lets a user keep track of different books they would like to read, are currently
reading, have read or did not finish.
Copyright (C) 2020 Karan Kumar
This program is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program.
If not, see <https://www.gnu.org/licenses/>.
*/
>>>>>>>
/*
The book project lets a user keep track of different books they would like to read, are currently
reading, have read or did not finish.
Copyright (C) 2020 Karan Kumar
This program is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program.
If not, see <https://www.gnu.org/licenses/>.
*/
<<<<<<<
=======
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
import java.util.Set;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static com.karankumar.bookproject.backend.utils.ShelfUtils.ALL_BOOKS_SHELF;
>>>>>>> |
<<<<<<<
toggleBooksGoalInfo(true);
readingGoal.setText(haveRead + howManyReadThisYear + outOf + + targetToRead + getPluralized(" book", targetToRead));
=======
>>>>>>>
readingGoal.setText(haveRead + howManyReadThisYear + outOf + + targetToRead + getPluralized(" book", targetToRead));
<<<<<<<
toggleBooksGoalInfo(false);
readingGoal.setText(haveRead + howManyReadThisYear + outOf + targetToRead + getPluralized(" page", targetToRead));
=======
readingGoal.setText(haveRead + howManyReadThisYear + outOf + targetToRead + " pages");
toggleBooksGoalInfo(false, hasReachedGoal);
>>>>>>>
readingGoal.setText(haveRead + howManyReadThisYear + outOf + targetToRead + getPluralized(" page", targetToRead));
toggleBooksGoalInfo(false, hasReachedGoal);
<<<<<<<
int weekOfYear = getWeekOfYear();
int weeksLeftInYear = weeksLeftInYear(weekOfYear);
double booksStillToReadAWeek = Math.ceil((double) booksStillToRead / weeksLeftInYear);
booksToRead.setText("You need to read " + booksStillToReadAWeek +
getPluralized(" book", (int)booksStillToReadAWeek) + " a week on average to achieve your goal");
=======
>>>>>>> |
<<<<<<<
import com.karankumar.bookproject.backend.service.ReadingGoalService;
import com.karankumar.bookproject.backend.util.DateUtils;
=======
import com.karankumar.bookproject.backend.service.ReadingGoalService;
import com.karankumar.bookproject.backend.utils.PredefinedShelfUtils;
>>>>>>>
import com.karankumar.bookproject.backend.service.ReadingGoalService;
import com.karankumar.bookproject.backend.utils.PredefinedShelfUtils;
<<<<<<<
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
=======
>>>>>>>
<<<<<<<
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
=======
>>>>>>>
<<<<<<<
MockitoAnnotations.initMocks(dateUtils);
goalView = new ReadingGoalView(goalService, predefinedShelfService, dateUtils);
Mockito.when(dateUtils.getWeeksInYear()).thenReturn(52);
=======
this.predefinedShelfUtils = new PredefinedShelfUtils(predefinedShelfService);
goalView = new ReadingGoalView(goalService, predefinedShelfService);
>>>>>>>
this.predefinedShelfUtils = new PredefinedShelfUtils(predefinedShelfService);
goalView = new ReadingGoalView(goalService, predefinedShelfService);
MockitoAnnotations.initMocks(dateUtils);
goalView = new ReadingGoalView(goalService, predefinedShelfService, dateUtils);
Mockito.when(dateUtils.getWeeksInYear()).thenReturn(52); |
<<<<<<<
import com.karankumar.bookproject.backend.util.DateUtils;
=======
import com.karankumar.bookproject.backend.utils.PredefinedShelfUtils;
import com.karankumar.bookproject.backend.utils.StringUtils;
>>>>>>>
import com.karankumar.bookproject.backend.utils.PredefinedShelfUtils;
import com.karankumar.bookproject.backend.utils.StringUtils;
import com.karankumar.bookproject.backend.util.DateUtils;
<<<<<<<
import javax.validation.constraints.NotNull;
import java.time.LocalDate;
=======
>>>>>>>
import javax.validation.constraints.NotNull;
import java.time.LocalDate;
<<<<<<<
public static final String SET_GOAL = "Set goal";
public static final String UPDATE_GOAL = "Update goal";
public static final String TARGET_MET = "Congratulations for reaching your target!";
private static final String BEHIND = "behind";
private static final String AHEAD_OF = "ahead of";
=======
@VisibleForTesting
static final String SET_GOAL = "Set goal";
@VisibleForTesting
static final String UPDATE_GOAL = "Update goal";
@VisibleForTesting
static final String TARGET_MET = "Congratulations for reaching your target!";
>>>>>>>
@VisibleForTesting
static final String SET_GOAL = "Set goal";
@VisibleForTesting
static final String UPDATE_GOAL = "Update goal";
@VisibleForTesting
static final String TARGET_MET = "Congratulations for reaching your target!";
<<<<<<<
private static DateUtils dateUtils;
/**
* Displays what the reading goal is and how many books/pages the user has read
*/
H1 readingGoal;
/**
* Displays whether a user has met the goal, is ahead or is behind the goal
*/
=======
@VisibleForTesting
H1 readingGoalSummary;
@VisibleForTesting
>>>>>>>
private static DateUtils dateUtils;
@VisibleForTesting
H1 readingGoalSummary;
@VisibleForTesting
<<<<<<<
int weekOfYear = dateUtils.getWeekOfYear();
int weeksLeftInYear = dateUtils.getWeeksLeftInYear(weekOfYear);
=======
int weekOfYear = CalculateReadingGoal.getWeekOfYear();
int weeksLeftInYear = CalculateReadingGoal.weeksLeftInYear(weekOfYear);
>>>>>>>
int weekOfYear = CalculateReadingGoal.getWeekOfYear();
int weeksLeftInYear = CalculateReadingGoal.weeksLeftInYear(weekOfYear);
<<<<<<<
/**
* @param booksToReadThisYear the number of books to read by the end of the year (the goal)
* @param booksReadThisYear the number of books read so far
* @return the number of books that the user is ahead or behind schedule by
*/
public int howFarAheadOrBehindSchedule(int booksToReadThisYear, int booksReadThisYear) {
int shouldHaveRead = booksToReadFromStartOfYear(booksToReadThisYear) * dateUtils.getWeekOfYear();
return Math.abs(shouldHaveRead - booksReadThisYear);
}
/**
* @param booksToReadThisYear the number of books to read by the end of the year (the goal)
* @return the number of books that should have been read a week (on average) from the start of the year
*/
public static int booksToReadFromStartOfYear(int booksToReadThisYear) {
return ((int) Math.ceil(booksToReadThisYear / dateUtils.getWeeksInYear()));
}
/**
* @param booksToReadThisYear the number of books to read by the end of the year (the goal)
* @return the number of books that the user should have ready by this point in the year in order to be on target
*/
public int shouldHaveRead(int booksToReadThisYear) {
return booksToReadFromStartOfYear(booksToReadThisYear) * dateUtils.getWeekOfYear();
}
/**
* Note that this method assumes that the user is behind or ahead of schedule (and that they haven't met their goal)
* @param booksReadThisYear the number of books read so far
* @param shouldHaveRead the number of books that should have been ready by this point to be on schedule
* @return a String denoting that the user is ahead or behind schedule
*/
public static String behindOrAheadSchedule(int booksReadThisYear, int shouldHaveRead) {
return (booksReadThisYear < shouldHaveRead) ? BEHIND : AHEAD_OF;
}
/**
* Calculates a user's progress towards their reading goal
* @param toRead the number of books to read by the end of the year (the goal)
* @param read the number of books that the user has read so far
* @return a fraction of the number of books to read over the books read. If greater than 1, 1.0 is returned
*/
public static double getProgress(int toRead, int read) {
double progress = (toRead == 0) ? 0 : ((double) read / toRead);
return Math.min(progress, 1.0);
}
=======
>>>>>>> |
<<<<<<<
=======
import lombok.extern.java.Log;
>>>>>>>
import lombok.extern.java.Log;
<<<<<<<
bookGrid.setColumns();
bookGrid.addColumn(this::combineTitleAndSeries) // we want to display the series only if it is bigger than 0
.setHeader("Title").setKey(TITLE_KEY)
.setSortable(true);
bookGrid.addColumns(AUTHOR_KEY, GENRE_KEY);
=======
bookGrid.setColumns(
TITLE_KEY,
AUTHOR_KEY,
GENRE_KEY,
DATE_STARTED_KEY,
DATE_FINISHED_KEY,
RATING_KEY,
PAGES_KEY);
// Sort provided as setColumn provides default sort only for primitive Data types.
sortColumn(AUTHOR_KEY);
}
/**
* Sorts Column by Name of the Author
*
* @param columnName
*/
private void sortColumn(final String columnName) {
switch (columnName) {
case AUTHOR_KEY:
Column<Book> authorNameColumn = bookGrid.getColumnByKey(columnName);
if (Objects.nonNull(authorNameColumn)) {
authorNameColumn.setComparator(
(author, otherAuthor) ->
author
.getAuthor()
.toString()
.compareToIgnoreCase(otherAuthor.getAuthor().toString()));
} else {
LOGGER.log(Level.SEVERE, "Column AuthorName cannot be Loaded");
}
break;
// Future implementation of comparator when required
default:
break;
}
bookGrid.setColumns(TITLE_KEY, AUTHOR_KEY, GENRE_KEY);
>>>>>>>
bookGrid.setColumns(
TITLE_KEY,
AUTHOR_KEY,
GENRE_KEY,
DATE_STARTED_KEY,
DATE_FINISHED_KEY,
RATING_KEY,
PAGES_KEY);
// Sort provided as setColumn provides default sort only for primitive Data types.
sortColumn(AUTHOR_KEY);
}
/**
* Sorts Column by Name of the Author
*
* @param columnName
*/
private void sortColumn(final String columnName) {
switch (columnName) {
case AUTHOR_KEY:
Column<Book> authorNameColumn = bookGrid.getColumnByKey(columnName);
if (Objects.nonNull(authorNameColumn)) {
authorNameColumn.setComparator(
(author, otherAuthor) ->
author
.getAuthor()
.toString()
.compareToIgnoreCase(otherAuthor.getAuthor().toString()));
} else {
LOGGER.log(Level.SEVERE, "Column AuthorName cannot be Loaded");
}
break;
// Future implementation of comparator when required
default:
break;
}
bookGrid.setColumns();
bookGrid.addColumn(this::combineTitleAndSeries) // we want to display the series only if it is bigger than 0
.setHeader("Title").setKey(TITLE_KEY)
.setSortable(true);
bookGrid.setColumns(AUTHOR_KEY, GENRE_KEY); |
<<<<<<<
private static int pageCount;
private static int pagesRead;
=======
private static int numberOfPages;
>>>>>>>
private static int pagesRead;
private static int numberOfPages;
<<<<<<<
pageCount = generateRandomPageCount();
pagesRead = generateRandomPageCount();
=======
numberOfPages = generateRandomNumberOfPages();
>>>>>>>
pagesRead = generateRandomPageCount();
numberOfPages = generateRandomNumberOfPages();
<<<<<<<
book.setNumberOfPages(pageCount);
book.setPagesRead(pagesRead);
=======
book.setNumberOfPages(numberOfPages);
>>>>>>>
book.setNumberOfPages(numberOfPages);
<<<<<<<
Assertions.assertEquals(pageCount, bookForm.pageCount.getValue());
Assertions.assertEquals(pagesRead, bookForm.pagesRead.getValue());
=======
Assertions.assertEquals(numberOfPages, bookForm.numberOfPages.getValue());
>>>>>>>
Assertions.assertEquals(pagesRead, bookForm.pagesRead.getValue());
Assertions.assertEquals(numberOfPages, bookForm.numberOfPages.getValue());
<<<<<<<
Assertions.assertEquals(pageCount, savedOrDeletedBook.getNumberOfPages());
Assertions.assertEquals(pagesRead, savedOrDeletedBook.getPagesRead());
=======
Assertions.assertEquals(numberOfPages, savedOrDeletedBook.getNumberOfPages());
>>>>>>>
Assertions.assertEquals(pagesRead, savedOrDeletedBook.getPagesRead());
Assertions.assertEquals(numberOfPages, savedOrDeletedBook.getNumberOfPages());
<<<<<<<
bookForm.pageCount.setValue(pageCount);
bookForm.pagesRead.setValue(pagesRead);
=======
bookForm.numberOfPages.setValue(numberOfPages);
>>>>>>>
bookForm.pagesRead.setValue(pagesRead);
bookForm.numberOfPages.setValue(numberOfPages);
<<<<<<<
Assumptions.assumeFalse(bookForm.pageCount.isEmpty(), "Page count not populated");
Assumptions.assumeFalse(bookForm.pagesRead.isEmpty(), "Pages read not populated");
=======
Assumptions.assumeFalse(bookForm.numberOfPages.isEmpty(), "Number of pages not populated");
>>>>>>>
Assumptions.assumeFalse(bookForm.pagesRead.isEmpty(), "Pages read not populated");
Assumptions.assumeFalse(bookForm.numberOfPages.isEmpty(), "Number of pages not populated");
<<<<<<<
Assertions.assertTrue(bookForm.pageCount.isEmpty(), "Page count not cleared");
Assertions.assertTrue(bookForm.pagesRead.isEmpty(), "Pages read not cleared");
=======
Assertions.assertTrue(bookForm.numberOfPages.isEmpty(), "Number of pages not cleared");
>>>>>>>
Assertions.assertTrue(bookForm.pagesRead.isEmpty(), "Pages read not cleared");
Assertions.assertTrue(bookForm.numberOfPages.isEmpty(), "Number of pages not cleared"); |
<<<<<<<
=======
import lombok.extern.java.Log;
import java.time.format.DateTimeFormatter;
import java.time.format.FormatStyle;
import java.util.Comparator;
>>>>>>>
import lombok.extern.java.Log;
import java.time.format.DateTimeFormatter;
import java.time.format.FormatStyle;
import java.util.Comparator;
<<<<<<<
bookGrid.setColumns(
TITLE_KEY,
AUTHOR_KEY,
GENRE_KEY,
DATE_STARTED_KEY,
DATE_FINISHED_KEY,
RATING_KEY,
PAGES_KEY);
// Sort provided as setColumn provides default sort only for primitive Data types.
sortColumn(AUTHOR_KEY);
}
/**
* Sorts Column by Name of the Author
*
* @param columnName
*/
private void sortColumn(final String columnName) {
switch (columnName) {
case AUTHOR_KEY:
Column<Book> authorNameColumn = bookGrid.getColumnByKey(columnName);
if (Objects.nonNull(authorNameColumn)) {
authorNameColumn.setComparator(
(author, otherAuthor) ->
author
.getAuthor()
.toString()
.compareToIgnoreCase(otherAuthor.getAuthor().toString()));
} else {
LOGGER.log(Level.SEVERE, "Column AuthorName cannot be Loaded");
}
break;
// Future implementation of comparator when required
default:
break;
}
=======
bookGrid.setColumns(TITLE_KEY, AUTHOR_KEY, GENRE_KEY);
bookGrid.addColumn(new LocalDateRenderer<>(
Book::getDateStartedReading, DateTimeFormatter.ofLocalizedDate(FormatStyle.MEDIUM)))
.setHeader("Date started reading")
.setComparator(Comparator.comparing(Book::getDateStartedReading))
.setKey(DATE_STARTED_KEY);
bookGrid.addColumn(new LocalDateRenderer<>(
Book::getDateFinishedReading, DateTimeFormatter.ofLocalizedDate(FormatStyle.MEDIUM)))
.setHeader("Date finished reading")
.setComparator(Comparator.comparing(Book::getDateStartedReading))
.setSortable(true)
.setKey(DATE_FINISHED_KEY);
bookGrid.addColumn(RATING_KEY);
bookGrid.addColumn(PAGES_KEY);
>>>>>>>
bookGrid.setColumns(
TITLE_KEY,
AUTHOR_KEY,
GENRE_KEY,
DATE_STARTED_KEY,
DATE_FINISHED_KEY,
RATING_KEY,
PAGES_KEY);
// Sort provided as setColumn provides default sort only for primitive Data types.
sortColumn(AUTHOR_KEY);
}
/**
* Sorts Column by Name of the Author
*
* @param columnName
*/
private void sortColumn(final String columnName) {
switch (columnName) {
case AUTHOR_KEY:
Column<Book> authorNameColumn = bookGrid.getColumnByKey(columnName);
if (Objects.nonNull(authorNameColumn)) {
authorNameColumn.setComparator(
(author, otherAuthor) ->
author
.getAuthor()
.toString()
.compareToIgnoreCase(otherAuthor.getAuthor().toString()));
} else {
LOGGER.log(Level.SEVERE, "Column AuthorName cannot be Loaded");
}
break;
// Future implementation of comparator when required
default:
break;
}
bookGrid.setColumns(TITLE_KEY, AUTHOR_KEY, GENRE_KEY);
bookGrid.addColumn(new LocalDateRenderer<>(
Book::getDateStartedReading, DateTimeFormatter.ofLocalizedDate(FormatStyle.MEDIUM)))
.setHeader("Date started reading")
.setComparator(Comparator.comparing(Book::getDateStartedReading))
.setKey(DATE_STARTED_KEY);
bookGrid.addColumn(new LocalDateRenderer<>(
Book::getDateFinishedReading, DateTimeFormatter.ofLocalizedDate(FormatStyle.MEDIUM)))
.setHeader("Date finished reading")
.setComparator(Comparator.comparing(Book::getDateStartedReading))
.setSortable(true)
.setKey(DATE_FINISHED_KEY);
bookGrid.addColumn(RATING_KEY);
bookGrid.addColumn(PAGES_KEY); |
<<<<<<<
import android.os.Bundle;
=======
import android.os.Build;
>>>>>>>
import android.os.Build;
import android.os.Bundle; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.