Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package de.cryptodev.cryptoos.main;
- import java.awt.BorderLayout;
- import java.awt.Color;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.LayoutManager;
- import java.awt.Rectangle;
- import java.awt.TextArea;
- import java.awt.TextField;
- import java.awt.image.BufferedImage;
- import java.io.File;
- import java.io.IOException;
- import javax.imageio.ImageIO;
- import javax.swing.BorderFactory;
- import javax.swing.JButton;
- import javax.swing.JPanel;
- import javax.swing.JTextArea;
- import javax.swing.JTextField;
- import javax.swing.border.Border;
- public class Editor extends SystemObject {
- private Handler handler;
- public Editor(int x, int y, int width, int height, ID id, Handler handler) {
- super(x, y, height, width, id, handler);
- this.handler = handler;
- setTaskid(handler.getTaskId(this));
- setTitle("(" + getTaskid() + ") Editor");
- }
- public void tick() {
- }
- @SuppressWarnings("deprecation")
- public void render(Graphics g) {
- g.setColor(Color.LIGHT_GRAY);
- g.fillRect((int)x, (int)y, (int)width, (int)height);
- g.setColor(Color.BLACK);
- g.drawRect((int)x, (int)y, 1000, 32);
- g.drawRect((int)x, (int)y, 1000, 600);
- JTextField text = new JTextField();
- text.setLayout(null);
- text.setBounds((int)x, (int)y, (int)width, (int)height);
- text.paint(g);
- g.drawRect((int)x, (int)y, 134, 32);
- g.drawRect((int)x, (int)y, 905, 32);
- g.drawRect((int)x, (int)y, 134, 600);
- g.drawRect((int)x , (int)y + 32, 134, 568);
- BufferedImage img = null;
- try {
- img = ImageIO.read(new File("res/close.png"));
- } catch (IOException e) {
- e.printStackTrace();
- }
- g.drawImage(img, (int) x+ 969, (int) y + 1, 31, 31, null);
- BufferedImage img1 = null;
- try {
- img1 = ImageIO.read(new File("res/maximize.png"));
- } catch (IOException e) {
- e.printStackTrace();
- }
- g.drawImage(img1, (int) x+ 938, (int) y + 1, 31, 31, null);
- BufferedImage img2 = null;
- try {
- img2 = ImageIO.read(new File("res/minimize.png"));
- } catch (IOException e) {
- e.printStackTrace();
- }
- g.drawImage(img2, (int) x+ 906, (int) y + 1, 31, 31, null);
- g.setColor(Color.BLACK);
- Font heading = new Font("arial", 1, 20);
- g.setFont(heading);
- g.drawString("Editor", (int)x + 10, (int)y + 25);
- }
- public Rectangle getBounds() {
- // TODO Auto-generated method stub
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement