📄 childfigure.java
字号:
/*******************************************************************************
* $Header: /cvsroot/EOS6/work_dir/niegy/com.primeton.studio.gef.ui/src/com/primeton/studio/gef/ui/figure/ChildFigure.java,v 1.1 2006/11/18 12:13:53 niegy Exp $
* $Revision: 1.1 $
* $Date: 2006/11/18 12:13:53 $
*
*==============================================================================
*
* Copyright (c) 2001-2006 Primeton Technologies, Ltd.
* All rights reserved.
*
* Created on 2006-11-17
*******************************************************************************/
package com.primeton.studio.gef.ui.figure;
import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.LineBorder;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.swt.graphics.Color;
/**
* TODO 此处填写 class 信息
*
* @author niegy (mailto:niegy@primeton.com)
*/
/*
* 修改历史
* $Log: ChildFigure.java,v $
* Revision 1.1 2006/11/18 12:13:53 niegy
* 增加容器模型
*
*/
public class ChildFigure extends Figure {
public static Color color = new Color(null, 230, 230, 230);
private String text;
private Label label;
public ChildFigure() {
this.label = new Label();
this.add(label);
setOpaque(true);
setBorder(new LineBorder(1));
setBackgroundColor(color);
}
public String getText() {
return this.label.getText();
}
public Rectangle getTextBounds() {
return this.label.getTextBounds();
}
public void setText(String name) {
this.text = name;
this.label.setText(name);
this.repaint();
}
public void setBounds(Rectangle rect) {
super.setBounds(rect);
this.label.setBounds(rect);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -