use of com.dsoft.pb.idef.elements.Status in project ramus by Vitaliy-Yakovchuk.
the class IDLImporter method addBox.
private void addBox() {
Function function = getFunction(box.reference);
int i = box.name.indexOf('}');
box.function = function;
function.setName(box.name.substring(i + 1));
StringTokenizer st = new StringTokenizer(box.name.substring(1, i), " ");
if (st.hasMoreTokens())
st.nextElement();
if (st.hasMoreTokens()) {
try {
int font = Integer.parseInt(st.nextToken());
function.setFont(uniqueFonts.get(font));
} catch (Exception e) {
}
}
if (st.hasMoreTokens())
st.nextElement();
Color bColor = null;
Color fColor = null;
if (st.hasMoreTokens()) {
int tmp = Integer.parseInt(st.nextToken());
if (tmp < COLORS.length) {
fColor = COLORS[tmp];
}
tmp = Integer.parseInt(st.nextToken());
if (tmp < COLORS.length) {
bColor = COLORS[tmp];
}
}
if (bColor != null)
function.setBackground(bColor);
if (fColor != null)
function.setForeground(fColor);
StringTokenizer tokenizer = new StringTokenizer(box.coordinates, " ()");
FloatPoint p1 = toPoint(tokenizer.nextToken());
FloatPoint p2 = toPoint(tokenizer.nextToken());
FRectangle rectangle = new FRectangle(p1.getX(), p2.getY(), p2.getX() - p1.getX(), p1.getY() - p2.getY());
function.setBounds(rectangle);
Status status = new Status(Status.WORKING, "");
function.setStatus(status);
}
Aggregations