Initial sharing of project
This commit is contained in:
31
Display.java
Normal file
31
Display.java
Normal file
@@ -0,0 +1,31 @@
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
|
||||
/**
|
||||
* Beschreiben Sie hier die Klasse Display.
|
||||
*
|
||||
* @author (Ihr Name)
|
||||
* @version (eine Versionsnummer oder ein Datum)
|
||||
*/
|
||||
public class Display extends JPanel
|
||||
{
|
||||
private final Spiel spiel;
|
||||
public Display(Spiel spiel){
|
||||
super();
|
||||
this.spiel = spiel;
|
||||
spiel.add(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paint(Graphics g){
|
||||
Graphics2D g2 = (Graphics2D) g;
|
||||
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
|
||||
g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,RenderingHints.VALUE_INTERPOLATION_BICUBIC);
|
||||
g2.setRenderingHint(RenderingHints.KEY_RENDERING,RenderingHints.VALUE_RENDER_QUALITY);
|
||||
|
||||
spiel.render(g2);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user