repo_name stringlengths 7 104 | file_path stringlengths 13 198 | context stringlengths 67 7.15k | import_statement stringlengths 16 4.43k | code stringlengths 40 6.98k | prompt stringlengths 227 8.27k | next_line stringlengths 8 795 |
|---|---|---|---|---|---|---|
Tyde/TuCanMobile | app/src/main/java/com/dalthed/tucan/ui/ApplyEvent.java | // Path: app/src/main/java/com/dalthed/tucan/Connection/AnswerObject.java
// public class AnswerObject {
// private String HTML_text;
// private String redirectURL;
// private String lastcalledURL;
// private CookieManager Cookies;
// /**
// * RückgabeObjekt der BrowseMethods
// * @param HTML HTML-Code
// * ... | import android.os.Bundle;
import com.dalthed.tucan.Connection.AnswerObject;
import com.dalthed.tucan.util.ConfigurationChangeStorage; | /**
* This file is part of TuCan Mobile.
*
* TuCan Mobile is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* TuCan Mobile is d... | // Path: app/src/main/java/com/dalthed/tucan/Connection/AnswerObject.java
// public class AnswerObject {
// private String HTML_text;
// private String redirectURL;
// private String lastcalledURL;
// private CookieManager Cookies;
// /**
// * RückgabeObjekt der BrowseMethods
// * @param HTML HTML-Code
// * ... | public ConfigurationChangeStorage saveConfiguration() { |
Tyde/TuCanMobile | app/src/main/java/com/dalthed/tucan/scraper/UniApplicationScraper.java | // Path: app/src/main/java/com/dalthed/tucan/Connection/AnswerObject.java
// public class AnswerObject {
// private String HTML_text;
// private String redirectURL;
// private String lastcalledURL;
// private CookieManager Cookies;
// /**
// * RückgabeObjekt der BrowseMethods
// * @param HTML HTML-Code
// * ... | import com.dalthed.tucan.exceptions.LostSessionException;
import com.dalthed.tucan.exceptions.TucanDownException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import android.content.Context;
import android.widget.ListA... | /**
* This file is part of TuCan Mobile.
*
* TuCan Mobile is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* TuCan Mobile is d... | // Path: app/src/main/java/com/dalthed/tucan/Connection/AnswerObject.java
// public class AnswerObject {
// private String HTML_text;
// private String redirectURL;
// private String lastcalledURL;
// private CookieManager Cookies;
// /**
// * RückgabeObjekt der BrowseMethods
// * @param HTML HTML-Code
// * ... | public UniApplicationScraper(Context context, AnswerObject result) { |
Tyde/TuCanMobile | app/src/main/java/com/dalthed/tucan/scraper/UniApplicationScraper.java | // Path: app/src/main/java/com/dalthed/tucan/Connection/AnswerObject.java
// public class AnswerObject {
// private String HTML_text;
// private String redirectURL;
// private String lastcalledURL;
// private CookieManager Cookies;
// /**
// * RückgabeObjekt der BrowseMethods
// * @param HTML HTML-Code
// * ... | import com.dalthed.tucan.exceptions.LostSessionException;
import com.dalthed.tucan.exceptions.TucanDownException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import android.content.Context;
import android.widget.ListA... | /**
* This file is part of TuCan Mobile.
*
* TuCan Mobile is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* TuCan Mobile is d... | // Path: app/src/main/java/com/dalthed/tucan/Connection/AnswerObject.java
// public class AnswerObject {
// private String HTML_text;
// private String redirectURL;
// private String lastcalledURL;
// private CookieManager Cookies;
// /**
// * RückgabeObjekt der BrowseMethods
// * @param HTML HTML-Code
// * ... | public ListAdapter scrapeAdapter(int mode) throws LostSessionException, |
Tyde/TuCanMobile | app/src/main/java/com/dalthed/tucan/scraper/UniApplicationScraper.java | // Path: app/src/main/java/com/dalthed/tucan/Connection/AnswerObject.java
// public class AnswerObject {
// private String HTML_text;
// private String redirectURL;
// private String lastcalledURL;
// private CookieManager Cookies;
// /**
// * RückgabeObjekt der BrowseMethods
// * @param HTML HTML-Code
// * ... | import com.dalthed.tucan.exceptions.LostSessionException;
import com.dalthed.tucan.exceptions.TucanDownException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import android.content.Context;
import android.widget.ListA... | /**
* This file is part of TuCan Mobile.
*
* TuCan Mobile is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* TuCan Mobile is d... | // Path: app/src/main/java/com/dalthed/tucan/Connection/AnswerObject.java
// public class AnswerObject {
// private String HTML_text;
// private String redirectURL;
// private String lastcalledURL;
// private CookieManager Cookies;
// /**
// * RückgabeObjekt der BrowseMethods
// * @param HTML HTML-Code
// * ... | TucanDownException { |
Tyde/TuCanMobile | app/src/main/java/com/dalthed/tucan/scraper/SingleMessageScraper.java | // Path: app/src/main/java/com/dalthed/tucan/Connection/AnswerObject.java
// public class AnswerObject {
// private String HTML_text;
// private String redirectURL;
// private String lastcalledURL;
// private CookieManager Cookies;
// /**
// * RückgabeObjekt der BrowseMethods
// * @param HTML HTML-Code
// * ... | import com.dalthed.tucan.exceptions.TucanDownException;
import java.util.ArrayList;
import org.jsoup.select.Elements;
import android.content.Context;
import android.text.Html;
import android.text.Spanned;
import android.widget.ArrayAdapter;
import android.widget.ListAdapter;
import com.dalthed.tucan.R;
import com.dalth... | /**
* This file is part of TuCan Mobile.
*
* TuCan Mobile is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* TuCan Mobile is d... | // Path: app/src/main/java/com/dalthed/tucan/Connection/AnswerObject.java
// public class AnswerObject {
// private String HTML_text;
// private String redirectURL;
// private String lastcalledURL;
// private CookieManager Cookies;
// /**
// * RückgabeObjekt der BrowseMethods
// * @param HTML HTML-Code
// * ... | public ListAdapter scrapeAdapter(int mode) throws LostSessionException, TucanDownException { |
Tyde/TuCanMobile | app/src/main/java/com/dalthed/tucan/scraper/SingleMessageScraper.java | // Path: app/src/main/java/com/dalthed/tucan/Connection/AnswerObject.java
// public class AnswerObject {
// private String HTML_text;
// private String redirectURL;
// private String lastcalledURL;
// private CookieManager Cookies;
// /**
// * RückgabeObjekt der BrowseMethods
// * @param HTML HTML-Code
// * ... | import com.dalthed.tucan.exceptions.TucanDownException;
import java.util.ArrayList;
import org.jsoup.select.Elements;
import android.content.Context;
import android.text.Html;
import android.text.Spanned;
import android.widget.ArrayAdapter;
import android.widget.ListAdapter;
import com.dalthed.tucan.R;
import com.dalth... | /**
* This file is part of TuCan Mobile.
*
* TuCan Mobile is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* TuCan Mobile is d... | // Path: app/src/main/java/com/dalthed/tucan/Connection/AnswerObject.java
// public class AnswerObject {
// private String HTML_text;
// private String redirectURL;
// private String lastcalledURL;
// private CookieManager Cookies;
// /**
// * RückgabeObjekt der BrowseMethods
// * @param HTML HTML-Code
// * ... | public ListAdapter scrapeAdapter(int mode) throws LostSessionException, TucanDownException { |
Tyde/TuCanMobile | app/src/main/java/com/dalthed/tucan/scraper/ModuleScraper.java | // Path: app/src/main/java/com/dalthed/tucan/Connection/AnswerObject.java
// public class AnswerObject {
// private String HTML_text;
// private String redirectURL;
// private String lastcalledURL;
// private CookieManager Cookies;
// /**
// * RückgabeObjekt der BrowseMethods
// * @param HTML HTML-Code
// * ... | import java.util.ArrayList;
import org.jsoup.select.Elements;
import android.content.Context;
import android.widget.ArrayAdapter;
import android.widget.ListAdapter;
import com.dalthed.tucan.Connection.AnswerObject;
import com.dalthed.tucan.exceptions.LostSessionException;
import com.dalthed.tucan.exceptions.TucanDownEx... | /**
* This file is part of TuCan Mobile.
*
* TuCan Mobile is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* TuCan Mobile is d... | // Path: app/src/main/java/com/dalthed/tucan/Connection/AnswerObject.java
// public class AnswerObject {
// private String HTML_text;
// private String redirectURL;
// private String lastcalledURL;
// private CookieManager Cookies;
// /**
// * RückgabeObjekt der BrowseMethods
// * @param HTML HTML-Code
// * ... | public ModuleScraper(Context context, AnswerObject result) { |
Tyde/TuCanMobile | app/src/main/java/com/dalthed/tucan/scraper/ModuleScraper.java | // Path: app/src/main/java/com/dalthed/tucan/Connection/AnswerObject.java
// public class AnswerObject {
// private String HTML_text;
// private String redirectURL;
// private String lastcalledURL;
// private CookieManager Cookies;
// /**
// * RückgabeObjekt der BrowseMethods
// * @param HTML HTML-Code
// * ... | import java.util.ArrayList;
import org.jsoup.select.Elements;
import android.content.Context;
import android.widget.ArrayAdapter;
import android.widget.ListAdapter;
import com.dalthed.tucan.Connection.AnswerObject;
import com.dalthed.tucan.exceptions.LostSessionException;
import com.dalthed.tucan.exceptions.TucanDownEx... | /**
* This file is part of TuCan Mobile.
*
* TuCan Mobile is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* TuCan Mobile is d... | // Path: app/src/main/java/com/dalthed/tucan/Connection/AnswerObject.java
// public class AnswerObject {
// private String HTML_text;
// private String redirectURL;
// private String lastcalledURL;
// private CookieManager Cookies;
// /**
// * RückgabeObjekt der BrowseMethods
// * @param HTML HTML-Code
// * ... | public ListAdapter scrapeAdapter(int mode) throws LostSessionException, TucanDownException { |
Tyde/TuCanMobile | app/src/main/java/com/dalthed/tucan/scraper/ModuleScraper.java | // Path: app/src/main/java/com/dalthed/tucan/Connection/AnswerObject.java
// public class AnswerObject {
// private String HTML_text;
// private String redirectURL;
// private String lastcalledURL;
// private CookieManager Cookies;
// /**
// * RückgabeObjekt der BrowseMethods
// * @param HTML HTML-Code
// * ... | import java.util.ArrayList;
import org.jsoup.select.Elements;
import android.content.Context;
import android.widget.ArrayAdapter;
import android.widget.ListAdapter;
import com.dalthed.tucan.Connection.AnswerObject;
import com.dalthed.tucan.exceptions.LostSessionException;
import com.dalthed.tucan.exceptions.TucanDownEx... | /**
* This file is part of TuCan Mobile.
*
* TuCan Mobile is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* TuCan Mobile is d... | // Path: app/src/main/java/com/dalthed/tucan/Connection/AnswerObject.java
// public class AnswerObject {
// private String HTML_text;
// private String redirectURL;
// private String lastcalledURL;
// private CookieManager Cookies;
// /**
// * RückgabeObjekt der BrowseMethods
// * @param HTML HTML-Code
// * ... | public ListAdapter scrapeAdapter(int mode) throws LostSessionException, TucanDownException { |
siemens/omniproperties | src/main/java/com/siemens/oss/omniproperties/MapOmniProperties.java | // Path: src/main/java/com/siemens/oss/omniproperties/exceptions/PropertyNotFoundException.java
// public class PropertyNotFoundException extends RuntimeException {
//
// private static final long serialVersionUID = 1L;
//
// public PropertyNotFoundException(String arg0) {
// super(arg0);
// }
//
// public Pro... | import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.siemens.oss.omniproperties.exceptions.PropertyNotFoundException;
import com.siemens.oss.omniproperties.exceptions.WrongClassExcep... | public String getString(final String key, final String def) {
return getObject(key, def, String.class);
}
/* (non-Javadoc)
* @see com.siemens.oss.omniproperties.OmniProperties#getBoolean(java.lang.String)
*/
@Override
public boolean getBoolean(String key) {
return getObject(key, Boolean.class).booleanVal... | // Path: src/main/java/com/siemens/oss/omniproperties/exceptions/PropertyNotFoundException.java
// public class PropertyNotFoundException extends RuntimeException {
//
// private static final long serialVersionUID = 1L;
//
// public PropertyNotFoundException(String arg0) {
// super(arg0);
// }
//
// public Pro... | throw new PropertyNotFoundException("No property '" + key |
siemens/omniproperties | src/main/java/com/siemens/oss/omniproperties/MapOmniProperties.java | // Path: src/main/java/com/siemens/oss/omniproperties/exceptions/PropertyNotFoundException.java
// public class PropertyNotFoundException extends RuntimeException {
//
// private static final long serialVersionUID = 1L;
//
// public PropertyNotFoundException(String arg0) {
// super(arg0);
// }
//
// public Pro... | import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.siemens.oss.omniproperties.exceptions.PropertyNotFoundException;
import com.siemens.oss.omniproperties.exceptions.WrongClassExcep... | return getObject(key, Boolean.valueOf(def), Boolean.class).booleanValue();
}
/* (non-Javadoc)
* @see com.siemens.oss.omniproperties.IOmniProperties#getObject(java.lang.String, java.lang.Class)
*/
@Override
public <T> T getObject(final String key, final Class<T> type) {
final T result = getObject(key, nu... | // Path: src/main/java/com/siemens/oss/omniproperties/exceptions/PropertyNotFoundException.java
// public class PropertyNotFoundException extends RuntimeException {
//
// private static final long serialVersionUID = 1L;
//
// public PropertyNotFoundException(String arg0) {
// super(arg0);
// }
//
// public Pro... | throw new WrongClassException("Property '" + key |
thasmin/Podax | src/main/java/com/axelby/gpodder/NoAuthClient.java | // Path: src/main/java/com/axelby/gpodder/dto/Podcast.java
// public class Podcast {
// private Uri website;
// private String description;
// private String title;
// private String url;
// private String logoUrl;
// private Integer positionLastWeek;
// private Integer subscribersLastWeek;
// private Integer s... | import android.content.Context;
import android.net.Uri;
import android.util.Log;
import com.axelby.gpodder.dto.Podcast;
import com.google.gson.stream.JsonReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.... | reader.nextName();
config.mygpo = reader.nextString();
reader.endObject();
} else if (name.equals("mygpo-feedservice")) {
reader.beginObject();
reader.nextName();
config.mygpo_feedservice = reader.nextString();
reader.endObject();
} else if (name.equals("update_timeout")) {
... | // Path: src/main/java/com/axelby/gpodder/dto/Podcast.java
// public class Podcast {
// private Uri website;
// private String description;
// private String title;
// private String url;
// private String logoUrl;
// private Integer positionLastWeek;
// private Integer subscribersLastWeek;
// private Integer s... | public List<Podcast> getPodcastToplist() { |
thasmin/Podax | src/main/java/com/axelby/podax/ui/ITunesPopularListFragment.java | // Path: src/main/java/com/axelby/podax/Constants.java
// public class Constants {
// public static final int NOTIFICATION_UPDATE = 1;
// public static final int SUBSCRIPTION_UPDATE_ERROR = 2;
// public static final int NOTIFICATION_PLAYING = 3;
// public static final int NOTIFICATION_GPODDER_ERROR = 4;
// public ... | import android.os.AsyncTask;
import android.os.Bundle;
import android.sax.RootElement;
import android.sax.StartElementListener;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.app.ListFragment;
import android.util.Xml;
import android.view.LayoutInflater;
import android.view.View;
import and... | } catch (IllegalStateException e) {
e.printStackTrace();
} catch (SAXException e) {
e.printStackTrace();
}
return feeds;
}
@Override
protected void onPostExecute(ArrayList<PodaxFeed> result) {
// make sure the activity still exists
if (getActivity() != null) {
setListAda... | // Path: src/main/java/com/axelby/podax/Constants.java
// public class Constants {
// public static final int NOTIFICATION_UPDATE = 1;
// public static final int SUBSCRIPTION_UPDATE_ERROR = 2;
// public static final int NOTIFICATION_PLAYING = 3;
// public static final int NOTIFICATION_GPODDER_ERROR = 4;
// public ... | args.putString(Constants.EXTRA_TITLE, feed.title); |
thasmin/Podax | src/main/java/com/axelby/podax/ui/PodaxPreferenceFragment.java | // Path: src/main/java/com/axelby/podax/Storage.java
// public class Storage {
// public static File getExternalStorageDirectory(Context context) {
// SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
// String storageCard = prefs.getString("storageCard", "/storage/sdcard0");
// i... | import android.os.Bundle;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceScreen;
import com.axelby.podax.R;
import com.axelby.podax.Storage;
import java.io.File;
import java.util.ArrayList; |
setPreferenceScreen(screen);
}
private CharSequence getEntryText(ListPreference listPreference, String value) {
if (listPreference.getEntries() == null)
return "";
int index = listPreference.findIndexOfValue(value);
return listPreference.getEntries()[index];
}
@Override
public boolean onPreferenceCha... | // Path: src/main/java/com/axelby/podax/Storage.java
// public class Storage {
// public static File getExternalStorageDirectory(Context context) {
// SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
// String storageCard = prefs.getString("storageCard", "/storage/sdcard0");
// i... | File oldStorage = Storage.getExternalStorageDirectory(getActivity()); |
thasmin/Podax | src/main/java/com/axelby/podax/ui/StatsFragment.java | // Path: src/main/java/com/axelby/podax/Stats.java
// public class Stats {
// private Stats() { }
//
// public static void addTime(Context context, float seconds) {
// SharedPreferences statsPrefs = context.getSharedPreferences("stats", Context.MODE_PRIVATE);
// float listenTime = statsPrefs.getFloat("listenTime... | import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.axelby.podax.R;
import com.axelby.podax.Stats; | package com.axelby.podax.ui;
// todo: fragment doesn't update when stats change
public class StatsFragment extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.stats, container, false);
}
@Override
pu... | // Path: src/main/java/com/axelby/podax/Stats.java
// public class Stats {
// private Stats() { }
//
// public static void addTime(Context context, float seconds) {
// SharedPreferences statsPrefs = context.getSharedPreferences("stats", Context.MODE_PRIVATE);
// float listenTime = statsPrefs.getFloat("listenTime... | listenTime.setText(Stats.getTimeString(getActivity())); |
thasmin/Podax | src/main/java/com/axelby/podax/ui/PodaxFragmentActivity.java | // Path: src/main/java/com/axelby/podax/Helper.java
// public class Helper {
//
// private static RequestQueue _requestQueue = null;
// private static ImageLoader _imageLoader = null;
// private static LruCache<String, Bitmap> _imageCache = new LruCache<String, Bitmap>(10);
// private static DiskBasedCache _diskCa... | import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.view.MenuItem;
import android.widget.FrameLayout;
import android.widget.FrameLayout.LayoutParams;
import com.axelby.podax.Helper;
import com.axel... | package com.axelby.podax.ui;
public class PodaxFragmentActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getActionBar().setDisplayHomeAsUpEnabled(true);
}
@Override
protected void onResume() {
super.onResume();
| // Path: src/main/java/com/axelby/podax/Helper.java
// public class Helper {
//
// private static RequestQueue _requestQueue = null;
// private static ImageLoader _imageLoader = null;
// private static LruCache<String, Bitmap> _imageCache = new LruCache<String, Bitmap>(10);
// private static DiskBasedCache _diskCa... | Helper.registerMediaButtons(this); |
pajikos/java-examples | spring-rest-api-client-auth/src/main/java/com/pavelsklenar/rest/controller/CustomerController.java | // Path: spring-rest-api-client-auth/src/main/java/com/pavelsklenar/rest/pojo/Customer.java
// public class Customer {
//
// private Long id;
// private String name;
//
// public Customer(Long id, String name) {
// this.id = id;
// this.name = name;
// }
//
// public Long getId() ... | import org.springframework.security.access.annotation.Secured;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.... | package com.pavelsklenar.rest.controller;
@RestController
@RequestMapping("/customer")
public class CustomerController {
@GetMapping("/{id}")
@Secured("ROLE_USER") | // Path: spring-rest-api-client-auth/src/main/java/com/pavelsklenar/rest/pojo/Customer.java
// public class Customer {
//
// private Long id;
// private String name;
//
// public Customer(Long id, String name) {
// this.id = id;
// this.name = name;
// }
//
// public Long getId() ... | public Customer GetCustomer(@PathVariable Long id) { |
pajikos/java-examples | spring-sftp-upload-demo/src/test/java/com/pavelsklenar/SpringSftpUploadDemoApplicationTests.java | // Path: spring-sftp-upload-demo/src/main/java/com/pavelsklenar/SftpConfig.java
// @MessagingGateway
// public interface UploadGateway {
//
// @Gateway(requestChannel = "toSftpChannel")
// void upload(File file);
//
// }
| import static org.junit.Assert.assertEquals;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import java.util.stream.Collectors;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
impo... | package com.pavelsklenar;
@RunWith(SpringRunner.class)
@SpringBootTest
@TestPropertySource(properties = { "sftp.port = 10022" })
public class SpringSftpUploadDemoApplicationTests {
@Autowired | // Path: spring-sftp-upload-demo/src/main/java/com/pavelsklenar/SftpConfig.java
// @MessagingGateway
// public interface UploadGateway {
//
// @Gateway(requestChannel = "toSftpChannel")
// void upload(File file);
//
// }
// Path: spring-sftp-upload-demo/src/test/java/com/pavelsklenar/SpringSftpUploadDemoApp... | private UploadGateway gateway; |
pajikos/java-examples | spring-boot-docker-build/src/main/java/com/pavelsklenar/rest/controller/CustomerController.java | // Path: spring-rest-api-client-auth/src/main/java/com/pavelsklenar/rest/pojo/Customer.java
// public class Customer {
//
// private Long id;
// private String name;
//
// public Customer(Long id, String name) {
// this.id = id;
// this.name = name;
// }
//
// public Long getId() ... | import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.pavelsklenar.rest.pojo.Customer; | package com.pavelsklenar.rest.controller;
@RestController
@RequestMapping("/customer")
public class CustomerController {
@GetMapping("/{id}") | // Path: spring-rest-api-client-auth/src/main/java/com/pavelsklenar/rest/pojo/Customer.java
// public class Customer {
//
// private Long id;
// private String name;
//
// public Customer(Long id, String name) {
// this.id = id;
// this.name = name;
// }
//
// public Long getId() ... | public Customer GetCustomer(@PathVariable Long id) { |
pajikos/java-examples | spring-security-radius-login/src/main/java/com/pavelsklenar/radiuslogin/bootstrap/WebSecurityConfig.java | // Path: spring-security-radius-login/src/main/java/com/pavelsklenar/radiuslogin/authentication/RadiusAuthenticationProvider.java
// public class RadiusAuthenticationProvider implements AuthenticationProvider {
//
// private static final Logger logger = LoggerFactory.getLogger(RadiusAuthenticationProvider.class);
// ... | import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.... | package com.pavelsklenar.radiuslogin.bootstrap;
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.anyRequest().authenti... | // Path: spring-security-radius-login/src/main/java/com/pavelsklenar/radiuslogin/authentication/RadiusAuthenticationProvider.java
// public class RadiusAuthenticationProvider implements AuthenticationProvider {
//
// private static final Logger logger = LoggerFactory.getLogger(RadiusAuthenticationProvider.class);
// ... | public RadiusAuthenticationProvider radiusAuthenticationProvider() { |
AlexeyDmitriev/JHelper | src/name/admitriev/jhelper/ui/ConfigurationDialog.java | // Path: src/name/admitriev/jhelper/components/Configurator.java
// @State(name = "Configurator", storages = @Storage("JHelper.xml"))
// @Service(Service.Level.PROJECT)
// public final class Configurator implements PersistentStateComponent<Configurator.State> {
// public Configurator() {
// state = new Configurator.... | import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.LabeledComponent;
import name.admitriev.jhelper.components.Configurator;
import org.jdesktop.swingx.VerticalLayout;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullabl... | package name.admitriev.jhelper.ui;
public class ConfigurationDialog extends DialogWrapper {
private final JComponent component;
private JTextField author;
private FileSelector tasksDirectory;
private FileSelector outputFile;
private FileSelector runFile;
private JCheckBox codeEliminationOn;
private JCheckBox ... | // Path: src/name/admitriev/jhelper/components/Configurator.java
// @State(name = "Configurator", storages = @Storage("JHelper.xml"))
// @Service(Service.Level.PROJECT)
// public final class Configurator implements PersistentStateComponent<Configurator.State> {
// public Configurator() {
// state = new Configurator.... | public ConfigurationDialog(@NotNull Project project, Configurator.State configuration) { |
AlexeyDmitriev/JHelper | src/name/admitriev/jhelper/ui/AddTaskDialog.java | // Path: src/name/admitriev/jhelper/task/TaskData.java
// public class TaskData {
// private final String name;
// private final String className;
// private final String cppPath;
// private final StreamConfiguration input;
// private final StreamConfiguration output;
// private final TestType testType;
// priva... | import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import name.admitriev.jhelper.task.TaskData;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*; | package name.admitriev.jhelper.ui;
public class AddTaskDialog extends DialogWrapper {
private TaskSettingsComponent component;
public AddTaskDialog(@NotNull Project project) {
super(project);
setTitle("Add Task");
component = new TaskSettingsComponent(
project,
true,
this::pack
);
init();
}... | // Path: src/name/admitriev/jhelper/task/TaskData.java
// public class TaskData {
// private final String name;
// private final String className;
// private final String cppPath;
// private final StreamConfiguration input;
// private final StreamConfiguration output;
// private final TestType testType;
// priva... | public TaskData getTask() { |
AlexeyDmitriev/JHelper | src/name/admitriev/jhelper/actions/BaseAction.java | // Path: src/name/admitriev/jhelper/exceptions/JHelperException.java
// public class JHelperException extends RuntimeException {
//
// public JHelperException(String message, Throwable cause) {
// super(message, cause);
// }
//
// public JHelperException(String message) {
// super(message);
// }
//
// @Over... | import com.intellij.notification.NotificationType;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import name.admitriev.jhelper.exceptions.JHelperException;
import name.admitriev.jhelper.exceptions.NotificationException;
import name.admitriev.jhelper.ui.Notifi... | package name.admitriev.jhelper.actions;
public abstract class BaseAction extends AnAction {
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
try {
performAction(e);
} | // Path: src/name/admitriev/jhelper/exceptions/JHelperException.java
// public class JHelperException extends RuntimeException {
//
// public JHelperException(String message, Throwable cause) {
// super(message, cause);
// }
//
// public JHelperException(String message) {
// super(message);
// }
//
// @Over... | catch (NotificationException exception) { |
AlexeyDmitriev/JHelper | src/name/admitriev/jhelper/actions/BaseAction.java | // Path: src/name/admitriev/jhelper/exceptions/JHelperException.java
// public class JHelperException extends RuntimeException {
//
// public JHelperException(String message, Throwable cause) {
// super(message, cause);
// }
//
// public JHelperException(String message) {
// super(message);
// }
//
// @Over... | import com.intellij.notification.NotificationType;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import name.admitriev.jhelper.exceptions.JHelperException;
import name.admitriev.jhelper.exceptions.NotificationException;
import name.admitriev.jhelper.ui.Notifi... | package name.admitriev.jhelper.actions;
public abstract class BaseAction extends AnAction {
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
try {
performAction(e);
}
catch (NotificationException exception) { | // Path: src/name/admitriev/jhelper/exceptions/JHelperException.java
// public class JHelperException extends RuntimeException {
//
// public JHelperException(String message, Throwable cause) {
// super(message, cause);
// }
//
// public JHelperException(String message) {
// super(message);
// }
//
// @Over... | Notificator.showNotification( |
AlexeyDmitriev/JHelper | src/name/admitriev/jhelper/actions/BaseAction.java | // Path: src/name/admitriev/jhelper/exceptions/JHelperException.java
// public class JHelperException extends RuntimeException {
//
// public JHelperException(String message, Throwable cause) {
// super(message, cause);
// }
//
// public JHelperException(String message) {
// super(message);
// }
//
// @Over... | import com.intellij.notification.NotificationType;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import name.admitriev.jhelper.exceptions.JHelperException;
import name.admitriev.jhelper.exceptions.NotificationException;
import name.admitriev.jhelper.ui.Notifi... | package name.admitriev.jhelper.actions;
public abstract class BaseAction extends AnAction {
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
try {
performAction(e);
}
catch (NotificationException exception) {
Notificator.showNotification(
exception.getTitle(),
exception.getCon... | // Path: src/name/admitriev/jhelper/exceptions/JHelperException.java
// public class JHelperException extends RuntimeException {
//
// public JHelperException(String message, Throwable cause) {
// super(message, cause);
// }
//
// public JHelperException(String message) {
// super(message);
// }
//
// @Over... | catch (JHelperException exception) { |
AlexeyDmitriev/JHelper | src/name/admitriev/jhelper/generation/FileUtils.java | // Path: src/name/admitriev/jhelper/exceptions/NotificationException.java
// public class NotificationException extends RuntimeException {
// private final String title;
// private final String content;
//
// public NotificationException(String content) {
// this(content, (Throwable) null);
// }
//
// public N... | import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.command.WriteCommandAction;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.fileEditor.FileDocumentManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Computable;
import co... | package name.admitriev.jhelper.generation;
public class FileUtils {
private FileUtils() {
}
public static OutputWriter getOutputWriter(VirtualFile virtualFile, Object requestor) {
try {
return new OutputWriter(virtualFile.getOutputStream(requestor));
}
catch (IOException e) { | // Path: src/name/admitriev/jhelper/exceptions/NotificationException.java
// public class NotificationException extends RuntimeException {
// private final String title;
// private final String content;
//
// public NotificationException(String content) {
// this(content, (Throwable) null);
// }
//
// public N... | throw new NotificationException("Couldn't open virtual file to write", e); |
AlexeyDmitriev/JHelper | src/name/admitriev/jhelper/network/SimpleHttpServer.java | // Path: src/name/admitriev/jhelper/ui/Notificator.java
// public class Notificator {
// private static final NotificationGroup GROUP = NotificationGroupManager.getInstance().getNotificationGroup("JHelper");
//
// private Notificator() {
// }
//
// public static void showNotification(String title, String content,... | import com.intellij.notification.NotificationType;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.ModalityState;
import com.intellij.util.Consumer;
import name.admitriev.jhelper.ui.Notificator;
import java.io.BufferedReader;
import java.io.IOException;
import java.io... | package name.admitriev.jhelper.network;
/**
* Simple HTTP Server.
* Passes every request without headers to given Consumer
*/
public class SimpleHttpServer implements Runnable {
private Consumer<String> consumer;
private ServerSocket serverSocket = null;
public SimpleHttpServer(SocketAddress endpoint, Consume... | // Path: src/name/admitriev/jhelper/ui/Notificator.java
// public class Notificator {
// private static final NotificationGroup GROUP = NotificationGroupManager.getInstance().getNotificationGroup("JHelper");
//
// private Notificator() {
// }
//
// public static void showNotification(String title, String content,... | Notificator.showNotification( |
AlexeyDmitriev/JHelper | src/name/admitriev/jhelper/ui/FileSelector.java | // Path: src/name/admitriev/jhelper/generation/FileUtils.java
// public class FileUtils {
// private FileUtils() {
// }
//
// public static OutputWriter getOutputWriter(VirtualFile virtualFile, Object requestor) {
// try {
// return new OutputWriter(virtualFile.getOutputStream(requestor));
// }
// catch (I... | import com.intellij.openapi.fileChooser.FileChooserDescriptor;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.TextBrowseFolderListener;
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
import com.intellij.openapi.vfs.VirtualFile;
import name.admitriev.jhelper.generation.FileUtils;
... | package name.admitriev.jhelper.ui;
public class FileSelector extends TextFieldWithBrowseButton.NoPathCompletion {
public FileSelector(Project project, String initialValue, FileChooserDescriptor descriptor) {
super(new JTextField(initialValue));
addBrowseFolderListener(
new RelativePathBrowseListener(descri... | // Path: src/name/admitriev/jhelper/generation/FileUtils.java
// public class FileUtils {
// private FileUtils() {
// }
//
// public static OutputWriter getOutputWriter(VirtualFile virtualFile, Object requestor) {
// try {
// return new OutputWriter(virtualFile.getOutputStream(requestor));
// }
// catch (I... | return FileUtils.relativePath(basePath, chosenFile.getPath()); |
AlexeyDmitriev/JHelper | src/name/admitriev/jhelper/ui/RelativeFileChooserDescriptor.java | // Path: src/name/admitriev/jhelper/generation/FileUtils.java
// public class FileUtils {
// private FileUtils() {
// }
//
// public static OutputWriter getOutputWriter(VirtualFile virtualFile, Object requestor) {
// try {
// return new OutputWriter(virtualFile.getOutputStream(requestor));
// }
// catch (I... | import com.intellij.openapi.fileChooser.FileChooserDescriptor;
import com.intellij.openapi.vfs.VirtualFile;
import name.admitriev.jhelper.generation.FileUtils; | package name.admitriev.jhelper.ui;
public class RelativeFileChooserDescriptor extends FileChooserDescriptor {
private String basePath;
private RelativeFileChooserDescriptor(
VirtualFile baseDir,
boolean chooseFiles,
boolean chooseFolders
) {
super(chooseFiles, chooseFolders, false, false, false, false)... | // Path: src/name/admitriev/jhelper/generation/FileUtils.java
// public class FileUtils {
// private FileUtils() {
// }
//
// public static OutputWriter getOutputWriter(VirtualFile virtualFile, Object requestor) {
// try {
// return new OutputWriter(virtualFile.getOutputStream(requestor));
// }
// catch (I... | return super.isFileSelectable(file) && FileUtils.isChild( |
AlexeyDmitriev/JHelper | src/name/admitriev/jhelper/generation/TemplatesUtils.java | // Path: src/name/admitriev/jhelper/exceptions/JHelperException.java
// public class JHelperException extends RuntimeException {
//
// public JHelperException(String message, Throwable cause) {
// super(message, cause);
// }
//
// public JHelperException(String message) {
// super(message);
// }
//
// @Over... | import com.intellij.openapi.editor.Document;
import com.intellij.openapi.fileEditor.FileDocumentManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiManager;
import name.admitriev.jhelper.exceptions.JHelperExceptio... | package name.admitriev.jhelper.generation;
/**
* Utility class for customizing templates of code
*/
public class TemplatesUtils {
public static final Pattern CLASS_NAME = Pattern.compile("%ClassName%", Pattern.LITERAL);
public static final Pattern TASK_FILE = Pattern.compile("%TaskFile%", Pattern.LITERAL);
pub... | // Path: src/name/admitriev/jhelper/exceptions/JHelperException.java
// public class JHelperException extends RuntimeException {
//
// public JHelperException(String message, Throwable cause) {
// super(message, cause);
// }
//
// public JHelperException(String message) {
// super(message);
// }
//
// @Over... | throw new JHelperException("Can't open template file(" + filename + ") after its creation"); |
AlexeyDmitriev/JHelper | src/name/admitriev/jhelper/generation/TemplatesUtils.java | // Path: src/name/admitriev/jhelper/exceptions/JHelperException.java
// public class JHelperException extends RuntimeException {
//
// public JHelperException(String message, Throwable cause) {
// super(message, cause);
// }
//
// public JHelperException(String message) {
// super(message);
// }
//
// @Over... | import com.intellij.openapi.editor.Document;
import com.intellij.openapi.fileEditor.FileDocumentManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiManager;
import name.admitriev.jhelper.exceptions.JHelperExceptio... | package name.admitriev.jhelper.generation;
/**
* Utility class for customizing templates of code
*/
public class TemplatesUtils {
public static final Pattern CLASS_NAME = Pattern.compile("%ClassName%", Pattern.LITERAL);
public static final Pattern TASK_FILE = Pattern.compile("%TaskFile%", Pattern.LITERAL);
pub... | // Path: src/name/admitriev/jhelper/exceptions/JHelperException.java
// public class JHelperException extends RuntimeException {
//
// public JHelperException(String message, Throwable cause) {
// super(message, cause);
// }
//
// public JHelperException(String message) {
// super(message);
// }
//
// @Over... | throw new NotificationException("Couldn't find template \"" + name + '"'); |
AlexeyDmitriev/JHelper | src/name/admitriev/jhelper/ui/TaskSettingsComponent.java | // Path: src/name/admitriev/jhelper/task/TaskData.java
// public class TaskData {
// private final String name;
// private final String className;
// private final String cppPath;
// private final StreamConfiguration input;
// private final StreamConfiguration output;
// private final TestType testType;
// priva... | import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.ComboBox;
import com.intellij.openapi.ui.LabeledComponent;
import name.admitriev.jhelper.task.TaskData;
import net.egork.chelper.task.StreamConfiguration;
import net.egork.chelper.task.Test;
import net.egork.chelper.task.TestType;
import org.jd... | package name.admitriev.jhelper.ui;
/**
* Panel for task configuration.
*/
public final class TaskSettingsComponent extends JPanel {
private JTextField name = null;
private JTextField className = null;
private FileSelector cppPath = null;
private StreamConfigurationPanel input = null;
private StreamConfigurati... | // Path: src/name/admitriev/jhelper/task/TaskData.java
// public class TaskData {
// private final String name;
// private final String className;
// private final String cppPath;
// private final StreamConfiguration input;
// private final StreamConfiguration output;
// private final TestType testType;
// priva... | setTaskData(TaskData.emptyTaskData(project)); |
AlexeyDmitriev/JHelper | src/name/admitriev/jhelper/task/TaskData.java | // Path: src/name/admitriev/jhelper/components/Configurator.java
// @State(name = "Configurator", storages = @Storage("JHelper.xml"))
// @Service(Service.Level.PROJECT)
// public final class Configurator implements PersistentStateComponent<Configurator.State> {
// public Configurator() {
// state = new Configurator.... | import com.intellij.openapi.project.Project;
import name.admitriev.jhelper.components.Configurator;
import net.egork.chelper.task.StreamConfiguration;
import net.egork.chelper.task.Test;
import net.egork.chelper.task.TestType;
import java.util.Arrays; |
public String getCppPath() {
return cppPath;
}
public StreamConfiguration getInput() {
return input;
}
public StreamConfiguration getOutput() {
return output;
}
public Test[] getTests() {
return Arrays.copyOf(tests, tests.length);
}
public static TaskData emptyTaskData(Project project) {
return ... | // Path: src/name/admitriev/jhelper/components/Configurator.java
// @State(name = "Configurator", storages = @Storage("JHelper.xml"))
// @Service(Service.Level.PROJECT)
// public final class Configurator implements PersistentStateComponent<Configurator.State> {
// public Configurator() {
// state = new Configurator.... | Configurator configurator = project.getService(Configurator.class); |
zhengxiaopeng/AndroidUtils | old-library-with-sample/src/main/java/com/rocko/update/UpdateService.java | // Path: old-library-with-sample/src/main/java/com/rocko/common/DebugLog.java
// public class DebugLog {
// /**
// * Log输出所在类
// */
// private static String className;
// /**
// * Log输出所在方法
// */
// private static String methodName;
// /**
// * Log输出所行号
// */
// pri... | import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.wi... | package com.rocko.update;
/**
* 更新下载服务
*
* @author Mr.Zheng
* @date 2014年7月13日21:39:49
*/
public class UpdateService extends Service {
public static final String INTENT_FILTER = "com.roc.service.UPDATE_SERVICE";
public static final int DOWNLOAD_PROGRESS = 1;
public static final int DOWNLOAD_FINISH ... | // Path: old-library-with-sample/src/main/java/com/rocko/common/DebugLog.java
// public class DebugLog {
// /**
// * Log输出所在类
// */
// private static String className;
// /**
// * Log输出所在方法
// */
// private static String methodName;
// /**
// * Log输出所行号
// */
// pri... | File dir = new File(Configs.EXTERNAL_STORAGE_DIRECTORY + Configs.UPDATE_DOWNLOAD_PATH); |
zhengxiaopeng/AndroidUtils | old-library-with-sample/src/main/java/com/rocko/update/UpdateService.java | // Path: old-library-with-sample/src/main/java/com/rocko/common/DebugLog.java
// public class DebugLog {
// /**
// * Log输出所在类
// */
// private static String className;
// /**
// * Log输出所在方法
// */
// private static String methodName;
// /**
// * Log输出所行号
// */
// pri... | import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.wi... | package com.rocko.update;
/**
* 更新下载服务
*
* @author Mr.Zheng
* @date 2014年7月13日21:39:49
*/
public class UpdateService extends Service {
public static final String INTENT_FILTER = "com.roc.service.UPDATE_SERVICE";
public static final int DOWNLOAD_PROGRESS = 1;
public static final int DOWNLOAD_FINISH ... | // Path: old-library-with-sample/src/main/java/com/rocko/common/DebugLog.java
// public class DebugLog {
// /**
// * Log输出所在类
// */
// private static String className;
// /**
// * Log输出所在方法
// */
// private static String methodName;
// /**
// * Log输出所行号
// */
// pri... | final String downloadUrl = Urls.baseUrl + Urls.downloadApk;// getResources().getString(R.string.base_url) |
zhengxiaopeng/AndroidUtils | old-library-with-sample/src/main/java/com/rocko/update/UpdateService.java | // Path: old-library-with-sample/src/main/java/com/rocko/common/DebugLog.java
// public class DebugLog {
// /**
// * Log输出所在类
// */
// private static String className;
// /**
// * Log输出所在方法
// */
// private static String methodName;
// /**
// * Log输出所行号
// */
// pri... | import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.wi... | package com.rocko.update;
/**
* 更新下载服务
*
* @author Mr.Zheng
* @date 2014年7月13日21:39:49
*/
public class UpdateService extends Service {
public static final String INTENT_FILTER = "com.roc.service.UPDATE_SERVICE";
public static final int DOWNLOAD_PROGRESS = 1;
public static final int DOWNLOAD_FINISH ... | // Path: old-library-with-sample/src/main/java/com/rocko/common/DebugLog.java
// public class DebugLog {
// /**
// * Log输出所在类
// */
// private static String className;
// /**
// * Log输出所在方法
// */
// private static String methodName;
// /**
// * Log输出所行号
// */
// pri... | DebugLog.e(e.getMessage()); |
zhengxiaopeng/AndroidUtils | old-library-with-sample/src/main/java/com/rocko/http/CustomAsyncTask.java | // Path: old-library-with-sample/src/main/java/com/rocko/common/DebugLog.java
// public class DebugLog {
// /**
// * Log输出所在类
// */
// private static String className;
// /**
// * Log输出所在方法
// */
// private static String methodName;
// /**
// * Log输出所行号
// */
// pri... | import android.content.Context;
import android.os.AsyncTask;
import com.rocko.common.DebugLog;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.protocol.HTTP;
import org.apache.http.util.EntityUtils;
import java.util.ArrayList;
import java.util.List; | @Override
protected void onPreExecute() {
if (mCallback != null)
mCallback.onPreExecute();
}
@Override
public String doInBackground(String... params) {
HttpResponse response = null;
String responseText = "";
try {
switch (mMode) {
... | // Path: old-library-with-sample/src/main/java/com/rocko/common/DebugLog.java
// public class DebugLog {
// /**
// * Log输出所在类
// */
// private static String className;
// /**
// * Log输出所在方法
// */
// private static String methodName;
// /**
// * Log输出所行号
// */
// pri... | DebugLog.e(e.getMessage()); |
zhengxiaopeng/AndroidUtils | old-library-with-sample/src/main/java/com/rocko/annotation/ViewInstaller.java | // Path: old-library-with-sample/src/main/java/com/rocko/common/DebugLog.java
// public class DebugLog {
// /**
// * Log输出所在类
// */
// private static String className;
// /**
// * Log输出所在方法
// */
// private static String methodName;
// /**
// * Log输出所行号
// */
// pri... | import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.CompoundButton;
import android.widget.RadioGroup;
import com.rocko.common.DebugLog;
import java.lang.reflect.Field;
import java.lang.reflect.Method; | package com.rocko.annotation;
/**
* 为带InitView注解的View控件初始化并设置监听器的加载器<br>
* 主要方法: {@link #processAnnotation(Object obj)}
*
* @author Mr.Zheng
* @date 2014年8月11日21:59:01
*/
public class ViewInstaller {
public static void processAnnotation(Activity obj) {
process(obj);
}
// public static vo... | // Path: old-library-with-sample/src/main/java/com/rocko/common/DebugLog.java
// public class DebugLog {
// /**
// * Log输出所在类
// */
// private static String className;
// /**
// * Log输出所在方法
// */
// private static String methodName;
// /**
// * Log输出所行号
// */
// pri... | DebugLog.v(">>>>>注解的field:" + f.getName()); |
zhengxiaopeng/AndroidUtils | old-library-with-sample/src/main/java/com/rocko/utils/PhoneUtils.java | // Path: old-library-with-sample/src/main/java/com/rocko/common/DebugLog.java
// public class DebugLog {
// /**
// * Log输出所在类
// */
// private static String className;
// /**
// * Log输出所在方法
// */
// private static String methodName;
// /**
// * Log输出所行号
// */
// pri... | import android.app.Activity;
import android.content.Context;
import android.telephony.TelephonyManager;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.inputmethod.InputMethodManager;
import com.rocko.common.DebugLog;
import java.net.InetAddress;
import java.net.NetworkInterface;
im... | * @return
*/
public static int getDefaultStatusBarHeight(Context context) {
int result = 0;
int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
if (resourceId > 0) {
result = context.getResources().getDimensionPixelSize(resour... | // Path: old-library-with-sample/src/main/java/com/rocko/common/DebugLog.java
// public class DebugLog {
// /**
// * Log输出所在类
// */
// private static String className;
// /**
// * Log输出所在方法
// */
// private static String methodName;
// /**
// * Log输出所行号
// */
// pri... | DebugLog.e(ex.getMessage()); |
zhengxiaopeng/AndroidUtils | old-library-with-sample/src/main/java/com/rocko/http/NetWorkHelper.java | // Path: old-library-with-sample/src/main/java/com/rocko/common/DebugLog.java
// public class DebugLog {
// /**
// * Log输出所在类
// */
// private static String className;
// /**
// * Log输出所在方法
// */
// private static String methodName;
// /**
// * Log输出所行号
// */
// pri... | import android.content.ContentValues;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.telephony.TelephonyManager;
import com.rocko.common.DebugLog;
import java.util.List; | package com.rocko.http;
/**
* 2014年7月13日12:06:14
*
* @author Mr.Zheng
*/
public class NetWorkHelper {
public static Uri uri = Uri.parse("content://telephony/carriers");
/**
* 判断是否有网络连接
*
* @param context ApplicationContext
*/
public static boolean isNetworkAvailable(Context cont... | // Path: old-library-with-sample/src/main/java/com/rocko/common/DebugLog.java
// public class DebugLog {
// /**
// * Log输出所在类
// */
// private static String className;
// /**
// * Log输出所在方法
// */
// private static String methodName;
// /**
// * Log输出所行号
// */
// pri... | DebugLog.v("无法获得网络连接"); |
zhengxiaopeng/AndroidUtils | old-library-with-sample/src/main/java/com/rocko/view/ViewUtils.java | // Path: old-library-with-sample/src/main/java/com/rocko/common/DebugLog.java
// public class DebugLog {
// /**
// * Log输出所在类
// */
// private static String className;
// /**
// * Log输出所在方法
// */
// private static String methodName;
// /**
// * Log输出所行号
// */
// pri... | import android.app.Activity;
import android.text.InputType;
import android.text.Selection;
import android.view.WindowManager;
import android.widget.EditText;
import com.rocko.common.DebugLog;
import java.lang.reflect.Method; | package com.rocko.view;
/**
* @author Mr.Zheng
* @date 2014年10月25日 下午11:03:39
*/
public class ViewUtils {
/**
* 设置EditText光标的位置
*
* @param editText
* @param position
*/
public static void setEditTextCursorPosition(EditText editText, int position) {
Selection.setSelection(... | // Path: old-library-with-sample/src/main/java/com/rocko/common/DebugLog.java
// public class DebugLog {
// /**
// * Log输出所在类
// */
// private static String className;
// /**
// * Log输出所在方法
// */
// private static String methodName;
// /**
// * Log输出所行号
// */
// pri... | DebugLog.e(">>>" + e.getMessage()); |
zhengxiaopeng/AndroidUtils | old-library-with-sample/src/main/java/com/rocko/io/IOHelper.java | // Path: old-library-with-sample/src/main/java/com/rocko/utils/ApplicationUtils.java
// public class ApplicationUtils {
//
// /**
// * 备份本程序的apk安装文件到SD卡根目录下
// *
// * @param context ApplicationContext
// * @param packageName
// * @param mActivity
// * @throws java.io.IOException
/... | import android.content.Context;
import android.os.Environment;
import com.rocko.utils.ApplicationUtils;
import java.io.File;
import java.io.IOException; | package com.rocko.io;
/**
* @author Mr.Zheng
* @date 2014年11月2日 上午12:49:30
*/
public class IOHelper {
/**
* 获取DiskLruCache实例
*
* @param context
* @param uniqueName 对不同类型的数据进行区分而设定的一个唯一值
* @return
*/
public static DiskLruCache getDiskLruCache(Context context, String uniqueNam... | // Path: old-library-with-sample/src/main/java/com/rocko/utils/ApplicationUtils.java
// public class ApplicationUtils {
//
// /**
// * 备份本程序的apk安装文件到SD卡根目录下
// *
// * @param context ApplicationContext
// * @param packageName
// * @param mActivity
// * @throws java.io.IOException
/... | mDiskLruCache = DiskLruCache.open(cacheDir, ApplicationUtils.getAppVersionCode(context), 1, |
zhengxiaopeng/AndroidUtils | old-library-with-sample/src/main/java/com/rocko/utils/ApplicationUtils.java | // Path: old-library-with-sample/src/main/java/com/rocko/security/MD5Helper.java
// public class MD5Helper {
//
// protected final static char hexDigits[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b',
// 'c', 'd', 'e', 'f'};
//
// protected static MessageDigest messagedigest = nul... | import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.Signature;
import android.os.Environment;
import com.rocko.security.MD5Helper;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.I... | }
FileInputStream fis = new FileInputStream(in);
FileOutputStream fos = new FileOutputStream(out);
int count;
// 文件太大的话,我觉得需要修改
byte[] buffer = new byte[256 * 1024];
while ((count = fis.read(buffer)) > 0) {
fos.write(buffer, 0, count);
}
... | // Path: old-library-with-sample/src/main/java/com/rocko/security/MD5Helper.java
// public class MD5Helper {
//
// protected final static char hexDigits[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b',
// 'c', 'd', 'e', 'f'};
//
// protected static MessageDigest messagedigest = nul... | return MD5Helper.hexdigest(sign.toByteArray()); |
zhengxiaopeng/AndroidUtils | old-library-with-sample/src/main/java/com/rocko/http/CustomHttpClient.java | // Path: old-library-with-sample/src/main/java/com/rocko/common/DebugLog.java
// public class DebugLog {
// /**
// * Log输出所在类
// */
// private static String className;
// /**
// * Log输出所在方法
// */
// private static String methodName;
// /**
// * Log输出所行号
// */
// pri... | import android.content.Context;
import com.rocko.common.DebugLog;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.HttpVersion;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.... | package com.rocko.http;
/**
* @author Mr.Zheng
* @date 2014年7月13日12:05:00
*/
public class CustomHttpClient {
private static final String CHARSET_UTF8 = HTTP.UTF_8;
private static final String CHARSET_GB2312 = "GB2312";
private static HttpClient customerHttpClient;
private static HttpEntity urlEn... | // Path: old-library-with-sample/src/main/java/com/rocko/common/DebugLog.java
// public class DebugLog {
// /**
// * Log输出所在类
// */
// private static String className;
// /**
// * Log输出所在方法
// */
// private static String methodName;
// /**
// * Log输出所行号
// */
// pri... | DebugLog.v(url); |
zhengxiaopeng/AndroidUtils | sample/src/main/java/com/rocko/android/common/sample/MainActivity.java | // Path: library/src/main/java/com/rocko/android/common/util/DialogUtils.java
// public class DialogUtils {
// private static Dialog mDialog = null;
// private static View mDialogView = null;
//
// /**
// * 开启全屏无进度的progress
// *
// * @param context Activity的上下文,不可为ApplicationC... | import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuItem;
import com.rocko.android.common.util.DialogUtils; | package com.rocko.android.common.sample;
public class MainActivity extends ActionBarActivity {
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main); | // Path: library/src/main/java/com/rocko/android/common/util/DialogUtils.java
// public class DialogUtils {
// private static Dialog mDialog = null;
// private static View mDialogView = null;
//
// /**
// * 开启全屏无进度的progress
// *
// * @param context Activity的上下文,不可为ApplicationC... | DialogUtils.stratProgressDialog(this, "ss", false, false); |
zhengxiaopeng/AndroidUtils | old-library-with-sample/src/main/java/com/rocko/http/HttpUtil.java | // Path: old-library-with-sample/src/main/java/com/rocko/common/DebugLog.java
// public class DebugLog {
// /**
// * Log输出所在类
// */
// private static String className;
// /**
// * Log输出所在方法
// */
// private static String methodName;
// /**
// * Log输出所行号
// */
// pri... | import java.util.List;
import android.content.Context;
import com.rocko.common.DebugLog;
import org.apache.http.NameValuePair; | package com.rocko.http;
/**
* @author Mr.Zheng
* @date 2014年7月13日12:06:00
*/
public class HttpUtil {
/**
* ****************************** 网络连接部分 ********************************
*/
public static String postByHttpURLConnection(String strUrl, NameValuePair... nameValuePairs) {
return Cus... | // Path: old-library-with-sample/src/main/java/com/rocko/common/DebugLog.java
// public class DebugLog {
// /**
// * Log输出所在类
// */
// private static String className;
// /**
// * Log输出所在方法
// */
// private static String methodName;
// /**
// * Log输出所行号
// */
// pri... | DebugLog.e(e.getMessage()); |
zhengxiaopeng/AndroidUtils | old-library-with-sample/src/main/java/com/rocko/utils/DialogUtils.java | // Path: old-library-with-sample/src/main/java/com/rocko/widget/dialog/SimpleDialog.java
// public class SimpleDialog implements OnClickListener {
// private Dialog dialog = null;
// private Context mContext = null;
// private TextView txtViewTitle, txtViewMsg;
// private Button btnCancel, btnConfirm;
/... | import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import com.rocko.androidutils.R;
import com.rocko.widget.dialog.SimpleDialog;
import com.rocko.... | package com.rocko.utils;
/**
* 基本Dialog的工具
*
* @author Mr.Zheng
* @date 2014年7月30日11:16:53
*/
public class DialogUtils {
private static Dialog mDialog = null;
private static View mDialogView = null; | // Path: old-library-with-sample/src/main/java/com/rocko/widget/dialog/SimpleDialog.java
// public class SimpleDialog implements OnClickListener {
// private Dialog dialog = null;
// private Context mContext = null;
// private TextView txtViewTitle, txtViewMsg;
// private Button btnCancel, btnConfirm;
/... | private static SimpleDialog mSimpleDialog = null; |
zhengxiaopeng/AndroidUtils | old-library-with-sample/src/main/java/com/rocko/app/MainApplication.java | // Path: old-library-with-sample/src/main/java/com/rocko/common/DebugLog.java
// public class DebugLog {
// /**
// * Log输出所在类
// */
// private static String className;
// /**
// * Log输出所在方法
// */
// private static String methodName;
// /**
// * Log输出所行号
// */
// pri... | import android.app.Activity;
import android.app.ActivityManager;
import android.app.Application;
import android.content.Context;
import com.rocko.common.DebugLog;
import java.util.Stack; | package com.rocko.app;
/**
* @author Mr.Zheng
* @date 2014年9月15日 下午6:46:32
* 注意:Application对象并不是始终在内存中的,它有可能会由于系统内存不足而被杀掉(例如Home键或任务切换退出此程序后内存不足,Application被杀)。但Android在你恢复这个应用时
* 并不是重新开始启动这个应用,它会创建一个新的Application对象并且启动上次用户离开时的activity以造成这个app从
* 来没有被kill掉得假象。
*/
public class MainApplication extends Applicati... | // Path: old-library-with-sample/src/main/java/com/rocko/common/DebugLog.java
// public class DebugLog {
// /**
// * Log输出所在类
// */
// private static String className;
// /**
// * Log输出所在方法
// */
// private static String methodName;
// /**
// * Log输出所行号
// */
// pri... | DebugLog.v("<<<"); |
zhengxiaopeng/AndroidUtils | old-library-with-sample/src/main/java/com/rocko/adapter/ViewHolder.java | // Path: old-library-with-sample/src/main/java/com/rocko/adapter/ImageLoader.java
// public enum Type {
// FIFO, LIFO
// }
| import android.content.Context;
import android.graphics.Bitmap;
import android.util.SparseArray;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.rocko.adapter.ImageLoader.Type; | * @return
*/
public ViewHolder setImageResource(int viewId, int drawableId) {
ImageView view = getView(viewId);
view.setImageResource(drawableId);
return this;
}
/**
* 为ImageView设置图片
*
* @param viewId
* @param drawableId
* @return
*/
publ... | // Path: old-library-with-sample/src/main/java/com/rocko/adapter/ImageLoader.java
// public enum Type {
// FIFO, LIFO
// }
// Path: old-library-with-sample/src/main/java/com/rocko/adapter/ViewHolder.java
import android.content.Context;
import android.graphics.Bitmap;
import android.util.SparseArray;
import androi... | ImageLoader.getInstance(3, Type.LIFO).loadImage(url, (ImageView) getView(viewId)); |
zhengxiaopeng/AndroidUtils | library/src/main/java/com/rocko/android/common/util/ApplicationUtils.java | // Path: library/src/main/java/com/rocko/android/common/security/MD5Helper.java
// public class MD5Helper {
//
// protected final static char hexDigits[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b',
// 'c', 'd', 'e', 'f'};
//
// protected static MessageDigest messagedigest = null... | import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.Signature;
import android.os.Environment;
import com.rocko.android.common.security.MD5Helper;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
i... | }
FileInputStream fis = new FileInputStream(in);
FileOutputStream fos = new FileOutputStream(out);
int count;
// 文件太大的话,我觉得需要修改
byte[] buffer = new byte[256 * 1024];
while ((count = fis.read(buffer)) > 0) {
fos.write(buffer, 0, count);
}
... | // Path: library/src/main/java/com/rocko/android/common/security/MD5Helper.java
// public class MD5Helper {
//
// protected final static char hexDigits[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b',
// 'c', 'd', 'e', 'f'};
//
// protected static MessageDigest messagedigest = null... | return MD5Helper.hexdigest(sign.toByteArray()); |
zhengxiaopeng/AndroidUtils | old-library-with-sample/src/main/java/com/rocko/utils/JsonUtils.java | // Path: old-library-with-sample/src/main/java/com/rocko/common/DebugLog.java
// public class DebugLog {
// /**
// * Log输出所在类
// */
// private static String className;
// /**
// * Log输出所在方法
// */
// private static String methodName;
// /**
// * Log输出所行号
// */
// pri... | import com.fasterxml.jackson.core.JsonGenerationException;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.typ... | package com.rocko.utils;
/**
* Json工具:Json数据和Java对象之间的转换
*
* @author Mr.Zheng
* @date 2014年7月15日10:24:52
*/
public class JsonUtils {
private static ObjectMapper objectMapper = new ObjectMapper();
/**
* 将对象序列化为JSON字符串
*
* @param object
* @return JSON字符串
*/
public static Stri... | // Path: old-library-with-sample/src/main/java/com/rocko/common/DebugLog.java
// public class DebugLog {
// /**
// * Log输出所在类
// */
// private static String className;
// /**
// * Log输出所在方法
// */
// private static String methodName;
// /**
// * Log输出所行号
// */
// pri... | DebugLog.e(e.getMessage()); |
pe-pan/flappy | core/src/main/java/net/panuska/tlappy/FinalScreen.java | // Path: core/src/main/java/net/panuska/tlappy/awt/Color.java
// public enum Color {
// BLACK(0xff000000),
// RED(0xffff0000),
// BLUE(0xff0000ff),
// YELLOW(0xffffff00),
// WHITE(0xffffffff),
// DARK_GRAY(0xff404040),
// LIGHT_GRAY(0xffc0c0c0),
// TRANSPARENT(0x00000000),
//
// bla... | import net.panuska.tlappy.awt.Color;
import static net.panuska.tlappy.Device.*; | }
}
//sync
vram.refresh();
Main.wait(50);
}
vram.imageNoOfs(20, 22, Images.chickenDown);
vram.refresh();
}
private void rut(byte[] arr, int c, Chicken chicken) {
Chicken.DemoStepInfo par = new Chicken.DemoStepInfo()... | // Path: core/src/main/java/net/panuska/tlappy/awt/Color.java
// public enum Color {
// BLACK(0xff000000),
// RED(0xffff0000),
// BLUE(0xff0000ff),
// YELLOW(0xffffff00),
// WHITE(0xffffffff),
// DARK_GRAY(0xff404040),
// LIGHT_GRAY(0xffc0c0c0),
// TRANSPARENT(0x00000000),
//
// bla... | final Color c = Color.WHITE; |
pe-pan/flappy | core/src/main/java/net/panuska/tlappy/awt/Graphics.java | // Path: core/src/main/java/net/panuska/tlappy/Constants.java
// public class Constants {
//
// static final int SCREEN_WIDTH = 320;
// static final int SCREEN_HEIGHT = 200;
// static final int NUM_SCENES = 200;
// static final int LIVES = 5;
// public static final int SPRITE_SIZE = 16;
// publ... | import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Typeface;
import net.panuska.tlappy.Constants;
import net.panuska.tlappy.ImageUtils; | package net.panuska.tlappy.awt;
/**
* Flappy:
* Original game created by dB-SOFT in 1984 for SHARP MZ-800 computer.
* Java version by Petr Slechta, 2014.
* Android version by Petr Panuska, 2015.
*/
public class Graphics {
private Canvas c;
static final private Paint p = new Paint();
public Graphics... | // Path: core/src/main/java/net/panuska/tlappy/Constants.java
// public class Constants {
//
// static final int SCREEN_WIDTH = 320;
// static final int SCREEN_HEIGHT = 200;
// static final int NUM_SCENES = 200;
// static final int LIVES = 5;
// public static final int SPRITE_SIZE = 16;
// publ... | p.setTextSize(Constants.SPRITE_SIZE); |
pe-pan/flappy | core/src/main/java/net/panuska/tlappy/awt/Graphics.java | // Path: core/src/main/java/net/panuska/tlappy/Constants.java
// public class Constants {
//
// static final int SCREEN_WIDTH = 320;
// static final int SCREEN_HEIGHT = 200;
// static final int NUM_SCENES = 200;
// static final int LIVES = 5;
// public static final int SPRITE_SIZE = 16;
// publ... | import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Typeface;
import net.panuska.tlappy.Constants;
import net.panuska.tlappy.ImageUtils; | }
public boolean drawImage(BufferedImage img, int x, int y, Paint paint) {
c.drawBitmap(img.getBitmap(), x, y, paint);
return true;
}
public void drawString(String str, int x, int y, Color color) {
Paint p = new Paint();
p.setTypeface(Typeface.DEFAULT_BOLD);
p.s... | // Path: core/src/main/java/net/panuska/tlappy/Constants.java
// public class Constants {
//
// static final int SCREEN_WIDTH = 320;
// static final int SCREEN_HEIGHT = 200;
// static final int NUM_SCENES = 200;
// static final int LIVES = 5;
// public static final int SPRITE_SIZE = 16;
// publ... | BufferedImage imgChar = ImageUtils.createLetterImage(z, color, Color.BLACK); |
pe-pan/flappy | core/src/main/java/net/panuska/tlappy/BlueEnemy.java | // Path: core/src/main/java/net/panuska/tlappy/awt/BufferedImage.java
// public class BufferedImage {
// private Bitmap b;
// private Graphics g;
// public static final int TYPE_INT_RGB = Bitmap.Config.ARGB_8888.ordinal();
//
// public BufferedImage(BitmapDrawable d) {
// Bitmap immb = d.getBit... | import net.panuska.tlappy.awt.BufferedImage;
import static net.panuska.tlappy.Constants.*;
import static net.panuska.tlappy.Device.*; | break;
case 0xFE:
drawMe(Images.blueEnemySleep3);
break;
case 0xFF:
default:
drawMe(Images.blueEnemySleep4);
break;
}
direction++;
retur... | // Path: core/src/main/java/net/panuska/tlappy/awt/BufferedImage.java
// public class BufferedImage {
// private Bitmap b;
// private Graphics g;
// public static final int TYPE_INT_RGB = Bitmap.Config.ARGB_8888.ordinal();
//
// public BufferedImage(BitmapDrawable d) {
// Bitmap immb = d.getBit... | BufferedImage img = (n2 & 1) == 0 ? Images.blueEnemySleep5 : Images.blueEnemySleep6; |
pe-pan/flappy | core/src/main/java/net/panuska/tlappy/RedEnemy.java | // Path: core/src/main/java/net/panuska/tlappy/awt/BufferedImage.java
// public class BufferedImage {
// private Bitmap b;
// private Graphics g;
// public static final int TYPE_INT_RGB = Bitmap.Config.ARGB_8888.ordinal();
//
// public BufferedImage(BitmapDrawable d) {
// Bitmap immb = d.getBit... | import net.panuska.tlappy.awt.BufferedImage;
import static net.panuska.tlappy.Constants.*;
import static net.panuska.tlappy.Device.*; | drawMe3x2(x, y, Images.redEnemyRightS2);
didMove = true;
}
}
}
// TODO: refactor this
private boolean testMove(int m1, int m2) {
boolean chick = false;
boolean wall = false;
if ((m1 & 0xF0) == CHICKEN || ((m2 & 0xF0) ==... | // Path: core/src/main/java/net/panuska/tlappy/awt/BufferedImage.java
// public class BufferedImage {
// private Bitmap b;
// private Graphics g;
// public static final int TYPE_INT_RGB = Bitmap.Config.ARGB_8888.ordinal();
//
// public BufferedImage(BitmapDrawable d) {
// Bitmap immb = d.getBit... | private void drawMe2x3(int x, int y, BufferedImage img) { |
pe-pan/flappy | core/src/main/java/net/panuska/tlappy/Main.java | // Path: core/src/main/java/net/panuska/tlappy/awt/Color.java
// public enum Color {
// BLACK(0xff000000),
// RED(0xffff0000),
// BLUE(0xff0000ff),
// YELLOW(0xffffff00),
// WHITE(0xffffffff),
// DARK_GRAY(0xff404040),
// LIGHT_GRAY(0xffc0c0c0),
// TRANSPARENT(0x00000000),
//
// bla... | import android.util.Log;
import android.view.SurfaceView;
import net.panuska.tlappy.awt.Color;
import static net.panuska.tlappy.Constants.*;
import static net.panuska.tlappy.Device.*; | // todo shift the scenes also upon unsuccessful run
Main.setState(NORMAL_WAIT);
lives--;
if (lives == 0) {
s.gameOver();
return;
}
} else {
listener.gameFinished(scNo, scor... | // Path: core/src/main/java/net/panuska/tlappy/awt/Color.java
// public enum Color {
// BLACK(0xff000000),
// RED(0xffff0000),
// BLUE(0xff0000ff),
// YELLOW(0xffffff00),
// WHITE(0xffffffff),
// DARK_GRAY(0xff404040),
// LIGHT_GRAY(0xffc0c0c0),
// TRANSPARENT(0x00000000),
//
// bla... | vram.printText(16, 5, "M E N U", Color.BLUE); |
pe-pan/flappy | core/src/main/java/net/panuska/tlappy/VRAM.java | // Path: core/src/main/java/net/panuska/tlappy/awt/BufferedImage.java
// public class BufferedImage {
// private Bitmap b;
// private Graphics g;
// public static final int TYPE_INT_RGB = Bitmap.Config.ARGB_8888.ordinal();
//
// public BufferedImage(BitmapDrawable d) {
// Bitmap immb = d.getBit... | import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.Log;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import net.panuska.tlappy.awt.BufferedImage;
import net.panuska.tlappy.awt.Color;
import net.panuska.tlappy.awt.Graphics; | package net.panuska.tlappy;
/**
* VideoRAM "routines".
*
* @author Petr Slechta
*/
public class VRAM {
private static final int ZOOM = 1;
private static final int Y_OFS = 3;
private static VRAM me;
static VRAM getInstance() {
if (me == null) me = new VRAM();
return me;
} | // Path: core/src/main/java/net/panuska/tlappy/awt/BufferedImage.java
// public class BufferedImage {
// private Bitmap b;
// private Graphics g;
// public static final int TYPE_INT_RGB = Bitmap.Config.ARGB_8888.ordinal();
//
// public BufferedImage(BitmapDrawable d) {
// Bitmap immb = d.getBit... | private BufferedImage img; |
pe-pan/flappy | core/src/main/java/net/panuska/tlappy/Moveable.java | // Path: core/src/main/java/net/panuska/tlappy/awt/BufferedImage.java
// public class BufferedImage {
// private Bitmap b;
// private Graphics g;
// public static final int TYPE_INT_RGB = Bitmap.Config.ARGB_8888.ordinal();
//
// public BufferedImage(BitmapDrawable d) {
// Bitmap immb = d.getBit... | import net.panuska.tlappy.awt.BufferedImage;
import static net.panuska.tlappy.Device.*; | package net.panuska.tlappy;
/**
* Flappy:
* Original game created by dB-SOFT in 1984 for SHARP MZ-800 computer.
* Java version by Petr Slechta, 2014.
*/
class Moveable {
protected int x, y;
protected byte objType;
protected byte number;
protected byte sig;
protected boolean finished = fals... | // Path: core/src/main/java/net/panuska/tlappy/awt/BufferedImage.java
// public class BufferedImage {
// private Bitmap b;
// private Graphics g;
// public static final int TYPE_INT_RGB = Bitmap.Config.ARGB_8888.ordinal();
//
// public BufferedImage(BitmapDrawable d) {
// Bitmap immb = d.getBit... | protected void drawMe(BufferedImage img) { |
pe-pan/flappy | core/src/main/java/net/panuska/tlappy/ImageUtils.java | // Path: core/src/main/java/net/panuska/tlappy/awt/Color.java
// public enum Color {
// BLACK(0xff000000),
// RED(0xffff0000),
// BLUE(0xff0000ff),
// YELLOW(0xffffff00),
// WHITE(0xffffffff),
// DARK_GRAY(0xff404040),
// LIGHT_GRAY(0xffc0c0c0),
// TRANSPARENT(0x00000000),
//
// bla... | import android.content.res.Resources;
import android.graphics.drawable.BitmapDrawable;
import net.panuska.tlappy.awt.Color;
import net.panuska.tlappy.awt.Graphics;
import net.panuska.tlappy.awt.BufferedImage; | package net.panuska.tlappy;
/**
* Image utilities.
*
* @author Petr Slechta 2014; Petr Panuska 2016
*/
public class ImageUtils {
private static final int ZOOM = 1;
private ImageUtils() {
} | // Path: core/src/main/java/net/panuska/tlappy/awt/Color.java
// public enum Color {
// BLACK(0xff000000),
// RED(0xffff0000),
// BLUE(0xff0000ff),
// YELLOW(0xffffff00),
// WHITE(0xffffffff),
// DARK_GRAY(0xff404040),
// LIGHT_GRAY(0xffc0c0c0),
// TRANSPARENT(0x00000000),
//
// bla... | static BufferedImage loadDrawable(Resources r, int drawableId) { |
pe-pan/flappy | core/src/main/java/net/panuska/tlappy/ImageUtils.java | // Path: core/src/main/java/net/panuska/tlappy/awt/Color.java
// public enum Color {
// BLACK(0xff000000),
// RED(0xffff0000),
// BLUE(0xff0000ff),
// YELLOW(0xffffff00),
// WHITE(0xffffffff),
// DARK_GRAY(0xff404040),
// LIGHT_GRAY(0xffc0c0c0),
// TRANSPARENT(0x00000000),
//
// bla... | import android.content.res.Resources;
import android.graphics.drawable.BitmapDrawable;
import net.panuska.tlappy.awt.Color;
import net.panuska.tlappy.awt.Graphics;
import net.panuska.tlappy.awt.BufferedImage; | package net.panuska.tlappy;
/**
* Image utilities.
*
* @author Petr Slechta 2014; Petr Panuska 2016
*/
public class ImageUtils {
private static final int ZOOM = 1;
private ImageUtils() {
}
static BufferedImage loadDrawable(Resources r, int drawableId) {
BitmapDrawable d = (BitmapDrawab... | // Path: core/src/main/java/net/panuska/tlappy/awt/Color.java
// public enum Color {
// BLACK(0xff000000),
// RED(0xffff0000),
// BLUE(0xff0000ff),
// YELLOW(0xffffff00),
// WHITE(0xffffffff),
// DARK_GRAY(0xff404040),
// LIGHT_GRAY(0xffc0c0c0),
// TRANSPARENT(0x00000000),
//
// bla... | public static BufferedImage createLetterImage(int z, Color color, Color background) { |
pe-pan/flappy | mobile/src/main/java/net/panuska/tlappy/CustomControlsActivity.java | // Path: core/src/main/java/net/panuska/tlappy/awt/BufferedImage.java
// public class BufferedImage {
// private Bitmap b;
// private Graphics g;
// public static final int TYPE_INT_RGB = Bitmap.Config.ARGB_8888.ordinal();
//
// public BufferedImage(BitmapDrawable d) {
// Bitmap immb = d.getBit... | import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.util.SparseIntArray;
import android.view.KeyEvent;
import android.view.SurfaceView;
import net.panuska.tlappy.awt.BufferedImage;
import net.panuska.tlappy.awt.Color;
import net.panuska.tlappy.mobile.R;
import static net.panus... | package net.panuska.tlappy;
/**
* Flappy:
* Original game created by dB-SOFT in 1984 for SHARP MZ-800 computer.
* Java version by Petr Slechta, 2014.
* Android version by Petr Panuska, 2017.
*/
public class CustomControlsActivity extends TlappyActivity {
private static final String TAG = CustomControlsActi... | // Path: core/src/main/java/net/panuska/tlappy/awt/BufferedImage.java
// public class BufferedImage {
// private Bitmap b;
// private Graphics g;
// public static final int TYPE_INT_RGB = Bitmap.Config.ARGB_8888.ordinal();
//
// public BufferedImage(BitmapDrawable d) {
// Bitmap immb = d.getBit... | private static final int[] STATES = {LEFT, RIGHT, UP, DOWN, SPACE_BAR, -1}; |
pe-pan/flappy | mobile/src/main/java/net/panuska/tlappy/CustomControlsActivity.java | // Path: core/src/main/java/net/panuska/tlappy/awt/BufferedImage.java
// public class BufferedImage {
// private Bitmap b;
// private Graphics g;
// public static final int TYPE_INT_RGB = Bitmap.Config.ARGB_8888.ordinal();
//
// public BufferedImage(BitmapDrawable d) {
// Bitmap immb = d.getBit... | import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.util.SparseIntArray;
import android.view.KeyEvent;
import android.view.SurfaceView;
import net.panuska.tlappy.awt.BufferedImage;
import net.panuska.tlappy.awt.Color;
import net.panuska.tlappy.mobile.R;
import static net.panus... | package net.panuska.tlappy;
/**
* Flappy:
* Original game created by dB-SOFT in 1984 for SHARP MZ-800 computer.
* Java version by Petr Slechta, 2014.
* Android version by Petr Panuska, 2017.
*/
public class CustomControlsActivity extends TlappyActivity {
private static final String TAG = CustomControlsActi... | // Path: core/src/main/java/net/panuska/tlappy/awt/BufferedImage.java
// public class BufferedImage {
// private Bitmap b;
// private Graphics g;
// public static final int TYPE_INT_RGB = Bitmap.Config.ARGB_8888.ordinal();
//
// public BufferedImage(BitmapDrawable d) {
// Bitmap immb = d.getBit... | private static final int[] STATES = {LEFT, RIGHT, UP, DOWN, SPACE_BAR, -1}; |
pe-pan/flappy | mobile/src/main/java/net/panuska/tlappy/CustomControlsActivity.java | // Path: core/src/main/java/net/panuska/tlappy/awt/BufferedImage.java
// public class BufferedImage {
// private Bitmap b;
// private Graphics g;
// public static final int TYPE_INT_RGB = Bitmap.Config.ARGB_8888.ordinal();
//
// public BufferedImage(BitmapDrawable d) {
// Bitmap immb = d.getBit... | import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.util.SparseIntArray;
import android.view.KeyEvent;
import android.view.SurfaceView;
import net.panuska.tlappy.awt.BufferedImage;
import net.panuska.tlappy.awt.Color;
import net.panuska.tlappy.mobile.R;
import static net.panus... | package net.panuska.tlappy;
/**
* Flappy:
* Original game created by dB-SOFT in 1984 for SHARP MZ-800 computer.
* Java version by Petr Slechta, 2014.
* Android version by Petr Panuska, 2017.
*/
public class CustomControlsActivity extends TlappyActivity {
private static final String TAG = CustomControlsActi... | // Path: core/src/main/java/net/panuska/tlappy/awt/BufferedImage.java
// public class BufferedImage {
// private Bitmap b;
// private Graphics g;
// public static final int TYPE_INT_RGB = Bitmap.Config.ARGB_8888.ordinal();
//
// public BufferedImage(BitmapDrawable d) {
// Bitmap immb = d.getBit... | private static final int[] STATES = {LEFT, RIGHT, UP, DOWN, SPACE_BAR, -1}; |
pe-pan/flappy | mobile/src/main/java/net/panuska/tlappy/CustomControlsActivity.java | // Path: core/src/main/java/net/panuska/tlappy/awt/BufferedImage.java
// public class BufferedImage {
// private Bitmap b;
// private Graphics g;
// public static final int TYPE_INT_RGB = Bitmap.Config.ARGB_8888.ordinal();
//
// public BufferedImage(BitmapDrawable d) {
// Bitmap immb = d.getBit... | import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.util.SparseIntArray;
import android.view.KeyEvent;
import android.view.SurfaceView;
import net.panuska.tlappy.awt.BufferedImage;
import net.panuska.tlappy.awt.Color;
import net.panuska.tlappy.mobile.R;
import static net.panus... | package net.panuska.tlappy;
/**
* Flappy:
* Original game created by dB-SOFT in 1984 for SHARP MZ-800 computer.
* Java version by Petr Slechta, 2014.
* Android version by Petr Panuska, 2017.
*/
public class CustomControlsActivity extends TlappyActivity {
private static final String TAG = CustomControlsActi... | // Path: core/src/main/java/net/panuska/tlappy/awt/BufferedImage.java
// public class BufferedImage {
// private Bitmap b;
// private Graphics g;
// public static final int TYPE_INT_RGB = Bitmap.Config.ARGB_8888.ordinal();
//
// public BufferedImage(BitmapDrawable d) {
// Bitmap immb = d.getBit... | private static final int[] STATES = {LEFT, RIGHT, UP, DOWN, SPACE_BAR, -1}; |
pe-pan/flappy | mobile/src/main/java/net/panuska/tlappy/CustomControlsActivity.java | // Path: core/src/main/java/net/panuska/tlappy/awt/BufferedImage.java
// public class BufferedImage {
// private Bitmap b;
// private Graphics g;
// public static final int TYPE_INT_RGB = Bitmap.Config.ARGB_8888.ordinal();
//
// public BufferedImage(BitmapDrawable d) {
// Bitmap immb = d.getBit... | import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.util.SparseIntArray;
import android.view.KeyEvent;
import android.view.SurfaceView;
import net.panuska.tlappy.awt.BufferedImage;
import net.panuska.tlappy.awt.Color;
import net.panuska.tlappy.mobile.R;
import static net.panus... | package net.panuska.tlappy;
/**
* Flappy:
* Original game created by dB-SOFT in 1984 for SHARP MZ-800 computer.
* Java version by Petr Slechta, 2014.
* Android version by Petr Panuska, 2017.
*/
public class CustomControlsActivity extends TlappyActivity {
private static final String TAG = CustomControlsActi... | // Path: core/src/main/java/net/panuska/tlappy/awt/BufferedImage.java
// public class BufferedImage {
// private Bitmap b;
// private Graphics g;
// public static final int TYPE_INT_RGB = Bitmap.Config.ARGB_8888.ordinal();
//
// public BufferedImage(BitmapDrawable d) {
// Bitmap immb = d.getBit... | private static final int[] STATES = {LEFT, RIGHT, UP, DOWN, SPACE_BAR, -1}; |
pe-pan/flappy | mobile/src/main/java/net/panuska/tlappy/CustomControlsActivity.java | // Path: core/src/main/java/net/panuska/tlappy/awt/BufferedImage.java
// public class BufferedImage {
// private Bitmap b;
// private Graphics g;
// public static final int TYPE_INT_RGB = Bitmap.Config.ARGB_8888.ordinal();
//
// public BufferedImage(BitmapDrawable d) {
// Bitmap immb = d.getBit... | import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.util.SparseIntArray;
import android.view.KeyEvent;
import android.view.SurfaceView;
import net.panuska.tlappy.awt.BufferedImage;
import net.panuska.tlappy.awt.Color;
import net.panuska.tlappy.mobile.R;
import static net.panus... | package net.panuska.tlappy;
/**
* Flappy:
* Original game created by dB-SOFT in 1984 for SHARP MZ-800 computer.
* Java version by Petr Slechta, 2014.
* Android version by Petr Panuska, 2017.
*/
public class CustomControlsActivity extends TlappyActivity {
private static final String TAG = CustomControlsActi... | // Path: core/src/main/java/net/panuska/tlappy/awt/BufferedImage.java
// public class BufferedImage {
// private Bitmap b;
// private Graphics g;
// public static final int TYPE_INT_RGB = Bitmap.Config.ARGB_8888.ordinal();
//
// public BufferedImage(BitmapDrawable d) {
// Bitmap immb = d.getBit... | private static final BufferedImage[][] animation = { |
pe-pan/flappy | mobile/src/main/java/net/panuska/tlappy/CustomControlsActivity.java | // Path: core/src/main/java/net/panuska/tlappy/awt/BufferedImage.java
// public class BufferedImage {
// private Bitmap b;
// private Graphics g;
// public static final int TYPE_INT_RGB = Bitmap.Config.ARGB_8888.ordinal();
//
// public BufferedImage(BitmapDrawable d) {
// Bitmap immb = d.getBit... | import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.util.SparseIntArray;
import android.view.KeyEvent;
import android.view.SurfaceView;
import net.panuska.tlappy.awt.BufferedImage;
import net.panuska.tlappy.awt.Color;
import net.panuska.tlappy.mobile.R;
import static net.panus... | {Images.chickenLeft, Images.chickenLeft1},
{Images.chickenRight, Images.chickenRight1},
{Images.chickenUp, Images.chickenUp1, Images.chickenUp, Images.chickenUp2},
{Images.chickenDown, Images.chickenDown1, Images.chickenDown, Images.chickenDown2},
{Images.chic... | // Path: core/src/main/java/net/panuska/tlappy/awt/BufferedImage.java
// public class BufferedImage {
// private Bitmap b;
// private Graphics g;
// public static final int TYPE_INT_RGB = Bitmap.Config.ARGB_8888.ordinal();
//
// public BufferedImage(BitmapDrawable d) {
// Bitmap immb = d.getBit... | vram.clear(); |
pe-pan/flappy | mobile/src/main/java/net/panuska/tlappy/CustomControlsActivity.java | // Path: core/src/main/java/net/panuska/tlappy/awt/BufferedImage.java
// public class BufferedImage {
// private Bitmap b;
// private Graphics g;
// public static final int TYPE_INT_RGB = Bitmap.Config.ARGB_8888.ordinal();
//
// public BufferedImage(BitmapDrawable d) {
// Bitmap immb = d.getBit... | import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.util.SparseIntArray;
import android.view.KeyEvent;
import android.view.SurfaceView;
import net.panuska.tlappy.awt.BufferedImage;
import net.panuska.tlappy.awt.Color;
import net.panuska.tlappy.mobile.R;
import static net.panus... |
@Override
protected void onCreate(Bundle savedInstanceState) {
Log.d(TAG, "onCreate");
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_customcontrols);
view = (SurfaceView) findViewById(R.id.customControlsContent);
}
@Override
protected void on... | // Path: core/src/main/java/net/panuska/tlappy/awt/BufferedImage.java
// public class BufferedImage {
// private Bitmap b;
// private Graphics g;
// public static final int TYPE_INT_RGB = Bitmap.Config.ARGB_8888.ordinal();
//
// public BufferedImage(BitmapDrawable d) {
// Bitmap immb = d.getBit... | printMessageInCenter(20, message, Color.YELLOW); |
pe-pan/flappy | mobile/src/main/java/net/panuska/tlappy/FullscreenActivity.java | // Path: core/src/main/java/net/panuska/tlappy/Device.java
// public static Keyboard keyboard;
| import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.SurfaceView;
import android.view.View;
import net.panuska.tlappy.mobile.R;
import static net.panuska.tlappy.Device.keyboard; |
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (hasFocus) { // when getting back from pause
Device.vram.refresh();
}
}
private static final int MOVE_LIMIT = 5;
private float initia... | // Path: core/src/main/java/net/panuska/tlappy/Device.java
// public static Keyboard keyboard;
// Path: mobile/src/main/java/net/panuska/tlappy/FullscreenActivity.java
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import an... | keyboard.keyDown(translatedKey); |
decorators-squad/eva | src/test/java/com/amihaiemil/eva/EvolutionaryAlgorithmTest.java | // Path: src/main/java/com/amihaiemil/eva/concurrency/AsynchronousEvaThread.java
// public final class AsynchronousEvaThread implements Runnable {
// private SolutionCallback callback;
// private Eva algorithm;
// private String threadName;
// private int runs;
// private Thread tr;
// /**
// ... | import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import com.amihaiemil.eva.concurrency.AsynchronousEvaThread;
import com.amihaiemil.eva.concurrency.SolutionCallback;
import org.junit.Test;
import com.a... | /*
Copyright (c) 2016, Mihai-Emil Andronache
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and th... | // Path: src/main/java/com/amihaiemil/eva/concurrency/AsynchronousEvaThread.java
// public final class AsynchronousEvaThread implements Runnable {
// private SolutionCallback callback;
// private Eva algorithm;
// private String threadName;
// private int runs;
// private Thread tr;
// /**
// ... | SolutionCallback assertsCallback = new SolutionCallback() { |
decorators-squad/eva | src/test/java/com/amihaiemil/eva/EvolutionaryAlgorithmTest.java | // Path: src/main/java/com/amihaiemil/eva/concurrency/AsynchronousEvaThread.java
// public final class AsynchronousEvaThread implements Runnable {
// private SolutionCallback callback;
// private Eva algorithm;
// private String threadName;
// private int runs;
// private Thread tr;
// /**
// ... | import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import com.amihaiemil.eva.concurrency.AsynchronousEvaThread;
import com.amihaiemil.eva.concurrency.SolutionCallback;
import org.junit.Test;
import com.a... | /*
Copyright (c) 2016, Mihai-Emil Andronache
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and th... | // Path: src/main/java/com/amihaiemil/eva/concurrency/AsynchronousEvaThread.java
// public final class AsynchronousEvaThread implements Runnable {
// private SolutionCallback callback;
// private Eva algorithm;
// private String threadName;
// private int runs;
// private Thread tr;
// /**
// ... | AsynchronousEvaThread asyncEva = new AsynchronousEvaThread(eva, assertsCallback, "testAsyncEva"); |
decorators-squad/eva | src/test/java/com/amihaiemil/eva/EvolutionaryAlgorithmTest.java | // Path: src/main/java/com/amihaiemil/eva/concurrency/AsynchronousEvaThread.java
// public final class AsynchronousEvaThread implements Runnable {
// private SolutionCallback callback;
// private Eva algorithm;
// private String threadName;
// private int runs;
// private Thread tr;
// /**
// ... | import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import com.amihaiemil.eva.concurrency.AsynchronousEvaThread;
import com.amihaiemil.eva.concurrency.SolutionCallback;
import org.junit.Test;
import com.a... | * @throws Exception If something goes wrong.
*/
@Test
public void asyncSimpleEvaFindsASolution() throws InterruptedException, ExecutionException {
// The algorithm should stop when the found solution is acceptable.
final Condition solutionIsAcceptable = new Condition() {
p... | // Path: src/main/java/com/amihaiemil/eva/concurrency/AsynchronousEvaThread.java
// public final class AsynchronousEvaThread implements Runnable {
// private SolutionCallback callback;
// private Eva algorithm;
// private String threadName;
// private int runs;
// private Thread tr;
// /**
// ... | BinaryArraySolutionsGenerator generator = new BinaryArraySolutionsGenerator(weights.length); |
decorators-squad/eva | src/test/java/com/amihaiemil/eva/util/BinaryArraySolutionsGeneratorTestCase.java | // Path: src/main/java/com/amihaiemil/eva/Solution.java
// public abstract class Solution {
//
// /**
// * Fitness of this solution. How good it is (how fit) in comparison to other solutions.
// */
// private Fitness fitness;
//
// /**
// * Representation of this solution.
// */
// ... | import static org.junit.Assert.assertTrue;
import com.amihaiemil.eva.Solution;
import com.amihaiemil.eva.SolutionsGenerator;
import org.junit.Test; | /*
Copyright (c) 2016, Mihai-Emil Andronache
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and th... | // Path: src/main/java/com/amihaiemil/eva/Solution.java
// public abstract class Solution {
//
// /**
// * Fitness of this solution. How good it is (how fit) in comparison to other solutions.
// */
// private Fitness fitness;
//
// /**
// * Representation of this solution.
// */
// ... | SolutionsGenerator generator = new BinaryArraySolutionsGenerator(5); |
decorators-squad/eva | src/test/java/com/amihaiemil/eva/util/BinaryArraySolutionsGeneratorTestCase.java | // Path: src/main/java/com/amihaiemil/eva/Solution.java
// public abstract class Solution {
//
// /**
// * Fitness of this solution. How good it is (how fit) in comparison to other solutions.
// */
// private Fitness fitness;
//
// /**
// * Representation of this solution.
// */
// ... | import static org.junit.Assert.assertTrue;
import com.amihaiemil.eva.Solution;
import com.amihaiemil.eva.SolutionsGenerator;
import org.junit.Test; | /*
Copyright (c) 2016, Mihai-Emil Andronache
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and th... | // Path: src/main/java/com/amihaiemil/eva/Solution.java
// public abstract class Solution {
//
// /**
// * Fitness of this solution. How good it is (how fit) in comparison to other solutions.
// */
// private Fitness fitness;
//
// /**
// * Representation of this solution.
// */
// ... | Solution generatedSolution = generator.generateRandomSolution(); |
decorators-squad/eva | src/test/java/com/amihaiemil/eva/backpack/FitnessForBackpackTestCase.java | // Path: src/main/java/com/amihaiemil/eva/Fitness.java
// public interface Fitness extends Comparable<Fitness>{
// /**
// * Indicates whether this fitness is OK.
// * E.g. If it is not OK, then it's not even worth comparing it to others, since
// * we know that a solution with this fitness is not goo... | import org.junit.Test;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import com.amihaiemil.eva.Fitness;
import com.amihaiemil.eva.backpack.FitnessForBackpack; | /*
Copyright (c) 2016, Mihai-Emil Andronache
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and th... | // Path: src/main/java/com/amihaiemil/eva/Fitness.java
// public interface Fitness extends Comparable<Fitness>{
// /**
// * Indicates whether this fitness is OK.
// * E.g. If it is not OK, then it's not even worth comparing it to others, since
// * we know that a solution with this fitness is not goo... | Fitness fitness = new FitnessForBackpack(56, 100); |
decorators-squad/eva | src/test/java/com/amihaiemil/eva/backpack/FitnessForBackpackTestCase.java | // Path: src/main/java/com/amihaiemil/eva/Fitness.java
// public interface Fitness extends Comparable<Fitness>{
// /**
// * Indicates whether this fitness is OK.
// * E.g. If it is not OK, then it's not even worth comparing it to others, since
// * we know that a solution with this fitness is not goo... | import org.junit.Test;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import com.amihaiemil.eva.Fitness;
import com.amihaiemil.eva.backpack.FitnessForBackpack; | /*
Copyright (c) 2016, Mihai-Emil Andronache
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and th... | // Path: src/main/java/com/amihaiemil/eva/Fitness.java
// public interface Fitness extends Comparable<Fitness>{
// /**
// * Indicates whether this fitness is OK.
// * E.g. If it is not OK, then it's not even worth comparing it to others, since
// * we know that a solution with this fitness is not goo... | Fitness fitness = new FitnessForBackpack(56, 100); |
decorators-squad/eva | src/test/java/com/amihaiemil/eva/util/BinaryArraySolutionTestCase.java | // Path: src/main/java/com/amihaiemil/eva/Solution.java
// public abstract class Solution {
//
// /**
// * Fitness of this solution. How good it is (how fit) in comparison to other solutions.
// */
// private Fitness fitness;
//
// /**
// * Representation of this solution.
// */
// ... | import java.util.Arrays;
import java.util.Random;
import static org.junit.Assert.assertTrue;
import com.amihaiemil.eva.Solution;
import org.junit.Test;
import org.mockito.Mockito; | /*
Copyright (c) 2016, Mihai-Emil Andronache
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and th... | // Path: src/main/java/com/amihaiemil/eva/Solution.java
// public abstract class Solution {
//
// /**
// * Fitness of this solution. How good it is (how fit) in comparison to other solutions.
// */
// private Fitness fitness;
//
// /**
// * Representation of this solution.
// */
// ... | Solution testSolution = new BinaryArraySolution(mockChance); |
decorators-squad/eva | src/main/java/com/amihaiemil/eva/util/BinaryArraySolutionsGenerator.java | // Path: src/main/java/com/amihaiemil/eva/Solution.java
// public abstract class Solution {
//
// /**
// * Fitness of this solution. How good it is (how fit) in comparison to other solutions.
// */
// private Fitness fitness;
//
// /**
// * Representation of this solution.
// */
// ... | import java.util.Random;
import com.amihaiemil.eva.Solution;
import com.amihaiemil.eva.SolutionsGenerator; | /*
Copyright (c) 2016, Mihai-Emil Andronache
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and th... | // Path: src/main/java/com/amihaiemil/eva/Solution.java
// public abstract class Solution {
//
// /**
// * Fitness of this solution. How good it is (how fit) in comparison to other solutions.
// */
// private Fitness fitness;
//
// /**
// * Representation of this solution.
// */
// ... | public Solution generateRandomSolution() { |
decorators-squad/eva | src/test/java/com/amihaiemil/eva/SolutionsTestCase.java | // Path: src/main/java/com/amihaiemil/eva/util/BinaryArraySolution.java
// public class BinaryArraySolution extends Solution {
// private Random chance;
//
// public BinaryArraySolution() {
// this.chance = new Random();
// }
//
// public BinaryArraySolution(NumericalRepresentation representa... | import java.util.Collection;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import com.amihaiemil.eva.util.BinaryArraySolution;
import static org.junit.Assert.assertTrue; | /*
Copyright (c) 2016, Mihai-Emil Andronache
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and th... | // Path: src/main/java/com/amihaiemil/eva/util/BinaryArraySolution.java
// public class BinaryArraySolution extends Solution {
// private Random chance;
//
// public BinaryArraySolution() {
// this.chance = new Random();
// }
//
// public BinaryArraySolution(NumericalRepresentation representa... | Solution solution = Mockito.spy(new BinaryArraySolution()); |
Pokechu22/WorldDownloader-Serverside-Companion | src/main/java/wdl/request/PermissionRequest.java | // Path: src/main/java/wdl/range/ProtectionRange.java
// public final class ProtectionRange {
// public ProtectionRange(String tag, int x1, int z1, int x2, int z2) {
// if (tag == null) {
// tag = "";
// }
// this.tag = tag;
// this.x1 = x1;
// this.z1 = z1;
// this.x2 = x2;
// this.z2 = z2;
... | import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitTask;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import wdl.range.ProtectionRange;
| package wdl.request;
/**
* Represents a single request.
*/
public class PermissionRequest {
/**
* Different states a request can be in.
*/
public static enum State {
/**
* The request is waiting on moderator action.
*/
WAITING(ChatColor.YELLOW),
/**
* The request has been ... | // Path: src/main/java/wdl/range/ProtectionRange.java
// public final class ProtectionRange {
// public ProtectionRange(String tag, int x1, int z1, int x2, int z2) {
// if (tag == null) {
// tag = "";
// }
// this.tag = tag;
// this.x1 = x1;
// this.z1 = z1;
// this.x2 = x2;
// this.z2 = z2;
... | public final List<ProtectionRange> rangeRequests;
|
Pokechu22/WorldDownloader-Serverside-Companion | src/main/java/wdl/WDLPackets.java | // Path: src/main/java/wdl/range/ProtectionRange.java
// public final class ProtectionRange {
// public ProtectionRange(String tag, int x1, int z1, int x2, int z2) {
// if (tag == null) {
// tag = "";
// }
// this.tag = tag;
// this.x1 = x1;
// this.z1 = z1;
// this.x2 = x2;
// this.z2 = z2;
... | import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.bukkit.entity.Player;
import wdl.range.ProtectionRange;
import wdl.request.PermissionRequest;
import com.google.common.io.ByteArrayDataInput;
import com.google.common.io.ByteArrayDataOutput;
import com... | *
* This packet replaces all of the ranges with the given tag with a new set
* of ranges.
*
* This packet starts with a String stating the group, then a second string
* that specifies the tag to replace. After that, there is an int stating
* the number of ranges, and then each range as formated by
... | // Path: src/main/java/wdl/range/ProtectionRange.java
// public final class ProtectionRange {
// public ProtectionRange(String tag, int x1, int z1, int x2, int z2) {
// if (tag == null) {
// tag = "";
// }
// this.tag = tag;
// this.x1 = x1;
// this.z1 = z1;
// this.x2 = x2;
// this.z2 = z2;
... | public static PermissionRequest readPermissionRequest(
|
Pokechu22/WorldDownloader-Serverside-Companion | src/main/java/wdl/PermissionHandler.java | // Path: src/main/java/wdl/request/PermissionRequest.java
// public class PermissionRequest {
// /**
// * Different states a request can be in.
// */
// public static enum State {
// /**
// * The request is waiting on moderator action.
// */
// WAITING(ChatColor.YELLOW),
// /**
// * The r... | import java.util.logging.Level;
import org.bukkit.entity.Player;
import wdl.request.PermissionRequest;
| }
// No request value for this.
return getPerworldBoolean(player, "canDoNewThings");
}
/**
* Should the given player receive entity range data?
*/
public boolean getSendEntityRanges(Player player) {
if (player.hasPermission("wdl.override.sendEntityRanges")) {
return true;
}
if (... | // Path: src/main/java/wdl/request/PermissionRequest.java
// public class PermissionRequest {
// /**
// * Different states a request can be in.
// */
// public static enum State {
// /**
// * The request is waiting on moderator action.
// */
// WAITING(ChatColor.YELLOW),
// /**
// * The r... | PermissionRequest request = plugin.requestManager.getPlayerRequest(player);
|
Pokechu22/WorldDownloader-Serverside-Companion | src/main/java/wdl/RangeGroupTypeRegistrationEvent.java | // Path: src/main/java/wdl/range/IRangeGroupType.java
// public interface IRangeGroupType<T extends IRangeProducer> {
// /**
// * Validates that the given {@link ConfigurationSection} is acceptable.
// *
// * @param config
// * The config to check.
// * @param warnings
// * A ... | import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.bukkit.plugin.AuthorNagException;
import wdl.range.IRangeGroupType;
| package wdl;
/**
* Event that is raised when {@link WDLCompanion} is ready to receive new
* {@link IRangeGroupType} registrations.
*/
public final class RangeGroupTypeRegistrationEvent extends Event {
private static final HandlerList handlers = new HandlerList();
private final WDLCompanion plugin;
... | // Path: src/main/java/wdl/range/IRangeGroupType.java
// public interface IRangeGroupType<T extends IRangeProducer> {
// /**
// * Validates that the given {@link ConfigurationSection} is acceptable.
// *
// * @param config
// * The config to check.
// * @param warnings
// * A ... | public void addRegistration(String id, IRangeGroupType<?> rangeGroupType)
|
Pokechu22/WorldDownloader-Serverside-Companion | src/main/java/wdl/ConfigValidation.java | // Path: src/main/java/wdl/range/IRangeGroupType.java
// public interface IRangeGroupType<T extends IRangeProducer> {
// /**
// * Validates that the given {@link ConfigurationSection} is acceptable.
// *
// * @param config
// * The config to check.
// * @param warnings
// * A ... | import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.Configuration;
import org.bukkit.configuration.ConfigurationSection;
import wdl.range.IRangeGroupType;
| }
}
/**
* Validates the given chunk override.
*
* @param override The {@link ConfigurationSection} for the chunk override.
* @param key ID of the override
* @param warnTo The player to complain to if something is wrong.
* @param plugin The instance of the plugin.
* @return True if the ove... | // Path: src/main/java/wdl/range/IRangeGroupType.java
// public interface IRangeGroupType<T extends IRangeProducer> {
// /**
// * Validates that the given {@link ConfigurationSection} is acceptable.
// *
// * @param config
// * The config to check.
// * @param warnings
// * A ... | IRangeGroupType<?> type = plugin.registeredRangeGroupTypes.get(typeName);
|
KodeMunkie/imagetozxspec | src/main/java/uk/co/silentsoftware/core/converters/image/orderedditherstrategy/BayerFourByFourDitherStrategy.java | // Path: src/main/java/uk/co/silentsoftware/config/LanguageSupport.java
// public static String getCaption(String key) {
// String translation = null;
// if (captions != null) {
// try {
// translation = captions.getString(key);
// } catch(MissingResourceException ignore){}
// }
// // We're missing a key's v... | import static uk.co.silentsoftware.config.LanguageSupport.getCaption; | /* Image to ZX Spec
* Copyright (C) 2020 Silent Software (Benjamin Brown)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) an... | // Path: src/main/java/uk/co/silentsoftware/config/LanguageSupport.java
// public static String getCaption(String key) {
// String translation = null;
// if (captions != null) {
// try {
// translation = captions.getString(key);
// } catch(MissingResourceException ignore){}
// }
// // We're missing a key's v... | return "Bayer 4x4 ("+getCaption("ordered_dither")+")"; |
KodeMunkie/imagetozxspec | src/main/java/uk/co/silentsoftware/core/converters/image/errordiffusionstrategy/SierraFilterLightStrategy.java | // Path: src/main/java/uk/co/silentsoftware/config/LanguageSupport.java
// public static String getCaption(String key) {
// String translation = null;
// if (captions != null) {
// try {
// translation = captions.getString(key);
// } catch(MissingResourceException ignore){}
// }
// // We're missing a key's v... | import java.awt.image.BufferedImage;
import static uk.co.silentsoftware.config.LanguageSupport.getCaption; | /* Image to ZX Spec
* Copyright (C) 2020 Silent Software (Benjamin Brown)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) an... | // Path: src/main/java/uk/co/silentsoftware/config/LanguageSupport.java
// public static String getCaption(String key) {
// String translation = null;
// if (captions != null) {
// try {
// translation = captions.getString(key);
// } catch(MissingResourceException ignore){}
// }
// // We're missing a key's v... | return "Sierra Filter Light ("+getCaption("error_diffusion")+")"; |
KodeMunkie/imagetozxspec | src/main/java/uk/co/silentsoftware/core/converters/image/orderedditherstrategy/MagicSquareDitherStrategy.java | // Path: src/main/java/uk/co/silentsoftware/config/LanguageSupport.java
// public static String getCaption(String key) {
// String translation = null;
// if (captions != null) {
// try {
// translation = captions.getString(key);
// } catch(MissingResourceException ignore){}
// }
// // We're missing a key's v... | import static uk.co.silentsoftware.config.LanguageSupport.getCaption; | /* Image to ZX Spec
* Copyright (C) 2020 Silent Software (Benjamin Brown)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) an... | // Path: src/main/java/uk/co/silentsoftware/config/LanguageSupport.java
// public static String getCaption(String key) {
// String translation = null;
// if (captions != null) {
// try {
// translation = captions.getString(key);
// } catch(MissingResourceException ignore){}
// }
// // We're missing a key's v... | return "Magic Square 4x4 ("+getCaption("ordered_dither")+")"; |
KodeMunkie/imagetozxspec | src/main/java/uk/co/silentsoftware/core/converters/image/DitherStrategy.java | // Path: src/main/java/uk/co/silentsoftware/core/colourstrategy/ColourChoiceStrategy.java
// public interface ColourChoiceStrategy {
//
// /**
// * Method to return the RGB int colour (Spectrum colour) that should be
// * used for a given pixel based on the Spectrum colours
// * passed in as mostPopularColour ... | import uk.co.silentsoftware.core.colourstrategy.ColourChoiceStrategy;
import uk.co.silentsoftware.core.converters.image.processors.ImageConverter; | /* Image to ZX Spec
* Copyright (C) 2020 Silent Software (Benjamin Brown)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) an... | // Path: src/main/java/uk/co/silentsoftware/core/colourstrategy/ColourChoiceStrategy.java
// public interface ColourChoiceStrategy {
//
// /**
// * Method to return the RGB int colour (Spectrum colour) that should be
// * used for a given pixel based on the Spectrum colours
// * passed in as mostPopularColour ... | ImageConverter createPreviewImageConverter(ColourChoiceStrategy colourChoiceStrategy); |
KodeMunkie/imagetozxspec | src/main/java/uk/co/silentsoftware/core/helpers/colourdistance/EuclideanColourDistance.java | // Path: src/main/java/uk/co/silentsoftware/config/LanguageSupport.java
// public static String getCaption(String key) {
// String translation = null;
// if (captions != null) {
// try {
// translation = captions.getString(key);
// } catch(MissingResourceException ignore){}
// }
// // We're missing a key's v... | import static uk.co.silentsoftware.config.LanguageSupport.getCaption; | /* Image to ZX Spec
* Copyright (C) 2020 Silent Software (Benjamin Brown)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) an... | // Path: src/main/java/uk/co/silentsoftware/config/LanguageSupport.java
// public static String getCaption(String key) {
// String translation = null;
// if (captions != null) {
// try {
// translation = captions.getString(key);
// } catch(MissingResourceException ignore){}
// }
// // We're missing a key's v... | return getCaption("adv_colour_dist_euclidean") ; |
KodeMunkie/imagetozxspec | src/main/java/uk/co/silentsoftware/core/converters/video/VLCVideoImportEngine.java | // Path: src/main/java/uk/co/silentsoftware/config/LanguageSupport.java
// public static String getCaption(String key) {
// String translation = null;
// if (captions != null) {
// try {
// translation = captions.getString(key);
// } catch(MissingResourceException ignore){}
// }
// // We're missing a key's v... | import com.sun.jna.Native;
import com.sun.jna.NativeLibrary;
import uk.co.caprica.vlcj.binding.LibVlc;
import uk.co.caprica.vlcj.component.EmbeddedMediaPlayerComponent;
import uk.co.caprica.vlcj.player.MediaPlayer;
import uk.co.caprica.vlcj.runtime.RuntimeUtil;
import static uk.co.silentsoftware.config.LanguageSupport.... | if (cancel) {
break;
}
// Always add images if we don't want a single preview
// image or when the time exceeds the point we want a
// single image from
if (singleImageSelectionTime == -1 || player.getTime() >= singleImageSelectionTime) {
sharedQueue.add(player.getSnapshot());
... | // Path: src/main/java/uk/co/silentsoftware/config/LanguageSupport.java
// public static String getCaption(String key) {
// String translation = null;
// if (captions != null) {
// try {
// translation = captions.getString(key);
// } catch(MissingResourceException ignore){}
// }
// // We're missing a key's v... | return getCaption("VLC"); |
KodeMunkie/imagetozxspec | src/main/java/uk/co/silentsoftware/core/helpers/colourdistance/ClassicColourDistanceStrategy.java | // Path: src/main/java/uk/co/silentsoftware/config/LanguageSupport.java
// public static String getCaption(String key) {
// String translation = null;
// if (captions != null) {
// try {
// translation = captions.getString(key);
// } catch(MissingResourceException ignore){}
// }
// // We're missing a key's v... | import static uk.co.silentsoftware.config.LanguageSupport.getCaption; | /* Image to ZX Spec
* Copyright (C) 2020 Silent Software (Benjamin Brown)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) an... | // Path: src/main/java/uk/co/silentsoftware/config/LanguageSupport.java
// public static String getCaption(String key) {
// String translation = null;
// if (captions != null) {
// try {
// translation = captions.getString(key);
// } catch(MissingResourceException ignore){}
// }
// // We're missing a key's v... | return getCaption("adv_colour_dist_classic") ; |
KodeMunkie/imagetozxspec | src/main/java/uk/co/silentsoftware/core/converters/image/orderedditherstrategy/OmegaOrderedDitherStrategy.java | // Path: src/main/java/uk/co/silentsoftware/config/LanguageSupport.java
// public static String getCaption(String key) {
// String translation = null;
// if (captions != null) {
// try {
// translation = captions.getString(key);
// } catch(MissingResourceException ignore){}
// }
// // We're missing a key's v... | import static uk.co.silentsoftware.config.LanguageSupport.getCaption; | /* Image to ZX Spec
* Copyright (C) 2020 Silent Software (Benjamin Brown)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) an... | // Path: src/main/java/uk/co/silentsoftware/config/LanguageSupport.java
// public static String getCaption(String key) {
// String translation = null;
// if (captions != null) {
// try {
// translation = captions.getString(key);
// } catch(MissingResourceException ignore){}
// }
// // We're missing a key's v... | return "Omega Ordered 2x2 ("+getCaption("ordered_dither")+")"; |
KodeMunkie/imagetozxspec | src/main/java/uk/co/silentsoftware/core/converters/image/errordiffusionstrategy/LowErrorAtkinsonDitherStrategy.java | // Path: src/main/java/uk/co/silentsoftware/config/LanguageSupport.java
// public static String getCaption(String key) {
// String translation = null;
// if (captions != null) {
// try {
// translation = captions.getString(key);
// } catch(MissingResourceException ignore){}
// }
// // We're missing a key's v... | import java.awt.image.BufferedImage;
import static uk.co.silentsoftware.config.LanguageSupport.getCaption; | /* Image to ZX Spec
* Copyright (C) 2020 Silent Software (Benjamin Brown)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) an... | // Path: src/main/java/uk/co/silentsoftware/config/LanguageSupport.java
// public static String getCaption(String key) {
// String translation = null;
// if (captions != null) {
// try {
// translation = captions.getString(key);
// } catch(MissingResourceException ignore){}
// }
// // We're missing a key's v... | return "Low Error Atkinson ("+getCaption("error_diffusion")+")"; |
KodeMunkie/imagetozxspec | src/main/java/uk/co/silentsoftware/core/converters/image/orderedditherstrategy/BayerEightByEightDitherStrategy.java | // Path: src/main/java/uk/co/silentsoftware/config/LanguageSupport.java
// public static String getCaption(String key) {
// String translation = null;
// if (captions != null) {
// try {
// translation = captions.getString(key);
// } catch(MissingResourceException ignore){}
// }
// // We're missing a key's v... | import static uk.co.silentsoftware.config.LanguageSupport.getCaption; | /* Image to ZX Spec
* Copyright (C) 2020 Silent Software (Benjamin Brown)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) an... | // Path: src/main/java/uk/co/silentsoftware/config/LanguageSupport.java
// public static String getCaption(String key) {
// String translation = null;
// if (captions != null) {
// try {
// translation = captions.getString(key);
// } catch(MissingResourceException ignore){}
// }
// // We're missing a key's v... | return "Bayer 8x8 ("+getCaption("ordered_dither")+")"; |
KodeMunkie/imagetozxspec | src/main/java/uk/co/silentsoftware/core/helpers/colourdistance/CompuphaseColourDistanceStrategy.java | // Path: src/main/java/uk/co/silentsoftware/config/LanguageSupport.java
// public static String getCaption(String key) {
// String translation = null;
// if (captions != null) {
// try {
// translation = captions.getString(key);
// } catch(MissingResourceException ignore){}
// }
// // We're missing a key's v... | import static uk.co.silentsoftware.config.LanguageSupport.getCaption; | /* Image to ZX Spec
* Copyright (C) 2020 Silent Software (Benjamin Brown)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) an... | // Path: src/main/java/uk/co/silentsoftware/config/LanguageSupport.java
// public static String getCaption(String key) {
// String translation = null;
// if (captions != null) {
// try {
// translation = captions.getString(key);
// } catch(MissingResourceException ignore){}
// }
// // We're missing a key's v... | return getCaption("adv_colour_dist_compuphase") ; |
KodeMunkie/imagetozxspec | src/main/java/uk/co/silentsoftware/core/converters/image/orderedditherstrategy/BayerTwoByOneOrderedDitherStrategy.java | // Path: src/main/java/uk/co/silentsoftware/config/LanguageSupport.java
// public static String getCaption(String key) {
// String translation = null;
// if (captions != null) {
// try {
// translation = captions.getString(key);
// } catch(MissingResourceException ignore){}
// }
// // We're missing a key's v... | import static uk.co.silentsoftware.config.LanguageSupport.getCaption; | /* Image to ZX Spec
* Copyright (C) 2020 Silent Software (Benjamin Brown)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) an... | // Path: src/main/java/uk/co/silentsoftware/config/LanguageSupport.java
// public static String getCaption(String key) {
// String translation = null;
// if (captions != null) {
// try {
// translation = captions.getString(key);
// } catch(MissingResourceException ignore){}
// }
// // We're missing a key's v... | return "Bayer 2x1 ("+getCaption("ordered_dither")+")"; |
KodeMunkie/imagetozxspec | src/main/java/uk/co/silentsoftware/core/converters/image/orderedditherstrategy/BayerTwoByTwoOrderedDitherStrategy.java | // Path: src/main/java/uk/co/silentsoftware/config/LanguageSupport.java
// public static String getCaption(String key) {
// String translation = null;
// if (captions != null) {
// try {
// translation = captions.getString(key);
// } catch(MissingResourceException ignore){}
// }
// // We're missing a key's v... | import static uk.co.silentsoftware.config.LanguageSupport.getCaption; | /* Image to ZX Spec
* Copyright (C) 2020 Silent Software (Benjamin Brown)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) an... | // Path: src/main/java/uk/co/silentsoftware/config/LanguageSupport.java
// public static String getCaption(String key) {
// String translation = null;
// if (captions != null) {
// try {
// translation = captions.getString(key);
// } catch(MissingResourceException ignore){}
// }
// // We're missing a key's v... | return "Bayer 2x2 ("+getCaption("ordered_dither")+")"; |
KodeMunkie/imagetozxspec | src/main/java/uk/co/silentsoftware/dispatcher/WorkContainer.java | // Path: src/main/java/uk/co/silentsoftware/core/converters/image/ResultImage.java
// public class ResultImage {
//
// private volatile ResultImageType resultImageType;
// private volatile BufferedImage image;
//
// public ResultImage(ResultImageType resultImageType, BufferedImage image) {
// this.resultImageTyp... | import java.awt.image.BufferedImage;
import uk.co.silentsoftware.core.converters.image.ResultImage; | /* Image to ZX Spec
* Copyright (C) 2020 Silent Software (Benjamin Brown)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) an... | // Path: src/main/java/uk/co/silentsoftware/core/converters/image/ResultImage.java
// public class ResultImage {
//
// private volatile ResultImageType resultImageType;
// private volatile BufferedImage image;
//
// public ResultImage(ResultImageType resultImageType, BufferedImage image) {
// this.resultImageTyp... | private ResultImage[] resultImage; |
KodeMunkie/imagetozxspec | src/main/java/uk/co/silentsoftware/core/converters/image/orderedditherstrategy/NasikMagicSquareDitherStrategy.java | // Path: src/main/java/uk/co/silentsoftware/config/LanguageSupport.java
// public static String getCaption(String key) {
// String translation = null;
// if (captions != null) {
// try {
// translation = captions.getString(key);
// } catch(MissingResourceException ignore){}
// }
// // We're missing a key's v... | import static uk.co.silentsoftware.config.LanguageSupport.getCaption; | /* Image to ZX Spec
* Copyright (C) 2020 Silent Software (Benjamin Brown)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) an... | // Path: src/main/java/uk/co/silentsoftware/config/LanguageSupport.java
// public static String getCaption(String key) {
// String translation = null;
// if (captions != null) {
// try {
// translation = captions.getString(key);
// } catch(MissingResourceException ignore){}
// }
// // We're missing a key's v... | return "Nasik Magic Square 4x4 ("+getCaption("ordered_dither")+")"; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.