|
|
|
@ -68,6 +68,7 @@ public class Panel extends JPanel implements Runnable,KeyListener { |
|
|
|
|
int ACTUAL_WINDOW_WIDTH,ACTUAL_WINDOW_HEIGHT; |
|
|
|
|
Point<Integer> vViewSize = new Point<Integer>(1,1); |
|
|
|
|
Point<Integer> vViewPos = new Point<Integer>(1,1); |
|
|
|
|
java.awt.Color borderCol = java.awt.Color.BLACK; |
|
|
|
|
|
|
|
|
|
static Cursor currentCursor = new Cursor(Cursor.DEFAULT_CURSOR); |
|
|
|
|
// Recursive function to return gcd of a and b in single line
|
|
|
|
@ -276,10 +277,15 @@ public class Panel extends JPanel implements Runnable,KeyListener { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void SetBorderColor(Color col){ |
|
|
|
|
borderCol=new java.awt.Color(col.r,col.g,col.b); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void paintComponent(Graphics g) { |
|
|
|
|
// perform draws on pixels
|
|
|
|
|
long startTime = System.currentTimeMillis(); |
|
|
|
|
g.setColor(borderCol); |
|
|
|
|
g.fillRect(0,0,getWidth(),getHeight()); |
|
|
|
|
g.drawImage(imageBuffer,vViewPos.x,vViewPos.y,vViewSize.x+vViewPos.x,vViewSize.y+vViewPos.y,0,0,ACTUAL_WINDOW_WIDTH,ACTUAL_WINDOW_HEIGHT,this); |
|
|
|
|
scaleTime=System.currentTimeMillis()-startTime; |
|
|
|
|