Commit dd7150b8 authored by Beuster's avatar Beuster
Browse files

Deleted all unnecessary test projects

parent c4fb48fb
Pipeline #11005 passed with stage
in 1 minute and 14 seconds
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-22">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>AngleConverter</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
encoding/<project>=UTF-8
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=22
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=22
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=22
import java.awt.*;
import javax.swing.*;
public class AngleDrawer extends JFrame {
private static final long serialVersionUID = 1L; // Empfohlene serialVersionUID
private final JTextField gradField;
private final DrawPanel drawPanel;
public AngleDrawer() {
// Fenster konfigurieren
setTitle("Grad-Anzeige auf Kreis");
setSize(400, 400);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLayout(null); // Kein Layout-Manager, manuelle Positionierung
// Eingabefeld und Label
JLabel label = new JLabel("Grad:");
label.setBounds(20, 20, 50, 30); // x, y, Breite, Höhe
add(label);
gradField = new JTextField();
gradField.setBounds(70, 20, 100, 30);
add(gradField);
// Button
JButton drawButton = new JButton("Zeichnen");
drawButton.setBounds(180, 20, 100, 30);
add(drawButton);
// Zeichenbereich
drawPanel = new DrawPanel();
drawPanel.setBounds(20, 70, 350, 280); // Position und Größe des Zeichenbereichs
add(drawPanel);
// Button-Action
drawButton.addActionListener(e -> {
try {
double grad = Double.parseDouble(gradField.getText());
drawPanel.setAngle(grad);
} catch (NumberFormatException ex) {
JOptionPane.showMessageDialog(this, "Bitte eine gültige Gradzahl eingeben.");
}
});
}
private static class DrawPanel extends JPanel {
private static final long serialVersionUID = 1L; // Empfohlene serialVersionUID
private double angle = 0; // Winkel in Grad
public void setAngle(double angle) {
this.angle = angle % 360; // Winkel auf Bereich [0, 360) reduzieren
repaint(); // Neuzeichnen des Panels anfordern
}
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
// Panel-Mitte und Radius berechnen
int width = getWidth();
int height = getHeight();
int radius = Math.min(width, height) / 2 - 10;
int centerX = width / 2;
int centerY = height / 2;
// Kreis zeichnen
g.drawOval(centerX - radius, centerY - radius, radius * 2, radius * 2);
// Pfeil berechnen und zeichnen
double radian = Math.toRadians(angle);
int arrowX = centerX + (int) (radius * Math.cos(radian));
int arrowY = centerY - (int) (radius * Math.sin(radian));
g.drawLine(centerX, centerY, arrowX, arrowY);
// Winkel anzeigen
g.drawString("Grad: " + (int) angle, 10, 20);
}
}
public static void main(String[] args) {
// GUI starten
SwingUtilities.invokeLater(() -> {
AngleDrawer frame = new AngleDrawer();
frame.setVisible(true);
});
}
}
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-22">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>TestBHT</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
encoding/<project>=UTF-8
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=22
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=22
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=22
package main;
import java.util.Scanner;
public class JavaMenu
{
public static void main(String[] args)
{
System.out.println("Hallo, bitte gebe deinen Nachnamen und Vornamen ein: ");
String name = System.console().readLine();
System.out.println("Bitte waehle dein Geschlecht:");
System.out.println("1 fuer weiblich");
System.out.println("2 fuer maennlich");
System.out.println("3 fuer divers");
try
{
int var = Integer.parseInt(System.console().readLine());
switch (var)
{
case 1:
System.out.println("Hallo Frau " + name);
break;
case 2:
System.out.println("Hallo Herr " + name);
break;
case 3:
System.out.println("Hallo " + name);
break;
default:
System.out.println("Keine gueltige Auswahl (1, 2, 3) getroffen. Trotzdem hallo " + name);
break;
}
}
catch(NumberFormatException e)
{
System.out.println("Das hat nicht geklappt. Es muss eine Zahl eingegeben werden. Versuche es nochmal.");
e.printStackTrace();
}
}
}
\ No newline at end of file
/**
*
*/
/**
*
*/
module TestBHT {
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>VectorDemo</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment