Class CastQRWindow
java.lang.Object
com.iizigo.panel.CastQRWindow
The window of "Show QR code for iiziRun Developer" (the Panel Editor's Cast to Device drop-down): a chooser of this computer's addresses, named by interface, and ONE QR code for the address chosen (QL-D-2), the link as selectable text under it, and a line saying what to do on the phone. The addresses, the port and the link come from
CastLink. The window is not modal: the Designer stays usable while the phone scans, and the device appears in the drop-down once it has connected. One window is open at a time; opening it again replaces it.The texts are in PanelEditor.properties, keys castQR.*.
- Author:
- Christopher Mindus
Method Summary
Modifier and TypeMethodDescriptionvoidchoose(int index) Chooses an address, as a user does in the chooser.Gets the addresses offered, in the order of the chooser.String[]Gets the texts of the chooser.Gets the QR code shown at 100 % zoom.Gets the text shown in place of the code.static CastQRWindowGets the window that is open.getLink()Gets the link of the address chosen.Gets the link text shown.getShell()Gets the shell.static CastQRWindowOpens the window for this computer: the addresses byCastLink.offerOfThisComputer(), the port the web server holds.static CastQRWindowopen(Shell parent, List<CastLink.Address> addresses, int port) Opens the window for given addresses and port.static ImageDatatoImageData(BufferedImage image) Converts an image to SWT image data, 24 bits per pixel.
Method Details
open
Opens the window for this computer: the addresses byCastLink.offerOfThisComputer(), the port the web server holds. Returns at once (the window is not modal).- Parameters:
parent- The parent shell.- Returns:
- The window.
open
Opens the window for given addresses and port. Returns at once (the window is not modal); a window already open is closed first.- Parameters:
parent- The parent shell.addresses- The addresses to offer, the first one chosen.port- The HTTP port, 0 when the web server is not running.- Returns:
- The window.
getCurrent
Gets the window that is open.- Returns:
- The window, null for none.
getShell
getAddresses
Gets the addresses offered, in the order of the chooser.- Returns:
- The unmodifiable list.
getChooserItems
choose
public void choose(int index) Chooses an address, as a user does in the chooser.- Parameters:
index- The index in the chooser.
getLink
Gets the link of the address chosen.- Returns:
- The link, null when there is none (no address, or the web server is not running).
getLinkText
getCodeImageData
Gets the QR code shown at 100 % zoom.- Returns:
- The image data, null when no code is shown.
getCodeText
Gets the text shown in place of the code.- Returns:
- The text, empty when a code is shown.
toImageData
Converts an image to SWT image data, 24 bits per pixel.- Parameters:
image- The image.- Returns:
- The image data.