NonFlickerPanel.java
资源名称:OA.rar [点击查看]
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:1k
源码类别:
OA系统
开发平台:
Java
- // Decompiled by DJ v2.9.9.60 Copyright 2000 Atanas Neshkov Date: 2002-12-03 18:43:38
- // Home Page : http://members.fortunecity.com/neshkov/dj.html - Check often for new version!
- // Decompiler options: packimports(3)
- // Source File Name: NonFlickerPanel.java
- package cn.com.fcsoft.chart;
- import java.awt.*;
- public class NonFlickerPanel extends Panel
- {
- public void invalidate()
- {
- super.invalidate();
- offscreen = null;
- }
- public NonFlickerPanel()
- {
- }
- public NonFlickerPanel(LayoutManager layoutmanager)
- {
- super(layoutmanager);
- }
- public void paint(Graphics g)
- {
- Dimension dimension = getSize();
- if(offscreen == null)
- {
- dimension.width = Math.max(1, dimension.width);
- dimension.height = Math.max(1, dimension.height);
- offscreen = createImage(dimension.width, dimension.height);
- }
- try
- {
- Graphics g1 = offscreen.getGraphics();
- g1.setClip(0, 0, dimension.width, dimension.height);
- super.paint(g1);
- g.drawImage(offscreen, 0, 0, null);
- g1.dispose();
- }
- catch(NullPointerException _ex) { }
- }
- public void update(Graphics g)
- {
- paint(g);
- }
- private Image offscreen;
- }