Beispiel #1
0
 @Override
 public final void destroyBuffers() {
   final Image oldBB = getBackBuffer();
   synchronized (getStateLock()) {
     backBuffer = null;
   }
   if (oldBB != null) {
     oldBB.flush();
   }
 }
 public void onDispose() {
   if (image != null) {
     image.flush();
     image = null;
   }
 }
 public final void paint(final Graphics g) {
   final Rectangle bounds = getBounds();
   if (myAnchor == ToolWindowAnchor.LEFT) {
     if (myDirection == 1) {
       g.setClip(null);
       g.clipRect(myOffset, 0, bounds.width - myOffset, bounds.height);
       UIUtil.drawImage(g, myBottomImage, 0, 0, null);
       g.setClip(null);
       g.clipRect(0, 0, myOffset, bounds.height);
       UIUtil.drawImage(g, myTopImage, myOffset - bounds.width, 0, null);
     } else {
       g.setClip(null);
       g.clipRect(bounds.width - myOffset, 0, myOffset, bounds.height);
       UIUtil.drawImage(g, myBottomImage, 0, 0, null);
       g.setClip(null);
       g.clipRect(0, 0, bounds.width - myOffset, bounds.height);
       UIUtil.drawImage(g, myTopImage, -myOffset, 0, null);
     }
     myTopImage.flush();
   } else if (myAnchor == ToolWindowAnchor.RIGHT) {
     if (myDirection == 1) {
       g.setClip(null);
       g.clipRect(0, 0, bounds.width - myOffset, bounds.height);
       UIUtil.drawImage(g, myBottomImage, 0, 0, null);
       g.setClip(null);
       g.clipRect(bounds.width - myOffset, 0, myOffset, bounds.height);
       UIUtil.drawImage(g, myTopImage, bounds.width - myOffset, 0, null);
     } else {
       g.setClip(null);
       g.clipRect(0, 0, myOffset, bounds.height);
       UIUtil.drawImage(g, myBottomImage, 0, 0, null);
       g.setClip(null);
       g.clipRect(myOffset, 0, bounds.width - myOffset, bounds.height);
       UIUtil.drawImage(g, myTopImage, myOffset, 0, null);
     }
   } else if (myAnchor == ToolWindowAnchor.TOP) {
     if (myDirection == 1) {
       g.setClip(null);
       g.clipRect(0, myOffset, bounds.width, bounds.height - myOffset);
       UIUtil.drawImage(g, myBottomImage, 0, 0, null);
       g.setClip(null);
       g.clipRect(0, 0, bounds.width, myOffset);
       UIUtil.drawImage(g, myTopImage, 0, -bounds.height + myOffset, null);
     } else {
       g.setClip(null);
       g.clipRect(0, bounds.height - myOffset, bounds.width, myOffset);
       UIUtil.drawImage(g, myBottomImage, 0, 0, null);
       g.setClip(null);
       g.clipRect(0, 0, bounds.width, bounds.height - myOffset);
       UIUtil.drawImage(g, myTopImage, 0, -myOffset, null);
     }
   } else if (myAnchor == ToolWindowAnchor.BOTTOM) {
     if (myDirection == 1) {
       g.setClip(null);
       g.clipRect(0, 0, bounds.width, bounds.height - myOffset);
       UIUtil.drawImage(g, myBottomImage, 0, 0, null);
       g.setClip(null);
       g.clipRect(0, bounds.height - myOffset, bounds.width, myOffset);
       UIUtil.drawImage(g, myTopImage, 0, bounds.height - myOffset, null);
     } else {
       g.setClip(null);
       g.clipRect(0, 0, bounds.width, myOffset);
       UIUtil.drawImage(g, myBottomImage, 0, 0, null);
       g.setClip(null);
       g.clipRect(0, myOffset, bounds.width, bounds.height - myOffset);
       UIUtil.drawImage(g, myTopImage, 0, myOffset, null);
     }
   }
 }