mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
cleaning up
This commit is contained in:
@@ -1,36 +0,0 @@
|
||||
package processing.app.tools.android;
|
||||
|
||||
public class AndroidProcess {
|
||||
public final String pid;
|
||||
public final String name;
|
||||
|
||||
public AndroidProcess(final String pid, final String name) {
|
||||
if (pid == null) {
|
||||
throw new IllegalArgumentException("null pid");
|
||||
}
|
||||
if (name == null) {
|
||||
throw new IllegalArgumentException("null name");
|
||||
}
|
||||
this.pid = pid;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return name + " (" + pid + ")";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object obj) {
|
||||
if (!(obj instanceof AndroidProcess)) {
|
||||
return false;
|
||||
}
|
||||
final AndroidProcess o = (AndroidProcess) obj;
|
||||
return pid.equals(o.pid) && name.equals(o.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return pid.hashCode() * 17 + name.hashCode();
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package processing.app.tools.android;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JLabel;
|
||||
|
||||
public class Harness implements AndroidEnvironmentProperties,
|
||||
AndroidDeviceProperties {
|
||||
public static void main(final String[] args) throws Exception {
|
||||
System.err.println("Waiting for device to be plugged in.");
|
||||
final AndroidDevice device = AndroidEnvironment.getInstance().getHardware()
|
||||
.get();
|
||||
System.err.println("Got it.");
|
||||
final JFrame f = new JFrame("Harness");
|
||||
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
f.add(new JLabel("Close me to quit"));
|
||||
f.pack();
|
||||
f.setVisible(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
package processing.app.tools.android;
|
||||
|
||||
public interface LineProcessor {
|
||||
interface LineProcessor {
|
||||
void processLine(final String line);
|
||||
}
|
||||
|
||||
@@ -27,14 +27,11 @@ import processing.app.tools.Tool;
|
||||
public class Reset implements Tool {
|
||||
static final String MENU_TITLE = "Reset Android";
|
||||
|
||||
Editor editor;
|
||||
|
||||
public String getMenuTitle() {
|
||||
return MENU_TITLE;
|
||||
}
|
||||
|
||||
public void init(final Editor editor) {
|
||||
this.editor = editor;
|
||||
}
|
||||
|
||||
public void run() {
|
||||
|
||||
@@ -79,14 +79,14 @@ class StreamPump implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
static public class WriterLineProcessor implements LineProcessor {
|
||||
private class WriterLineProcessor implements LineProcessor {
|
||||
private final PrintWriter writer;
|
||||
|
||||
public WriterLineProcessor(final OutputStream out) {
|
||||
WriterLineProcessor(final OutputStream out) {
|
||||
this.writer = new PrintWriter(out, true);
|
||||
}
|
||||
|
||||
public WriterLineProcessor(final Writer writer) {
|
||||
WriterLineProcessor(final Writer writer) {
|
||||
this.writer = new PrintWriter(writer, true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user