Package cnuphys.splot.plot
Class Environment
java.lang.Object
cnuphys.splot.plot.Environment
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Singleton objects cannot be cloned, so we override clone to throw a CloneNotSupportedException.void
commonize
(JComponent component, Color color) Useful for making common look componentsGet the JAVA class path.getCommonFont
(int size) Convenience method for sharing common fontsGet the current working directory.Get the UIManager's choice for panel background colorGets the user's home directory.static Environment
Public access for the singleton.Gets the operating system name.Gets the temp directory.Gets the user name.boolean
isLinux()
Check whether we are running on linuxboolean
isMac()
Check whether we are running on a Macboolean
Check whether we are running on Windowsstatic void
static void
memoryReport
(String message) Print a memory reporttoString()
Convert to a string representation.
-
Method Details
-
getCommonFont
Convenience method for sharing common fonts- Parameters:
size
- the size of the font- Returns:
- the common font
-
getInstance
Public access for the singleton.- Returns:
- the singleton object.
-
getClassPath
Get the JAVA class path.- Returns:
- the JAVA class path.
-
getCurrentWorkingDirectory
Get the current working directory.- Returns:
- the currentWorkingDirectory.
-
getHomeDirectory
Gets the user's home directory.- Returns:
- the user's home directory.
-
getOsName
Gets the operating system name.- Returns:
- the operating system name..
-
getTempDirectory
Gets the temp directory.- Returns:
- the tempDirectory.
-
getUserName
Gets the user name.- Returns:
- the userName.
-
toString
Convert to a string representation. -
isLinux
public boolean isLinux()Check whether we are running on linux- Returns:
true
if we are running on linux
-
isWindows
public boolean isWindows()Check whether we are running on Windows- Returns:
true
if we are running on Windows
-
isMac
public boolean isMac()Check whether we are running on a Mac- Returns:
true
if we are running on a Mac
-
getPngWriter
- Returns:
- the pngWriter
-
clone
Singleton objects cannot be cloned, so we override clone to throw a CloneNotSupportedException.- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
getDefaultPanelBackgroundColor
Get the UIManager's choice for panel background color- Returns:
- the UIManager's choice for panel background color
-
commonize
Useful for making common look components- Parameters:
component
- the componentcolor
- the background color--ifnull
use default.
-
memoryReport
Print a memory report- Parameters:
message
- a message to add on
-
main
-