您的位置:首页 > 其它

GEF 改变选中框的颜色

2014-11-13 23:33 357 查看
GEF 改变选中框的颜色

此方法的父类为moveHandle

public calss aaaMocveHandle extends basdsf

{

@Override

protected void initialize() {

setOpaque(false);

setBorder(new LineBorder(1){

public void paint(IFigure figure, Graphics graphics, Insets insets) {

tempRect.setBounds(getPaintRectangle(figure, insets));

if (getWidth() % 2 == 1) {

tempRect.width--;

tempRect.height--;

}

tempRect.shrink(getWidth() / 2, getWidth() / 2);

graphics.setLineWidth(getWidth());

//选中边框颜色

graphics.setForegroundColor(ColorConstants.blue);

//用椭圆形替代矩形

graphics.drawRectangle(tempRect);

}

});

setCursor(Cursors.SIZEALL);

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: