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.tooltip;
14 import java.awt.Color;
15 import java.awt.Frame;
17 import javax.swing.BorderFactory;
18 import javax.swing.BoxLayout;
19 import javax.swing.JLabel;
20 import javax.swing.JPanel;
22 import org.simantics.g2d.element.IElement;
26 * @author Marko Luukkainen <marko.luukkainen@vtt.fi>
29 public class TerminalTooltipProvider extends AWTTooltipProvider {
31 public static TerminalTooltipProvider INSTANCE = new TerminalTooltipProvider();
36 public void constructPopup(Frame frame, IElement element) {
37 frame.setLayout(new BoxLayout(frame, BoxLayout.X_AXIS));
38 JPanel panel = new JPanel();
39 panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
40 Color c = new Color(255, 255, 220);
41 panel.setBackground(c);
42 panel.setBorder(BorderFactory.createLineBorder(Color.black));
43 JLabel label = new JLabel((String)element.getHint(TerminalTooltipParticipant.KEY_TOOLTIP_TEXT));