1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.g2d.notification;
15 import java.awt.geom.Point2D;
16 import java.awt.geom.Rectangle2D;
18 import org.simantics.scenegraph.g2d.G2DParentNode;
20 public class PositionedMessage extends AbstractNotification implements INotification {
22 private static final double MARGIN = 10;
26 Font font = new Font("Arial", Font.PLAIN, 14);
28 public PositionedMessage(String message, Point2D canvasPosition) {
29 this.message = message;
30 this.position = canvasPosition;
31 this.bounds.setFrame(position.getX(), position.getY(), 0, 0);
35 public void setBounds(Rectangle2D r) {
40 public void update(G2DParentNode parent) {