-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathControl.java
72 lines (62 loc) · 1.31 KB
/
Control.java
1
import java.awt.*;import java.awt.image.*;import java.util.*;abstract class Control extends Object{ protected int xPos,yPos,width,height,value,minValue,maxValue,refCon,hiliteState; protected boolean visible; protected NewWindow theWindow; protected String Title; public Control() { } public void add2Window(Rectangle theRect,String theTitle,boolean isVisible,int theValue,int min,int max,int theRefCon,NewWindow Win) { xPos = theRect.x; yPos = theRect.y; width = theRect.width; height = theRect.height; Title = theTitle; visible = isVisible; value = theValue; minValue = min; maxValue = max; refCon = theRefCon; theWindow = Win; if (theWindow.highlighted) hiliteState = 255; else hiliteState = 0; SetSize(); Draw(); } public void Draw() { int i = 0; NewWindow Temp; boolean okDraw = false; if (theWindow.visible & this.visible) { DrawIt(); theWindow.UpdateGraphicsPort(); } } abstract protected void SetSize(); abstract protected void DrawIt(); abstract public int TrackControl(Point location); public int GetControlValue() { return value; } public void SetControlValue(int theValue) { value = theValue; Draw(); } public void HiliteControl(int theValue) { if (theValue != hiliteState) { hiliteState = theValue; Draw(); } }}