Class Environment

java.lang.Object
cnuphys.splot.plot.Environment

public final class Environment extends Object
  • Method Details

    • getCommonFont

      public Font getCommonFont(int size)
      Convenience method for sharing common fonts
      Parameters:
      size - the size of the font
      Returns:
      the common font
    • getInstance

      public static Environment getInstance()
      Public access for the singleton.
      Returns:
      the singleton object.
    • getClassPath

      public String getClassPath()
      Get the JAVA class path.
      Returns:
      the JAVA class path.
    • getCurrentWorkingDirectory

      public String getCurrentWorkingDirectory()
      Get the current working directory.
      Returns:
      the currentWorkingDirectory.
    • getHomeDirectory

      public String getHomeDirectory()
      Gets the user's home directory.
      Returns:
      the user's home directory.
    • getOsName

      public String getOsName()
      Gets the operating system name.
      Returns:
      the operating system name..
    • getTempDirectory

      public String getTempDirectory()
      Gets the temp directory.
      Returns:
      the tempDirectory.
    • getUserName

      public String getUserName()
      Gets the user name.
      Returns:
      the userName.
    • toString

      public String toString()
      Convert to a string representation.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the Environment object.
    • 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

      public ImageWriter getPngWriter()
      Returns:
      the pngWriter
    • clone

      public Object clone() throws CloneNotSupportedException
      Singleton objects cannot be cloned, so we override clone to throw a CloneNotSupportedException.
      Overrides:
      clone in class Object
      Throws:
      CloneNotSupportedException
    • getDefaultPanelBackgroundColor

      public Color getDefaultPanelBackgroundColor()
      Get the UIManager's choice for panel background color
      Returns:
      the UIManager's choice for panel background color
    • commonize

      public void commonize(JComponent component, Color color)
      Useful for making common look components
      Parameters:
      component - the component
      color - the background color--if null use default.
    • memoryReport

      public static void memoryReport(String message)
      Print a memory report
      Parameters:
      message - a message to add on
    • main

      public static void main(String[] arg)