📄 win32rubberband.java
字号:
/*
* Created on Aug 31, 2004
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package org.flexdock.docking.drag.outline.win32;
import java.awt.Graphics;
import java.awt.Rectangle;
import org.flexdock.docking.drag.effects.RubberBand;
import org.flexdock.util.ResourceManager;
/**
* @author Christopher Butler
*
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
public class Win32RubberBand extends RubberBand {
private static final String NATIVE_RESOURCE = "org/flexdock/docking/drag/outline/win32/RubberBand.dll";
private static final String NATIVE_LIB = "RubberBand";
private static final Win32RubberBand SINGLETON = new Win32RubberBand();
private Rectangle currentRect;
private native void drawRectangle(int x, int y, int width, int height);
private native void clearRectangle(int x, int y, int width, int height);
private native void cleanup();
static {
ResourceManager.loadLibrary(NATIVE_LIB, NATIVE_RESOURCE);
}
public Win32RubberBand() {
}
public void paint(Graphics g, Rectangle r) {
clear();
currentRect = r;
draw(currentRect, true);
}
public void clear() {
draw(currentRect, false);
currentRect = null;
}
private void draw(Rectangle r, boolean xor) {
if(r==null)
return;
if(xor)
drawRectangle(r.x, r.y, r.width, r.height);
else
clearRectangle(r.x, r.y, r.width, r.height);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -