Advertisement
Guest User

Die Komplette Klasse

a guest
May 24th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 KB | None | 0 0
  1. package de.cryptodev.cryptoos.main;
  2.  
  3. import java.awt.BorderLayout;
  4. import java.awt.Color;
  5. import java.awt.Font;
  6. import java.awt.Graphics;
  7. import java.awt.LayoutManager;
  8. import java.awt.Rectangle;
  9. import java.awt.TextArea;
  10. import java.awt.TextField;
  11. import java.awt.image.BufferedImage;
  12. import java.io.File;
  13. import java.io.IOException;
  14.  
  15. import javax.imageio.ImageIO;
  16. import javax.swing.BorderFactory;
  17. import javax.swing.JButton;
  18. import javax.swing.JPanel;
  19. import javax.swing.JTextArea;
  20. import javax.swing.JTextField;
  21. import javax.swing.border.Border;
  22.  
  23. public class Editor extends SystemObject {
  24.  
  25. private Handler handler;
  26.  
  27. public Editor(int x, int y, int width, int height, ID id, Handler handler) {
  28. super(x, y, height, width, id, handler);
  29. this.handler = handler;
  30. setTaskid(handler.getTaskId(this));
  31. setTitle("(" + getTaskid() + ") Editor");
  32. }
  33.  
  34.  
  35. public void tick() {
  36.  
  37.  
  38. }
  39.  
  40. @SuppressWarnings("deprecation")
  41. public void render(Graphics g) {
  42.  
  43. g.setColor(Color.LIGHT_GRAY);
  44. g.fillRect((int)x, (int)y, (int)width, (int)height);
  45.  
  46. g.setColor(Color.BLACK);
  47.  
  48. g.drawRect((int)x, (int)y, 1000, 32);
  49. g.drawRect((int)x, (int)y, 1000, 600);
  50.  
  51. JTextField text = new JTextField();
  52.  
  53. text.setLayout(null);
  54.  
  55. text.setBounds((int)x, (int)y, (int)width, (int)height);
  56.  
  57. text.paint(g);
  58.  
  59. g.drawRect((int)x, (int)y, 134, 32);
  60.  
  61. g.drawRect((int)x, (int)y, 905, 32);
  62.  
  63. g.drawRect((int)x, (int)y, 134, 600);
  64.  
  65. g.drawRect((int)x , (int)y + 32, 134, 568);
  66.  
  67. BufferedImage img = null;
  68. try {
  69. img = ImageIO.read(new File("res/close.png"));
  70. } catch (IOException e) {
  71. e.printStackTrace();
  72. }
  73.  
  74. g.drawImage(img, (int) x+ 969, (int) y + 1, 31, 31, null);
  75.  
  76. BufferedImage img1 = null;
  77. try {
  78. img1 = ImageIO.read(new File("res/maximize.png"));
  79. } catch (IOException e) {
  80. e.printStackTrace();
  81. }
  82.  
  83. g.drawImage(img1, (int) x+ 938, (int) y + 1, 31, 31, null);
  84.  
  85. BufferedImage img2 = null;
  86. try {
  87. img2 = ImageIO.read(new File("res/minimize.png"));
  88. } catch (IOException e) {
  89. e.printStackTrace();
  90. }
  91.  
  92. g.drawImage(img2, (int) x+ 906, (int) y + 1, 31, 31, null);
  93.  
  94. g.setColor(Color.BLACK);
  95.  
  96. Font heading = new Font("arial", 1, 20);
  97.  
  98. g.setFont(heading);
  99.  
  100. g.drawString("Editor", (int)x + 10, (int)y + 25);
  101.  
  102. }
  103.  
  104. public Rectangle getBounds() {
  105. // TODO Auto-generated method stub
  106. return null;
  107. }
  108.  
  109. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement