public class PClientContext extends Object
PClientContext
encapsulates information about the physical
structure of the application or applet to run.
A client component can use this API to move its display to the top,
increase or decrease its size, and so forth as needed, without
regard to the actual structure.
When the applet or application is created, subclass PClientContext
to provide the needed functions as fits the real UI.Constructor and Description |
---|
PClientContext() |
Modifier and Type | Method and Description |
---|---|
static Color |
getChangedColor()
Gets the color to use for fields that have changed.
|
static PAppContext |
getContext()
Gets the current
PAppContext object. |
static Color |
getErrorColor()
Gets the color to use for fields in an error condition.
|
static Color |
getRequiredColor()
Gets the color to use for fields that are required.
|
static PClientServices |
getServices()
Gets a global instance of an appropriate
PClientServices object. |
static PClientServices |
getServices(Applet app)
Gets a global instance of an appropriate
PClientServices object
that is called from an applet. |
static PClientServices |
getServices(JFrame frame,
URL props)
Gets a global instance of an appropriate
PClientServices object,
given a frame and application property file to use. |
static PClientServices |
getServices(JFrame frame,
URL props,
String res)
Gets a global instance of an appropriate
PClientServices object,
given a frame, the application property file, and the application
resource file. |
static void |
initLookAndFeel()
Initializes the look and feel
|
static void |
setContext(PAppContext main)
Sets the current
PAppContext object. |
static void |
setCurrentTheme(com.jgoodies.looks.plastic.PlasticTheme theme)
Sets the current theme with the passed theme.
|
static void |
setCustomServices(PClientServices serv,
boolean initContext)
Sets a custom
PClientServices subclass. |
public static PAppContext getContext()
PAppContext
object. If one doesn't exist,
for example, within a test environment, null is returned.public static void setContext(PAppContext main)
PAppContext
object. This is called by main or the
PInfranetApplet
when a main panel that implements the
PAppContext
interface is loaded. In the case of an application that loads
its own panels, this should be called directly by the application shell.main
- a PAppContext
objectpublic static PClientServices getServices()
PClientServices
object.PClientServices
object.public static PClientServices getServices(JFrame frame, URL props)
PClientServices
object,
given a frame and application property file to use.frame
- a frame to use as the underlying windowprops
- the application property file to usePClientServices
object.public static PClientServices getServices(JFrame frame, URL props, String res)
PClientServices
object,
given a frame, the application property file, and the application
resource file.frame
- a frame to use as the underlying windowprops
- the application property file to useres
- the application resource file to usePClientServices
object.public static PClientServices getServices(Applet app)
PClientServices
object
that is called from an applet.app
- the applet namePClientServices
object.public static void setCustomServices(PClientServices serv, boolean initContext)
PClientServices
subclass. This is an advanced utility method for
users with unique requirements for a PClientServices
object.
Call this before any other BAS framework API.serv
- the PClientServices
object to setinitContext
- true if the context should be initialized
(this sets up look and feel, for example, the colors to use)public static Color getErrorColor()
Color
to use to indicate errors.public static Color getRequiredColor()
Color
to use to indicate required data.public static Color getChangedColor()
Color
to use to indicate a changed field.public static void setCurrentTheme(com.jgoodies.looks.plastic.PlasticTheme theme)
theme
- public static void initLookAndFeel()
Copyright © 2003, 2023, Oracle and/or its affiliates.