home *** CD-ROM | disk | FTP | other *** search
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Dimension;
- import java.awt.Event;
- import java.awt.Frame;
- import java.awt.Graphics;
- import java.awt.Image;
- import java.awt.Rectangle;
- import java.awt.Window;
-
- class OCwin extends Window {
- boolean paintCalled;
- Image off;
- Graphics g_off;
- int barHeight = 20;
- // $FF: renamed from: d java.awt.Dimension
- Dimension field_0;
- int oldx;
- int oldy;
- int iposx;
- int iposy;
- long timestamp;
- long WAIT_TIME = 5L;
- Rectangle bar;
- boolean mouse_in = false;
- boolean inBar = false;
-
- public void reshape(int var1, int var2, int var3, int var4) {
- this.field_0 = new Dimension(var3, var4);
- if (this.paintCalled) {
- this.paintCalled = false;
- this.paintIt();
- }
-
- super.reshape(var1, var2, var3, var4);
- }
-
- public boolean mouseEnter(Event var1, int var2, int var3) {
- this.mouse_in = true;
- return true;
- }
-
- public void initialize() {
- this.bar = new Rectangle(0, 0, this.field_0.width, this.barHeight);
- this.off = ((Component)this).createImage(this.field_0.width, this.barHeight);
- this.g_off = this.off.getGraphics();
- this.g_off.setColor(Color.black);
- this.g_off.fillRect(0, 0, this.field_0.width, this.barHeight);
- }
-
- public boolean mouseExit(Event var1, int var2, int var3) {
- this.mouse_in = false;
- return true;
- }
-
- OCwin(Frame var1) {
- super(var1);
- }
-
- public void paint(Graphics var1) {
- this.paintIt();
- }
-
- public boolean mouseUp(Event var1, int var2, int var3) {
- return true;
- }
-
- public void moveIt(int var1, int var2) {
- ((Component)this).move(this.oldx + var1 - this.iposx, this.oldy + var2 - this.iposy);
- this.oldx += var1 - this.iposx;
- this.oldy += var2 - this.iposy;
- }
-
- public synchronized void paintIt() {
- Graphics var1 = ((Component)this).getGraphics();
- if (!this.paintCalled) {
- this.initialize();
- this.paintCalled = true;
- }
-
- var1.drawImage(this.off, 0, 0, this);
- }
-
- public void resize(Dimension var1) {
- if (this.paintCalled) {
- this.paintCalled = false;
- this.paintIt();
- }
-
- super.resize(var1);
- }
-
- public void resize(int var1, int var2) {
- this.field_0 = new Dimension(var1, var2);
- if (this.paintCalled) {
- this.paintCalled = false;
- this.paintIt();
- }
-
- super.resize(var1, var2);
- }
-
- public boolean mouseDown(Event var1, int var2, int var3) {
- if (var3 < this.barHeight) {
- this.inBar = true;
- }
-
- ((Component)this).requestFocus();
- return true;
- }
-
- public boolean mouseDrag(Event var1, int var2, int var3) {
- if (var1.when > this.timestamp + this.WAIT_TIME && this.inBar) {
- this.moveIt(var2, var3);
- this.timestamp = var1.when;
- }
-
- return true;
- }
-
- public boolean mouseMove(Event var1, int var2, int var3) {
- return true;
- }
- }
-