Class TextDisplayControl

All Implemented Interfaces:
ActionListener, ItemListener, MouseListener, MouseMotionListener, PropertyChangeListener, EventListener, HyperlinkListener, Sharable, DataChangeListener, DisplayControl, Prototypable, ControlListener, DisplayListener

public class TextDisplayControl extends DisplayControlImpl implements HyperlinkListener, MouseMotionListener, MouseListener
DisplayControl for displaying straight text or HTML.
Version:
$Revision: 1.93 $
Author:
IDV development team
  • Field Details

  • Constructor Details

    • TextDisplayControl

      public TextDisplayControl()
      Default constructor; does nothing. Heavy work done in init().
  • Method Details

    • init

      public boolean init(DataChoice dataChoice) throws VisADException, RemoteException
      Initialize this class with the supplied DataChoice.
      Overrides:
      init in class DisplayControlImpl
      Parameters:
      dataChoice - choice to describe the data
      Returns:
      true if successful
      Throws:
      RemoteException - Java RMI error
      VisADException - VisAD Error
    • getTitle

      protected String getTitle()
      Overwrite the base class method to return the filename or url.
      Overrides:
      getTitle in class DisplayControlImpl
      Returns:
      The filename or url as the title.
    • doMakeContents

      protected Container doMakeContents() throws VisADException, RemoteException
      Make the contents for this control
      Overrides:
      doMakeContents in class DisplayControlImpl
      Returns:
      UI for the control
      Throws:
      RemoteException - Java RMI error
      VisADException - VisAD Error
    • mouseDragged

      public void mouseDragged(MouseEvent e)
      Public method for mouse dragged events
      Specified by:
      mouseDragged in interface MouseMotionListener
      Parameters:
      e - mouse event
    • mouseMoved

      public void mouseMoved(MouseEvent e)
      Public method for mouse moved events
      Specified by:
      mouseMoved in interface MouseMotionListener
      Parameters:
      e - mouse event
    • mouseClicked

      public void mouseClicked(MouseEvent e)
      Public method for mouse clicked events
      Specified by:
      mouseClicked in interface MouseListener
      Parameters:
      e - mouse event
    • mouseEntered

      public void mouseEntered(MouseEvent e)
      Public method for mouse entered events
      Specified by:
      mouseEntered in interface MouseListener
      Parameters:
      e - mouse event
    • mouseExited

      public void mouseExited(MouseEvent e)
      Public method for mouse exited events
      Specified by:
      mouseExited in interface MouseListener
      Parameters:
      e - mouse event
    • mousePressed

      public void mousePressed(MouseEvent e)
      Public method for mouse Pressed events
      Specified by:
      mousePressed in interface MouseListener
      Parameters:
      e - mouse event
    • mouseReleased

      public void mouseReleased(MouseEvent e)
      Public method for mouse released events
      Specified by:
      mouseReleased in interface MouseListener
      Parameters:
      e - mouse event
    • reload

      public void reload()
      Reload the page
    • print

      public void print(Element elem, String tab)
      Print the element
      Parameters:
      elem - element to print
      tab - tab (prefix) string
    • getHistory

      public ArrayList getHistory()
      Get the history list. Used by XML persistence.
      Returns:
      list of visited sites
    • setHistory

      public void setHistory(ArrayList h)
      Set the history list. Used by XML persistence.
      Parameters:
      h - list to use
    • getGlyphHistory

      public ArrayList getGlyphHistory()
      Get the glyph history. Used by XML persistence.
      Returns:
      glyph history list
    • setGlyphHistory

      public void setGlyphHistory(ArrayList h)
      Set the history list. Used by XML persistence.
      Parameters:
      h - history list
    • setGlyphs

      public void setGlyphs(List value)
      Set the Glyphs property.
      Parameters:
      value - The new value for Glyphs
    • getGlyphs

      public List getGlyphs()
      Get the Glyphs property.
      Returns:
      The Glyphs
    • getHistoryIdx

      public int getHistoryIdx()
      Get the index into the history
      Returns:
      history index.
    • setHistoryIdx

      public void setHistoryIdx(int h)
      Set the index into the history
      Parameters:
      h - index
    • doMakeMainButtonPanel

      protected Component doMakeMainButtonPanel()
      Override the base class button panel method
      Returns:
      component for button panel
    • processForm

      public void processForm(String action, String data)
      Process the form data.
      Parameters:
      action - action for form
      data - form data.
    • hyperlinkUpdate

      public void hyperlinkUpdate(HyperlinkEvent e)
      Respond to any hyperlink events: ACTIVATED, ENTERED, EXITED. TODO: When we move to 1.4 we can get the DOM Anchor Element that perhaps could contain a description attribute.
      Specified by:
      hyperlinkUpdate in interface HyperlinkListener
      Overrides:
      hyperlinkUpdate in class DisplayControlImpl
      Parameters:
      e - event
    • getRootPath

      public String getRootPath()
      Get the root path.
      Returns:
      root path
    • click

      public void click(String linkText, boolean doHistory)
      Respond to a click.
      Parameters:
      linkText - link that was clicked
      doHistory - true if should look at history
    • click

      public void click(String linkText, boolean doHistory, boolean andShare)
      Respond to a click.
      Parameters:
      linkText - link that was clicked
      doHistory - true if should look at history
      andShare - true to share event
    • getFilename

      public String getFilename()
      Get the display file name.
      Returns:
      file string
    • setFilename

      public void setFilename(String filename)
      Set the display file name.
    • receiveShareData

      public void receiveShareData(Sharable from, Object dataId, Object[] data)
      Receive shared data from another control
      Specified by:
      receiveShareData in interface Sharable
      Overrides:
      receiveShareData in class DisplayControlImpl
      Parameters:
      from - sending control
      dataId - data type
      data - shared data
    • getDisplayName

      public String getDisplayName()
      Get the display name.
      Overrides:
      getDisplayName in class DisplayControlImpl
      Returns:
      empty string
    • doRemove

      public void doRemove() throws RemoteException, VisADException
      Remove from the IDV
      Specified by:
      doRemove in interface DisplayControl
      Overrides:
      doRemove in class DisplayControlImpl
      Throws:
      RemoteException - Java RMI error
      VisADException - VisAD Error
    • getCurrentUrl

      public String getCurrentUrl()
      Get the current URL.
      Returns:
      current URL.
    • history

      public void history(int delta)
      Scroll through the history.
      Parameters:
      delta - index
    • goToUrl

      public void goToUrl(String url)
      Go to a particular URL
      Parameters:
      url - URL
    • writeTestArchive

      public void writeTestArchive(String archiveName)
      test code
      Specified by:
      writeTestArchive in interface DisplayControl
      Overrides:
      writeTestArchive in class DisplayControlImpl
      Parameters:
      archiveName - archive name
    • getShowSideLegend

      public boolean getShowSideLegend()
    • getExtraLegendComponent

      protected JComponent getExtraLegendComponent(int legendType)
      Assume that any display controls that have a color table widget will want the color table to show up in the legend.
      Overrides:
      getExtraLegendComponent in class DisplayControlImpl
      Parameters:
      legendType - type of legend
      Returns:
      The extra JComponent to use in legend
    • getViewMenuItems

      protected void getViewMenuItems(List items, boolean forMenuBar)
      Set the show html item
      Overrides:
      getViewMenuItems in class DisplayControlImpl
      Parameters:
      items - The items of view menu
      forMenuBar - Is this for the menu in the window's menu bar or for a popup menu in the legend
    • getShowHtmlInLegend

      public boolean getShowHtmlInLegend()
      Get the ShowTableInLegend property.
      Returns:
      The ShowTableInLegend
    • setShowHtmlInLegend

      public void setShowHtmlInLegend(boolean value)
      Set the ShowTableInLegend property.
      Parameters:
      value - The new value for ShowTable
    • initAfterUnPersistence

      public void initAfterUnPersistence(ControlContext vc, Hashtable properties, List preSelectedDataChoices)
      Called by the IntegratedDataViewer to initialize after this control has been unpersisted
      Specified by:
      initAfterUnPersistence in interface DisplayControl
      Overrides:
      initAfterUnPersistence in class DisplayControlImpl
      Parameters:
      vc - The context in which this control exists
      properties - Properties that may hold things
      preSelectedDataChoices - set of preselected data choices