// Common for vertex and edge
private DynamicComboFieldEditor componentMappingSelector;
private DynamicComboFieldEditor idSelector;
- private DynamicComboFieldEditor labelSelector;
// For vertex import
private DynamicComboFieldEditor xCoordSelector;
private Composite composite;
private Composite childComposite;
protected Map<String, Resource> componentMappings;
- private Collection<String> distinctMappingIvalues;
private Collection<String> distinctMappingIndexColumnValues;
public ComponentMappingPage(CSVImportModel model) {
*
* @return <code>true</code> if it is ok, and <code>false</code> otherwise
*/
+ @SuppressWarnings("unused")
private boolean checkArray(String[][] table) {
if (table == null) {
return false;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
-import java.util.function.Consumer;
import java.util.function.Function;
import org.apache.commons.csv.CSVFormat;
Color originalColor = g2d.getColor();
g2d.transform(transform);
- AffineTransform tr = g2d.getTransform();
-
g2d.setTransform(new AffineTransform());
// do the rendering magic
Color originalColor = g2d.getColor();
g2d.transform(transform);
- AffineTransform tr = g2d.getTransform();
-
g2d.setTransform(new AffineTransform());
// do the rendering magic
private static final Logger LOGGER = LoggerFactory.getLogger(MapNode.class);
- private final double MAP_SCALE = 1;
- private final int MAX_TILE_LEVEL = 19;
+ //private final double MAP_SCALE = 1;
+ //private final int MAX_TILE_LEVEL = 19;
private final int TILE_PIXEL_SIZE = 256;
private final int VIEWBOX_QUIET_TIME = 500;
private static final transient int MAX_DIGITS = 0;
private static final transient double EPSILON = 0.01;
private static final transient double TRIM_THRESHOLD_MAX_VALUE = Math.pow(10, 2);
- private static final transient String[] SI_UNIT_LARGE_PREFIXES = { "m", "km" };
+ //private static final transient String[] SI_UNIT_LARGE_PREFIXES = { "m", "km" };
private static final transient double[] SCALE_VALUES = { 2, 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000, 100000, 200000, 500000, 1000000, 2000000, 50000000 };
package org.simantics.district.network.ui;
import java.awt.geom.Rectangle2D;
-import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Optional;
double y2= coords[1] + halfPadding;
Envelope e = new Envelope(x1, x2, y1, y2);
- List result = qtree.query(e);
+ List<?> result = qtree.query(e);
+ @SuppressWarnings("unchecked")
List<ResourceVertex> vertices = (List<ResourceVertex>) result;
for (ResourceVertex vertx : vertices) {
Rectangle2D existing = new Rectangle2D.Double(vertx.coords[0] - halfPadding, vertx.coords[1] - halfPadding, padding, padding);
public class DistrictDiagramViewer extends DiagramViewer {
- private static final Logger LOGGER = LoggerFactory.getLogger(DistrictDiagramViewer.class);
+ @SuppressWarnings("unused")
+ private static final Logger LOGGER = LoggerFactory.getLogger(DistrictDiagramViewer.class);
@Override
protected void addDiagramParticipants(ICanvasContext ctx) {
}
private boolean zoomToPage() {
- int currentZoomLevel = MapScalingTransform.zoomLevel(util.getTransform());
-
util.setTransform(new AffineTransform(2,0,0,2,270,270));
return true;
}
private Map<NamedResource, Map<String, Resource>> possibleMappings = new HashMap<>();
- private Resource defaultVertexMapping;
-
protected SelectMappingDialog(Shell parentShell, CompletableFuture<Map<NamedResource, Collection<NamedResource>>> elements) {
super(parentShell);
this.elements = elements;
setTitle("Change mappings");
}
- public Resource getDefaultVertexMapping() {
- return defaultVertexMapping;
- }
-
@Override
protected Control createDialogArea(Composite parent) {
composite = (Composite) super.createDialogArea(parent);
import org.simantics.district.network.ModelledCRS;
import org.simantics.maps.MapScalingTransform;
-import org.simantics.scenegraph.utils.GeometryUtils;
public class DistrictNetworkNodeUtils {
package org.simantics.district.network.changeset;
-import java.util.Arrays;
import java.util.Map;
import org.simantics.db.MetadataI;
public class DistrictChangeListener extends GenericChangeListener<DependencyChangesRequest, DependencyChanges> {
- private static final Logger LOGGER = LoggerFactory.getLogger(DistrictChangeListener.class);
+ @SuppressWarnings("unused")
+ private static final Logger LOGGER = LoggerFactory.getLogger(DistrictChangeListener.class);
@Override
public void onEvent(ReadGraph graph, MetadataI metadata, DependencyChanges event) throws DatabaseException {
import org.simantics.db.Resource;
import org.simantics.db.common.procedure.adapter.TransientCacheAsyncListener;
import org.simantics.db.exception.DatabaseException;
-import org.simantics.diagram.profile.StyleBase;
import org.simantics.scenegraph.INode;
import org.simantics.scenegraph.g2d.nodes.SingleElementNode;
import org.simantics.scenegraph.profile.EvaluationContext;
private static final Logger LOGGER = LoggerFactory.getLogger(ThrottledStyleBase.class);
private static final long DEFAULT_INTERVAL = 2000;
- private long lastCalculateTimestamp = 0;
+ //private long lastCalculateTimestamp = 0;
private AtomicLong interval = new AtomicLong(DEFAULT_INTERVAL);
private Listener<Optional<Result>> resultListener;
public Object[] getElements(Object inputElement) {
if (inputElement == null && (!(inputElement instanceof Collection)))
return new Object[0];
- Set<DiagramRegion> set = (Set) inputElement;
+ @SuppressWarnings("unchecked")
+ Set<DiagramRegion> set = (Set<DiagramRegion>) inputElement;
return set.toArray();
}
public class RemoveRegionHandler {
- private static final Logger LOGGER = LoggerFactory.getLogger(RemoveRegionHandler.class);
+ @SuppressWarnings("unused")
+ private static final Logger LOGGER = LoggerFactory.getLogger(RemoveRegionHandler.class);
public static final String COMMAND_ID = "org.simantics.district.region.ui.command.removeRegion";
public static final String LABEL = "Remove Region";
public class DeleteElementSelector {
+ @SuppressWarnings("unused")
private static final Logger LOGGER = LoggerFactory.getLogger(DeleteElementSelector.class);
@Inject
String labelText = "";
String buttonText = "";
int labelColor = -1;
- boolean running = false;
try {
if (server.isRunning()) {
- running = true;
buttonText = "Stop";
labelText = "running";
labelColor = SWT.COLOR_DARK_GREEN;
package org.simantics.district.maps.server;
-import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.DirectoryStream;
import java.nio.file.Files;
import java.nio.file.Path;
-import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
import java.util.ArrayList;
import java.util.HashMap;
public class TileserverMapnik {
private static final Logger LOGGER = LoggerFactory.getLogger(TileserverMapnik.class);
- private static final String[] ADDITIONAL_DEPENDENCIES = new String[] { "tilelive-vector@3.9.4", "tilelive-tmstyle@0.6.0" };
private SystemProcess process;
private Path serverRoot;
// }
- private Path tileserverMapnikRoot() {
+ @SuppressWarnings("unused")
+ private Path tileserverMapnikRoot() {
return serverRoot.resolve("tileserver-mapnik").toAbsolutePath();
}
return serverRoot.resolve("dist/share/icu").toAbsolutePath();
}
- private Path getTessera() {
+ @SuppressWarnings("unused")
+ private Path getTessera() {
return serverRoot.resolve("tileserver-mapnik/bin/tessera.js").toAbsolutePath();
}
return getDataDirectory().resolve(MapsServerPreferences.currentMBTiles());
}
+ @SuppressWarnings("unchecked")
public void checkTm2Styles() {
Path tm2 = getStyleDirectory();
try (DirectoryStream<Path> stream = Files.newDirectoryStream(tm2)) {