-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathZoomBox.java
55 lines (50 loc) · 1.39 KB
/
ZoomBox.java
1
import java.awt.*;import java.awt.image.*;import java.applet.*;import java.util.*;public class ZoomBox extends Control{ private static Color lighterGray = new Color(239,239,239); public ZoomBox(NewWindow win) { theWindow = win; local = false; xPos = theWindow.width - 20; yPos = 4; width = 11; height = 11; value = 0; visible = true; hiliteState = 255; } public void Draw() { xPos = theWindow.width - 20; if (hiliteState == 255) { theWindow.graphicsPortGC.setColor(lighterGray); theWindow.graphicsPortGC.fillRect(xPos-1,4,13,11); if (value == 0) theWindow.graphicsPortGC.drawImage(theWindow.theDesktop.zoomImage,xPos,yPos,null); else theWindow.graphicsPortGC.drawImage(theWindow.theDesktop.clickedImage,xPos,yPos,null); } } public void SetControlValue(int theValue) { Graphics g; value = theValue; Draw(); g = theWindow.theDesktop.getGraphics(); if (value == 0) { theWindow.theDesktop.offScreenImageGC.drawImage(theWindow.theDesktop.zoomImage,xPos+theWindow.xPos,yPos+theWindow.yPos,null); g.drawImage(theWindow.theDesktop.zoomImage,xPos+theWindow.xPos,yPos+theWindow.yPos,null); } else { theWindow.theDesktop.offScreenImageGC.drawImage(theWindow.theDesktop.clickedImage,xPos+theWindow.xPos,yPos+theWindow.yPos,null); g.drawImage(theWindow.theDesktop.clickedImage,xPos+theWindow.xPos,yPos+theWindow.yPos,null); } }}