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.voidcommonize(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 EnvironmentPublic access for the singleton.Gets the operating system name.Gets the temp directory.Gets the user name.booleanisLinux()Check whether we are running on linuxbooleanisMac()Check whether we are running on a MacbooleanCheck whether we are running on Windowsstatic voidstatic voidmemoryReport(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
-
getCurrentWorkingDirectory
Get the current working directory.- Returns:
- the currentWorkingDirectory.
-
getHomeDirectory
Gets the user's home directory.- Returns:
- the user's home directory.
-
getOsName
-
getTempDirectory
-
getUserName
-
toString
-
isLinux
public boolean isLinux()Check whether we are running on linux- Returns:
trueif we are running on linux
-
isWindows
public boolean isWindows()Check whether we are running on Windows- Returns:
trueif we are running on Windows
-
isMac
public boolean isMac()Check whether we are running on a Mac- Returns:
trueif 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:
clonein 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--ifnulluse default.
-
memoryReport
Print a memory report- Parameters:
message- a message to add on
-
main
-