public class Global
extends Object
charger.Global.setup();
charger.Global.closeOutAll();should allow CharGer to exit gracefully.
Modifier and Type | Field and Description |
---|---|
static int |
AcceleratorKey
Key to use with shortcut commands; i.e., CNTL on PC, Cmd on Mac
|
static Hashtable |
ActiveDatabases
A list of file names and charger.db.Database objects, representing all
known Databases
|
static boolean |
ActorAnimation |
static Hashtable |
allObjectList
Stores list of (objectID, GraphObject) pairs for keeping track of all
graph's objects.
|
static boolean |
allowActorLinksAcrossContexts
If "restricted" then actor links cannot cross context boundaries;
otherwise they can
|
static boolean |
allowAnyGenSpecLink
Temporary fix to allow any gen spec links to be drawn, because defaulting implicit subtypes of "T" is
problematic when users want to explicitly show it.
|
static boolean |
AllowNullActorArguments |
static int |
AnimationDelay
Number of milliseconds between "animation" frames.
|
static String |
APPLICATION_CONFIG_FOLDER |
static ImageIcon |
applicationIcon |
(package private) static URL |
applicationIconURL |
static Double |
arrowPointLocation
How far toward the "to" object to draw an arrowhead.
|
static JMenuItem |
BackToHubCmdItem |
static Border |
BeveledBorder |
static String |
BUILD_NUM
The build number (e.g., the string " (678)") for developers and support.
|
static Hashtable<String,Color> |
bwBackground |
static Hashtable<String,Color> |
bwForeground |
static Clipboard |
cgClipboard |
static String |
cgClipboardType |
static FileFilter |
CGIFFileFilter |
static FileFilter |
CGXFileFilter |
static Color |
chargerBlueColor |
static String |
CharGerCGIFCommentStart
Used in setting CGIF comments so that they are clearly recognizable by
CharGer
|
static String |
CharGerDate
The date assigned to this version in the form (YYYY-MM-DD)
|
static chargerlib.CDateTime.STYLE |
ChargerDefaultDateTimeStyle |
static String |
ChargerFileExtension
The default extension for Charger files.
|
static HubFrame |
CharGerMasterFrame
So we always know where our hub is.
|
static String |
chargerpluginPackage |
static String |
copyrightNotice |
static EditFrame |
CurrentEditFrame
The editing window being edited; null if there is none
|
static File |
DatabaseFolderFile |
static String |
DatabaseFolderString |
static Font |
defaultBoldFont |
static String |
defaultContextLabel |
static chargerlib.FileFormat |
defaultFileFormat
Charger's current file format.
|
static Font |
defaultFont |
static FontMetrics |
defaultFontMetrics |
static String |
defaultFontName |
static int |
defaultFontSize |
static int |
defaultFontStyle |
static Graphics |
defaultGraphics
These globals require an active frame to make sense, mostly graphics.
|
static BasicStroke |
defaultStroke |
static Hashtable<Integer,EditFrame> |
editFrameList
Stores list of (FrameNum, EditFrame) pairs for referencing
|
(package private) ReferenceQueue |
EditFrameReferenceQueue |
static ThreadGroup |
EditFrameThreadGroup |
static String |
EditorNameString
Currently set to "CharGer"
|
static boolean |
enableActors |
static boolean |
enableCopyCorefs |
static boolean |
enableEditFrameThreads |
static boolean |
enforceStandardRelations |
static boolean |
exportSubtypesAsRelations
Whether to export type hierarchies as (subtype ...
|
static ArrayList<String> |
extraArguments |
static Hashtable<String,Color> |
factoryBackground
the current factory color scheme, background where entries are
charger.obj class names, default background (fill) color
|
static EdgeAttributes |
factoryEdgeAttributes |
static Hashtable<String,Color> |
factoryForeground
the current factory color scheme, foreground where entries are
charger.obj class names, default foreground (text) color
|
static PrintStream |
fileStdErrorPrintStream |
static PrintStream |
fileStdOutputPrintStream |
static Color |
fuchsiaColor |
static File |
GraphFolderFile |
static String |
GraphFolderString |
static Hashtable |
graphList
Stores list of (GraphNum, Graph ) pairs for referencing
|
static Hashtable<String,Color> |
grayBackground |
static Hashtable<String,Color> |
grayForeground |
static String |
HubFolder |
static Collator |
ignoreCase |
static double |
imageCopyScaleFactor
Image scaling when converting to image or copying for external paste.
|
static String |
imagePath |
static boolean |
importSubtypeRelationsAsHierarchy
Whether to treat [Type] concepts and (subtype) relations as special type hierarchy denotations or not.
|
static boolean |
includeCharGerInfoInCGIF
Whether to include CharGer data (e.g., element positions, source names)
in exported graphs
|
static boolean |
infoOn
whether to show some tracing information.
|
static boolean |
keepClipboardIDs |
static KnowledgeManager |
knowledgeManager |
static File |
LastFolderUsedForOpen |
static File |
LastFolderUsedForSave |
private static int |
LastWindow
Number assigned to last editframe window that was allocated
|
static String |
LineSeparator |
static String |
LinkToContextStrategy |
static TextProperties |
LocaleStrings |
static String |
LOG_FILENAME |
static File |
logFile |
private static Border |
loweredBevel |
static Thread |
MainThread
since each EditFrame instance runs in its own thread, keep track of them
|
static String |
matchingStrategy |
static boolean |
mmatEnabled
Name of the class that is our default matcher for binary relation
matching.
|
static boolean |
modalityLabelsActive
Disabled for the time being since some graphs have one and some don't
|
static String |
moduleNamesToEnableCommaSeparated |
static ArrayList<ModulePlugin> |
modulePluginsActivated |
static ArrayList<ModulePlugin> |
modulePluginsAvailable |
static ArrayList<ModulePlugin> |
modulePluginsEnabled |
static boolean |
modulesChanged
Indicates whether modules have been changed, so that some methods can respond
appropriately.
|
static boolean |
OfficialRelease
if false, then enables Global.info output and enables various
experimental menu items and operations.
|
static Color |
oliveGreenColor |
static ThreadGroup |
orphanUpdaters |
static PreferencesFrame |
pf |
static PageFormat |
pformat
keep a global page format instance for all the editing windows to use
|
static double |
PIXEL_EPSILON
Considered the minimum difference in object size and position that is worth considering.
|
static String |
PREFERENCES_FILENAME |
static double |
preferredEdgeLength |
static File |
prefFile |
static byte[] |
prefFileAsBytes |
static Properties |
Prefs
Prefs simply stores (Name,Value) pairs as strings.
|
private static Border |
raisedBevel |
static String |
RELEASE_VERSION
Used as a human-readable rendition of the current version.
|
static boolean |
saveHistoryRecords |
static double |
ScalingFactor |
static KnowledgeBase |
sessionKB |
static Color |
shadowColor |
static Point |
shadowOffset |
static boolean |
showAllFonts |
static boolean |
showBorders
Whether to show an "outline" for each displayed node in a graph.
|
static boolean |
ShowBoringDebugInfo |
static boolean |
showCutOrnamented
Whether to shade the inside of a cut so that nesting is easier to
understand
|
static boolean |
showFooterOnPrint |
static boolean |
showGEdgeDisplayRect
whether to display an edge selection "handle" on edges between things
|
static boolean |
showShadows |
static int |
springLayoutMaxIterations |
static boolean |
standardOutputToLog |
static int |
TotalGobjs
Actual graph object count.
|
static boolean |
traceActors
Whether to display (on the console) tracing information as each actor
fires.
|
static boolean |
use_1_0_actors
Whether to use 1-0 as true-false or else use "top" and "absurd"
|
static boolean |
useBufferedImage |
static Hashtable<String,Color> |
userBackground |
static EdgeAttributes |
userEdgeAttributes |
static Hashtable<String,Color> |
userForeground
the user's color scheme, with any changes as per their prefs or session
choices
|
static boolean |
wordnetEnabled |
Constructor and Description |
---|
Global()
Sets up all one-time decisions and values.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
acceptCGIFFileName(String name)
Checks for strings ending in ".cgif" or "CGIF", but not starting with
".".
|
static boolean |
acceptCGXFileName(String name)
Checks for strings ending in charger cgx extension, but not starting with ".".
|
static CGDatabase |
activateDatabase(String filename)
Stores an entry for the "database" as indicated by its file name, and
sets up the file for reading, by getting the field headers from the first
line.
|
static int |
addEditFrame(EditFrame ef)
Stores an entry for the edit frame
|
static String |
addGraph(Graph g)
Stores an entry for a given graph
|
static GraphObjectID |
applyForID()
Gives a unique ID to be used in identifying graph objects
|
static boolean |
closeOutAll()
Housekeeping before we quit: calls closeOut on every open edit frame
detaches every database
|
static void |
consoleMsg(String s)
Displays a status message on System.out
|
static void |
deactivateDatabase(String filename)
Removes the entry for the edit frame, and removes the edit frame's graph
from the global list.
|
static void |
deactivateID(GraphObjectID id)
Informs the global store that an ID is no longer in use.
|
static void |
error(String s)
Displays an error message on System.out
|
static String |
getChargerVersion() |
static EditFrame |
getCurrentEditFrame() |
static Color |
getDefaultColor(String classname,
String foreback)
Gets the default foreground or the default background color scheme for
the given object.
|
static int |
getGraphCount()
Get the number of graphs available to CharGer.
|
static File |
getLogFile() |
static EditFrame |
getNewestEditFrame()
Returns the newest edit frame created.
|
static int |
getObjectCount() |
static ModulePlugin |
getPluginInstanceForClassName(String pluginClassName)
Find the module plugin instance for a given classname.
|
static File |
getPrefFile() |
static int |
getWindowCount()
Get the number of editing windows currently open.
|
static void |
info(String s)
Displays a status message on System.out
|
static void |
initializeDefaultColors()
Set up the lookup tables that keep the colors for each kind of object.
|
static void |
loadConfig(String fname)
Loads in the configuration from a text file.
|
static void |
managePreferencesFrame() |
static String |
openGraphInNewFrame(String filename)
Opens a new graph in its own editframe.
|
private static Color |
parseRGB(String RGBstring) |
static void |
performActionPageSetup()
Invokes the system's page setup routine.
|
static void |
queryForDatabaseFolder(JFrame f)
Query the user for a new graphs folder.
|
static File |
queryForFolder(JFrame f,
File initialDirectory,
String prompt)
Query the user to identify a folder by choosing a file within it.
|
static File |
queryForGraphFile(File sourceDirectoryFile) |
static void |
queryForGraphFolder(JFrame f)
Query the user for a new graphs folder.
|
static void |
removeCurrentEditFrame(EditFrame ef)
Shouldn't be used; just use setCurrentEditFrame( null );
|
static void |
removeEditFrame(EditFrame ef)
Removes the entry for the edit frame, and removes the edit frame's graph
from the global list.
|
static void |
removeGraph(Graph g)
Removes the entry for the graph
|
static void |
setAppearanceAll()
Resets appearance on all editing frames.
|
static void |
setCurrentEditFrame(EditFrame ef)
Marks which edit frame is the active frame.
|
static void |
setDefaultColor(String classname,
String foreback,
Color c)
Set a default color to override factory defaults.
|
static void |
setDefaultColorsFromPrefs(String classname)
sets the default colors from preference entries of the form
"defaultColor-Concept-fill" and "255,255,255".
|
static void |
setDefaultFont(Font f)
Sets the default canvas font for all new edit frames.
|
static void |
setGraphFolder(String newGraphFolder,
boolean queryToReplacePrefs)
Set the global graph folder and look for a new preferences file.
|
static void |
setModulesChanged()
Should be called whenever the mix of external modules has changed,
either one or more being enabled, or one or more being disabled.
|
static void |
setup1()
Starts up the main charger application.
|
static void |
setupAll(String startupFolder,
ArrayList<String> extraArgs,
boolean diagnostics) |
static void |
setupArguments(String startupFolder,
ArrayList<String> extraArgs,
boolean diagnostics) |
static void |
setupAsLibrary()
When Charger is being used as a library, not as a standalone.
|
static void |
setupFonts() |
static void |
setupGraphAppearance() |
static String |
strs(String key)
Wrapper for the LocaleStrings property list.
|
static void |
warning(String s)
Displays a warning message on System.out
|
public static final String RELEASE_VERSION
BUILD_NUM
,
Constant Field Valuespublic static final String BUILD_NUM
public static final String CharGerDate
public static final String EditorNameString
public static final String copyrightNotice
public static final boolean OfficialRelease
info(java.lang.String)
,
Constant Field Valuespublic static boolean infoOn
public static final boolean traceActors
public static final String CharGerCGIFCommentStart
public static boolean includeCharGerInfoInCGIF
public static boolean exportSubtypesAsRelations
public static boolean importSubtypeRelationsAsHierarchy
public static final String LineSeparator
public static final String imagePath
public static int AcceleratorKey
public static final TextProperties LocaleStrings
TextProperties
public static String HubFolder
public static String GraphFolderString
public static String DatabaseFolderString
public static File GraphFolderFile
public static File DatabaseFolderFile
public static File LastFolderUsedForSave
public static File LastFolderUsedForOpen
public static chargerlib.FileFormat defaultFileFormat
public static final String ChargerFileExtension
public static final chargerlib.CDateTime.STYLE ChargerDefaultDateTimeStyle
public static KnowledgeBase sessionKB
public static boolean wordnetEnabled
public static ArrayList<String> extraArguments
public static boolean mmatEnabled
public static KnowledgeManager knowledgeManager
public static boolean allowAnyGenSpecLink
public static String matchingStrategy
public static boolean ActorAnimation
public static int AnimationDelay
public static boolean AllowNullActorArguments
public static boolean allowActorLinksAcrossContexts
public static Hashtable ActiveDatabases
public static boolean use_1_0_actors
public static boolean enableActors
public static boolean enableCopyCorefs
public static double ScalingFactor
public static boolean useBufferedImage
public static Hashtable<Integer,EditFrame> editFrameList
public static Hashtable graphList
public static Hashtable allObjectList
private static int LastWindow
public static int TotalGobjs
public static EditFrame CurrentEditFrame
public static JMenuItem BackToHubCmdItem
public static HubFrame CharGerMasterFrame
public static PageFormat pformat
public static Collator ignoreCase
public static boolean modalityLabelsActive
public static Thread MainThread
public static ThreadGroup EditFrameThreadGroup
public static boolean enableEditFrameThreads
public static ThreadGroup orphanUpdaters
public static Properties Prefs
public static String LinkToContextStrategy
public static boolean enforceStandardRelations
public static boolean saveHistoryRecords
public static byte[] prefFileAsBytes
public static final String LOG_FILENAME
public static final String APPLICATION_CONFIG_FOLDER
public static final String PREFERENCES_FILENAME
public static File prefFile
public static File logFile
public static boolean standardOutputToLog
public static PrintStream fileStdOutputPrintStream
public static PrintStream fileStdErrorPrintStream
public static ArrayList<ModulePlugin> modulePluginsAvailable
public static ArrayList<ModulePlugin> modulePluginsEnabled
public static ArrayList<ModulePlugin> modulePluginsActivated
public static String moduleNamesToEnableCommaSeparated
public static String chargerpluginPackage
public static boolean modulesChanged
static URL applicationIconURL
public static final ImageIcon applicationIcon
public static Graphics defaultGraphics
public static FontMetrics defaultFontMetrics
public static Font defaultFont
public static String defaultFontName
public static int defaultFontStyle
public static int defaultFontSize
public static Font defaultBoldFont
public static boolean showAllFonts
public static Color fuchsiaColor
public static Color chargerBlueColor
public static Color oliveGreenColor
public static Color shadowColor
public static Point shadowOffset
public static boolean showShadows
private static Border raisedBevel
private static Border loweredBevel
public static Border BeveledBorder
public static boolean showGEdgeDisplayRect
public static double preferredEdgeLength
public static double PIXEL_EPSILON
public static Double arrowPointLocation
public static EdgeAttributes factoryEdgeAttributes
public static EdgeAttributes userEdgeAttributes
public static BasicStroke defaultStroke
public static boolean showBorders
public static boolean showFooterOnPrint
public static double imageCopyScaleFactor
public static boolean showCutOrnamented
public static Hashtable<String,Color> factoryForeground
public static Hashtable<String,Color> factoryBackground
public static Hashtable<String,Color> userForeground
public static Hashtable<String,Color> userBackground
public static Hashtable<String,Color> bwForeground
public static Hashtable<String,Color> bwBackground
public static Hashtable<String,Color> grayForeground
public static Hashtable<String,Color> grayBackground
public static String defaultContextLabel
public static int springLayoutMaxIterations
public static Clipboard cgClipboard
public static boolean keepClipboardIDs
public static String cgClipboardType
public static boolean ShowBoringDebugInfo
ReferenceQueue EditFrameReferenceQueue
public static PreferencesFrame pf
public static FileFilter CGIFFileFilter
public static FileFilter CGXFileFilter
public static File getPrefFile()
public static File getLogFile()
public static String getChargerVersion()
public static void setupAsLibrary()
public static void setupAll(String startupFolder, ArrayList<String> extraArgs, boolean diagnostics)
public static void setupArguments(String startupFolder, ArrayList<String> extraArgs, boolean diagnostics)
public static void setupFonts()
public static void setupGraphAppearance()
public static void setup1()
driver
- startupFolder
- the graphs folder, if one is setextraArgs
- any command line options that aren't in the known setdiagnostics
- whether to turn on Global.info and other output
routines.public static void setCurrentEditFrame(EditFrame ef)
ef
- the editing window that will become the new current windowpublic static EditFrame getCurrentEditFrame()
public static EditFrame getNewestEditFrame()
public static void removeCurrentEditFrame(EditFrame ef)
public static boolean closeOutAll()
public static ModulePlugin getPluginInstanceForClassName(String pluginClassName)
pluginClassName
- a simple name for a plugin class (e.g., "TestModulePlugin")public static GraphObjectID applyForID()
public static void deactivateID(GraphObjectID id)
public static int getWindowCount()
public static int getGraphCount()
public static int getObjectCount()
public static void initializeDefaultColors()
public static void setDefaultColorsFromPrefs(String classname)
private static Color parseRGB(String RGBstring)
public static Color getDefaultColor(String classname, String foreback)
classname
- one of "Concept" "Relation" etc.foreback
- either "text" or "fill"public static void setDefaultColor(String classname, String foreback, Color c)
classname
- Name of the class whose text/fill is to be defaultedforeback
- one of either "text" or "fill"c
- The color to be made the current default.public static void setAppearanceAll()
public static CGDatabase activateDatabase(String filename) throws CGFileException
CGFileException
CGDatabase
public static void deactivateDatabase(String filename)
public static int addEditFrame(EditFrame ef)
public static void removeEditFrame(EditFrame ef)
EditFrame.closeOut()
public static void setDefaultFont(Font f)
f
- New font to be set.public static String addGraph(Graph g)
graphList
public static void removeGraph(Graph g)
graphList
public static void queryForGraphFolder(JFrame f)
f
- parent frame for the dialog.public static void setGraphFolder(String newGraphFolder, boolean queryToReplacePrefs)
newGraphFolder
- the absolute path for the new graph folderpublic static void queryForDatabaseFolder(JFrame f)
f
- parent frame for the dialog.public static File queryForFolder(JFrame f, File initialDirectory, String prompt)
f
- parent frame for the dialog.initialDirectory
- where to initially point the chooser dialogprompt
- title string for the dialog boxpublic static void loadConfig(String fname) throws CGFileException
fname
- file name from preferences are to be loaded. File format is
CGFileException
APPLICATION_CONFIG_FOLDER
,
PREFERENCES_FILENAME
public static void performActionPageSetup()
public static String strs(String key)
key
- logical name of the stringpublic static void setModulesChanged()
public static void managePreferencesFrame()
public static boolean acceptCGXFileName(String name)
FileFormat
public static boolean acceptCGIFFileName(String name)
public static File queryForGraphFile(File sourceDirectoryFile)
public static String openGraphInNewFrame(String filename)
filename
- the file from which to open a graph; null if a dialog is
to be invoked. Called from various open menus, buttons and routines. Has
two parts: getting the graph from the file and then setting up the
editing window. Not responsible for focus, etc.public static void error(String s)
s
- the error message to be shownpublic static void warning(String s)
s
- the warning message to be shownpublic static void info(String s)
s
- the status message to be showninfoOn
,
ShowBoringDebugInfo
public static void consoleMsg(String s)
s
- the status message to be shown