|
What this is
Other links
The source code// $Id: Argo.java,v 1.35 2004/07/18 10:52:24 linus Exp $ // Copyright (c) 1996-2004 The Regents of the University of California. All // Rights Reserved. Permission to use, copy, modify, and distribute this // software and its documentation without fee, and without a written // agreement is hereby granted, provided that the above copyright notice // and this paragraph appear in all copies. This software program and // documentation are copyrighted by The Regents of the University of // California. The software program and documentation are supplied "AS // IS", without any accompanying services from The Regents. The Regents // does not warrant that the operation of the program will be // uninterrupted or error-free. The end-user understands that the program // was developed for research purposes and is advised not to rely // exclusively on the program for any reason. IN NO EVENT SHALL THE // UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, // SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, // ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF // THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF // SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE // PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF // CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, // UPDATES, ENHANCEMENTS, OR MODIFICATIONS. package org.argouml.application.api; import java.util.ArrayList; import javax.swing.Icon; import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.argouml.application.helpers.ResourceLoaderWrapper; import org.argouml.application.modules.ModuleLoader; /** * The
* format: * perspective name,rule,rule,rule;perspective name, etc **/ public static final ConfigurationKey KEY_USER_EXPLORER_PERSPECTIVES = Configuration.makeKey("explorer", "perspectives"); /** Standard definition of the logging category for the console. */ public static final String CONSOLE_LOG = "argo.console.log"; /** Standard definition of the logging category for the console. */ public static final String ARGO_CONSOLE_SUPPRESS = "argo.console.suppress"; /** Standard definition of system variable to add text prefix to * console log. */ public static final String ARGO_CONSOLE_PREFIX = "argo.console.prefix"; /** Don't let this class be instantiated. */ private Argo() { } /** Change the default startup directory. * @param dir the directory to save */ public static void setDirectory(String dir) { // Store in the user configuration, and // let gef know also. org.tigris.gef.base.Globals.setLastDirectory(dir); // Configuration.setString(KEY_STARTUP_DIR, dir); } /** Get the default startup directory. * @return the startup directory */ public static String getDirectory() { // Use the configuration if it exists, otherwise // use what gef thinks. return Configuration.getString(KEY_STARTUP_DIR, org.tigris.gef.base.Globals .getLastDirectory()); } /** Returns a vector of plugins of the class type passed * which satisfy both of the contexts required. * * If no plugins are available, returns null. * * @param pluginType class of the plugin to search for * @param context plugin-specific query parameters * @return a vector of plugins or null */ public static final ArrayList getPlugins(Class pluginType, Object[] context) { return ModuleLoader.getInstance().getPlugins(pluginType, context); } /** Returns a vector of all plugins of the class type passed. * * If no plugins are available, returns null. * @param pluginType class of the plugin to search for * @return a vector of plugins or null */ public static final ArrayList getPlugins(Class pluginType) { return ModuleLoader.getInstance().getPlugins(pluginType, null); } /** Initializes the module loader. Multiple calls are ignored. */ public static final void initializeModules() { ModuleLoader.getInstance().initialize(); } /** Convenience helper to access the argo home directory * * @return the argo home directory */ public static String getArgoHome() { return ModuleLoader.getInstance().getArgoHome(); } /** Convenience helper to access the argo root directory * * @return the argo root directory */ public static String getArgoRoot() { return ModuleLoader.getInstance().getArgoRoot(); } /** * Look up an icon resource. * * @param arg1 the name of the resource to find. * @return an Icon */ public static Icon lookupIconResource(String arg1) { return ResourceLoaderWrapper.lookupIconResource(arg1); } /** * Look up an icon resource. * * @param arg1 the name of the resource to find. * @param arg2 the description of the resource * @return an Icon */ public static Icon lookupIconResource(String arg1, String arg2) { return ResourceLoaderWrapper.lookupIconResource(arg1, arg2); } static { if (System.getProperty(ARGO_CONSOLE_SUPPRESS) != null) { Logger.getRoot().getLoggerRepository().setThreshold(Level.OFF); } } } |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.