Interface LinkingObject

  • All Superinterfaces:
    All Known Implementing Classes:
    AnalogClock2Display, LinkingLabel

    public interface LinkingObject
    extends java.lang.Cloneable
    Adds capability for a object to load a browser page or bring a panel frame to the top. Implementations must include code to do this: if (url.startsWith("frame:")) { // locate JmriJFrame and push to front String frame = url.substring(6); final jmri.util.JmriJFrame jframe = jmri.util.JmriJFrame.getFrame(frame); java.awt.EventQueue.invokeLater(new Runnable() { @Override public void run() { jframe.toFront(); jframe.repaint(); } }); } else { jmri.util.ExternalLinkContentViewerUI.activateURL(new; } This code typically is done within the following Positionable call public void doMouseClicked(MouseEvent event); Positionable object may use the following call to edit the "url" string public boolean setLinkMenu(JPopupMenu popup) { // perhaps check if "url" is OK or just this popup.add(CoordinateEdit.getLinkEditAction(this, "EditLink")); return true; } See or for examples