I thought releasing this paint as I dont use it anymore and if anyone would like to use feel free to
Note: There will be errors IE the start time and skills etc, you can fix those but the paint is full
Features:
-Clean
-Small
-Draggable
-Clickable
-informative
Paint Class
import java.awt.Graphics;import java.awt.Graphics2D;import java.awt.Rectangle;public class jLPaint { private int x; private int y; public Rectangle misc; public Rectangle stats; public Rectangle drag; public jLPaint() { x = 261; y = 343; } public void draw(Graphics g1) { Graphics2D g = (Graphics2D) g1; misc = new Rectangle(x + 3, y + 3, 27, 25); stats = new Rectangle(x + 31, y + 3, 27, 25); drag = new Rectangle(x + 83, y + 41, 83, 8); jLVariables.millis = System.currentTimeMillis() - jLVariables.startTime; jLVariables.hours = jLVariables.millis / (1000 * 60 * 60); jLVariables.millis -= jLVariables.hours * (1000 * 60 * 60); jLVariables.minutes = jLVariables.millis / (1000 * 60); jLVariables.millis -= jLVariables.minutes * (1000 * 60); jLVariables.seconds = jLVariables.millis / 1000; g.setColor(jLVariables.color1); g.fillRect(x, y, 258, 47); g.setColor(jLVariables.color2); g.setStroke(jLVariables.stroke1); g.drawRect(x + 1, y + 1, 255, 44); g.setColor(jLVariables.color3); g.setStroke(jLVariables.stroke1); g.draw(misc); g.setStroke(jLVariables.stroke1); g.draw(stats); g.drawRect(x + 61, y + 3, 193, 25); g.drawRect(x + 3, y + 31, 251, 12); if (jLVariables.showMisc == true) { g.setColor(jLVariables.color4); g.fillRect(x + 4, y + 4, 26, 24); } if (jLVariables.showStats == true) { g.setColor(jLVariables.color4); g.fillRect(x + 32, y + 4, 26, 24); } g.setColor(jLVariables.color4); g.fillRect(x + 62, y + 4, 50, 24); g.drawImage(jLVariables.img1, x + 5, y + 5, null); g.drawImage(jLVariables.img2, x + 34, y + 5, null); g.setColor(jLVariables.color6); g.fillRect(x, y + 30, 258, 8); g.setColor(jLVariables.color6); g.fillRect(x, y, 258, 17); g.setFont(jLVariables.font1); g.setColor(jLVariables.color7); g.drawString("jLobsterPro - JDuke", x + 83, y + 41); g.setFont(jLVariables.font2); g.drawString("3% to ", x + 121, y + 19); if (jLVariables.showMisc == true) { g.setColor(jLVariables.color1); g.fillRect(x, y - 104, 160, 104); g.fillRect(x + 1, y - 103, 157, 101); g.setColor(jLVariables.color2); g.drawRect(x + 1, y - 103, 157, 101); g.setColor(jLVariables.color8); g.fillRect(x, y - 104, 160, 59); g.setColor(jLVariables.color7); g.drawString("Status : " + jLVariables.status, x + 6, y - 71); g.drawString("Anti-Ban : " + jLVariables.antiban, x + 6, y - 58); g.drawString("Run Time : " + jLVariables.hours + ":" + jLVariables.minutes + ":" + jLVariables.seconds, x + 6, y - 45); g.drawString("Lobster caught : ", x + 6, y - 32); g.drawString("Lobster Price : ", x + 6, y - 19); g.drawString("Profit : ", x + 6, y - 6); g.setFont(jLVariables.font3); g.drawString("Miscellaneous :-", x + 5, y - 87); } if (jLVariables.showStats == true) { g.setColor(jLVariables.color1); g.fillRect(x, y - 104, 160, 104); g.fillRect(x + 1, y - 103, 157, 101); g.setColor(jLVariables.color2); g.drawRect(x + 1, y - 103, 157, 101); g.setColor(jLVariables.color8); g.fillRect(x, y - 104, 160, 59); g.setFont(jLVariables.font2); g.setColor(jLVariables.color7); g.drawString("Exp Gained : ", x + 6, y - 71); g.drawString("Current Exp : ", x + 6, y - 58); g.drawString("Exp TNL : ", x + 6, y - 45); g.drawString("Exp/Hour : ", x + 6, y - 32); g.drawString("Start Level : ", x + 6, y - 19); g.drawString("Current Level : ", x + 6, y - 6); g.setFont(jLVariables.font3); g.drawString("Stats :-", x + 5, y - 87); } } public int getX() { return this.x; } public void setX(int x) { this.x = x; } public int getY() { return this.y; } public void setY(int y) { this.y = y; }}
Variables:
public static long startTime = 0; public static long millis = 0; public static long hours = 0; public static long minutes = 0; public static long seconds = 0; public static int draggedFromX = 0; public static int draggedFromY = 0; public static String status = "Idle"; public static String antiban = "Idle"; public static boolean showMisc = false; public static boolean showStats = false; public static boolean canDrag = false; public static Point p; public static final Color color1 = new Color(36, 36, 36); public static final Color color2 = new Color(103, 103, 103); public static final Color color3 = new Color(103, 103, 103, 150); public static final Color color4 = new Color(0, 102, 255); public static final Color color5 = new Color(76, 76, 76, 100); public static final Color color6 = new Color(255, 255, 255, 30); public static final Color color7 = new Color(255, 255, 255); public static final Color color8 = new Color(255, 255, 255, 40); public static final BasicStroke stroke1 = new BasicStroke(1); public static final Font font1 = new Font("Arial", 0, 9); public static final Font font2 = new Font("Arial", 0, 10); public static final Font font3 = new Font("Arial", 0, 12); public static BufferedImage img1; public static BufferedImage img2; public static BufferedImage normal = null; public static BufferedImage clicked = null;
Mouse Code:
@Override public void mousePressed(MouseEvent e) { if (paint.drag.contains(e.getPoint())) { jLVariables.canDrag = true; jLVariables.draggedFromX = e.getX() - paint.getX(); jLVariables.draggedFromY = e.getY() - paint.getY(); } } @Override public void mouseReleased(MouseEvent arg0) { jLVariables.canDrag = false; } @Override public void mouseDragged(MouseEvent e) { if (jLVariables.canDrag) { int newX = 0; int newY = 0; newX = e.getX() - jLVariables.draggedFromX; newY = e.getY() - jLVariables.draggedFromY; paint.setX(newX); paint.setY(newY); // System.out.println("Done!"); } }
Images code
try { final URL cursorURL = new URL( "http://i596.photobucket.com/albums/tt47/QaRTooN_/normal.png"); final URL cursor80URL = new URL( "http://i596.photobucket.com/albums/tt47/QaRTooN_/clicked-1.png"); jLVariables.normal = ImageIO.read(cursorURL); jLVariables.clicked = ImageIO.read(cursor80URL); jLVariables.img1 = ImageIO .read(new URL( "http://i596.photobucket.com/albums/tt47/QaRTooN_/reports-1.png")); jLVariables.img2 = ImageIO .read(new URL( "http://i596.photobucket.com/albums/tt47/QaRTooN_/stats.png")); } catch (MalformedURLException e) { // log("Unable to buffer images"); } catch (IOException e) { // log("Unable to open images."); }
using it
jLPaint paint = new jLPaint();//in the onPaint method putpaint.draw(g/*the graphic parameter*/);
Picture:
You can make any changes you want.
Thanks