Disabled external gits

This commit is contained in:
2022-04-07 18:43:21 +02:00
parent 182267a8cb
commit 88cb3426ad
1067 changed files with 102374 additions and 6 deletions

View File

@ -0,0 +1,31 @@
package ch.epfl.alpano.gui;
import static ch.epfl.alpano.gui.PredefinedPanoramas.*;
import ch.epfl.alpano.gui.PanoramaParametersBean;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.beans.property.ObjectProperty;
import javafx.stage.Stage;
public final class BeansUse extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception {
PanoramaParametersBean bean =
new PanoramaParametersBean(NIESEN.get());
ObjectProperty<Integer> prop =
bean.ObserverLatitudeProperty();
prop.addListener((o, oV, nV) ->
System.out.printf(" %d -> %d (%s)%n", oV, nV, o));
System.out.println("set to 1");
prop.set(1);
System.out.println("set to 2");
prop.set(2);
Platform.exit();
}
}

View File

@ -0,0 +1,28 @@
package ch.epfl.alpano.gui;
import static org.junit.Assert.*;
import org.junit.Test;
public class FixedPointStringConverterTest {
@Test
public void testFixedPointStringConverter() {
//fail("Not yet implemented");
}
@Test
public void testFromStringString() {
FixedPointStringConverter f = new FixedPointStringConverter(4);
assertEquals(123457, (int)f.fromString("12.3456789"));
FixedPointStringConverter f1 = new FixedPointStringConverter(2);
assertEquals("1011", f1.toString(101100));
}
@Test
public void testToStringInteger() {
FixedPointStringConverter f = new FixedPointStringConverter(1);
assertEquals("67.8", f.toString(678));
}
}

View File

@ -0,0 +1,28 @@
package ch.epfl.alpano.gui;
import static org.junit.Assert.*;
import org.junit.Test;
public class LabeledListStringConverterTest {
@Test
public void testLabeledListStringConverter() {
}
@Test
public void testFromStringString() {
LabeledListStringConverter c = new LabeledListStringConverter("none","2x","4x");
System.out.println(c.fromString("2x"));
//assertEquals(1,c.fromString("2x"));
}
@Test
public void testToStringInteger() {
LabeledListStringConverter c = new LabeledListStringConverter("none","2x","4x");
assertEquals("none",c.toString(0));
}
}

View File

@ -0,0 +1,50 @@
package ch.epfl.alpano.gui;
import java.io.File;
import java.io.IOException;
import java.util.List;
import org.junit.Test;
import ch.epfl.alpano.dem.ContinuousElevationModel;
import ch.epfl.alpano.dem.HgtDiscreteElevationModel;
import ch.epfl.alpano.summit.GazetteerParser;
import ch.epfl.alpano.summit.Summit;
import javafx.scene.Node;
import javafx.scene.text.Text;
public class LabelizerTest {
@Test
public void testLabels() {
try {
List<Summit> listOfSummit = GazetteerParser.readSummitsFrom(new File("HGT/alps.txt"));
HgtDiscreteElevationModel dDem = new HgtDiscreteElevationModel(new File ("HGT/N46E007.hgt"));
ContinuousElevationModel cDem = new ContinuousElevationModel(dDem);
Labelizer l = new Labelizer(cDem, listOfSummit);
List<Node> n= l.labels(PredefinedPanoramas.NIESEN.get().panoramaComputeParameters());
int count =0;
for (Node node : n){
System.out.println(node);
if (node instanceof Text){
++count;
//System.out.println("node");
System.out.println(node.toString());
}
}
System.out.println(count);
} catch (IOException e) {
e.printStackTrace();
}
}
}