Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • master
1 result

Target

Select target project
  • b21228304/graphic-2020-2-0
  • l21221596/graphic-2020
  • c19014407/graphic-2020
  • b23019494/graphic-2020
  • g21212987/graphic-2020
  • couetoux.b/graphic-2020
  • s22029480/graphic-2020
  • c23025119/tp-3-graphique
  • m19023837/graphic-2020-tp-5
  • s22029480/graphic-tp-4
  • m19023837/graphic-2020-tp-7
  • n22021899/tp-3-programmation-conception
  • r24025701/graphic-2020
  • a23022716/exo-2-tp-3-algo
  • m23000189/graphic-2024
  • b21228304/graphic-2020
  • t21234458/graphic-2020
  • v23014723/graphic-2020
  • h22021483/graphic-2020
  • t21234458/graphic-2020-tiakout-khaled
  • m19023837/graphic-2020-chadi
  • b20031964/graphic-2020
22 results
Select Git revision
  • master
1 result
Show changes
Commits on Source (6)
.gradle/
.idea/
idea/
build/
*.iml
*.ipr
*.iws
gradle/wrapper/gradle-wrapper.jar
out/
graphic
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="11" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="delegatedBuild" value="true" />
<option name="testRunner" value="GRADLE" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="11" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
<option name="useAutoImport" value="true" />
</GradleProjectSettings>
</option>
</component>
......
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="MavenRepo" />
<option name="name" value="MavenRepo" />
<option name="url" value="https://repo.maven.apache.org/maven2/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven" />
<option name="name" value="maven" />
<option name="url" value="http://pageperso.lif.univ-mrs.fr/~bertrand.estellon/maven" />
</remote-repository>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="11" project-jdk-type="JavaSDK">
<component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="corretto-16" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
\ No newline at end of file
plugins {
id 'java'
}
plugins {
id 'application'
id "org.openjfx.javafxplugin" version "0.0.8"
id "org.openjfx.javafxplugin" version "0.0.10"
}
javafx {
version = "11"
version = "17"
modules = [ 'javafx.controls', 'javafx.fxml' ]
}
version '1.0-SNAPSHOT'
sourceCompatibility = "11"
targetCompatibility = "11"
repositories {
mavenCentral()
maven {
url 'http://pageperso.lif.univ-mrs.fr/~bertrand.estellon/maven'
}
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile 'org.hamcrest:hamcrest-library:1.3'
implementation 'org.info:painter:1.0'
testImplementation group: 'junit', name: 'junit', version: '4.12'
testImplementation 'org.hamcrest:hamcrest-library:1.3'
}
mainClassName = "shape.App"
......
......@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
......@@ -3,6 +3,7 @@ package serializer;
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.stage.Stage;
public class App extends Application {
......@@ -18,5 +19,13 @@ public class App extends Application {
root.getChildren().add(container);
primaryStage.setScene(new Scene(root));
primaryStage.show();
Button save = new Button("save");
root.getChildren().add(save);
save.setLayoutX(0);
save.setLayoutY(0);
root.setOnKeyPressed(event->container.context.keyPressed(event));
//save.setOnKeyPressed(event->container.context.keyPressed(event));
save.setOnAction(event -> container.write());
}
}
\ No newline at end of file
......@@ -39,7 +39,7 @@ public class DrawerWithSave extends state.Drawer {
File file = fileChooser.showOpenDialog(getScene().getWindow());
if (file == null) return;
try {
super.shapes = ShapeReader.read(file, Collectors.toList());
super.shapes = ShapeReader.read(file);
repaint();
} catch (IOException e) {
Alert alert = new Alert(Alert.AlertType.INFORMATION);
......
......@@ -2,13 +2,19 @@ package serializer;
import shape.Shape;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.List;
import java.util.stream.Collector;
public class ShapeReader {
public static List<Shape> read(File file, Collector<Object,?, List<Object>> toList) throws IOException {
public static List<Shape> read(File file) throws IOException {
BufferedReader bufferedReader = new BufferedReader(new FileReader(file));
/*for(String line : bufferedReader.lines().toList()) {
System.out.println(line);
}*/
return null;
}
}
......@@ -4,9 +4,12 @@ import shape.Shape;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
public class ShapeWriter {
public static void write (File file, List<Shape> shapes) throws IOException {
PrintWriter printWriter = new PrintWriter(file);
printWriter.println("Coucou");
}
}
......@@ -10,7 +10,7 @@ import java.util.List;
public class Drawer extends Canvas {
protected List<Shape> shapes = new ArrayList<>();
DrawerContext context = new DrawerContext(this);
public DrawerContext context = new DrawerContext(this);
public Drawer(int width, int height) {
super(width,height);
......@@ -19,7 +19,7 @@ public class Drawer extends Canvas {
setOnMouseReleased(event->context.mouseReleased(event));
setOnMouseMoved(event->context.mouseMoved(event));
setOnMouseDragged(event->context.mouseMoved(event));
setOnKeyPressed(event -> context.keyPressed(event));
//setOnKeyPressed(event -> context.keyPressed(event));
}
public void repaint(){
......
......@@ -24,7 +24,7 @@ public class DrawerContext {
void mouseMoved(MouseEvent event){}
void keyPressed(KeyEvent event) {
public void keyPressed(KeyEvent event) {
switch (event.getText()) {
case "c":
currentState = new StateCircle0();
......