public class Phantom extends JApplet implements Runnable, VetoableChangeListener, PropertyChangeListener, ActionListener, AuthCB, LogEvent, NetPhantomConstants, IAppListener, ILogConsole, IPhantomFontScaling
JApplet.AccessibleJApplet
Applet.AccessibleApplet
Panel.AccessibleAWTPanel
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
IAppListener.QuitReply
Modifier and Type | Field and Description |
---|---|
protected Color |
appBgColor
The background color of application area in Applet or desktops, null for
defaults.
|
protected String[] |
applicationParameters
The parameters when started as a Java Application.
|
protected Container |
connectFrame
The initial "connecting..." window.
|
protected JLabel |
connectText
The connection text in the "connecting..." window.
|
protected boolean |
doPlacePanelsInBrowser
This flag indicates if all panels are placed inside the
parent
below or not. |
protected static boolean |
isApplet
Indicates that it's a real applet (otherwise a Java application).
|
protected boolean |
isFrameLess
Indicates this is running inside the browser for main panels only.
|
static boolean |
isParallelRun
Flag for Client Parallel Run.
|
protected SessionManager |
sessionManager
The panel session manager.
|
accessibleContext, rootPane, rootPaneCheckingEnabled
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ACTION_CLOSEWINDOW, ACTION_CONTROL, ACTION_HOSTKEY, ACTION_MENU, ACTION_NONE, ACTION_NOTEBOOKPAGE, ACTION_POPUPMENU, CC_BACKGROUND, CC_BOTH, CC_FOREGROUND, CC_NONE, CLIPBOARD_GET, CLIPBOARD_SET, DATEF_DMY, DATEF_MDY, DATEF_SYSTEM, DATEF_YMD, DDE_ADVISE, DDE_EXECUTE, DDE_INITIATE, DDE_POKE, DDE_REQUEST, DDE_TERMINATE, DDE_UNADVISE, DDE_UPDATE, DDEVAR_DISABLE, DDEVAR_ENABLE, DDEVAR_REQUEST, DDEVAR_SET, DDEVAR_VALIDATE, EFT_AMOUNT, EFT_DATE, EFT_DATEAMOUNT, EFT_NORMAL, EFT_PASSWORD, EVENT_CHAR, EVENT_CHECK, EVENT_CLICK, EVENT_COMMAND, EVENT_DBLCLICK, EVENT_DDECONNECTION, EVENT_DDEDATA, EVENT_DDEERROR, EVENT_DDEEXECUTE, EVENT_DDEINVALIDATE, EVENT_DDEPOKE, EVENT_DDEREQUEST, EVENT_DEFOCUS, EVENT_FOCUS, EVENT_PAGEDOWN, EVENT_PAGEUP, EVENT_SELECT, EVENT_UNKNOWN, EVENT_USERCHANGE, EXTENDEDINFO_IDS_TO_CLIENT, FOCUSTYPE_CLIENTTARGET, FOCUSTYPE_CONTROL, FOCUSTYPE_NONE, ICON_CRITICAL, ICON_INFORMATION, ICON_NOICON, ICON_QUERY, ICON_WARNING, J_AUTO, J_BOTTOM, J_BOTTOMLEFT, J_BOTTOMRIGHT, J_CENTER, J_LEFT, J_RIGHT, J_TOP, J_TOPLEFT, J_TOPRIGHT, MAX_PANELS_PER_SESSION, MAX_SESSIONS, MB_ABORTRETRYIGNORE, MB_CANCEL, MB_ENTER, MB_ENTERCANCEL, MB_OK, MB_OKCANCEL, MB_RETRYCANCEL, MB_YESNO, MB_YESNOCANCEL, MBID_CANCEL, MBID_DEFAULT, MBID_ENTER, MBID_IGNORE, MBID_NO, MBID_OK, MBID_RETRY, MBID_YES, MS_MOVE, MS_NONE, MS_SIZE, NETPHANTOM_COPYRIGHT, NETPHANTOM_COPYRIGHT2, NETPHANTOM_VERSION, OBJEVENT_CHECK, OBJEVENT_CLICK, OBJEVENT_DBLCLICK, OBJEVENT_DEFOCUS, OBJEVENT_FOCUS, OBJEVENT_SELECT, OBJEVENT_USERCHANGE, PANELCREATE_APPPANEL, PANELCREATE_DANGLINGPANEL, PANELCREATE_DLGFRAME, PANELCREATE_EXTENDEDINFO, PANELCREATE_ICON, PANELCREATE_INDIVIDUALSIZE, PANELCREATE_POPUP, REPLYTYPE_CLIENTEXECUTE, REPLYTYPE_CLIPBOARD, REPLYTYPE_DDE, REPLYTYPE_FFONTLIST, REPLYTYPE_MESSAGEBOX, REPLYTYPE_REPORT, REPLYTYPE_SAVEPROPS, REPLYTYPE_TERMMARK, RPRT_CANCELPRINTJOB, RPRT_CLOSEPRINTJOB, RPRT_CONTPRINTJOB, RPRT_OPENPRINTJOB, RPRT_PRINTJOBCANCLD, RPRT_PRINTJOBCLOSED, RPRT_PRINTJOBCONT, RPRT_PRINTJOBOPENED, RPRT_PRINTJOBSTARTED, RPRT_STARTPRINTJOB, SELMODE_NORMAL, SELMODE_NOTALLOWED, SELMODE_REQUIRED, SELTYPE_MULTIPLE, SELTYPE_SINGLE, SEPARATOR, SEPARATORCHAR, TRANS_APPLICATIONCHANGE, TRANS_CALLOBJECT, TRANS_CANCELEXIT, TRANS_CLEARLOCK, TRANS_CLIENTEXECUTE, TRANS_CLIENTJARS, TRANS_CLIENTTEXTTABLE, TRANS_CLIENTUPDATED, TRANS_CLIENTUPDATEDNOLOCK, TRANS_CLIPBOARD, TRANS_CLIPBOARDCOMPONENT, TRANS_CLOSETERMINALWINDOW, TRANS_CONNECTIONREFUSED, TRANS_COUNTRYINFO, TRANS_CREATEPANEL, TRANS_CREATESESSION, TRANS_DDE, TRANS_DDEEVENT, TRANS_DDEEVENTREPLY, TRANS_DDEVAREVENT, TRANS_DISPLAYHELP, TRANS_DISPLAYTERMINAL, TRANS_DISPLAYTOOLTIPS, TRANS_ENDCONVERSATION, TRANS_EXIT, TRANS_FONTSUBSTITUTION, TRANS_HOSTCOLORTABLE, TRANS_HOSTPRINT, TRANS_HWND, TRANS_INACTIVESESSION, TRANS_INITIATE, TRANS_KEEPALIVE, TRANS_LOCALE, TRANS_LOGEVENT, TRANS_MESSAGEBOX, TRANS_MESSAGEBOXWITHREPLY, TRANS_MODALREPLY, TRANS_MULTTERM, TRANS_PING, TRANS_PRINTCOMPONENT, TRANS_PRINTPANEL, TRANS_PRINTREPORT, TRANS_PRTWINKEY, TRANS_RECONNECT, TRANS_REDIRECTION, TRANS_REMOVEPANELATLEVEL, TRANS_REMOVETERMINAL, TRANS_RENEGOTIATESSL, TRANS_REQUESTHELP, TRANS_RESOURCEURL, TRANS_SELECTSESSION, TRANS_SESSIONACTIVE, TRANS_SESSIONSELECTED, TRANS_SETCOLORS, TRANS_SETFOCUS, TRANS_SETLOCK, TRANS_SETPANELNESTLEVEL, TRANS_SETUPPARAMS, TRANS_SHOWDOCUMENT, TRANS_SOCKET, TRANS_SOUNDALARM, TRANS_STARTUPINFO, TRANS_STOPSESSION, TRANS_TERMINALDATA, TRANS_TERMINALUPDATE, TRANS_TERMINALWINDOW, TRANS_TERMWINTEXT, TRANS_UPDATEAPPLICATION, TRANS_UPDATEPANEL, TRANS_USEREXITPRTKEY, TRANSACTION_VERSION, TS_CLOSE, TS_DATA, TS_ERROR, TS_OPEN, VSIGN_MINUS, VSIGN_NONE, VSIGN_PLUSMINUS, YEARF_6DIG, YEARF_8DIG, YEARF_EXP8
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
Phantom()
The Client Applet constructor.
|
Phantom(DirectInterface directInterface,
String[] args)
The Client constructor when used in direct communication with
the server/editor.
|
Modifier and Type | Method and Description |
---|---|
static void |
_runInAWT(String location,
Runnable r)
Runs a runnable directly if in AWT thread, otherwise synchronously
in the AWT thread.
|
protected void |
_setClosingWindow(Window owner,
boolean on)
Changes the state of closing window.
|
protected int |
_showOptionDialog(Component parentComponent,
Object message,
String title,
int optionType,
int messageType,
Icon icon,
Object[] options,
Object initialValue)
Brings up a dialog with a specified icon, where the initial choice is
determined by the
initialValue parameter and the number of
choices is determined by the optionType parameter. |
void |
actionPerformed(ActionEvent e)
Fired when the entry fields in the option pane gets Enter key pressed.
|
void |
addConnectTitle(String text)
Appends a text to the connect title.
|
protected void |
adjustPanelPosition(JDialog dialog,
PPanel panel,
Rectangle bounds)
Called just before a pop-up panel is about to be displayed and allows a
superclass of "Phantom" (i.e.
|
void |
appletDragFinished()
This method is called from the Java framework when an applet is "dropped"
on the desktop.
|
void |
appletDragStarted()
This method is called from the Java framework when an applet is
detached from the browser.
|
void |
appletRestored()
Remove the close window listener when applet is restored in the browser (should never happen).
|
protected void |
createAppletDesktopPane(Container c)
Creates the desktop pane for the applet.
|
protected JPanel |
createAppletPanel()
Create the JPanel with the centered applet layout manager.
|
protected Window |
createConnectFrame(boolean isReconnect)
Creates the initial window displaying the current activity.
|
se.entra.phantom.client.PJDesktopPane |
createDesktop()
Creates the desktop when panels are placed inside the browser and there is
just main panels.
|
boolean |
createDirectConnection()
Creates a direct connection to the host.
|
protected JPanel |
createImagePanel(JLabel label,
boolean isExiting)
Creates a vertical box with the required image icon in it.
|
protected SessionManager |
createSessionManager(Container c,
boolean pib)
Creates the Session Manager.
|
boolean |
createSocket(String refuseText)
Creates a socket to the host(s).
|
protected TerminalWindow |
createTerminalWindow(Container terminalParent,
Container container,
Color[] cgaColors,
String ii,
String im,
String mw,
String caps,
String num,
int cx,
int cy,
int x,
int y,
char[] cd,
int[] ad,
TerminalWindowListener listener)
Create the terminal window.
|
void |
destroy()
Called by the browser or applet viewer to inform this applet that it is
being reclaimed and that it should destroy any resources that it has
allocated.
|
void |
displayAboutBox()
Displays the About Box placed on top of all panels, outside a potential
browser in the middle of the screen.
|
protected void |
disposeConnectFrame(Window w)
Closes connection window.
|
static boolean |
doShowPrintDialogOnce()
Flag indicating printing dialog is shown once only.
|
void |
exitMessage(String msg)
Shows a message Dialog with an Exit message.
|
protected int |
exitMessage0(String msg)
Shows a message Dialog with an Exit message.
|
protected static void |
fixMessageBox(Container cnr)
Fixes the size of the button fonts in the message box.
|
String |
getAppletInfo()
Gets the Applet information.
|
AudioClip |
getAudioClip(URL url)
Returns the AudioClip object specified by the URL argument.
|
String[] |
getAuth(boolean usesSSL,
boolean isProxy,
String serverName,
String scheme,
String realm,
String resource,
String userID,
String password)
Requests a password.
|
URL |
getCodeBase()
Gets the base URL.
|
static ImageIcon |
getDefaultIcon()
Gets the default icon for the application.
|
static ArrayList<ImageIcon> |
getDefaultIcons()
Gets the default icon for the application.
|
static ArrayList<? extends Image> |
getDefaultImages()
Gets the images used for window frames.
|
se.entra.phantom.client.PJDesktopPane |
getDesktopPane()
Gets the desktop pane where all panels are placed inside.
|
URL |
getDocumentBase()
Gets the document URL.
|
Set<Window> |
getEditorWindows()
Gets the Editor's windows.
|
ImageIcon |
getImage(String name)
Returns an ImageIcon object that can then be painted on the screen.
|
ImageIcon |
getImage(String name,
boolean keepInCache)
Returns an ImageIcon object that can then be painted on the screen.
|
Image |
getImage(URL url)
Returns an Image object that can then be painted on the screen.
|
Image |
getImage(URL url,
boolean keepInCache)
Deprecated.
|
Image |
getImage(URL url,
String name)
Returns an Image object that can then be painted on the screen.
|
Image |
getImage(URL url,
String name,
boolean keepInCache)
Deprecated.
|
ImageManager |
getImageManager()
Gets a handle to the image manager.
|
int |
getMessageBoxCount()
Gets the count of message boxes displayed.
|
String |
getMessageOnExit()
Checks if an error message should be displayed at exit.
|
protected void |
getParameters()
Gets the parameters of the application or applet.
|
Applet |
getPhantomApplet()
Get a handle to the start Applet.
|
URL |
getPhantomCodeBase()
Get the URL that is the applications code base.
|
SessionManager |
getSessionManager()
Gets the SessionManager instance.
|
String |
getStringParameter(String p)
Gets a string parameter from the Applet (or the command line in case of a
Java Application.
|
String[] |
getStringParameterArray(String p)
Gets a string array parameter list from the Applet (or the command line in
case of a Java Application.
|
protected String |
getSystemInfo()
Returns information about the system.
|
Properties |
getSystemProperties()
Determines the current system properties.
|
protected Window |
getTopmostWindow()
Gets the topmost created window.
|
TraceInterface |
getTraceInterface()
Gets the trace interface (or null for none).
|
UITweaks |
getTweaks()
Gets the tweaks applied for the Look-and-Feel.
|
int |
getValueParameter(String p)
Gets an integer parameter from the Applet (or the command line in case of a
Java Application.
|
int[] |
getValuesParameter(String p)
Gets an integer array parameter list from the Applet (or the command line
in case of a Java Application.
|
void |
init()
Initializes the Applet.
|
protected void |
initDefaultFontScale(FontManager fm)
Initializes the font scaling if none has been set.
|
protected void |
initiateServer(String apps,
int host)
Initiates the server with the applications to run along with the wanted
host session.
|
protected void |
initStuff(Container c)
Initializes the Client system.
|
static boolean |
isApplet()
Indicates that it's a real applet (otherwise a Java application).
|
boolean |
isAppletDragStart(MouseEvent event)
Check if applet can be detached from browser.
|
protected boolean |
isClientSessionLocked(PPanel requestingPanel)
Method checked for panel lock in every panel.
|
boolean |
isDragDropEnabled()
Checks if Drag-and-Drop is enabled for the client or not.
|
boolean |
isDraggable()
Is this applet possible to drag outside the browser to be installed?
|
boolean |
isEditor()
Checks if this is the editor or not.
|
boolean |
isMessageBoxDisplayed()
Checks if a message box is currently displayed.
|
static boolean |
isVerbose()
Is verbose output to be used when applicable?
|
void |
logConsole(String text)
Prints an event to the Java Console, defaults to System.out.
|
void |
logEvent(String txt)
Logs an event in the server, defaults to output an error.
|
void |
logEvent(String txt,
int level)
Logs an event in the server.
|
void |
logInternalProgramError(String location,
Throwable t)
Logs an internal program error in the server.
|
void |
logInternalProgramError(Throwable t)
Logs an internal program error in the server.
|
static void |
main(String[] args)
The Client applications start method.
|
static void |
main(String[] args,
TraceInterface ti)
The Client applications start method using the trace interface
(or playback).
|
protected static void |
main(String[] args,
TraceInterface ti,
Phantom phantom)
The Client applications start method using the trace interface
(or playback).
|
protected void |
notifyModalPanelCreation(JDialog dialog)
For the editor, this notifies that a modal panel has been created.
|
protected static String |
onAWTInit()
Returns information about the system.
|
protected void |
onMessageBoxCountChanged()
Called when the message box count has changed.
|
protected void |
onNewWindow(Window w)
Called when a new panel Frame or Dialog window is created.
|
protected void |
onNextDialogOwner(JFrame frame,
JDialog dialog)
Called when the before the next dialog is to be shown, modally or not.
|
protected void |
onPopupMenuDisposed()
Apply the Designer Look-and-Feel because an Editor pop-up menu has been
hidden.
|
protected void |
onPopupMenuSoon()
Apply the Editor Look-and-Feel because a pop-up menu will be shown.
|
protected void |
onTerminalWindowDisplayed(PPanel panel,
Terminal terminal)
Called when the terminal window has been displayed.
|
void |
onUITweaks(UITweaks tweaks)
Called when UIDefaults has been changed by the Look-and-Feel tweaker.
|
void |
play(URL url)
Plays the audio clip at the specified absolute URL.
|
void |
play(URL url,
String name)
Plays the audio clip given the URL and a specifier that is relative to it.
|
void |
propertyChange(PropertyChangeEvent event)
The property change listener for option panes.
|
void |
redirectSocket(String hostAndPort)
Redirection of client to another socket.
|
void |
removeConnectWindow()
Removes the connect window as soon as a panel is created.
|
IAppListener.QuitReply |
requestQuit()
System requests a quit of the application.
|
void |
run()
When running as an applet, this method is called at init() due to starting
of a thread.
|
static void |
runInAWT(Phantom phantom,
String location,
Runnable r)
Runs a runnable directly if in AWT thread, otherwise synchronously
in the AWT thread.
|
void |
sendTransaction(Transaction trans)
Send a transaction to host.
|
protected void |
sessionReconnected()
Called when the session has been reconnected successfully.
|
void |
setAppletCloseListener(ActionListener closeListener)
Set the close listener.
|
void |
setBounds(int x,
int y,
int width,
int height)
Changes the applet size.
|
void |
setConnectText(String text)
Sets a text in the connect window.
|
static void |
setDefaultIcons(ArrayList<ImageIcon> imageIcons)
Sets the icon(s) to be used by the application.
|
static void |
setDefaultIcons(ImageIcon... imageIcons)
Sets the icon(s) to be used by the application.
|
void |
setDesktopContainer(Container c)
Creates the only component in the desktop pane inside the applet (either
the application panel or the JDesktopPane used to display JInternalFrames
for non-application panel applications.
|
protected int |
setLAF(String s)
Sets a look-and-feel from a string that can be separated by comma or colon.
|
static int |
setLAFClass(FontManager fontManager,
String className,
IPhantomFontScaling phantom,
boolean isDesignUI)
Sets the look-and-feel to specified class, called synchronous in the AWT thread.
|
static int |
setLAFClass(FontManager fontManager,
String className,
IPhantomFontScaling phantom,
boolean isDesignUI,
double scale)
Sets the look-and-feel to specified class, called synchronous in the AWT thread.
|
static int |
setLAFClass(String className,
IPhantomFontScaling phantom,
boolean isDesignUI)
Sets the look-and-feel to specified class, called synchronous in the AWT thread, using the current font managaer.
|
void |
setMessageAtExit(String msg)
Sets exit error message.
|
void |
setTraceInterface(TraceInterface ti)
Sets the trace interface (or null for none).
|
protected void |
showConnectFrame(Container connectFrame)
Shows the Connect frame.
|
void |
showMessageDialog(Component parentComponent,
String message,
String title,
int messageType)
Brings up a dialog that displays a message using a default icon determined
by the messageType parameter.
|
void |
showMessageDialog(Component parentComponent,
String message,
String title,
int messageType,
Icon icon)
Brings up a dialog displaying a message, specifying all parameters.
|
int |
showOptionDialog(Component parentComponent,
Object[] components,
String title,
int optionType,
int messageType,
Icon icon,
Object[] options,
Object initialValue)
Brings up a modal dialog with a specified icon, where the initial choice is
determined by the
initialValue parameter and the number of
choices is determined by the optionType parameter. |
int |
showOptionDialog(Component parentComponent,
String message,
String title,
int optionType,
int messageType,
Icon icon,
Object[] options,
Object initialValue)
Brings up a modal dialog with a specified icon, where the initial choice is
determined by the
initialValue parameter and the number of
choices is determined by the optionType parameter. |
protected int |
showOptionDialog0(Component parentComponent,
Object[] components,
String message,
String title,
int optionType,
int messageType,
Icon icon,
Object[] options,
Object initialValue)
The actual implementor, overridden in PhantomEditor superclass to handle
Win32 threads from JNI calls.
|
void |
start()
Called by the browser or applet viewer to inform this applet that it should
start its execution.
|
protected void |
startInit()
This method kicks the starter thread.
|
void |
stop() |
void |
vetoableChange(PropertyChangeEvent e)
Checks for maximize property being set on pop-up panels that can't be
maximized.
|
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isRootPaneCheckingEnabled, paramString, remove, repaint, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
getAppletContext, getAudioClip, getLocale, getParameter, getParameterInfo, isActive, isValidateRoot, newAudioClip, resize, resize, setStub, showStatus
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, revalidate, setBackground, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
protected static boolean isApplet
protected Container connectFrame
protected JLabel connectText
protected boolean doPlacePanelsInBrowser
parent
below or not.protected SessionManager sessionManager
protected Color appBgColor
protected String[] applicationParameters
protected boolean isFrameLess
public static final boolean isParallelRun
public Phantom()
public Phantom(DirectInterface directInterface, String[] args)
directInterface
- The direct interface instance, or null
for none.args
- The program arguments.protected static String onAWTInit()
public static void main(String[] args)
args
- An array of strings which contains the applications parameters.public static void main(String[] args, TraceInterface ti)
args
- An array of strings which contains the applications parameters.ti
- The trace interface instance, or null for none.protected static void main(String[] args, TraceInterface ti, Phantom phantom)
args
- An array of strings which contains the applications parameters.ti
- The trace interface instance, or null for none.public static boolean doShowPrintDialogOnce()
protected String getSystemInfo()
You can override this method to return null
to avoid
screen output.
public void setTraceInterface(TraceInterface ti)
This interface is used to trace client events, typically for response time measuring and/or client activity playback.
public TraceInterface getTraceInterface()
This interface is used to trace client events, typically for response time measuring and/or client activity playback.
public static boolean isApplet()
public void start()
A subclass of Applet should override this method if it has any operation that it wants to perform each time the Web page containing it is visited. For example, an applet with animation might want to use the start method to resume animation, and the stop method to suspend the animation.
public void destroy()
A subclass of Applet should override this method if it has any operation that it wants to perform before it is destroyed. For example, an applet with threads would use the initialize method to create the threads and the destroy method to kill them.
public void setBounds(int x, int y, int width, int height)
public String getAppletInfo()
getAppletInfo
in class Applet
public URL getDocumentBase()
If running as a non-applet and a RESURL is specified, it is returned.
getDocumentBase
in class Applet
public URL getCodeBase()
If running as a non-applet and a RESURL is specified, it is returned.
getCodeBase
in class Applet
public Image getImage(URL url)
This method always returns immediately, whether or not the image exists. When this applet attempts to draw the image on the screen, the data will be loaded. The graphics primitives that draw the image will incrementally paint on the screen.
The images are not kept in cache.
@Deprecated public Image getImage(URL url, boolean keepInCache)
This method always returns immediately, whether or not the image exists. When this applet attempts to draw the image on the screen, the data will be loaded. The graphics primitives that draw the image will incrementally paint on the screen.
The images are kept in cache depending on the keepInCache
parameter (no longer valid, false is always assumed).
url
- an absolute URL giving the location of the image.keepInCache
- flag specifying if the image should be cached or not.
This flag is not used anymore and assumed to be false.
Use the method getImage(URL)
instead.public Image getImage(URL url, String name)
This always returns immediately, whether or not the image exists. When this applet attempts to draw the image on the screen, the data will be loaded. The graphics primitives that draw the image will incrementally paint on the screen.
The images are not kept in cache.
@Deprecated public Image getImage(URL url, String name, boolean keepInCache)
This always returns immediately, whether or not the image exists. When this applet attempts to draw the image on the screen, the data will be loaded. The graphics primitives that draw the image will incrementally paint on the screen.
The images are kept in cache depending on the keepInCache
parameter (no longer valid, false is always assumed).
url
- an absolute URL giving the location of the image.name
- the location of the image, relative to the url argument.keepInCache
- flag specifying if the image should be cached or not.
This flag is not used anymore and assumed to be false.
Use the method getImage(URL,String)
instead.public ImageIcon getImage(String name)
name
- the location of the image, relative to the url argument.public ImageIcon getImage(String name, boolean keepInCache)
name
- the location of the image, relative to the url argument.keepInCache
- flag specifying if the image should be cached or not.public AudioClip getAudioClip(URL url)
This method always returns immediately, whether or not the audio clip exists. When this applet attempts to play the audio clip, the data will be loaded.
getAudioClip
in class Applet
url
- an absolute URL giving the location of the audio clip.public void play(URL url)
public void play(URL url, String name)
protected void createAppletDesktopPane(Container c)
c
- the container (content pane for the applet, null in order not to
create it).protected void startInit()
public void run()
public se.entra.phantom.client.PJDesktopPane getDesktopPane()
public se.entra.phantom.client.PJDesktopPane createDesktop()
public void setDesktopContainer(Container c)
This method may be called again after e.g. authentication, i.e. when there has been a non-application panel application and is now replaced with an application panel.
public String getMessageOnExit()
public void setMessageAtExit(String msg)
protected void initDefaultFontScale(FontManager fm)
FontManager.getInstance().initFont(null)
. This call
will set the font and image scaling to the system setting, e.g.
100% to 200% (older desktops 100%, newer laptops 150%, 4K screens
sometimes up to 200%).fm
- The FontManager
instance.FontManager.initFont(String)
protected void getParameters()
protected int setLAF(String s)
s
- The Look-and-Feel name such as "system", "metal", "jlf", or the
exact class name (case insensitive, a string that is contained
in the Look-and-Feel name itself (except if it's "Windows" and
Look-and-Feel name is "Windows Classic").public static int setLAFClass(String className, IPhantomFontScaling phantom, boolean isDesignUI)
className
- The fully qualified class name, e.g. "com.sun.java.swing.plaf.mac.MacLookAndFeel".phantom
- The Phantom instance to update the UI components for or the interface, can be null for none.isDesignUI
- Flag for Design UI (Panel Designer), false for Client or Editor itself, errors written to System.err.public static int setLAFClass(FontManager fontManager, String className, IPhantomFontScaling phantom, boolean isDesignUI)
fontManager
- The font manager instance.className
- The fully qualified class name, e.g. "com.sun.java.swing.plaf.mac.MacLookAndFeel".phantom
- The Phantom instance to update the UI components for or the interface, can be null for none.isDesignUI
- Flag for Design UI (Panel Designer), false for Client or Editor itself, errors written to System.err.public static int setLAFClass(FontManager fontManager, String className, IPhantomFontScaling phantom, boolean isDesignUI, double scale)
fontManager
- The font manager instance.className
- The fully qualified class name, e.g. "com.sun.java.swing.plaf.mac.MacLookAndFeel".phantom
- The Phantom instance to update the UI components for or the interface, can be null for none.isDesignUI
- Flag for Design UI (Panel Designer), false for Client or Editor itself, errors written to System.err.scale
- The scale to use, zero for current.protected void initStuff(Container c)
c
- The top windows ContentPane.protected SessionManager createSessionManager(Container c, boolean pib)
protected Window createConnectFrame(boolean isReconnect)
protected void disposeConnectFrame(Window w)
protected void showConnectFrame(Container connectFrame)
connectFrame.setVisible(true)
, so subclasses can override this method.connectFrame
- The JFrame or JInternalFrame container.public void displayAboutBox()
displayAboutBox
in interface IAppListener
public IAppListener.QuitReply requestQuit()
requestQuit
in interface IAppListener
public void setConnectText(String text)
text
- The message to set.public void addConnectTitle(String text)
public void removeConnectWindow()
public void redirectSocket(String hostAndPort)
public boolean createSocket(String refuseText)
public boolean createDirectConnection()
public Applet getPhantomApplet()
public URL getPhantomCodeBase()
public SessionManager getSessionManager()
public void sendTransaction(Transaction trans)
trans
- The transaction that should be send to the host.public ImageManager getImageManager()
public void exitMessage(String msg)
msg
- A string to display in the message box.protected JPanel createAppletPanel()
protected JPanel createImagePanel(JLabel label, boolean isExiting)
protected int exitMessage0(String msg)
msg
- A string to display in the message box.protected void sessionReconnected()
protected void initiateServer(String apps, int host)
apps
- the list of applications to run.host
- the host session id.public String getStringParameter(String p)
p
- the parameter to get.public String[] getStringParameterArray(String p)
p
- the parameter to get.public int getValueParameter(String p)
p
- the parameter to get.public int[] getValuesParameter(String p)
p
- the parameter to get.public void logEvent(String txt)
public void logEvent(String txt, int level)
txt
- Text to log.level
- Log level: 1=error, 2=critical, 3=warning, 4=informational.public void logInternalProgramError(Throwable t)
logInternalProgramError
in interface LogEvent
public void logInternalProgramError(String location, Throwable t)
logInternalProgramError
in interface LogEvent
public boolean isMessageBoxDisplayed()
public int showOptionDialog(Component parentComponent, Object[] components, String title, int optionType, int messageType, Icon icon, Object[] options, Object initialValue)
initialValue
parameter and the number of
choices is determined by the optionType
parameter.
If optionType
is YES_NO_OPTION, or YES_NO_CANCEL_OPTION and
the options
parameter is null, then the options are supplied
by the look and feel.
The messageType
parameter is primarily used to supply a
default icon from the look and feel.
parentComponent
- Determines the Frame in which the dialog is displayed. If null, or
if the parentComponent has no Frame, a default Frame is used.components
- the objects that will make up the message.title
- the title string for the dialogoptionType
- an integer designating the options available on the dialog:
YES_NO_OPTION, or YES_NO_CANCEL_OPTIONmessageType
- an integer designating the kind of message this is, primarily used
to determine the icon from the pluggable look and feel:
ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE,
QUESTION_MESSAGE, or PLAIN_MESSAGE.icon
- the icon to display in the dialogoptions
- an array of objects indicating the possible choices the user can
make. If the objects are components, they are rendered properly.
Non-String objects are rendered using their toString
methods. If this parameter is null, the options are determined by
the look and feel.initialValue
- the object that represents the default selection for the dialogpublic int showOptionDialog(Component parentComponent, String message, String title, int optionType, int messageType, Icon icon, Object[] options, Object initialValue)
initialValue
parameter and the number of
choices is determined by the optionType
parameter.
If optionType
is YES_NO_OPTION, or YES_NO_CANCEL_OPTION and
the options
parameter is null, then the options are supplied
by the look and feel.
The messageType
parameter is primarily used to supply a
default icon from the look and feel.
parentComponent
- Determines the Frame in which the dialog is displayed. If null, or
if the parentComponent has no Frame, a default Frame is used.message
- the string to display.title
- the title string for the dialogoptionType
- an integer designating the options available on the dialog:
YES_NO_OPTION, or YES_NO_CANCEL_OPTIONmessageType
- an integer designating the kind of message this is, primarily used
to determine the icon from the pluggable look and feel:
ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE,
QUESTION_MESSAGE, or PLAIN_MESSAGE.icon
- the icon to display in the dialogoptions
- an array of objects indicating the possible choices the user can
make. If the objects are components, they are rendered properly.
Non-String objects are rendered using their toString
methods. If this parameter is null, the options are determined by
the look and feel.initialValue
- the object that represents the default selection for the dialogprotected int showOptionDialog0(Component parentComponent, Object[] components, String message, String title, int optionType, int messageType, Icon icon, Object[] options, Object initialValue)
protected static void fixMessageBox(Container cnr)
protected int _showOptionDialog(Component parentComponent, Object message, String title, int optionType, int messageType, Icon icon, Object[] options, Object initialValue)
initialValue
parameter and the number of
choices is determined by the optionType
parameter.
If optionType
is YES_NO_OPTION
, or
YES_NO_CANCEL_OPTION
and the options
parameter is
null
, then the options are supplied by the look and feel.
The messageType
parameter is primarily used to supply a
default icon from the look and feel.
parentComponent
- determines the Frame
in which the dialog is
displayed; if null
, or if the
parentComponent
has no Frame
, a default
Frame
is usedmessage
- the Object
to displaytitle
- the title string for the dialogoptionType
- an integer designating the options available on the dialog:
DEFAULT_OPTION
, YES_NO_OPTION
,
YES_NO_CANCEL_OPTION
, or
OK_CANCEL_OPTION
messageType
- an integer designating the kind of message this is, primarily used
to determine the icon from the pluggable Look and Feel:
ERROR_MESSAGE
, INFORMATION_MESSAGE
,
WARNING_MESSAGE
, QUESTION_MESSAGE
, or
PLAIN_MESSAGE
icon
- the icon to display in the dialogoptions
- an array of objects indicating the possible choices the user can
make; if the objects are components, they are rendered properly;
non-String
objects are rendered using their
toString
methods; if this parameter is
null
, the options are determined by the Look and FeelinitialValue
- the object that represents the default selection for the dialog;
only meaningful if options
is used; can be
null
CLOSED_OPTION
if the user closed the dialogHeadlessException
- if GraphicsEnvironment.isHeadless
returns
true
GraphicsEnvironment.isHeadless()
public int getMessageBoxCount()
protected void onMessageBoxCountChanged()
public void showMessageDialog(Component parentComponent, String message, String title, int messageType)
parentComponent
- Determines the Frame in which the dialog is displayed. If null, or
if the parentComponent has no Frame, a default Frame is used.message
- The String to displaytitle
- the title string for the dialogmessageType
- the type of message to be displayed: ERROR_MESSAGE,
INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE, or
PLAIN_MESSAGE.public void showMessageDialog(Component parentComponent, String message, String title, int messageType, Icon icon)
parentComponent
- Determines the Frame in which the dialog is displayed. If null, or
if the parentComponent has no Frame, a default Frame is used.message
- The String to displaytitle
- the title string for the dialogmessageType
- the type of message to be displayed: ERROR_MESSAGE,
INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE, or
PLAIN_MESSAGE.icon
- an icon to display in the dialog that helps the user identify the
kind of message that is being displayed.public void propertyChange(PropertyChangeEvent event)
propertyChange
in interface PropertyChangeListener
public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException
vetoableChange
in interface VetoableChangeListener
PropertyVetoException
public Properties getSystemProperties()
As the Client is signed, it is allowed to access these
properties without a security problem. User windows might encounter a
SecurityException and can therefore call this method instead. It is
equivalent to System.getProperties()
.
The current set of system properties is returned as a Properties object. If there is no current set of system properties, a set of system properties is first created and initialized.
This set of system properties always includes values for the following keys:
Key Description of Associated Value java.version Java version number java.vendor Java vendor-specific string java.vendor.url Java vendor URL java.home Java installation directory java.class.version Java class format version number java.class.path Java class path os.name Operating system name os.arch Operating system architecture os.version Operating system version file.separator File separator ("/" on UNIX) path.separator Path separator (":" on UNIX) line.separator Line separator ("\n" on UNIX) user.name User's account name user.home User's home directory user.dir User's current working directory
public String[] getAuth(boolean usesSSL, boolean isProxy, String serverName, String scheme, String realm, String resource, String userID, String password)
The following parameters indicates how the process is handled:
server = null, realm = null, resource = certificateFileName
server = protocol://serverName[:port], realm = null, resource = null
server = protocol://serverName[:port], realm = realmString, resource = null
The parameters "userID" and "password" are set to null if no previous data is present, otherwise the previous userID (always null for certificate files) and the previous password.
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
protected void onTerminalWindowDisplayed(PPanel panel, Terminal terminal)
panel
- the terminal window Phantom panelterminal
- the terminal window instancepublic boolean isEditor()
public static boolean isVerbose()
protected void notifyModalPanelCreation(JDialog dialog)
protected void adjustPanelPosition(JDialog dialog, PPanel panel, Rectangle bounds)
protected void _setClosingWindow(Window owner, boolean on)
protected TerminalWindow createTerminalWindow(Container terminalParent, Container container, Color[] cgaColors, String ii, String im, String mw, String caps, String num, int cx, int cy, int x, int y, char[] cd, int[] ad, TerminalWindowListener listener)
public boolean isDragDropEnabled()
public static void setDefaultIcons(ArrayList<ImageIcon> imageIcons)
public static void setDefaultIcons(ImageIcon... imageIcons)
public static ImageIcon getDefaultIcon()
public static ArrayList<ImageIcon> getDefaultIcons()
public static ArrayList<? extends Image> getDefaultImages()
public boolean isAppletDragStart(MouseEvent event)
event
- public void appletDragStarted()
public void appletDragFinished()
public void setAppletCloseListener(ActionListener closeListener)
closeListener
- public void appletRestored()
public boolean isDraggable()
protected boolean isClientSessionLocked(PPanel requestingPanel)
The default implementation is to return false.
requestingPanel
- The panel requesting the client session lock state, set to null
when the entire client session is checked globally for lock.protected void onNextDialogOwner(JFrame frame, JDialog dialog)
This method is ALWAYS called in the AWT thread.
frame
- the Frame owner of the dialog.dialog
- The dialog that will be shown.public void logConsole(String text)
logConsole
in interface ILogConsole
public static void _runInAWT(String location, Runnable r)
public static void runInAWT(Phantom phantom, String location, Runnable r)
public void onUITweaks(UITweaks tweaks)
onUITweaks
in interface IPhantomFontScaling
tweaks
- The new tweaks for the Look-and-Feel.public UITweaks getTweaks()
getTweaks
in interface IPhantomFontScaling
public Set<Window> getEditorWindows()
getEditorWindows
in interface IPhantomFontScaling
protected void onNewWindow(Window w)
w
- The Window created (PJFrame, PJDialog or JDialog).protected Window getTopmostWindow()
protected void onPopupMenuSoon()
protected void onPopupMenuDisposed()
Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.