Class MessageSlideShell

java.lang.Object
com.biglybt.ui.swt.shells.MessageSlideShell

public class MessageSlideShell extends Object
+=====================================+ | +----+ | | |Icon| Big Bold Title | | +----+ | | Wrapping message text | | with optional URL links | | +-----+ | | |BGImg| XX more slideys.. | | | Icon| Closing in XX secs | | +-----+ [HideAll] [Details] [Hide] | +=====================================+
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private boolean
    paused state of auto-close delay
    private org.eclipse.swt.widgets.Button
    Button that hides all slideys in the popupList.
    private org.eclipse.swt.widgets.Button
    Button to move to next message.
    private org.eclipse.swt.graphics.Color
     
    protected org.eclipse.swt.graphics.Color
     
    private org.eclipse.swt.widgets.Composite
    Composite in shell
    private static int
    Current popup being displayed
    private static final boolean
     
    private static final int
    Height of the details shell
    private static final int
    Width of the details shell
    private ArrayList<Object>
    List of SWT objects needing disposal
    private static final int
    Slide until there's this much gap between shell and edge of screen
    private static int
    Index of first message which the user has not seen (index) - set to -1 if we don't care.
    List of all popups ever created
    private int
    Position this popup is in the history list
    private org.eclipse.swt.widgets.Label
    popup could and closing in xx seconds label
    private static final AEMonitor
    Synchronization for popupList
    private String
    Text to put into details popup
    private org.eclipse.swt.widgets.Shell
    Shell for popup
    private static final int
    Width used when BG image can't be loaded
    private static final int
    Maximum height of popup.
    private static final int
    Standard height of the shell.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
    MessageSlideShell(org.eclipse.swt.widgets.Display display, int iconID, String keyPrefix, String details, String[] textParams, int timeoutSecs)
    Open a popup using resource keys for title/text
     
    MessageSlideShell(org.eclipse.swt.widgets.Display display, int iconID, String keyPrefix, String details, String[] textParams, Object[] relatedObjects, int timeoutSecs)
     
     
    MessageSlideShell(org.eclipse.swt.widgets.Display display, int iconID, String title, String text, String details, int timeoutSecs)
     
     
    MessageSlideShell(org.eclipse.swt.widgets.Display display, int iconID, String title, String text, String details, Object[] relatedObjects, int timeoutSecs)
    Open Mr Slidey
    private
    MessageSlideShell(org.eclipse.swt.widgets.Display display, MessageSlideShell.PopupParams popupParams, boolean bSlide)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private void
    addMouseTrackListener(org.eclipse.swt.widgets.Composite parent, org.eclipse.swt.events.MouseTrackListener listener)
    Adds mousetracklistener to composite and all it's children
    private static void
     
    private void
    create(org.eclipse.swt.widgets.Display display, MessageSlideShell.PopupParams popupParams, boolean bSlide)
     
    private void
    createLinkLabel(org.eclipse.swt.widgets.Composite shell, MessageSlideShell.PopupParams popupParams)
     
    static void
    displayLastMessage(org.eclipse.swt.widgets.Display display, boolean last_unread)
     
    private void
    disposeShell(org.eclipse.swt.widgets.Shell shell)
     
    org.eclipse.swt.graphics.Color
     
    org.eclipse.swt.graphics.Color
     
    static void
    main(String[] args)
    Test
    static void
    recordMessage(int iconID, String title, String text, String details, Object[] relatedTo, int timeoutSecs)
    Adds this message to the slide shell without forcing it to be displayed.
    private void
    removeMouseTrackListener(org.eclipse.swt.widgets.Composite parent, org.eclipse.swt.events.MouseTrackListener listener)
    removes mousetracklistener from composite and all it's children
    private void
    runPopup(org.eclipse.swt.graphics.Rectangle endBounds, int idx, boolean bSlide, int timeoutSecs)
    Start the slid in, wait specified time while notifying user of impending auto-close, then slide out.
    private void
    setButtonNextText(int numAfter)
     
    void
    setColorFG(org.eclipse.swt.graphics.Color colorFG)
     
    void
    setUrlColor(org.eclipse.swt.graphics.Color urlColor)
     
    private void
    showPopup(org.eclipse.swt.widgets.Display display, MessageSlideShell.PopupParams item, boolean bSlide)
    Show the popup with the specified parameters.
    static void
    test(org.eclipse.swt.widgets.Display display)
     
    static void
    Waits until all slideys are closed before returning to caller.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEBUG

      private static final boolean DEBUG
      See Also:
    • EDGE_GAP

      private static final int EDGE_GAP
      Slide until there's this much gap between shell and edge of screen
      See Also:
    • SHELL_DEF_WIDTH

      private static final int SHELL_DEF_WIDTH
      Width used when BG image can't be loaded
      See Also:
    • SHELL_MIN_HEIGHT

      private static final int SHELL_MIN_HEIGHT
      Standard height of the shell. Shell may grow depending on text
      See Also:
    • SHELL_MAX_HEIGHT

      private static final int SHELL_MAX_HEIGHT
      Maximum height of popup. If text is too long, the full text will be put into details.
      See Also:
    • DETAILS_WIDTH

      private static final int DETAILS_WIDTH
      Width of the details shell
      See Also:
    • DETAILS_HEIGHT

      private static final int DETAILS_HEIGHT
      Height of the details shell
      See Also:
    • monitor

      private static final AEMonitor monitor
      Synchronization for popupList
    • historyList

      private static ArrayList<MessageSlideShell.PopupParams> historyList
      List of all popups ever created
    • currentPopupIndex

      private static int currentPopupIndex
      Current popup being displayed
    • firstUnreadMessage

      private static int firstUnreadMessage
      Index of first message which the user has not seen (index) - set to -1 if we don't care. :)
    • shell

      private org.eclipse.swt.widgets.Shell shell
      Shell for popup
    • cShell

      private org.eclipse.swt.widgets.Composite cShell
      Composite in shell
    • lblCloseIn

      private org.eclipse.swt.widgets.Label lblCloseIn
      popup could and closing in xx seconds label
    • btnHideAll

      private org.eclipse.swt.widgets.Button btnHideAll
      Button that hides all slideys in the popupList. Visible only when there's more than 1 slidey
    • btnNext

      private org.eclipse.swt.widgets.Button btnNext
      Button to move to next message. Text changes from "Hide" to "Next" appropriately.
    • bDelayPaused

      private boolean bDelayPaused
      paused state of auto-close delay
    • disposeList

      private ArrayList<Object> disposeList
      List of SWT objects needing disposal
    • sDetails

      private String sDetails
      Text to put into details popup
    • idxHistory

      private int idxHistory
      Position this popup is in the history list
    • colorURL

      protected org.eclipse.swt.graphics.Color colorURL
    • colorFG

      private org.eclipse.swt.graphics.Color colorFG
  • Constructor Details

    • MessageSlideShell

      public MessageSlideShell(org.eclipse.swt.widgets.Display display, int iconID, String keyPrefix, String details, String[] textParams, int timeoutSecs)
      Open a popup using resource keys for title/text
      Parameters:
      display - Display to create the shell on
      iconID - SWT.ICON_* constant for icon in top left
      keyPrefix - message bundle key prefix used to get title and text. Title will be keyPrefix + ".title", and text will be set to keyPrefix + ".text"
      details - actual text for details (not a key)
      textParams - any parameters for text
    • MessageSlideShell

      public MessageSlideShell(org.eclipse.swt.widgets.Display display, int iconID, String keyPrefix, String details, String[] textParams, Object[] relatedObjects, int timeoutSecs)
      Parameters:
      display -
      iconID -
      keyPrefix -
      details -
      textParams -
      relatedObjects -
      timeoutSecs - = -1 -> use default timeout, 0 -> no timeout, other -> timeout in secs
    • MessageSlideShell

      public MessageSlideShell(org.eclipse.swt.widgets.Display display, int iconID, String title, String text, String details, int timeoutSecs)
    • MessageSlideShell

      public MessageSlideShell(org.eclipse.swt.widgets.Display display, int iconID, String title, String text, String details, Object[] relatedObjects, int timeoutSecs)
      Open Mr Slidey
      Parameters:
      display - Display to create the shell on
      iconID - SWT.ICON_* constant for icon in top left
      title - Text to put in the title
      text - Text to put in the body
      details - Text displayed when the Details button is pressed. Null for disabled Details button.
      timeoutSecs - = -1 -> use default timeout, 0 -> no timeout, other -> timeout in secs
    • MessageSlideShell

      private MessageSlideShell(org.eclipse.swt.widgets.Display display, MessageSlideShell.PopupParams popupParams, boolean bSlide)
  • Method Details

    • addToHistory

      private static void addToHistory(MessageSlideShell.PopupParams popupParams)
      Parameters:
      popupParams -
      Since:
      4.1.0.5
    • displayLastMessage

      public static void displayLastMessage(org.eclipse.swt.widgets.Display display, boolean last_unread)
    • recordMessage

      public static void recordMessage(int iconID, String title, String text, String details, Object[] relatedTo, int timeoutSecs)
      Adds this message to the slide shell without forcing it to be displayed.
      Parameters:
      relatedTo -
    • create

      private void create(org.eclipse.swt.widgets.Display display, MessageSlideShell.PopupParams popupParams, boolean bSlide)
    • createLinkLabel

      private void createLinkLabel(org.eclipse.swt.widgets.Composite shell, MessageSlideShell.PopupParams popupParams)
      Parameters:
      shell2 -
      b -
      Since:
      3.0.0.9
    • setButtonNextText

      private void setButtonNextText(int numAfter)
      Parameters:
      numAfter -
    • showPopup

      private void showPopup(org.eclipse.swt.widgets.Display display, MessageSlideShell.PopupParams item, boolean bSlide)
      Show the popup with the specified parameters.
      Parameters:
      display - Display to show on
      item - popup to display. Must already exist in historyList
      bSlide - Whether to slide in or show immediately
    • addMouseTrackListener

      private void addMouseTrackListener(org.eclipse.swt.widgets.Composite parent, org.eclipse.swt.events.MouseTrackListener listener)
      Adds mousetracklistener to composite and all it's children
      Parameters:
      parent - Composite to start at
      listener - Listener to add
    • removeMouseTrackListener

      private void removeMouseTrackListener(org.eclipse.swt.widgets.Composite parent, org.eclipse.swt.events.MouseTrackListener listener)
      removes mousetracklistener from composite and all it's children
      Parameters:
      parent - Composite to start at
      listener - Listener to remove
    • runPopup

      private void runPopup(org.eclipse.swt.graphics.Rectangle endBounds, int idx, boolean bSlide, int timeoutSecs)
      Start the slid in, wait specified time while notifying user of impending auto-close, then slide out. Run on separate thread, so this method returns immediately
      Parameters:
      endBounds - end location and size wanted
      idx - Index in historyList of popup (Used to calculate # prev, next)
      bSlide - Whether to slide in, or show immediately
    • disposeShell

      private void disposeShell(org.eclipse.swt.widgets.Shell shell)
    • waitUntilClosed

      public static void waitUntilClosed()
      Waits until all slideys are closed before returning to caller.
    • main

      public static void main(String[] args)
      Test
      Parameters:
      args -
    • test

      public static void test(org.eclipse.swt.widgets.Display display)
    • getUrlColor

      public org.eclipse.swt.graphics.Color getUrlColor()
    • setUrlColor

      public void setUrlColor(org.eclipse.swt.graphics.Color urlColor)
    • getColorFG

      public org.eclipse.swt.graphics.Color getColorFG()
    • setColorFG

      public void setColorFG(org.eclipse.swt.graphics.Color colorFG)