code
stringlengths 10
174k
| nl
stringlengths 3
129k
|
---|---|
@Override public String formatCookie(final Cookie cookie){
LOG.trace("enter RFC2965Spec.formatCookie(Cookie)");
if (cookie == null) {
throw new IllegalArgumentException("Cookie may not be null");
}
if (cookie instanceof Cookie2) {
final Cookie2 cookie2=(Cookie2)cookie;
final int version=cookie2.getVersion();
final StringBuffer buffer=new StringBuffer();
formatter.format(buffer,new NameValuePair("$Version",Integer.toString(version)));
buffer.append("; ");
doFormatCookie2(cookie2,buffer);
return buffer.toString();
}
else {
return rfc2109.formatCookie(cookie);
}
}
| Return a string suitable for sending in a <tt>"Cookie"</tt> header as defined in RFC 2965 |
protected boolean isBlocked(AxisAlignedBB aabb){
return !this.entity.worldObj.getCollisionBoxes(this.entity,aabb).isEmpty();
}
| Returns whether the entities path is blocked at the specified AABB |
public AnnotationVisitor visitTypeAnnotation(int typeRef,TypePath typePath,String desc,boolean visible){
if (api < Opcodes.ASM5) {
throw new RuntimeException();
}
if (fv != null) {
return fv.visitTypeAnnotation(typeRef,typePath,desc,visible);
}
return null;
}
| Visits an annotation on the type of the field. |
public boolean writeCharacteristic(BluetoothGattCharacteristic charact,byte[] data,final BleCharactCallback bleCallback){
if (BleLog.isPrint) {
BleLog.i(TAG,charact.getUuid() + " characteristic write bytes: " + Arrays.toString(data)+ " ,hex: "+ HexUtil.encodeHexStr(data));
}
handleCharacteristicWriteCallback(bleCallback);
charact.setValue(data);
return handleAfterInitialed(getBluetoothGatt().writeCharacteristic(charact),bleCallback);
}
| write data to specified characteristic |
public static String newStringUtf8(byte[] bytes){
return org.apache.commons.codec.binary.StringUtils.newStringUtf8(bytes);
}
| Constructs a new <code>String</code> by decoding the specified array of bytes using the UTF-8 charset. |
public ColladaTexture(String ns){
super(ns);
}
| Construct an instance. |
static int hash(Object x1,Object x2,Object x3,Object x4){
int h=0;
h^=x1.hashCode();
if (x2 != null) {
h^=x2.hashCode();
}
if (x3 != null) {
h^=x3.hashCode();
}
if (x4 != null) {
h^=x4.hashCode();
}
h+=~(h << 9);
h^=(h >>> 14);
h+=(h << 4);
h^=(h >>> 10);
return h;
}
| Returns a hash code for non-null Objects. Uses the same hash code spreader as most other java.util hash tables. |
public static byte[] toByteArray(URI uri) throws IOException {
return IOUtils.toByteArray(uri.toURL());
}
| Get the contents of a <code>URI</code> as a <code>byte[]</code>. |
public static byte[] longToByteArray(final long value){
final byte[] output=new byte[8];
final DataBuffer buffer=new DataBuffer(output,0,8);
buffer.writeLong(value);
return output;
}
| Long to byte array. |
public static void onEventEnd(final Context context,final String event_id,final String label){
onEventDuration(context,event_id,label,log.onEventEnd(context,event_id,label));
}
| End to log the duration of event |
private void refreshAccessToken(){
final Long expiresIn=credential.getExpiresInSeconds();
String accessToken=credential.getAccessToken();
if (accessToken == null || expiresIn != null && expiresIn <= 60) {
try {
credential.refreshToken();
accessToken=credential.getAccessToken();
}
catch ( final IOException e) {
log.error("Failed to fetch access token",e);
}
}
if (accessToken != null) {
this.accessToken=accessToken;
}
}
| Refresh the Google Cloud API access token, if necessary. |
@Override public final int computeHashCode(int val){
return HashFunctions.hash(val);
}
| Default implementation of TIntHashingStrategy: delegates hashing to HashFunctions.hash(int). |
private Object rawMake(HGPersistentHandle[] layout,HGAtomType type,HGPersistentHandle atomHandle){
HGPersistentHandle[] targetSet=EMPTY_PERSISTENT_HANDLE_SET;
if (layout.length > 2) {
targetSet=new HGPersistentHandle[layout.length - 2];
for (int i=2; i < layout.length; i++) targetSet[i - 2]=layout[i];
}
Object result=type.make(layout[1],new ReadyRef<HGHandle[]>(targetSet),new IncidenceSetRef(atomHandle,this));
if (targetSet.length > 0 && !(result instanceof HGLink)) result=new HGValueLink(result,targetSet);
if (result instanceof HGAtomType) result=typeSystem.toRuntimeInstance(atomHandle,(HGAtomType)result);
if (result instanceof HGGraphHolder) ((HGGraphHolder)result).setHyperGraph(this);
return result;
}
| Make a run-time instance given a layout and a type. Ignore caching, incidence set management etc. |
public static void initialize(final JFrame parent,final CProjectTree tree,final CDatabaseManager databaseManager){
final List<IDropHandler> handlers=new ArrayList<IDropHandler>();
handlers.add(new CViewsToProjectHandler(parent));
handlers.add(new CViewsToTagHandler(parent));
handlers.add(new CModulesToAddressSpaceHandler(parent));
handlers.add(new CDatabaseSortingHandler(databaseManager));
handlers.add(new CTagSortingHandler());
new CDefaultTransferHandler(tree,DnDConstants.ACTION_COPY_OR_MOVE,handlers);
}
| Initializes the drag & drop handlers for the project tree. |
private void processResponseHeaders(State state,InnerState innerState,HttpResponse response) throws StopRequest {
if (innerState.mContinuingDownload) {
return;
}
readResponseHeaders(state,innerState,response);
try {
state.mFilename=mService.generateSaveFile(mInfo.mFileName,mInfo.mTotalBytes);
}
catch ( DownloaderService.GenerateSaveFileError exc) {
throw new StopRequest(exc.mStatus,exc.mMessage);
}
try {
state.mStream=new FileOutputStream(state.mFilename);
}
catch ( FileNotFoundException exc) {
File pathFile=new File(Helpers.getSaveFilePath(mService));
try {
if (pathFile.mkdirs()) {
state.mStream=new FileOutputStream(state.mFilename);
}
}
catch ( Exception ex) {
throw new StopRequest(DownloaderService.STATUS_FILE_ERROR,"while opening destination file: " + exc.toString(),exc);
}
}
if (Constants.LOGV) {
Log.v(Constants.TAG,"writing " + mInfo.mUri + " to "+ state.mFilename);
}
updateDatabaseFromHeaders(state,innerState);
checkConnectivity(state);
}
| Read HTTP response headers and take appropriate action, including setting up the destination file and updating the database. |
public long countUsers(){
if (supportsTransactions) graph.tx().rollback();
return g.V().hasLabel(CredentialGraphTokens.VERTEX_LABEL_USER).count().next();
}
| Get a count of the number of users in the database. |
public void flush(){
if (this.size > 0) {
list.setSize(this.size);
this.target.addAllOf(list);
this.size=0;
}
}
| Adds all internally buffered elements to the receiver's target, then resets the current buffer size to zero. |
public double[] distributionForInstance(Instance instance) throws Exception {
double transProb=0.0, temp=0.0;
double[] classProbability=new double[m_NumClasses];
double[] predictedValue=new double[1];
for (int i=0; i < classProbability.length; i++) {
classProbability[i]=0.0;
}
predictedValue[0]=0.0;
if (m_InitFlag == ON) {
if (m_BlendMethod == B_ENTROPY) {
generateRandomClassColomns();
}
m_Cache=new KStarCache[m_NumAttributes];
for (int i=0; i < m_NumAttributes; i++) {
m_Cache[i]=new KStarCache();
}
m_InitFlag=OFF;
}
Instance trainInstance;
Enumeration<Instance> enu=m_Train.enumerateInstances();
while (enu.hasMoreElements()) {
trainInstance=(Instance)enu.nextElement();
transProb=instanceTransformationProbability(instance,trainInstance);
switch (m_ClassType) {
case Attribute.NOMINAL:
classProbability[(int)trainInstance.classValue()]+=transProb;
break;
case Attribute.NUMERIC:
predictedValue[0]+=transProb * trainInstance.classValue();
temp+=transProb;
break;
}
}
if (m_ClassType == Attribute.NOMINAL) {
double sum=Utils.sum(classProbability);
if (sum <= 0.0) for (int i=0; i < classProbability.length; i++) classProbability[i]=(double)1 / (double)m_NumClasses;
else Utils.normalize(classProbability,sum);
return classProbability;
}
else {
predictedValue[0]=(temp != 0) ? predictedValue[0] / temp : 0.0;
return predictedValue;
}
}
| Calculates the class membership probabilities for the given test instance. |
@DSComment("From safe class list") @DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:57:43.526 -0500",hash_original_method="76B0F415E6F814FE548D14BC6D5843EE",hash_generated_method="3845385B9FADAA47A4B502A9AE94271B") public boolean contains(Object o){
if (o == null) return false;
int mask=elements.length - 1;
int i=head;
E x;
while ((x=elements[i]) != null) {
if (o.equals(x)) return true;
i=(i + 1) & mask;
}
return false;
}
| Returns <tt>true</tt> if this deque contains the specified element. More formally, returns <tt>true</tt> if and only if this deque contains at least one element <tt>e</tt> such that <tt>o.equals(e)</tt>. |
public void addTime(When time){
getTimes().add(time);
}
| Adds a new event time. |
private void srcMemoryToCombinedBuffer(boolean compact,Memory srcMem){
final int preLongs=2;
final int extra=2;
final int preBytes=(preLongs + extra) << 3;
long cumOffset=srcMem.getCumulativeOffset(0L);
Object memArr=srcMem.array();
int bbCnt=baseBufferCount_;
int k=getK();
long n=getN();
double[] combinedBuffer=getCombinedBuffer();
putMinValue(extractMinDouble(memArr,cumOffset));
putMaxValue(extractMaxDouble(memArr,cumOffset));
if (compact) {
srcMem.getDoubleArray(preBytes,combinedBuffer,0,bbCnt);
long bits=bitPattern_;
if (bits != 0) {
long memOffset=preBytes + (bbCnt << 3);
int combBufOffset=2 * k;
while (bits != 0L) {
if ((bits & 1L) > 0L) {
srcMem.getDoubleArray(memOffset,combinedBuffer,combBufOffset,k);
memOffset+=(k << 3);
}
combBufOffset+=k;
bits>>>=1;
}
}
}
else {
int levels=Util.computeNumLevelsNeeded(k,n);
int totItems=(levels == 0) ? bbCnt : (2 + levels) * k;
srcMem.getDoubleArray(preBytes,combinedBuffer,0,totItems);
}
}
| Loads the Combined Buffer, min and max from the given source Memory. The Combined Buffer is always in non-compact form and must be pre-allocated. |
public AROW(double r,boolean diagonalOnly){
setR(r);
setDiagonalOnly(diagonalOnly);
}
| Creates a new AROW learner |
@VisibleForTesting static String prettyPrintSetDiff(Set<?> a,Set<?> b){
Set<?> removed=Sets.difference(a,b);
Set<?> added=Sets.difference(b,a);
if (removed.isEmpty() && added.isEmpty()) {
return "NO DIFFERENCES";
}
return Joiner.on("\n ").skipNulls().join("",!added.isEmpty() ? ("ADDED:" + formatSetContents(added)) : null,!removed.isEmpty() ? ("REMOVED:" + formatSetContents(removed)) : null,"FINAL CONTENTS:" + formatSetContents(b));
}
| Returns a string displaying the differences between the old values in a set and the new ones. |
private static long totalSize(Map<String,Long> relPathToSize){
long total=0;
for ( Long l : relPathToSize.values()) {
total+=l;
}
return total;
}
| Get the total size of the paths. |
private void checkRange(int index){
if (index >= count || index < 0) {
throw new IndexOutOfBoundsException("Index: " + index + ", Size: "+ count);
}
}
| Checks if the given index is in range. If not, throws an appropriate runtime exception. |
private static String[] split(final String text){
return text.split(";",2);
}
| Splits the text parts. |
public void addAddress(InetAddress address){
addAddress(new PeerAddress(address,params.getPort()));
}
| Convenience method for addAddress(new PeerAddress(address, params.port)); |
@Override protected void service(HttpServletRequest req,HttpServletResponse resp) throws IOException, ServletException {
SessionConfiguration config=Server.createSessionConfiguration();
if (oAuth2Credentials == null) {
oAuth2Credentials=Server.createOAuth2Credentials(config);
}
HttpSession httpSession=req.getSession(true);
if (httpSession.getAttribute(Server.USER_SESSION_ID) == null) {
httpSession.setAttribute(Server.USER_SESSION_ID,new Random().nextLong());
}
credential=oAuth2Credentials.loadCredential(httpSession.getAttribute(Server.USER_SESSION_ID).toString());
if (credential != null && credential.getAccessToken() != null) {
if (uberRidesService == null) {
CredentialsSession session=new CredentialsSession(config,credential);
UberRidesApi api=UberRidesApi.with(session).build();
uberRidesService=api.createService();
}
super.service(req,resp);
}
else {
resp.sendRedirect(oAuth2Credentials.getAuthorizationUrl());
}
}
| Before each request, fetch an OAuth2 credential for the user or redirect them to the OAuth2 login page instead. |
public String masterNodeId(){
return this.masterNodeId;
}
| Get the id of the master node |
protected POInfo initPO(Properties ctx){
POInfo poi=POInfo.getPOInfo(ctx,Table_ID,get_TrxName());
return poi;
}
| Load Meta Data |
Formatter<T> doNotReport(){
report=false;
return this;
}
| Deactivates logging of this kind of error. |
public void schedule(Runnable command,long delay,TimeUnit unit){
schedule(command,delay,0,unit);
}
| Schedules the runnable for future execution on the internal RunLoopThread. |
public StringVector(int blocksize){
m_blocksize=blocksize;
m_mapSize=blocksize;
m_map=new String[blocksize];
}
| Construct a StringVector, using the given block size. |
public COpenInLastWindowAction(final Window parent,final IViewContainer container,final INaviView[] views){
super("Open in last window");
m_parent=Preconditions.checkNotNull(parent,"IE02876: parent argument can not be null");
m_container=Preconditions.checkNotNull(container,"IE02877: container argument can not be null");
m_views=Preconditions.checkNotNull(views,"IE02878: views argument can not be null").clone();
putValue(ACCELERATOR_KEY,HotKeys.LOAD_LAST_WINDOW_HK.getKeyStroke());
}
| Creates a new action object. |
@Override public void service(RequestWeb request){
try {
if (!request.method().equals("OPTIONS")) {
request.ok();
return;
}
if (_crossOrigin.allowCredentials()) request.header(ALLOW_CREDENTIALS,"true");
String[] origin=_crossOrigin.value();
if (origin.length == 0) origin=_crossOrigin.allowOrigin();
if (origin.length > 0) request.header(ALLOW_ORIGIN,join(origin));
HttpMethod[] methods=_crossOrigin.allowMethods();
if (methods.length > 0) {
request.header(ALLOW_METHODS,join(methods));
}
else if (_httpMethod != null) {
request.header(ALLOW_METHODS,_httpMethod.toString());
}
String[] allowHeaders=_crossOrigin.allowHeaders();
if (allowHeaders.length > 0) request.header(ALLOW_HEADERS,join(allowHeaders));
String[] exposeHeaders=_crossOrigin.exposeHeaders();
if (exposeHeaders.length > 0) request.header(EXPOSE_HEADERS,join(exposeHeaders));
request.header(MAX_AGE,Long.toString(_crossOrigin.maxAge()));
request.ok();
request.halt();
}
catch ( Exception e) {
log.log(Level.WARNING,e.toString(),e);
}
}
| Service a request. |
public boolean isBackCommandEnabled(){
return baseFormNavigationStack != null;
}
| Seamlessly inserts a back command to all the forms |
@Override public void fillCirclePoints(Map<Integer,Point> circleIndexPoint,Map<Point,Integer> circlePointIndex){
if (SHOW_LOGS) Log.v(TAG,">> fillCirclePoints");
createFirstOctant(circleIndexPoint,circlePointIndex);
mCircleMirrorHelper.mirror_2nd_Octant(circleIndexPoint,circlePointIndex);
mCircleMirrorHelper.mirror_2nd_Quadrant(circleIndexPoint,circlePointIndex);
mCircleMirrorHelper.mirror_2nd_Semicircle(circleIndexPoint,circlePointIndex);
if (SHOW_LOGS) Log.v(TAG,"<< fillCirclePoints");
}
| This method is based on "Midpoint circle algorithm." We use three steps: 1. Create 1 octant of a circle. 2. Mirror the created points for the 2nd octant At this stage we have points for 1 quadrant of a circle 3. Mirror 2nd quadrant points using points from 1 quadrant At this stage we have points for 1 semicircle 4. Mirror 2nd semicircle points using points from 1 semicircle |
@Action(value="/masters/overhead-newform") public String newform(){
return NEW;
}
| This method is invoked to create a new form. |
public Instance[] transformInstance(Instance x) throws Exception {
return null;
}
| TransformInstances - this function is DEPRECATED. this function preloads the instances with the correct class labels ... to make the chain much faster, but CNode does not yet have this functionality ... need to do something about this! |
public static Relevance relevantFact(Fact fact,Schema schema){
if (Schema.isSchemaTriple(fact.getTriple())) {
return Relevance.NONE;
}
Resource subject=fact.getSubject();
URI predURI=fact.getPredicate();
Value object=fact.getObject();
boolean relevantToSubject=false;
boolean relevantToObject=false;
boolean literalObject=object instanceof Literal;
if (predURI.equals(RDF.TYPE)) {
Resource typeURI=(Resource)fact.getObject();
if (typeURI.equals(OWL.NOTHING) || schema.hasClass(typeURI)) {
relevantToSubject=true;
}
}
if (schema.hasProperty(predURI)) {
OwlProperty prop=schema.getProperty(predURI);
if (prop.isAsymmetric() || prop.isTransitive() || !prop.getRestrictions().isEmpty()) {
relevantToSubject=true;
relevantToObject=!literalObject;
}
if (!relevantToSubject && (!prop.getDomain().isEmpty() || prop.getSuperProperties().size() > 1 || !prop.getDisjointProperties().isEmpty())) {
relevantToSubject=true;
}
if (!literalObject && !relevantToObject && (!prop.getRange().isEmpty() || !prop.getInverseProperties().isEmpty() || prop.isSymmetric()|| prop.isIrreflexive() && subject.equals(object))) {
relevantToObject=true;
}
}
return Relevance.get(relevantToSubject,relevantToObject);
}
| Determine whether a fact is a triple which might be used by a local reasoner for its subject and/or object. |
public void testContractions() throws IOException {
Analyzer a=new IrishAnalyzer();
assertAnalyzesTo(a,"b'fhearr m'athair",new String[]{"fearr","athair"});
a.close();
}
| test use of elisionfilter |
protected boolean matchesTemplate(Instance first){
for ( int m_ResultsetKeyColumn : m_ResultsetKeyColumns) {
if (first.value(m_ResultsetKeyColumn) != m_Template.value(m_ResultsetKeyColumn)) {
return false;
}
}
return true;
}
| Returns true if the two instances match on those attributes that have been designated key columns (eg: scheme name and scheme options) |
static void svd_dswap(int n,double[] dx,int incx,double[] dy,int incy){
if (n <= 0 || incx == 0 || incy == 0) return;
int ix=(incx == 1) ? 0 : n - 1;
int iy=(incy == 1) ? 0 : n - 1;
for (int i=0; i < n; i++) {
double swap=dy[iy];
dy[iy]=dx[ix];
dx[ix]=swap;
iy+=incy;
ix+=incx;
}
}
| Function interchanges two vectors * Based on Fortran-77 routine from Linpack by J. Dongarra |
public VideoData duplicate() throws IOException, ClassNotFoundException {
VideoData result=new VideoData();
ByteArrayOutputStream baos=new ByteArrayOutputStream();
ObjectOutputStream oos=new ObjectOutputStream(baos);
writeExternal(oos);
oos.close();
byte[] buf=baos.toByteArray();
baos.close();
ByteArrayInputStream bais=new ByteArrayInputStream(buf);
ObjectInputStream ois=new ObjectInputStream(bais);
result.readExternal(ois);
ois.close();
bais.close();
if (header != null) {
result.setHeader(header.clone());
}
return result;
}
| Duplicate this message / event. |
public JSONObject put(String key,Map<String,Object> value) throws JSONException {
this.put(key,new JSONObject(value));
return this;
}
| Put a key/value pair in the JSONObject, where the value will be a JSONObject which is produced from a Map. |
@Override public void onDestroy(){
super.onDestroy();
eventBusC.unregister(this);
}
| Called when the controller is destroyed. This occurs when the controller is de-referenced and not retained by any objects. |
protected void update(boolean[] state){
if (isDisabledDueToFocusLost) {
return;
}
boolean ok=true;
boolean ignore=true;
for (int i=0; i < conditions.length; i++) {
if (conditions[i] != DONT_CARE) {
ignore=false;
if (((conditions[i] == MANDATORY) && (state[i] == false)) || ((conditions[i] == DISALLOWED) && (state[i] == true))) {
ok=false;
break;
}
}
}
if (!ignore) {
setEnabled(ok);
}
}
| Updates an action given the set of states that can be true or false. States refer to OPERATOR_SELECTED... An action is enabled iff for all states the condition is MANDATORY and state is true or DISALLOWED and state is false. If for all states the condition is DONT_CARE, the enabling status of the action is not touched. |
private void derive(CascadedStyle matched){
if (matched == null) {
return;
}
Iterator mProps=matched.getCascadedPropertyDeclarations();
while (mProps.hasNext()) {
PropertyDeclaration pd=(PropertyDeclaration)mProps.next();
FSDerivedValue val=deriveValue(pd.getCSSName(),pd.getValue());
_derivedValuesById[pd.getCSSName().FS_ID]=val;
}
}
| <p/> <p/> <p/> <p/> Implements cascade/inherit/important logic. This should result in the element for this style having a value for *each and every* (visual) property in the CSS2 spec. The implementation is based on the notion that the matched styles are given to us in a perfectly sorted order, such that properties appearing later in the rule-set always override properties appearing earlier. It also assumes that all properties in the CSS2 spec are defined somewhere across all the matched styles; for example, that the full-property set is given in the user-agent CSS that is always loaded with styles. The current implementation makes no attempt to check either of these assumptions. When this method exits, the derived property list for this class will be populated with the properties defined for this element, properly cascaded.</p> |
public static void registerBuiltInAnalysisEngines(IAnalysisCache analysisCache){
new edu.umd.cs.findbugs.classfile.engine.EngineRegistrar().registerAnalysisEngines(analysisCache);
new edu.umd.cs.findbugs.classfile.engine.asm.EngineRegistrar().registerAnalysisEngines(analysisCache);
new edu.umd.cs.findbugs.classfile.engine.bcel.EngineRegistrar().registerAnalysisEngines(analysisCache);
}
| Register the "built-in" analysis engines with given IAnalysisCache. |
public void addNotifier(final DSSNotifier dssNotifier){
if (!notifiers.contains(dssNotifier)) {
LOG.trace(">>> NOTIFIER ADDED: " + dssNotifier);
notifiers.add(dssNotifier);
}
}
| This method allows to declare a new object to be notified if any properties have changed. |
public void iinc(final int local,final int amount){
mv.visitIincInsn(local,amount);
}
| Generates the instruction to increment the given local variable. |
public RangeQueryBuilder gt(int from){
this.from=from;
this.includeLower=false;
return this;
}
| The from part of the range query. Null indicates unbounded. |
public PutMappingRequest source(String mappingSource){
this.source=mappingSource;
return this;
}
| The mapping source definition. |
public TurnCandidateHarvester(TransportAddress turnServer,LongTermCredential longTermCredential){
super(turnServer);
this.longTermCredential=longTermCredential;
}
| Initializes a new <tt>TurnCandidateHarvester</tt> instance which is to work with a specific TURN server using a specific <tt>LongTermCredential</tt>. |
public ImageBorderWizard(){
initComponents();
arcHeight.setModel(new SpinnerNumberModel(10,1,50,1));
arcWidth.setModel(new SpinnerNumberModel(10,1,50,1));
com.codename1.ui.Button btn=new com.codename1.ui.Button();
int bgColor=btn.getStyle().getBgColor();
int fgColor=btn.getStyle().getFgColor();
colorA.setText(Integer.toHexString(bgColor));
colorB.setText(Integer.toHexString(new Color(bgColor).darker().darker().getRGB() & 0xffffff));
colorC.setText(Integer.toHexString(fgColor));
colorD.setText(Integer.toHexString(new Color(fgColor).brighter().brighter().getRGB() & 0xffffff));
bindColorIconToButton(pickColorA,colorA);
bindColorIconToButton(pickColorB,colorB);
bindColorIconToButton(pickColorC,colorC);
bindColorIconToButton(pickColorD,colorD);
height.setModel(new SpinnerNumberModel(40,20,400,1));
opacity.setModel(new SpinnerNumberModel(255,0,255,1));
thickness.setModel(new SpinnerNumberModel(1,1,30,1));
width.setModel(new SpinnerNumberModel(150,20,400,1));
trackTextFieldChanges(colorA);
trackTextFieldChanges(colorB);
trackTextFieldChanges(colorC);
trackTextFieldChanges(colorD);
updateBorderImage();
}
| Creates new form ImageBorderWizard |
public static int convertSpToPx(int spSize){
return Math.round((float)spSize / getDisplayDensity4Fonts());
}
| Convert scale dependent pixels to absolute pixels. This scales the size by scale dependent screen density (accessibility setting) and the global display setting for message composition fields |
public boolean isAccptd(){
return accptd;
}
| Gets the value of the accptd property. |
@Override public int hashCode(){
return regionPath.hashCode();
}
| hashCode is defined for this class to make sure that the before details and after details for RebalanceResults are in the same order. This makes debugging printouts easier, and it also removes discrepancies due to rounding errors when calculating the stddev in tests. |
public FutureResult(CancelCriterion crit){
this.latch=new StoppableCountDownLatch(crit,1);
}
| Creates a new instance of FutureResult |
public WrappedByteBuffer fillWith(byte b,int size){
_autoExpand(size);
while (size-- > 0) {
_buf.put(b);
}
return this;
}
| Fills the buffer with a specific number of repeated bytes. |
public static boolean isPropositionSymbolIdentifierStart(char ch){
return Character.isJavaIdentifierStart(ch);
}
| Determine if the given character can be at the beginning of a proposition symbol. |
int readCheckpoint(ReadStream is,byte[] blockBuffer,int rowOffset,int blobTail) throws IOException {
int rowLength=length();
if (rowOffset < blobTail) {
return -1;
}
for ( Column column : columns()) {
blobTail=column.readCheckpoint(is,blockBuffer,rowOffset,rowLength,blobTail);
}
return blobTail;
}
| Reads column-specific data like blobs from the checkpoint. Returns -1 if the data does not fit into the current block. |
@Override public boolean isCatalogAtStart(){
debugCodeCall("isCatalogAtStart");
return true;
}
| Returns whether the catalog is at the beginning. |
private void writeKeysWithPrefix(String prefix){
for ( String key : keys) {
if (key.startsWith(prefix)) {
ps.println(key + "=" + prop.getProperty(key));
}
}
ps.println();
}
| writes all keys starting with the specified prefix in alphabetical order. |
public JSONArray(Collection collection){
this.myArrayList=new ArrayList();
if (collection != null) {
Iterator iter=collection.iterator();
while (iter.hasNext()) {
this.myArrayList.add(JSONObject.wrap(iter.next()));
}
}
}
| Construct a JSONArray from a Collection. |
public static void main(String[] args) throws IOException {
InetAddress ip4Group=InetAddress.getByName("225.4.5.6");
InetAddress ip6Group=InetAddress.getByName("ff02::a");
NetworkConfiguration config=NetworkConfiguration.probe();
NetworkInterface nif=config.ip4Interfaces().iterator().next();
InetAddress anySource=config.ip4Addresses(nif).iterator().next();
membershipKeyTests(nif,ip4Group,anySource);
exceptionTests(nif);
Iterator<NetworkInterface> iter=config.ip6Interfaces().iterator();
if (iter.hasNext()) {
nif=iter.next();
anySource=config.ip6Addresses(nif).iterator().next();
membershipKeyTests(nif,ip6Group,anySource);
}
}
| Probe interfaces to get interfaces that support IPv4 or IPv6 multicasting and invoke tests. |
public static void storagePorts(String id){
VirtualArrayRestRep virtualArray=getVirtualArray(id);
VirtualArrayStoragePortsDataTable dataTable=new VirtualArrayStoragePortsDataTable();
render(virtualArray,dataTable);
}
| Displays the storage ports page for the given virtual array. |
@Override @Transient public boolean isFullTextSearchable(){
return true;
}
| Override the gisFeature value.<br> Default to true;<br> If this field is set to false, then the object won't be synchronized with the fullText search engine |
protected void decodeBitmapData(final GifFrame frame,byte[] dstPixels){
if (frame != null) {
rawData.position(frame.bufferFrameStart);
}
final int nullCode=-1;
final int npix=(frame == null) ? width * height : frame.iw * frame.ih;
int available, clear, code_mask, code_size, end_of_information, in_code, old_code, bits, code, count, i, datum, data_size, first, top, bi, pi;
if (dstPixels == null || dstPixels.length < npix) {
dstPixels=new byte[npix];
}
if (prefix == null) {
prefix=new short[MAX_STACK_SIZE];
}
if (suffix == null) {
suffix=new byte[MAX_STACK_SIZE];
}
if (pixelStack == null) {
pixelStack=new byte[MAX_STACK_SIZE + 1];
}
data_size=read();
clear=1 << data_size;
end_of_information=clear + 1;
available=clear + 2;
old_code=nullCode;
code_size=data_size + 1;
code_mask=(1 << code_size) - 1;
for (code=0; code < clear; code++) {
prefix[code]=0;
suffix[code]=(byte)code;
}
datum=bits=count=first=top=pi=bi=0;
for (i=0; i < npix; ) {
if (top == 0) {
if (bits < code_size) {
if (count == 0) {
count=readBlock();
if (count <= 0) {
break;
}
bi=0;
}
datum+=((block[bi]) & 0xff) << bits;
bits+=8;
bi++;
count--;
continue;
}
code=datum & code_mask;
datum>>=code_size;
bits-=code_size;
if ((code > available) || (code == end_of_information)) {
break;
}
if (code == clear) {
code_size=data_size + 1;
code_mask=(1 << code_size) - 1;
available=clear + 2;
old_code=nullCode;
continue;
}
if (old_code == nullCode) {
pixelStack[top++]=suffix[code];
old_code=code;
first=code;
continue;
}
in_code=code;
if (code == available) {
pixelStack[top++]=(byte)first;
code=old_code;
}
while (code > clear) {
pixelStack[top++]=suffix[code];
code=prefix[code];
}
first=(suffix[code]) & 0xff;
if (available >= MAX_STACK_SIZE) {
break;
}
pixelStack[top++]=(byte)first;
prefix[available]=(short)old_code;
suffix[available]=(byte)first;
available++;
if (((available & code_mask) == 0) && (available < MAX_STACK_SIZE)) {
code_size++;
code_mask+=available;
}
old_code=in_code;
}
top--;
dstPixels[pi++]=pixelStack[top];
i++;
}
for (i=pi; i < npix; i++) {
dstPixels[i]=0;
}
}
| Decodes LZW image data into pixel array. Adapted from John Cristy's BitmapMagick. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:01:51.754 -0500",hash_original_method="EE858F66DF718641EEB790378894310A",hash_generated_method="094A33EA9471FB13E5326825C0B4619D") public void fatal(Object message){
log(Level.SEVERE,String.valueOf(message),null);
}
| Logs a message with <code>java.util.logging.Level.SEVERE</code>. |
public void newClass(){
classIndex++;
}
| The following three methods seem to be used only to create a single BracketStack object and initialize its classes field. |
public void visitBaseType(char descriptor){
}
| Visits a signature corresponding to a primitive type. |
public synchronized void animatePanAbs(double dx,double dy,long duration){
m_transact.pan(dx,dy,duration);
}
| Animate a pan along the specified distance in absolute (item-space) co-ordinates using the provided duration. |
public ForStatement createForStatement(){
ForStatementImpl forStatement=new ForStatementImpl();
return forStatement;
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
protected boolean[] weightedInstancesHandler(){
boolean[] result=new boolean[2];
print("weighted instances classifier...");
if (m_Classifier instanceof WeightedInstancesHandler) {
println("yes");
result[0]=true;
}
else {
println("no");
result[0]=false;
}
return result;
}
| Checks whether the scheme says it can handle instance weights. |
public String toString(int indentFactor) throws JSONException {
StringWriter w=new StringWriter();
synchronized (w.getBuffer()) {
return this.write(w,indentFactor,0).toString();
}
}
| Make a prettyprinted JSON text of this JSONObject. <p> Warning: This method assumes that the data structure is acyclical. |
private void render404(Response response,String uri) throws Exception {
String view404=ViewSettings.$().getView404();
if (StringKit.isNotBlank(view404)) {
ModelAndView modelAndView=new ModelAndView(view404);
modelAndView.add("viewName",uri);
response.render(modelAndView);
}
else {
response.status(HttpStatus.NOT_FOUND);
response.html(String.format(Const.VIEW_NOTFOUND,uri));
}
}
| 404 view render |
public static <K,V>Map<K,V> of(K k1,V v1){
Map map=of();
map.put(k1,v1);
return map;
}
| Returns map containing a single entry. |
public static boolean isValidCodePoint(int codePoint){
int plane=codePoint >>> 16;
return plane < ((MAX_CODE_POINT + 1) >>> 16);
}
| Determines whether the specified code point is a valid <a href="http://www.unicode.org/glossary/#code_point"> Unicode code point value</a>. |
public PBEParameterSpec(byte[] salt,int iterationCount){
if (salt == null) {
throw new NullPointerException("salt == null");
}
this.salt=new byte[salt.length];
System.arraycopy(salt,0,this.salt,0,salt.length);
this.iterationCount=iterationCount;
}
| Creates a new <code>PBEParameterSpec</code> with the specified salt and iteration count. |
private ContentValues unpackFavorite(byte[] buffer,int dataSize) throws IOException {
Favorite favorite=unpackProto(new Favorite(),buffer,dataSize);
ContentValues values=new ContentValues();
values.put(Favorites._ID,favorite.id);
values.put(Favorites.SCREEN,favorite.screen);
values.put(Favorites.CONTAINER,favorite.container);
values.put(Favorites.CELLX,favorite.cellX);
values.put(Favorites.CELLY,favorite.cellY);
values.put(Favorites.SPANX,favorite.spanX);
values.put(Favorites.SPANY,favorite.spanY);
values.put(Favorites.ICON_TYPE,favorite.iconType);
if (favorite.iconType == Favorites.ICON_TYPE_RESOURCE) {
values.put(Favorites.ICON_PACKAGE,favorite.iconPackage);
values.put(Favorites.ICON_RESOURCE,favorite.iconResource);
}
if (favorite.iconType == Favorites.ICON_TYPE_BITMAP) {
values.put(Favorites.ICON,favorite.icon);
}
if (!TextUtils.isEmpty(favorite.title)) {
values.put(Favorites.TITLE,favorite.title);
}
else {
values.put(Favorites.TITLE,"");
}
if (!TextUtils.isEmpty(favorite.intent)) {
values.put(Favorites.INTENT,favorite.intent);
}
values.put(Favorites.ITEM_TYPE,favorite.itemType);
UserHandleCompat myUserHandle=UserHandleCompat.myUserHandle();
long userSerialNumber=UserManagerCompat.getInstance(mContext).getSerialNumberForUser(myUserHandle);
values.put(LauncherSettings.Favorites.PROFILE_ID,userSerialNumber);
DeviceProfieData currentProfile=getDeviceProfieData();
if (favorite.itemType == Favorites.ITEM_TYPE_APPWIDGET) {
if (!TextUtils.isEmpty(favorite.appWidgetProvider)) {
values.put(Favorites.APPWIDGET_PROVIDER,favorite.appWidgetProvider);
}
values.put(Favorites.APPWIDGET_ID,favorite.appWidgetId);
values.put(LauncherSettings.Favorites.RESTORED,LauncherAppWidgetInfo.FLAG_ID_NOT_VALID | LauncherAppWidgetInfo.FLAG_PROVIDER_NOT_READY | LauncherAppWidgetInfo.FLAG_UI_NOT_READY);
if (((favorite.cellX + favorite.spanX) > currentProfile.desktopCols) || ((favorite.cellY + favorite.spanY) > currentProfile.desktopRows)) {
restoreSuccessful=false;
throw new InvalidBackupException("Widget not in screen bounds, aborting restore");
}
}
else {
values.put(LauncherSettings.Favorites.RESTORED,1);
if (favorite.container == Favorites.CONTAINER_HOTSEAT) {
if ((favorite.screen >= currentProfile.hotseatCount) || (favorite.screen == currentProfile.allappsRank)) {
restoreSuccessful=false;
throw new InvalidBackupException("Item not in hotseat bounds, aborting restore");
}
}
else {
if ((favorite.cellX >= currentProfile.desktopCols) || (favorite.cellY >= currentProfile.desktopRows)) {
restoreSuccessful=false;
throw new InvalidBackupException("Item not in desktop bounds, aborting restore");
}
}
}
return values;
}
| Deserialize a Favorite from persistence, after verifying checksum wrapper. |
public boolean isPanYEnabled(){
return mPanYEnabled;
}
| Returns the enabled state of the pan on Y axis. |
public static boolean isLowSurrogate(char ch){
return (MIN_LOW_SURROGATE <= ch && MAX_LOW_SURROGATE >= ch);
}
| <p> A test for determining if the <code>char</code> is a high surrogate/leading surrogate unit that's used for representing supplementary characters in UTF-16 encoding. </p> |
public PersistentCookieStore(Context context){
cookiePrefs=context.getSharedPreferences(COOKIE_PREFS,0);
cookies=new ConcurrentHashMap<String,Cookie>();
String storedCookieNames=cookiePrefs.getString(COOKIE_NAME_STORE,null);
if (storedCookieNames != null) {
String[] cookieNames=TextUtils.split(storedCookieNames,",");
for ( String name : cookieNames) {
String encodedCookie=cookiePrefs.getString(COOKIE_NAME_PREFIX + name,null);
if (encodedCookie != null) {
Cookie decodedCookie=decodeCookie(encodedCookie);
if (decodedCookie != null) {
cookies.put(name,decodedCookie);
}
}
}
clearExpired(new Date());
}
}
| Construct a persistent cookie store. |
public void start(){
synchronized (myQueue) {
if (myStarted) return;
myStarted=true;
if (!myQueue.isEmpty()) {
startProcessing();
}
}
}
| Starts queue processing if it hasn't started yet. Effective only if the QueueProcessor was created with no-autostart option: otherwise processing will start as soon as the first element is added to the queue. If there are several elements in the queue, processing starts from the first one. |
public void apply(int zoom_axis){
if (mChart instanceof XYChart) {
int scales=mRenderer.getScalesCount();
for (int i=0; i < scales; i++) {
double[] range=getRange(i);
checkRange(range,i);
double[] limits=mRenderer.getZoomLimits();
double centerX=(range[0] + range[1]) / 2;
double centerY=(range[2] + range[3]) / 2;
double newWidth=range[1] - range[0];
double newHeight=range[3] - range[2];
double newXMin=centerX - newWidth / 2;
double newXMax=centerX + newWidth / 2;
double newYMin=centerY - newHeight / 2;
double newYMax=centerY + newHeight / 2;
if (i == 0) {
limitsReachedX=limits != null && (newXMin <= limits[0] || newXMax >= limits[1]);
limitsReachedY=limits != null && (newYMin <= limits[2] || newYMax >= limits[3]);
}
if (mZoomIn) {
if (mRenderer.isZoomXEnabled() && (zoom_axis == ZOOM_AXIS_X || zoom_axis == ZOOM_AXIS_XY)) {
if (limitsReachedX && mZoomRate < 1) {
}
else {
newWidth/=mZoomRate;
}
}
if (mRenderer.isZoomYEnabled() && (zoom_axis == ZOOM_AXIS_Y || zoom_axis == ZOOM_AXIS_XY)) {
if (limitsReachedY && mZoomRate < 1) {
}
else {
newHeight/=mZoomRate;
}
}
}
else {
if (mRenderer.isZoomXEnabled() && !limitsReachedX && (zoom_axis == ZOOM_AXIS_X || zoom_axis == ZOOM_AXIS_XY)) {
newWidth*=mZoomRate;
}
if (mRenderer.isZoomYEnabled() && !limitsReachedY && (zoom_axis == ZOOM_AXIS_Y || zoom_axis == ZOOM_AXIS_XY)) {
newHeight*=mZoomRate;
}
}
double minX, minY;
if (limits != null) {
minX=Math.min(mRenderer.getZoomInLimitX(),limits[1] - limits[0]);
minY=Math.min(mRenderer.getZoomInLimitY(),limits[3] - limits[2]);
}
else {
minX=mRenderer.getZoomInLimitX();
minY=mRenderer.getZoomInLimitY();
}
newWidth=Math.max(newWidth,minX);
newHeight=Math.max(newHeight,minY);
if (mRenderer.isZoomXEnabled() && (zoom_axis == ZOOM_AXIS_X || zoom_axis == ZOOM_AXIS_XY)) {
newXMin=centerX - newWidth / 2;
newXMax=centerX + newWidth / 2;
setXRange(newXMin,newXMax,i);
}
if (mRenderer.isZoomYEnabled() && (zoom_axis == ZOOM_AXIS_Y || zoom_axis == ZOOM_AXIS_XY)) {
newYMin=centerY - newHeight / 2;
newYMax=centerY + newHeight / 2;
setYRange(newYMin,newYMax,i);
}
}
}
else {
DefaultRenderer renderer=((RoundChart)mChart).getRenderer();
if (mZoomIn) {
renderer.setScale(renderer.getScale() * mZoomRate);
}
else {
renderer.setScale(renderer.getScale() / mZoomRate);
}
}
notifyZoomListeners(new ZoomEvent(mZoomIn,mZoomRate));
}
| Apply the zoom. |
public void processThrownExceptions(TryStatement tryStatement,BlockScope scope){
this.thrownExceptions=new SimpleSet();
this.exceptionsStack=new Stack();
this.caughtExceptions=new SimpleSet();
this.discouragedExceptions=new SimpleSet();
tryStatement.traverse(this,scope);
removeCaughtExceptions(tryStatement,true);
}
| Finds the thrown exceptions minus the ones that are already caught in previous catch blocks. Exception is already caught even if its super type is being caught. Also computes, separately, a list comprising of (a)those exceptions that have been caught already and (b)those exceptions that are thrown by the method and whose super type has been caught already. |
@FlashException(value="buckets") public static void deleteAcl(String bucketId,@As(",") String[] ids){
BucketACL aclsToDelete=new BucketACL();
List<BucketACE> bucketAcl=Lists.newArrayList();
if (ids != null && ids.length > 0) {
for ( String id : ids) {
String type=BucketACLForm.extractTypeFromId(id);
String name=BucketACLForm.extractNameFromId(id);
String domain=BucketACLForm.extractDomainFromId(id);
BucketACE ace=new BucketACE();
if (GROUP.equalsIgnoreCase(type)) {
ace.setGroup(name);
}
else if (CUSTOMGROUP.equalsIgnoreCase(type)) {
ace.setCustomGroup(name);
}
else {
ace.setUser(name);
}
if (domain != null && !"".equals(domain) && !"null".equals(domain)) {
ace.setDomain(domain);
}
bucketAcl.add(ace);
}
aclsToDelete.setBucketACL(bucketAcl);
ObjectBucketACLUpdateParams input=new ObjectBucketACLUpdateParams();
input.setAclToDelete(aclsToDelete);
ViPRCoreClient client=BourneUtil.getViprClient();
client.objectBuckets().updateBucketACL(uri(bucketId),input);
}
flash.success(MessagesUtils.get(DELETED));
listBucketACL(bucketId);
}
| This method called When user selects ACLs and hit delete button. |
private static boolean checkObjectInline(SSAVar sVar){
for ( RegisterArg useArg : sVar.getUseList()) {
InsnNode insn=useArg.getParentInsn();
if (insn != null) {
InsnType insnType=insn.getType();
if (insnType == InsnType.INVOKE) {
InvokeNode inv=(InvokeNode)insn;
if (inv.getInvokeType() != InvokeType.STATIC && inv.getArg(0) == useArg) {
return true;
}
}
else if (insnType == InsnType.ARRAY_LENGTH) {
if (insn.getArg(0) == useArg) {
return true;
}
}
}
}
return false;
}
| Don't inline null object if: - used as instance arg in invoke instruction - used in 'array.length' |
private void actionWrite() throws PageException {
if (output == null) throw new ApplicationException("attribute output is not defined for tag file");
checkFile(pageContext,securityManager,file,serverPassword,createPath,true,false,true);
try {
if (output instanceof InputStream) {
IOUtil.copy((InputStream)output,file,false);
}
else if (Decision.isCastableToBinary(output,false)) {
IOUtil.copy(new ByteArrayInputStream(Caster.toBinary(output)),file,true);
}
else {
String content=Caster.toString(output);
if (fixnewline) content=doFixNewLine(content);
if (addnewline) content+=SystemUtil.getOSSpecificLineSeparator();
IOUtil.write(file,content,CharsetUtil.toCharset(charset),false);
}
}
catch ( UnsupportedEncodingException e) {
throw new ApplicationException("Unsupported Charset Definition [" + charset + "]",e.getMessage());
}
catch ( IOException e) {
throw new ApplicationException("can't write file " + file.getAbsolutePath(),e.getMessage());
}
setACL(pageContext,file,acl);
setMode(file,mode);
setAttributes(file,attributes);
}
| write to the source file |
public boolean hasStatus(){
return hasExtension(Status.class);
}
| Returns whether it has the status. |
private void leadNPC(){
final StendhalRPZone zone=fullpathin.get(0).get().first();
final int x=fullpathin.get(0).get().second().get(0).getX();
final int y=fullpathin.get(0).get().second().get(0).getY();
piedpiper.setPosition(x,y);
zone.add(piedpiper);
Observer o=new MultiZonesFixedPath(piedpiper,fullpathin,new NPCFollowing(mainNPC,piedpiper,new NPCChatting(piedpiper,mainNPC,conversations,explainations,new GoToPosition(piedpiper,PathsBuildHelper.getAdosTownHallMiddlePoint(),new MultiZonesFixedPath(piedpiper,fullpathout,new PhaseSwitcher(this))))));
o.update(null,null);
}
| prepare NPC to walk through his multizone pathes and do some actions during that. |
public static boolean instanceOf(Object obj,Object typeObject){
Class<?> typeClass=typeObject.getClass();
return instanceOf(obj,typeClass);
}
| Tests if an object is an instance of a sub-class of or properly implements an interface. |
private boolean isLocalMaximum(double kdist,DBIDs neighbors,WritableDoubleDataStore kdists){
for (DBIDIter it=neighbors.iter(); it.valid(); it.advance()) {
if (kdists.doubleValue(it) < kdist) {
return false;
}
}
return true;
}
| Test if a point is a local density maximum. |
protected AbstractRable(List srcs){
this(srcs,null);
}
| Construct an Abstract Rable from a list of sources. |
public static long flipC(long v,int off){
v^=(1L << off);
return v;
}
| Invert bit number "off" in v. |
public void startDelete(String key) throws AmazonClientException, AmazonServiceException {
super.startDelete(awsS3BucketName,key);
}
| Deletes the specified object in the specified bucket |
public boolean isSimpleTypeRef(){
FullMemberReference ref=nodeAsFullMemberReference();
if (ref != null) {
return ref.moduleNameSet() && !ref.typeNameSet();
}
return false;
}
| Returns true iff this is a simple type reference. |
private void updateMigrationInfo(VPlexMigrationInfo migrationInfo,URI baseMigrationPath) throws VPlexApiException {
StringBuilder uriBuilder=new StringBuilder();
uriBuilder.append(baseMigrationPath.toString());
uriBuilder.append(migrationInfo.getName());
URI requestURI=_vplexApiClient.getBaseURI().resolve(uriBuilder.toString());
s_logger.info("Migration Info Request URI is {}",requestURI.toString());
ClientResponse response=_vplexApiClient.get(requestURI);
String responseStr=response.getEntity(String.class);
s_logger.info("Response is {}",responseStr);
int status=response.getStatus();
response.close();
if (status != VPlexApiConstants.SUCCESS_STATUS) {
throw new VPlexApiException(String.format("Failed getting info for migration %s with status: %s",migrationInfo.getName(),status));
}
try {
VPlexApiUtils.setAttributeValues(responseStr,migrationInfo);
s_logger.info("Updated Migration Info {}",migrationInfo.toString());
}
catch ( VPlexApiException vae) {
throw vae;
}
catch ( Exception e) {
throw new VPlexApiException(String.format("Error updating migration information: %s",e.getMessage()),e);
}
}
| Updates the attribute info for the passed VPlex migration. |
@Override public void createPartControl(Composite parent){
Composite top=new Composite(parent,SWT.NONE);
FillLayout layout=new FillLayout(SWT.HORIZONTAL);
layout.marginHeight=10;
top.setLayout(layout);
CTabFolder tabFolder=new CTabFolder(top,SWT.BORDER);
tabFolder.setSelectionBackground(Display.getCurrent().getSystemColor(SWT.COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT));
GridLayout tabLayout=new GridLayout();
tabLayout.marginHeight=10;
tabLayout.marginWidth=10;
tabLayout.verticalSpacing=20;
tabLayout.numColumns=1;
tabFolder.setLayout(tabLayout);
new MQTTTab(tabFolder,SWT.NONE,connection,eventService);
new OptionsTab(tabFolder,SWT.NONE,connection);
tabFolder.setSelection(0);
}
| Create contents of the editor part. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.