?? thermometerattachment.java
字號:
/* * This source code is part of TWaver 1.3.1 * * SERVA Software PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * Copyright 2000-2005 SERVA Software, Inc. All rights reserved. */package demo.network.customui;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics2D;
import twaver.TWaverUtil;
import twaver.network.ui.ElementUI;
import twaver.network.ui.LayoutedIconAttachment;
public class ThermometerAttachment extends LayoutedIconAttachment {
public ThermometerAttachment(String name, ElementUI ui) {
super(name, ui, TWaverUtil.getImageIcon("/demo/resource/customui/thermometer.gif"));
}
public void paint(Graphics2D g2d) {
super.paint(g2d);
g2d.setStroke(new BasicStroke(2));
g2d.setColor(Color.red);
int basePoint = 27;
int topPoint = 5;
Object o = getElementUI().getElement().getClientProperty("temperature");
if (o != null) {
int value = ( (Integer) o).intValue();
g2d.drawLine(getLocation().x + 5,
getLocation().y + basePoint,
getLocation().x + 5,
getLocation().y + value + topPoint);
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -