rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
actionCommand = command; this.modifiers = modifiers; | cmd = command; | public ActionEvent (Object source, int id, String command, int modifiers) { super(source, id); actionCommand = command; this.modifiers = modifiers; } |
sendCommand("get "+source, getExpectedDownloadMessage(source, to)); | sendCommand("get "+source, getExpectedDownloadMessage(source, to), 0); | public void get(String source, File destination) throws IOException { File destDir = destination.getParentFile(); if (destDir != null) { sendCommand("lcd "+destDir.getAbsolutePath()); } if (destination.exists()) { destination.delete(); } int index = source.lastIndexOf('/'); String srcName = index == -1?sour... |
sendCommand("put "+source.getAbsolutePath(), getExpectedUploadMessage(source, to)); | sendCommand("put "+source.getAbsolutePath(), getExpectedUploadMessage(source, to), 0); | public void put(File source, String destination, boolean overwrite) throws IOException { if (getResource(destination).exists()) { if (overwrite) { sendCommand("rm "+destination, getExpectedRemoveMessage(destination)); } else { return; } } int index = destination.lastIndexOf('/'); String destDir = null;... |
protected String readResponse(final boolean sendErrorAsResponse) throws IOException { final StringBuffer response = new StringBuffer(); final IOException[] exc = new IOException[1]; final boolean[] done = new boolean[1]; Thread reader = new Thread() { public void run() { try { int c; while ((c = _in.read()) != -1) { re... | protected String readResponse(boolean sendErrorAsResponse) throws IOException { return readResponse(sendErrorAsResponse, _readTimeout); | protected String readResponse(final boolean sendErrorAsResponse) throws IOException { final StringBuffer response = new StringBuffer(); final IOException[] exc = new IOException[1]; final boolean[] done = new boolean[1]; Thread reader = new Thread() { public void run() { try { int c; while ((c = _in.r... |
return sendCommand(command, false); | return sendCommand(command, false, _readTimeout); | protected String sendCommand(String command) throws IOException { return sendCommand(command, false); } |
String id; if (hasBinding("id")) { id = (String) valueForBinding("id"); } else { id = AjaxUtils.toSafeElementID(context().elementID()); } return id; | if (_id==null) { if (hasBinding("id")) { _id = (String) valueForBinding("id"); } else { _id = AjaxUtils.toSafeElementID(context().elementID()); } } return _id; | public String id() { String id; if (hasBinding("id")) { id = (String) valueForBinding("id"); } else { id = AjaxUtils.toSafeElementID(context().elementID()); } return id; } |
writer.print(children[i].getName() + " = "); | if (children[i].getType().equals(ComponentData.NODEBINDER)) { writer.print("Node.AgentManager.Binder = "); } else { writer.print(children[i].getName() + " = "); } | private void writeNodeFile(File configDir, ComponentData nc) throws IOException { if (nc.childCount() == 0) { // node has no agents or binders. skip it return; } Object[] parameters = nc.getParameters(); String configFileName = nc.getName() + ".ini"; if (parameters.length > 0) configFileName... |
_directtowebfiles = Framework.frameworkClazz().orderedFrameworks(ec); | _directtowebfiles = Framework.clazz.orderedFrameworks(ec); | public NSArray directtowebfiles(){ if(_directtowebfiles == null){ _directtowebfiles = Framework.frameworkClazz().orderedFrameworks(ec); } return _directtowebfiles; } |
public Experiment(String name, SocietyComponent[] societyComponents, | public Experiment(String name, SocietyComponent societyComponent, | public Experiment(String name, SocietyComponent[] societyComponents, RecipeComponent[] recipes) { this(name); createLogger(); setSocietyComponents(societyComponents); setRecipes(recipes); setDefaultNodeArguments(); } |
setSocietyComponents(societyComponents); | setSocietyComponent(societyComponent); | public Experiment(String name, SocietyComponent[] societyComponents, RecipeComponent[] recipes) { this(name); createLogger(); setSocietyComponents(societyComponents); setRecipes(recipes); setDefaultNodeArguments(); } |
nc.setClassName(""); | nc.setClassName("org.cougaar.core.node.Node"); | private void addNodes() { NodeComponent[] nodesToWrite = getNodes(); for (int i = 0; i < nodesToWrite.length; i++) { ComponentData nc = new GenericComponentData(); nc.setType(ComponentData.NODE); nc.setName(nodesToWrite[i].getShortName()); nc.setClassName(""); // leave this out?? FIXME ... |
if (!societies.contains(sc)) societies.add(sc); | if (society == null) { setSocietyComponent (sc); } else { throw new IllegalArgumentException("Already have a society in experiment " + this); } | public void addSocietyComponent(SocietyComponent sc) { if (!societies.contains(sc)) societies.add(sc); } |
if (inDatabase) | if (DBUtils.dbMode) | public ModifiableComponent copy(String uniqueName) { Experiment experimentCopy = null; if (inDatabase) experimentCopy = new Experiment(uniqueName, expID, trialID); else experimentCopy = new Experiment(uniqueName); Properties newProps = experimentCopy.getDefaultNodeArguments(); newProps.clear... |
SocietyComponent soc = getSocietyComponent(0); if (soc != null && soc.getSocietyName().equals("3ID-135-CMT")) { node = addNode("SMALL-135-TRANS-NODE"); expID = "SMALL-135-TRANS"; } else node = addNode("Node0"); | SocietyComponent soc = getSocietyComponent(); node = addNode("Node0"); if (expID == null) { if (soc != null) expID = soc.getShortName() + "-basic-expt-id"; else expID = "Basic-expt-id"; } | public void createDefaultConfiguration() { // Check if it already has a node? // create one Node NodeComponent node = null; // BIG HACK IN HERE!!!!!! SocietyComponent soc = getSocietyComponent(0); if (soc != null && soc.getSocietyName().equals("3ID-135-CMT")) { node = addNode("SMALL-135-TRANS-N... |
if (inDatabase) { | if (DBUtils.dbMode) { | public void dumpINIFiles() { ExperimentINIWriter cw = null; if (inDatabase) { if (theWholeSoc == null) { // write it to the db // FIXME!! if(log.isDebugEnabled()) { log.error("Save experiment first."); } return; } cw = new ExperimentINIWriter(theWholeSoc); } else { ... |
if(log.isDebugEnabled()) { log.error("Save experiment first."); } return; } cw = new ExperimentINIWriter(theWholeSoc); | } if (theWholeSoc != null) cw = new ExperimentINIWriter(theWholeSoc); | public void dumpINIFiles() { ExperimentINIWriter cw = null; if (inDatabase) { if (theWholeSoc == null) { // write it to the db // FIXME!! if(log.isDebugEnabled()) { log.error("Save experiment first."); } return; } cw = new ExperimentINIWriter(theWholeSoc); } else { ... |
System.out.println("Writing ini files to " + f.getAbsolutePath() + "..."); | JOptionPane.showMessageDialog(null, "Writing ini file to " + f.getAbsolutePath() + "..."); | public void dumpINIFiles() { ExperimentINIWriter cw = null; if (inDatabase) { if (theWholeSoc == null) { // write it to the db // FIXME!! if(log.isDebugEnabled()) { log.error("Save experiment first."); } return; } cw = new ExperimentINIWriter(theWholeSoc); } else { ... |
for (int i = 0; i < societies.size(); i++) { ((SocietyComponent)societies.get(i)).setRunning(false); } | if (society != null) society.setRunning(false); | public void experimentStopped() { if (listeners != null) { for (int i = 0; i < listeners.size(); i++) { ExperimentListener listener = (ExperimentListener)listeners.get(i); listener.experimentTerminated(); } } // Tell the Societies in the experiment they are no longer running? for (int i = 0; i <... |
List nags = getAgentsInSocieties(); | List nags = getAgentsInSociety(); | private List getAgentsInComponents() { List agents = new ArrayList(); List nags = getAgentsInSocieties(); if (nags != null && (! nags.isEmpty())) agents.addAll(nags); nags = getAgentsInRecipes(); if (nags != null && (! nags.isEmpty())) agents.addAll(nags); return agents; } |
List agents = getAgentsInSocieties(); | List agents = getAgentsInSociety(); | public List getAgentsList() { List agents = getAgentsInSocieties(); if (agents == null) agents = new ArrayList(); List other = getAgentsInRecipes(); if (other != null && (! other.isEmpty())) agents.addAll(other); return agents; } |
return (ModifiableComponent)getSocietyComponent(i); | return (ModifiableComponent)getSocietyComponent(); | private ModifiableComponent getComponent(int i) { // What a hack!!! if (i < getSocietyComponentCount()) return (ModifiableComponent)getSocietyComponent(i); else if (i < getComponentCount()) return (ModifiableComponent)(getRecipe(i - (getSocietyComponentCount()))); else return null; } |
return societies.size() + recipes.size(); | return getSocietyComponentCount() + recipes.size(); | public int getComponentCount() { return societies.size() + recipes.size(); } |
if (inDatabase) { | if (DBUtils.dbMode) { | public ConfigurationWriter getConfigurationWriter(NodeComponent[] nodes) { // The given set of nodes is potentially fewer than the full set in the society // Note the ugly this parameter... if (inDatabase) { // Send a config writer that only writes LeafComponentData try { return new LeafOnly... |
if (inDatabase) { | if (DBUtils.dbMode) { | public String getExperimentID() { if (inDatabase) { return expID; } else { return null; } } |
return (SocietyComponent) societies.get(i); | if (i != 0) { throw new IllegalArgumentException("Asked for society " + i + " when only 1, index 0, allowed"); } return society; | public SocietyComponent getSocietyComponent(int i) { return (SocietyComponent) societies.get(i); } |
return societies.size(); | return (society == null ? 0 : 1); | public int getSocietyComponentCount() { return societies.size(); } |
if (inDatabase) | if (DBUtils.dbMode) | public ComponentData getSocietyComponentData() { if (inDatabase) return theWholeSoc; theWholeSoc = new GenericComponentData(); theWholeSoc.setType(ComponentData.SOCIETY); theWholeSoc.setName(getExperimentName()); // this should be experiment: trial FIXME theWholeSoc.setClassName("java.lang.Object"... |
if (inDatabase) { | if (DBUtils.dbMode) { | public String getTrialID() { if (inDatabase) { return trialID; } else { return null; } } |
societies.remove(sc); | society = null; | public void removeSociety(SocietyComponent sc) { societies.remove(sc); } |
defaultNodeArguments.put("org.cougaar.configuration.database", Parameters.findParameter(DBUtils.DATABASE)); defaultNodeArguments.put("org.cougaar.configuration.user", Parameters.findParameter(DBUtils.USER)); defaultNodeArguments.put("org.cougaar.configuration.password", Parameters.findParameter(DBUtils.PASSWORD)); defa... | if (DBUtils.dbMode) { defaultNodeArguments.put("org.cougaar.configuration.database", Parameters.findParameter(DBUtils.DATABASE)); defaultNodeArguments.put("org.cougaar.configuration.user", Parameters.findParameter(DBUtils.USER)); defaultNodeArguments.put("org.cougaar.configuration.password", Parameters.findParameter(DB... | private void setDefaultNodeArguments() { defaultNodeArguments = new ReadOnlyProperties(Collections.singleton("org.cougaar.experiment.id")); defaultNodeArguments.put("org.cougaar.core.persistence.enable", "false"); defaultNodeArguments.put("user.timezone", "GMT"); defaultNodeArguments.put("org.cougaar.core... |
if(log.isDebugEnabled()) { log.debug("org.cougaar.name.server=" + newNameServer); | if(log.isWarnEnabled()) { log.warn("org.cougaar.name.server=" + newNameServer); | public void updateNameServerHostName() { Properties defaultNodeArgs = getDefaultNodeArguments(); String oldNameServer = defaultNodeArgs.getProperty("org.cougaar.name.server"); String newNameServer = null; String dfltNameServer = null; String nameServerHost = null; if (oldNameServer != null) { i... |
removeRuntimeAssembly(csmiAssemblyId); if (! isAssemblyUsed(csmiAssemblyId)) cleanAssembly(csmiAssemblyId); | cleanAssembly(csmiAssemblyId, true); | public boolean populateCSA(ComponentData data) throws SQLException { // For storing the old cmtAssid if we have to change it String oldid = null; // If this is saving an Experiment, we create a CSA assembly: if (exptId != null && trialId != null) { if (log.isDebugEnabled()) { log.debug("populateC... |
csmiAssemblyId = null; | public boolean populateCSA(ComponentData data) throws SQLException { // For storing the old cmtAssid if we have to change it String oldid = null; // If this is saving an Experiment, we create a CSA assembly: if (exptId != null && trialId != null) { if (log.isDebugEnabled()) { log.debug("populateC... | |
if (csmiAssemblyId == null) { if (log.isErrorEnabled()) { log.error("popCSMI had null CSMI assembly ID. Will not save.", new Throwable()); } return false; } | public boolean populateCSMI(ComponentData data) throws SQLException { if (log.isDebugEnabled()) { log.debug("populateCSMI saving into " + csmiAssemblyId); } return populate(data, 1f, csmiAssemblyId); } | |
if (hnaAssemblyId == null) { if (log.isErrorEnabled()) { log.error("popHNA: null HNA assembly ID? Can't save", new Throwable()); } return false; } | public boolean populateHNA(ComponentData data) throws SQLException { if (log.isDebugEnabled()) { log.debug("populateHNA saving into " + hnaAssemblyId); } boolean added = false; try { // Incrementally save // so that later recipes have the benefit // of the earlier modifications ... | |
if(log.isDebugEnabled()) { log.error("CSMARTUL can't add results to collection: " + e); | if(log.isErrorEnabled()) { log.error("CSMARTUL can't add results to collection: ", e); | private static Collection getObjectsFromServletWorker(Vector agentURLs, String servletName, ArrayList parameterNames, ArrayList parameterValues, i... |
if(log.isDebugEnabled()) { | if(log.isInfoEnabled()) { | public void makeMetricsGraph() { Collection objectsFromServlet = getObjectsFromServlet(ClientServletUtil.METRICS_SERVLET); if (objectsFromServlet == null) return; if(log.isDebugEnabled()) { log.info("Received metrics: " + objectsFromServlet.size()); } ArrayList names = new ArrayList(); ... |
if(log.isDebugEnabled()) { | if(log.isWarnEnabled()) { | private void makeSocietyGraph() { Collection objectsFromServlet = getObjectsFromServlet(ClientServletUtil.AGENT_INFO_SERVLET); if (objectsFromServlet == null) return; Vector nodeObjects = new Vector(objectsFromServlet.size()); Hashtable nameToUID = new Hashtable(); for (Iterator i = objectsF... |
if(log.isDebugEnabled()) { | if(log.isInfoEnabled()) { | private void makeSocietyGraph() { Collection objectsFromServlet = getObjectsFromServlet(ClientServletUtil.AGENT_INFO_SERVLET); if (objectsFromServlet == null) return; Vector nodeObjects = new Vector(objectsFromServlet.size()); Hashtable nameToUID = new Hashtable(); for (Iterator i = objectsF... |
if(log.isDebugEnabled()) { log.error("Illegal number: "+sLimit); | if(log.isErrorEnabled()) { log.error("Illegal number: "+sLimit, nfe); | private void makeThreadGraph() { // will gather these parameters: String UID; String agentName; int limit; boolean isDown; // FIXME: should have a single popup: // UID=<default to empty> // AgentName=<default to empty> // Limit=<default to 200, add "no-limit" checkbox + grey-out> ... |
if(log.isDebugEnabled()) { | if(log.isWarnEnabled()) { | private static void processOrganizationAssets(Collection orgAssets) { Logger log = CSMART.createLogger("org.cougaar.tools.csmart.ui.monitor.viewer.CSMARTUL"); communityToAgents = new Hashtable(); agentToCommunity = new Hashtable(); agentToURL = new Hashtable(); for (Iterator i = orgAssets.iterator(); i... |
if (log.isDebugEnabled()) log.error("Exception parsing " + AGENT_PORT + " : " + e); | if (log.isErrorEnabled()) log.error("Exception parsing " + AGENT_PORT + " : ", e); | private static void setHostToMonitor() { Logger log = CSMART.createLogger("org.cougaar.tools.csmart.ui.monitor.viewer.CSMARUL"); ArrayList potentialHosts = new ArrayList(); ArrayList potentialNodes = new ArrayList(); HostComponent[] hosts = experiment.getHosts(); for (int i = 0; i < hosts.length; i++) ... |
if(log.isDebugEnabled()) { log.error("CSMARTUL: " + e); | if(log.isErrorEnabled()) { log.error("CSMARTUL: ", e); | private static void setURLToMonitor() { Logger log = CSMART.createLogger("org.cougaar.tools.csmart.ui.monitor.viewer.CSMARTUL"); JTextField tf = new JTextField(ClientServletUtil.makeURL("localhost", agentPort)); JPanel panel = new JPanel(); panel.add(new JLabel("Agent URL:")); panel.add(tf); i... |
if(log.isDebugEnabled()) { | if(log.isErrorEnabled()) { | public void update(Observable o, Object arg) { if (o instanceof NamedFrame) { NamedFrame namedFrame = (NamedFrame) o; NamedFrame.Event event = (NamedFrame.Event) arg; if (event.eventType == NamedFrame.Event.ADDED) { JMenuItem menuItem = new JMenuItem(event.title); titleToMenuItem.put(e... |
int maxColor = | maxColor = | public UIProperties() { createLogger(); // define default properties Properties defaults = new Properties(); setDefaults(defaults); // define new properties from config file; default to defaults properties = new Properties(defaults); ConfigFinder configFinder = ConfigFinder.getInstance(); File... |
if(log.isDebugEnabled()) { | if(log.isInfoEnabled()) { | public ULPlanNode(PropertyTree p, String communityName) { createLogger(); this.properties = p; UID = (String)properties.get(PropertyNames.UID_ATTR); tooltip = UID; // default tooltip if none other is set objectType = (String)properties.get(PropertyNames.OBJECT_TYPE); setNodeShapeParameters(); // ... |
if(log.isDebugEnabled()) { | if(log.isErrorEnabled()) { | public ULPlanNode(PropertyTree p, String communityName) { createLogger(); this.properties = p; UID = (String)properties.get(PropertyNames.UID_ATTR); tooltip = UID; // default tooltip if none other is set objectType = (String)properties.get(PropertyNames.OBJECT_TYPE); setNodeShapeParameters(); // ... |
synchronized (root) { | synchronized (lockObject) { | public void run() { synchronized (root) { while (true) { try { long now = System.currentTimeMillis(); if (updateNeeded && now > nextUpdate) { save(workspaceFileName); updateNeeded = false; root.notifyAll(); // In case anyone's waiting for the update to finish } else if (updateNeeded) { ... |
root.notifyAll(); | lockObject.notifyAll(); | public void run() { synchronized (root) { while (true) { try { long now = System.currentTimeMillis(); if (updateNeeded && now > nextUpdate) { save(workspaceFileName); updateNeeded = false; root.notifyAll(); // In case anyone's waiting for the update to finish } else if (updateNeeded) { ... |
root.wait(delay); | lockObject.wait(delay); | public void run() { synchronized (root) { while (true) { try { long now = System.currentTimeMillis(); if (updateNeeded && now > nextUpdate) { save(workspaceFileName); updateNeeded = false; root.notifyAll(); // In case anyone's waiting for the update to finish } else if (updateNeeded) { ... |
root.wait(); | lockObject.wait(); | public void run() { synchronized (root) { while (true) { try { long now = System.currentTimeMillis(); if (updateNeeded && now > nextUpdate) { save(workspaceFileName); updateNeeded = false; root.notifyAll(); // In case anyone's waiting for the update to finish } else if (updateNeeded) { ... |
synchronized(root) { | synchronized(lockObject) { | protected boolean exitAllowed() { synchronized(root) { if (updateNeeded) { nextUpdate = System.currentTimeMillis(); root.notify(); while (updateNeeded) { try { root.wait(); } catch (InterruptedException ie) { } } } } return true; } |
root.notify(); | lockObject.notify(); | protected boolean exitAllowed() { synchronized(root) { if (updateNeeded) { nextUpdate = System.currentTimeMillis(); root.notify(); while (updateNeeded) { try { root.wait(); } catch (InterruptedException ie) { } } } } return true; } |
root.wait(); | lockObject.wait(); | protected boolean exitAllowed() { synchronized(root) { if (updateNeeded) { nextUpdate = System.currentTimeMillis(); root.notify(); while (updateNeeded) { try { root.wait(); } catch (InterruptedException ie) { } } } } return true; } |
protected void replaceComponent(Experiment experiment, | public void replaceComponent(Experiment experiment, | protected void replaceComponent(Experiment experiment, ModifiableComponent component, ModifiableComponent newComponent) { // find experiment node DefaultMutableTreeNode expNode = findNode(experiment); if (expNode == null) { if (log.isErrorEnabl... |
synchronized (root) { | synchronized (lockObject) { | private void update() { synchronized (root) { nextUpdate = System.currentTimeMillis() + UPDATE_DELAY; updateNeeded = true; root.notify(); } } |
root.notify(); | lockObject.notify(); | private void update() { synchronized (root) { nextUpdate = System.currentTimeMillis() + UPDATE_DELAY; updateNeeded = true; root.notify(); } } |
assertEquals("Test getChild(CompositeName)", tmp, sc.getChild(name)); | assertEquals("1. Test getChild(CompositeName)", tmp, sc.getChild(name)); assertNull("2. Test getChild(CompositeName)", sc.getChild(failed)); | public void testgetChild() { SimpleName name = new SimpleName("ChildName"); SimpleComponent tmp = new SimpleComponent("ChildName"); sc.addChild(tmp); assertEquals("Test getChild(int)", tmp, sc.getChild(0)); assertEquals("Test getChild(CompositeName)", tmp, sc.getChild(name)); } |
filter.postFilter(this, graph); | ULPlanFilter filterCopy = filter.copy(); filterCopy.postFilter(this, graph); | public void actionPerformed(ActionEvent evt) { String command = ((JMenuItem)evt.getSource()).getText(); if (command.equals(NEW_WITH_SELECTION_MENU_ITEM)) { // check that at least one node is selected, else do nothing if (!graph.isNodeSelected()) return; CSMARTGraph newGraph = graph.newGraphFromSe... |
{ String[] zones = new String[1]; zones[0] = "GMT"; return zones; | { return (String[]) tzIDs.clone(); | public static String[] getAvailableIDs() { // FIXME - only knows about GMT String[] zones = new String[1]; zones[0] = "GMT"; return zones; } |
public static TimeZone getTimeZone (String ID) | public static synchronized TimeZone getTimeZone (String ID) | public static TimeZone getTimeZone (String ID) { return zoneGMT; // FIXME } |
return zoneGMT; | int i; for (i = 0; i < tzIDs.length; ++i) { if (ID.equals(tzIDs[i])) break; } if (i == tzIDs.length) return null; if (timeZones[i] == null) { if (ID.equals("GMT")) timeZones[i] = zoneGMT; else timeZones[i] = new SimpleTimeZone (rawOffsets[i], tzIDs[i]); } return timeZones[i]; | public static TimeZone getTimeZone (String ID) { return zoneGMT; // FIXME } |
NSArray attributes = spec.rawRowKeyPaths(); if (attributes == null || attributes.count() == 0) { attributes = entity.attributesToFetch(); | NSArray attributes = entity.attributesToFetch(); if(spec.fetchesRawRows()) { NSMutableArray arr = new NSMutableArray(); for(Enumeration e = spec.rawRowKeyPaths().objectEnumerator(); e.hasMoreElements(); ) { String keyPath = (String)e.nextElement(); arr.addObject(entity.anyAttributeNamed(keyPath)); } attributes = arr.i... | public static EOSQLExpression sqlExpressionForFetchSpecification(EOEditingContext ec, EOFetchSpecification spec, long start, long end) { EOEntity entity = ERXEOAccessUtilities.entityNamed(ec, spec.entityName()); EOModel model = entity.model(); EODatabaseContext dbc = EOUtilities.databaseContext... |
cache.put (len, cr); | cache.put (len, new WeakReference (cr)); | private synchronized CoderResult get (int length) { if (length <= 0) throw new IllegalArgumentException ("Non-positive length"); Integer len = new Integer (length); CoderResult cr = null; Object o; if ((o = cache.get (len)) != null) cr = (CoderResult) ((WeakReference) o).ge... |
return null; | return mrid; | public ModuleRevisionId getId() { return null; } |
return(pageIncrement); | return getPageIncrement (); | getBlockIncrement(){ return(pageIncrement);} |
return(lineIncrement); | return getLineIncrement (); | getUnitIncrement(){ return(lineIncrement);} |
return(visibleAmount); | return getVisible (); | getVisibleAmount(){ return(visibleAmount);} |
if (blockIncrement < 0) throw new IllegalArgumentException("Block increment less than zero."); int range = maximum - minimum; if (blockIncrement > range) { if (range == 0) blockIncrement = 1; else blockIncrement = range; } if (blockIncrement == pageIncrement) return; pageIncrement = blockIncrement; ScrollbarPeer sp... | setPageIncrement (blockIncrement); | setBlockIncrement(int blockIncrement){ if (blockIncrement < 0) throw new IllegalArgumentException("Block increment less than zero."); int range = maximum - minimum; if (blockIncrement > range) { if (range == 0) blockIncrement = 1; else blockIncrement = range; } if (blockIncrement ==... |
if (unitIncrement < 0) throw new IllegalArgumentException("Unit increment less than zero."); int range = maximum - minimum; if (unitIncrement > range) { if (range == 0) unitIncrement = 1; else unitIncrement = range; } if (unitIncrement == lineIncrement) return; lineIncrement = unitIncrement; ScrollbarPeer sp = (Scr... | setLineIncrement (unitIncrement); | setUnitIncrement(int unitIncrement){ if (unitIncrement < 0) throw new IllegalArgumentException("Unit increment less than zero."); int range = maximum - minimum; if (unitIncrement > range) { if (range == 0) unitIncrement = 1; else unitIncrement = range; } if (unitIncrement == lineInc... |
throw new GLException("Unable to initialize " + extensionName + " OpenGL extension"); | String message = "Unable to initialize " + extensionName + " OpenGL extension"; JOptionPane.showMessageDialog(null, message, "Unavailable extension", JOptionPane.ERROR_MESSAGE); throw new GLException(message); | private void checkExtension(GL gl, String extensionName) { if (!gl.isExtensionAvailable(extensionName)) { throw new GLException("Unable to initialize " + extensionName + " OpenGL extension"); } } |
water = new Water(); water.initialize("demos/data/images/nvfixed.tga", "demos/data/images/nvspin.tga", "demos/data/images/droplet.tga", "demos/data/cubemaps/CloudyHills_{0}.tga", canvas); while (!quit) { if (viewer != null) { try { if (drawing) { canvas.getSize(dim); water.addDroplet(new Water.Droplet( 2 * (mousePosX ... | try { water = new Water(); water.initialize("demos/data/images/nvfixed.tga", "demos/data/images/nvspin.tga", "demos/data/images/droplet.tga", "demos/data/cubemaps/CloudyHills_{0}.tga", canvas); } catch (GLException e) { JOptionPane.showMessageDialog(null, e.toString(), "Unavailable extension", JOptionPane.ERROR_MESSAGE... | public void run(String[] args) { canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities()); canvas.addGLEventListener(new Listener()); canvas.setNoAutoRedrawMode(true); Frame frame = new Frame("Procedural Texture Waves"); frame.setLayout(new BorderLayout()); canvas.setSize(512, 51... |
System.exit(0); | try { while (!quit) { if (viewer != null) { try { if (drawing) { canvas.getSize(dim); water.addDroplet(new Water.Droplet( 2 * (mousePosX / (float) dim.width - 0.5f), -2 * (mousePosY / (float) dim.height - 0.5f), 0.08f)); } water.tick(); canvas.display(); } catch (GLException e) { e.printStackTrace(); } } else { ca... | public void run(String[] args) { canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities()); canvas.addGLEventListener(new Listener()); canvas.setNoAutoRedrawMode(true); Frame frame = new Frame("Procedural Texture Waves"); frame.setLayout(new BorderLayout()); canvas.setSize(512, 51... |
log.debug("super.hasBinding(binding) == true for binding "+binding); | if (log.isDebugEnabled()) log.debug("super.hasBinding(binding) == true for binding "+binding); | public Object valueForBinding(String binding) { Object value=null; logDebugInfo(); if (super.hasBinding(binding)) { log.debug("super.hasBinding(binding) == true for binding "+binding); value = originalValueForBinding(binding); } else if(d2wContextFromBindings() != n... |
log.debug("has d2wContext == true for binding "+binding); | if (log.isDebugEnabled()) log.debug("has d2wContext == true for binding "+binding); | public Object valueForBinding(String binding) { Object value=null; logDebugInfo(); if (super.hasBinding(binding)) { log.debug("super.hasBinding(binding) == true for binding "+binding); value = originalValueForBinding(binding); } else if(d2wContextFromBindings() != n... |
log.debug("inside the extraBindings branch for binding "+binding); | if (log.isDebugEnabled()) log.debug("inside the extraBindings branch for binding "+binding); | public Object valueForBinding(String binding) { Object value=null; logDebugInfo(); if (super.hasBinding(binding)) { log.debug("super.hasBinding(binding) == true for binding "+binding); value = originalValueForBinding(binding); } else if(d2wContextFromBindings() != n... |
data.setClassName(getPluginClassName()); for(int i=0; i < nParameters; i++) { data.addParameter(getProperty(PROP_PARAM + i).getValue()); | if (data.getType() != ComponentData.AGENT && data.getType() != ComponentData.NODE) { if (log.isErrorEnabled()) { log.error("Asked to add to non Agent/Node: " + data); } return data; | public ComponentData addComponentData(ComponentData data) { data.setClassName(getPluginClassName()); for(int i=0; i < nParameters; i++) { data.addParameter(getProperty(PROP_PARAM + i).getValue()); } if(nParameters > 0) { data.setName(getPluginClassName()+"|"+getProperty(PROP_PARAM+0).getValue())... |
if(nParameters > 0) { data.setName(getPluginClassName()+"|"+getProperty(PROP_PARAM+0).getValue()); } else { data.setName(getPluginClassName()); | ComponentData self = new GenericComponentData(); self.setType(ComponentData.PLUGIN); self.setOwner(this); self.setParent(data); self.setClassName(getPluginClassName()); for(int i=0; i < nParameters; i++) { self.addParameter(getProperty(PROP_PARAM + i).getValue()); | public ComponentData addComponentData(ComponentData data) { data.setClassName(getPluginClassName()); for(int i=0; i < nParameters; i++) { data.addParameter(getProperty(PROP_PARAM + i).getValue()); } if(nParameters > 0) { data.setName(getPluginClassName()+"|"+getProperty(PROP_PARAM+0).getValue())... |
ComponentData[] children = data.getChildren(); String cname = data.getName() + "|" + getPluginClassName(); boolean addedparam = false; for (int i = 0; i < children.length; i++) { ComponentData kid = children[i]; if (kid.getName().equals(cname)) { if (nParameters > 0 && ! addedparam) { cname = cname + "|" + getProperty... | public ComponentData addComponentData(ComponentData data) { data.setClassName(getPluginClassName()); for(int i=0; i < nParameters; i++) { data.addParameter(getProperty(PROP_PARAM + i).getValue()); } if(nParameters > 0) { data.setName(getPluginClassName()+"|"+getProperty(PROP_PARAM+0).getValue())... | |
new GridBagConstraints(x, y++, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, | new GridBagConstraints(x, y++, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, | public void displayAbout() { final ArrayList agentNames = (ArrayList)getPropertyValue(node, "AgentNames"); JPanel aboutPanel = new JPanel(); aboutPanel.setLayout(new GridBagLayout()); int x = 0; int y = 0; // insets are top, left, bottom, right aboutPanel.add(new JLabel("Status:"), ... |
Artifact artifact = new DefaultArtifact(ModuleRevisionId.newInstance(_organisation, _module, _revision), _pubdate, artifactName, type, ext); artifacts.add(artifact); | Artifact artifact = new DefaultArtifact(_mrid, _pubdate, artifactName, type, ext); _artifacts.add(artifact); | public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { if ("module".equals(qName)) { _organisation = attributes.getValue("organisation"); _module = attributes.getValue("name"); ... |
final List artifacts = new ArrayList(); try { SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser(); saxParser.parse(report, new DefaultHandler() { private String _organisation; private String _module; private String _revision; private Date _pubdate; private boolean _skip; public void startElement(String ... | return getArtifacts(report); | public Artifact[] getArtifacts(ModuleId moduleId, String conf, File cache) throws ParseException, IOException { File report = new File(cache, XmlReportOutputter.getReportFileName(moduleId, conf)); if (!report.exists()) { throw new IllegalStateException("no report file found for "+moduleId+"... |
try { logFile.close(); } catch (Exception e) { System.out.println("Exception closing log file: " + e); | synchronized (logFileLock) { try { logFile.close(); } catch (Exception e) { System.out.println("Exception closing log file: " + e); } | public void closeLogFile() { try { logFile.close(); } catch (Exception e) { System.out.println("Exception closing log file: " + e); } } |
try { logFile.close(); doc.fillFromLogFile(logFileName); logFile = new BufferedWriter(new FileWriter(logFileName, true)); } catch (Exception e) { System.out.println(e); | synchronized (logFileLock) { try { logFile.close(); doc.fillFromLogFile(logFileName); logFile = new BufferedWriter(new FileWriter(logFileName, true)); } catch (Exception e) { System.out.println(e); } | public void fillFromLogFile() { try { logFile.close(); doc.fillFromLogFile(logFileName); logFile = new BufferedWriter(new FileWriter(logFileName, true)); } catch (Exception e) { System.out.println(e); } } |
try { logFile.write(nodeEventDescription); } catch (Exception e) { | synchronized (logFileLock) { try { logFile.write(nodeEventDescription); } catch (Exception e) { System.out.println("Exception writing to log file: " + e); } | public void handle(NodeServesClient nsc, NodeEvent nodeEvent) { final NodeEvent myNodeEvent = nodeEvent; // for swing utilities final int nodeEventType = nodeEvent.getType(); final String nodeEventDescription = getNodeEventDescription(nodeEvent); // write stdout/stderr/etc to log file try { logFil... |
try { int i = 0; do { NodeEvent nodeEvent = (NodeEvent)nodeEvents.get(i); logFile.write(getNodeEventDescription(nodeEvent)); } while (++i < n); } catch (Exception e) { System.out.println("Exception writing to log file: " + e); | synchronized (logFileLock) { try { int i = 0; do { NodeEvent nodeEvent = (NodeEvent)nodeEvents.get(i); logFile.write(getNodeEventDescription(nodeEvent)); } while (++i < n); } catch (Exception e) { System.out.println("Exception writing to log file: " + e); } | public void handleAll(final NodeServesClient nsc, final java.util.List nodeEvents) { final int n = nodeEvents.size(); if (n <= 0) { return; } // write a description of the event to the log file try { int i = 0; do { NodeEvent nodeEvent = (NodeEvent)nodeEvents.get(i); logFile.write(get... |
console.nodeStopped(nodeComponent); | private void updateStatus(NodeEvent nodeEvent) { int nodeEventType = nodeEvent.getType(); if (nodeEventType == NodeEvent.NODE_CREATED) statusButton.setStatus(NodeStatusButton.STATUS_IDLE); else if (nodeEventType == NodeEvent.NODE_DESTROYED) { statusButton.setStatus(NodeStatusButton.STATUS_... | |
public static void addObjectToObjectOnBothSidesOfRelationshipWithKey(EOEnterpriseObject addedObject, EOEnterpriseObject referenceObject, String key) { EOEditingContext referenceEc = referenceObject.editingContext(); EOEditingContext ec = addedObject.editingContext(); EOEnterpriseObject copy = addedObject; if (reference... | public static void addObjectToObjectOnBothSidesOfRelationshipWithKey(EOEnterpriseObject addedObject, EOEnterpriseObject referenceObject, String key) { ERXEOControlUtilities.addObjectToObjectOnBothSidesOfRelationshipWithKey(addedObject, referenceObject, key); | public static void addObjectToObjectOnBothSidesOfRelationshipWithKey(EOEnterpriseObject addedObject, EOEnterpriseObject referenceObject, String key) { EOEditingConte... |
return ERXUtilities.createEOLinkedToEO(entityName, editingContext, relationshipName, eo, null); | return ERXEOControlUtilities.createAndAddObjectToRelationship(editingContext,eo,relationshipName,entityName,null); | public static EOEnterpriseObject createEOLinkedToEO(String entityName, EOEditingContext editingContext, String relationshipName, EOEnterpriseObject eo)... |
return eo != null && ec != null && eo.editingContext() != null && !ec.equals(eo.editingContext()) ? EOUtilities.localInstanceOfObject(ec, eo) : eo; | return ERXEOControlUtilities.localInstanceOfObject(ec, eo); | public static EOEnterpriseObject localInstanceOfObject(EOEditingContext ec, EOEnterpriseObject eo) { return eo != null && ec != null && eo.editingContext() != null && !ec.equals(eo.editingContext()) ? EOUtilities.localInstanceOfObject(ec, eo) : eo; } |
if (eos == null) throw new RuntimeException("ERXUtilites: localInstancesOfObjects: Array is null"); if (ec == null) throw new RuntimeException("ERXUtilites: localInstancesOfObjects: EditingContext is null"); NSMutableArray localEos = new NSMutableArray(); for (Enumeration e = eos.objectEnumerator(); e.hasMoreElements()... | return ERXEOControlUtilities.localInstancesOfObjects(ec, eos); | public static NSArray localInstancesOfObjects(EOEditingContext ec, NSArray eos) { if (eos == null) throw new RuntimeException("ERXUtilites: localInstancesOfObjects: Array is null"); if (ec == null) throw new RuntimeException("ERXUtilites: localInstancesOfObjects: EditingContext i... |
EOEntity entity = EOModelGroup.defaultGroup().entityNamed(entityName); EODatabaseContext dbContext = EODatabaseContext.registeredDatabaseContextForModel(entity.model(), ec); NSDictionary primaryKey = null; try { dbContext.lock(); EOAdaptorChannel adaptorChannel = dbContext.availableChannel().adaptorChannel(); if (!adap... | return ERXEOAccessUtilities.primaryKeyDictionaryForEntity(ec,entityName); | public static NSDictionary primaryKeyDictionaryForEntity(EOEditingContext ec, String entityName) { // FIXME: Should use the modelgroup for the root object store of the // editing context. EOEntity entity = EOModelGroup.defaultGroup().entityNamed(entityName); EODatabaseContext dbContext... |
if (array == null || array.count() == 0) return NSSet.EmptySet; else { Object [] objs = new Object[array.count()]; objs = array.objects(); return new NSSet(objs); } | return ERXArrayUtilities.setFromArray(array); | public static NSSet setFromArray(NSArray array) { if (array == null || array.count() == 0) return NSSet.EmptySet; else { Object [] objs = new Object[array.count()]; objs = array.objects(); return new NSSet(objs); } } |
return EOUtilities.objectWithFetchSpecificationAndBindings(EOSharedEditingContext.defaultSharedEditingContext(), entityName, fetchSpec, null); | return ERXEOControlUtilities.sharedObjectWithFetchSpec(entityName, fetchSpec); | public static EOEnterpriseObject sharedObjectWithFetchSpec(String fetchSpec, String entityName) { return EOUtilities.objectWithFetchSpecificationAndBindings(EOSharedEditingContext.defaultSharedEditingContext(), entityName, ... |
NSSelector result=null; if (key!=null) { result=(NSSelector)_selectorsByKey.objectForKey(key); if (result==null) result=new NSSelector(key, ERXConstant.ObjectClassArray); } return result; | return ERXArrayUtilities.sortSelectorWithKey(key); | public static NSSelector sortSelectorWithKey(String key) { NSSelector result=null; if (key!=null) { result=(NSSelector)_selectorsByKey.objectForKey(key); if (result==null) result=new NSSelector(key, ERXConstant.ObjectClassArray); } return result; } |
public static MethodProxy create( Method method, Method superMethod ) { try { Class declaring = method.getDeclaringClass(); String className = NAME_FACTORY.getNextName(declaring); ClassLoader loader = declaring.getClassLoader(); if (loader == null) { loader = DEFAULT_LOADER; } Class gen = new Generator(className, supe... | public static MethodProxy create(Method method, Method superMethod) { return create(method, superMethod, null); | public static MethodProxy create( Method method, Method superMethod ) { try { Class declaring = method.getDeclaringClass(); String className = NAME_FACTORY.getNextName(declaring); ClassLoader loader = declaring.getClassLoader(); if (loader == null) { ... |
pluginPage = new ActivatePluginsPage(); pluginPage.setTitle("Activate Plugins"); pluginPage.setDescription("Activate Plugins"); addPage(pluginPage); | public void addPages() { page = new WizardNewProjectCreationPage("NewProjectCreationWizard"); page.setTitle("New"); page.setDescription("Create a new Content Package."); addPage(page); } | |
+ " seed"; | + " seedTestBusiness"; | private void finishPage(IProgressMonitor monitor) throws InterruptedException, CoreException { if (monitor == null) { monitor= new NullProgressMonitor(); } int exitValue = -1; try { String strName = page.getProjectName(); monitor.beginTask("Creating "+ strName + " Forrest Project", 3); IProject project... |
Method method = HttpMethodBase.class.getMethod("getResponseContentLength", new Class[0]); if (method.isAccessible()) { _httpClientHelper = new HttpClientHelper3x(); Message.verbose("using commons httpclient 3.x helper"); } else { _httpClientHelper = new HttpClientHelper2x(); Message.verbose("using commons httpclient 2.... | HttpMethodBase.class.getMethod("getResponseContentLength", new Class[0]); _httpClientHelper = new HttpClientHelper3x(); Message.verbose("using commons httpclient 3.x helper"); | private HttpClientHelper getHttpClientHelper() { if (_httpClientHelper == null) { // use commons httpclient 3.0 if available try { Method method = HttpMethodBase.class.getMethod("getResponseContentLength", new Class[0]); if (method.isAccessible()) { ... |
DataFlavor(String mimeType, String humanPresentableName) throws ClassNotFoundException | DataFlavor() | DataFlavor(String mimeType, String humanPresentableName) throws ClassNotFoundException{ this(mimeType, humanPresentableName, null);} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.