001package jmri.jmrit.display; 002 003import javax.swing.JPopupMenu; 004 005/** 006 * Adds capability for a object to load a browser page or bring a panel frame to 007 * the top. 008 * 009 * Implementations must include code to do this: 010 * 011 * if (url.startsWith("frame:")) { // locate JmriJFrame and push to front String 012 * frame = url.substring(6); final jmri.util.JmriJFrame jframe = 013 * jmri.util.JmriJFrame.getFrame(frame); java.awt.EventQueue.invokeLater(new 014 * Runnable() { @Override public void run() { jframe.toFront(); 015 * jframe.repaint(); } }); } else { 016 * jmri.util.ExternalLinkContentViewerUI.activateURL(new java.net.URL(url)); } 017 * This code typically is done within the following Positionable call 018 * 019 * public void doMouseClicked(MouseEvent event); 020 * 021 * Positionable object may use the following call to edit the "url" string 022 * 023 * public boolean setLinkMenu(JPopupMenu popup) { // perhaps check if "url" is 024 * OK or just this popup.add(CoordinateEdit.getLinkEditAction(this, 025 * "EditLink")); return true; } 026 * 027 * See LinkingLabel.java or AnalogClock2Display.java for examples 028 */ 029public interface LinkingObject extends Cloneable { 030 031 String getURL(); 032 033 void setULRL(String u); 034 035 void updateSize(); 036 037 boolean setLinkMenu(JPopupMenu popup); 038// public void doMouseClicked(MouseEvent event); 039}