1 package org.antlr.works.ate.analysis; 2 3 import org.antlr.xjlib.appkit.frame.XJFrameInterface; 4 import org.antlr.works.tooltip.ToolTipList; 5 import org.antlr.works.tooltip.ToolTipListDelegate; 6 import org.antlr.works.utils.OverlayObject; 7 8 import javax.swing.*; 9 import java.awt.*; 10 40 41 44 45 public class ATEAnalysisColumnOverlay extends OverlayObject implements ToolTipListDelegate { 46 47 public ToolTipList toolTip; 48 public Point location; 49 50 public ATEAnalysisColumnOverlay(XJFrameInterface parentFrame, JComponent parentComponent) { 51 super(parentFrame, parentComponent); 52 } 53 54 public void setLocation(Point location) { 55 this.location = SwingUtilities.convertPoint(parentComponent, location, parentFrame.getJavaContainer()); 56 resize(); 57 } 58 59 public void setText(String text) { 60 toolTip.setText(text); 61 } 62 63 public void resize() { 64 toolTip.resize(); 65 if(location != null) 66 content.setBounds(location.x-toolTip.getWidth(), location.y, toolTip.getWidth(), toolTip.getHeight()); 67 } 68 69 public JComponent overlayCreateInterface() { 70 toolTip = new ToolTipList(this); 71 return toolTip; 72 } 73 74 public boolean overlayWillDisplay() { 75 return true; 76 } 77 78 public void toolTipListHide() { 79 hide(); 80 } 81 82 } 83 | Popular Tags |