private File predfinedFile(String path){ return ConfigUtils.getFileSystemAdapter().openFile(path); }
/** * * @return */ public static Icon[] getPlayerIcons(){ Icon[] icons = new Icon[3]; String path = UIConfigHelper.getImagePath(); icons[0] = ConfigUtils.getFileSystemAdapter().openImageIcon(path + "Play24.gif"); icons[1] = ConfigUtils.getFileSystemAdapter().openImageIcon(path + "Pause24.gif"); icons[2] = ConfigUtils.getFileSystemAdapter().openImageIcon(path + "Stop24.gif"); return icons; }
/** * Attempts to load a Configuration from the default location. * @return Configuration loaded from the default location */ public static Configuration getConfiguration(){ if(theConfiguration == null){ try{ File config = getFileSystemAdapter().openFile("./resources/main.properties"); theConfiguration = new PropertiesConfiguration(config); }catch(ConfigurationException t){ theLogger.log(Level.WARNING, "Cannont find main.properties", t); } } return theConfiguration; }
/** * * @return */ public static Icon[] getFileIcons(){ Icon[] icons = new Icon[3]; String path = UIConfigHelper.getImagePath(); icons[0] = ConfigUtils.getFileSystemAdapter().openImageIcon(path + "new24.png"); icons[1] = ConfigUtils.getFileSystemAdapter().openImageIcon(path + "open24.png"); icons[2] = ConfigUtils.getFileSystemAdapter().openImageIcon(path + "save24.png"); return icons; }
/** * Loads an XML file from the given path. * @param path location of the XML file * @return XML file at the given path */ public static HierarchicalConfiguration loadXMLConfig(String path){ File file = ConfigUtils.getFileSystemAdapter().openFile(path); try{ return new XMLConfiguration(file); }catch (ConfigurationException t){ theLogger.log(Level.WARNING, "Cannont open XML file at: " + path, t); return null; } }
/** * * @return */ public static Icon[] getAllJointIcons(){ Icon[] icons = new Icon[6]; String path = UIConfigHelper.getImagePath(); icons[0] = ConfigUtils.getFileSystemAdapter().openImageIcon(path + "PlayStatus12.png"); icons[1] = ConfigUtils.getFileSystemAdapter().openImageIcon(path + "PauseStatus12.png"); icons[2] = ConfigUtils.getFileSystemAdapter().openImageIcon(path + "StopStatus12.png"); icons[3] = ConfigUtils.getFileSystemAdapter().openImageIcon(path + "Play24.gif"); icons[4] = ConfigUtils.getFileSystemAdapter().openImageIcon(path + "Pause24.gif"); icons[5] = ConfigUtils.getFileSystemAdapter().openImageIcon(path + "Reset16.gif"); return icons; }
}Configuration keyConfig = null; try{ File file = ConfigUtils.getFileSystemAdapter().openFile(path); keyConfig = new PropertiesConfiguration(file); }catch(ConfigurationException ex){
/** * * @return */ public static Icon[] getAnimationTableIcons(){ Icon[] icons = new Icon[4]; String path = UIConfigHelper.getImagePath(); icons[0] = ConfigUtils.getFileSystemAdapter().openImageIcon(path + "not_locked.png"); icons[1] = ConfigUtils.getFileSystemAdapter().openImageIcon(path + "locked.png"); icons[2] = ConfigUtils.getFileSystemAdapter().openImageIcon(path + "not_visible.png"); icons[3] = ConfigUtils.getFileSystemAdapter().openImageIcon(path + "visible.png"); return icons; }
private ManagedService launchRobot( BundleContext context, Robot.Id robotId, String path){ File file = ConfigUtils.getFileSystemAdapter().openFile(path); if(file == null){ return null; } String paramId = "robot/" + robotId + "/config/param/xml"; launchRobotConfig(context, file, paramId); return loadRobotService(context, robotId, paramId); }
/** * * @return */ public static Icon[] getPlayIcons24(){ Icon[] icons = new Icon[4]; String path = UIConfigHelper.getImagePath(); icons[0] = ConfigUtils.getFileSystemAdapter().openImageIcon(path + "Play24.gif"); icons[1] = ConfigUtils.getFileSystemAdapter().openImageIcon(path + "Pause24.gif"); icons[2] = ConfigUtils.getFileSystemAdapter().openImageIcon(path + "Continue24.gif"); icons[3] = ConfigUtils.getFileSystemAdapter().openImageIcon(path + "Stop24.gif"); return icons; }
protected static Set<OSGiComponent> loadJointGroup( BundleContext context, Robot.Id robotId, String configPath){ Set comps = new HashSet<OSGiComponent>(2); File file = ConfigUtils.getFileSystemAdapter().openFile(configPath); if(file == null){ return null; } String paramId = "robot/" + robotId + "/jointgroup/config/param/xml"; comps.add(launchJointGroupConfig(context, file, paramId)); RobotJointGroupLifecycle<File> lifecycle = new RobotJointGroupLifecycle<File>(robotId, File.class, paramId, RobotJointGroupConfigXMLReader.VERSION); OSGiComponent jointGroupComp = new OSGiComponent(context, lifecycle); jointGroupComp.start(); comps.add(jointGroupComp); return comps; }
/** * * @return */ public static Icon[] getPlayStatusIcons(){ Icon[] icons = new Icon[4]; String path = UIConfigHelper.getImagePath(); icons[0] = ConfigUtils.getFileSystemAdapter().openImageIcon(path + "PlayStatus12.png"); icons[1] = ConfigUtils.getFileSystemAdapter().openImageIcon(path + "PauseStatus12.png"); icons[2] = ConfigUtils.getFileSystemAdapter().openImageIcon(path + "StopStatus12.png"); icons[3] = ConfigUtils.getFileSystemAdapter().openImageIcon(path + "CompleteStatus12.png"); return icons; }
/** * * @return */ public static Icon[] getHistoryIcons(){ Icon[] icons = new Icon[2]; String path = UIConfigHelper.getImagePath(); icons[0] = ConfigUtils.getFileSystemAdapter().openImageIcon(path + "undo24.gif"); icons[1] = ConfigUtils.getFileSystemAdapter().openImageIcon(path + "redo24.gif"); return icons; }
/** * * @return */ public static Icon[] getDefaultHeaderIcons(){ Icon[] icons = new Icon[4]; String path = UIConfigHelper.getImagePath(); icons[0] = ConfigUtils.getFileSystemAdapter().openImageIcon(path + "DefaultHeader12.png"); path += theLookAndFeelDir; icons[1] = ConfigUtils.getFileSystemAdapter().openImageIcon(path + "close_enabled.png"); icons[2] = ConfigUtils.getFileSystemAdapter().openImageIcon(path + "close_rollover.png"); icons[3] = ConfigUtils.getFileSystemAdapter().openImageIcon(path + "close_pressed.png"); return icons; }
/** * * @return */ public static Icon getCompletedHeaderIcon(){ String path = UIConfigHelper.getImagePath(); return ConfigUtils.getFileSystemAdapter().openImageIcon(path + "CompleteStatus12.png"); }
/** * * @return */ public static Icon getDefaultHeaderIcon(){ String path = UIConfigHelper.getImagePath(); return ConfigUtils.getFileSystemAdapter().openImageIcon(path + "DefaultHeader12.png"); }