Skip to content

Instantly share code, notes, and snippets.

@monkstone
Created November 24, 2012 10:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save monkstone/4139174 to your computer and use it in GitHub Desktop.
Save monkstone/4139174 to your computer and use it in GitHub Desktop.
processing.py utils for jedit
[python]
noc|noCursor()\n
sat|saturation($1\|)
MY|mouseY
em|ellipseMode($1\|)\n
kr|def keyReleased()\:\n\t\|\n
rnd|random($1\|)
MX|mouseX
el|ellipse($1\|,$2,$3,$4)\n
imgl|import processing.opengl.*\n
kp|def keyPressed()\:\n\t\|\n
MR|mouseReleased
SV|Server
MP|mousePressed
nosm|noSmooth()\n
setup3d|def setup()\:\n\tsize($1\|, $2, P3D)\n\n\ndef draw()\:\n\tpass\n
SE|Serial
FR|for i in range(\|$1,$2)\:\n\tpass\n
pr|println(\|)\n
FL|for item in $1\:\n\tpass\n
ifmp|if (mousePressed)\:\n\t\|\n
txm|textureMode($1\|)\n
cv|curveVertex(\|)\n
setup2d|def setup()\:\n\tsize($1\|, $2, P2D)\n\n\ndef draw()\:\n\tpass\n
cm|colorMode($1\|)\n
v|vertex(\|)
os|openStream("$1\|")
im|imageMode($1\|)\n
t|this.
imv|import processing.video.*\n
s|stroke($1\|)\n
KR|keyReleased
cf|createFont("$1\|",$2)\n
r|return
ce|def captureEvent(Capture $1\|)\:\n\t$1.read()\n
KP|keyPressed
cd|curveDetail($1\|)\n
ims|import processing.serial.*\n
up|updatePixels()\n
n|noise($1\|)
if|if ($1\|)\:\n\t\PASSn\n
ie|if ($1\|)\:\n\t\n else \n\tPASS\n\n
l|line($1\|,$2,$3,$4)\n
imn|import processing.net.*\n
rem|resetMatrix()\n
f|fill($1\|)\n
bv|bezierVertex(\|)\n
WI|while(\|True)\:\n\tpass\n
hme|hasMoreElements()
PMY|pmouseY
PMX|pmouseX
mre|def mouseReleased(MouseEvent e)\:\n\tif (e.\|)\:\n\t\t\n\t\n
V|Vector
bg|background($1)\n
S|String
lerp|($1+($2-$1)*$3)
bd|bezierDetail($1\|)\n
tr|translate($1\|,$2,$3)\n
bc|beginCamera()\n\tresetMatrix()\n\t\|\nendCamera()
O|Object
ifkp|if (keyPressed == '$1\|')
M|Movie
tm|textMode($1\|)\n
kre|def keyReleased(KeyEvent e)\:\n\tif (e.\|)\:\n\t\t\n\t\n
I|Iterator $1 = $2\|.iterator()\n
ne|nextElement()
nd|noiseDetail($1\|)\n
PI|PImage
tf|textFont($1\|)\n
E|Enumeration $1 = $2\|.getElements()\n
av|available()
PG|PGraphics
PF|PFont
C|Capture
PA|PApplet
am|applyMatrix(\|)\n
sz|screenZ($1\|)
sy|screenY($1\|)
sx|screenX($1\|)
sve|def serverEvent(Server $1\|, Client $2)\:\n\t\n\n
sw|strokeWidth($1\|)\n
mr|def mouseReleased()\:\n\t\|\n
bsh|beginShape($1)\n\t\|\nendShape()
mp|def mousePressed()\:\n\t\|\n
argb|int a = ($1>>>24)\nint r = ($1>>16) & 0xff\nint g = ($1>>8) & 0xff\nint b = $1 & 0xff\n
CL|Client
ac|System.arraycopy($1,$2,$3,$4,$5)\n
mm|def mouseMoved()\:\n\t\|\n\n
setup|def setup()\:\n\tsize($1\|, $2)\n\n\ndef draw()\:\n\tpass\n
sm|smooth($1\|)\n
me|def movieEvent(Movie $1\|)\:\n\t$1.read()\n\n
md|def mouseDragged()\:\n\t\|\n\n
sf|saveFrame("$1\|")\n
se|def serialEvent(Serial $1\|)\:\n\t\n\n
sd|sphereDetail($1\|)\n
fr|frameRate($1\|)\n
rz|rotateZ($1\|)\n
ry|rotateY($1\|)\n
rx|rotateX($1\|)\n
mpe|def mousePressed(MouseEvent e)\:\n\tif (e.\|)\:\n\t\t\n\t\n
ls|loadStrings("$1\|")\n
bri|brightness($1\|)
HT|HashTable
lp|loadPixels()\n
rs|readString()\n
pom|popMatrix()\n
pum|pushMatrix()\n
not|noTint()\n
li|loadImage("$1\|")\n
rm|rectMode($1\|)\n
nos|noStroke()\n
kpe|def keyPressed(KeyEvent e)\:\n\tif (e.\|)\:\n\t\t\n\t\n
lf|loadFont("$1\|.vlw.gz")\n
lb|loadBytes("$1\|")\n
rc|readChar()\n
rb|readBytes()\n
nof|noFill()\n
// This macro creates a new 3d processing.py file uses abbreviations
Buffer newBuffer = jEdit.newFile(view);
view.goToBuffer(newBuffer);
newBuffer.setMode("python");
textArea.setSelectedText("setup3d#200#200#");
Abbrevs.expandAbbrev(view,true);
// This is a recorded macro. First, check over the
// commands to make sure this is what you intended. Then,
// save this buffer, and the macro should appear in the
// Macros menu.
new console.commando.CommandoDialog(view,"commando.PYP5");
<?xml version="1.0" ?>
<!DOCTYPE COMMANDO SYSTEM "commando.dtd">
<COMMANDO>
<UI>
<CAPTION LABEL="Run Processing.py">
<FILE_ENTRY LABEL="Path to java" VARNAME="java" DEFAULT=""/>
<FILE_ENTRY LABEL="sketch" VARNAME="sketch" EVAL="buffer.getPath()"/>
<FILE_ENTRY LABEL="Path to processing-py.jar" VARNAME="processingpy" DEFAULT=""/>
</CAPTION>
<CAPTION LABEL="VM settings">
<ENTRY LABEL="Initial heap size (Mb)" VARNAME="ms" DEFAULT="32" />
<ENTRY LABEL="Maximum heap size (Mb)" VARNAME="mx" DEFAULT="128" />
</CAPTION>
</UI>
<COMMANDS>
<COMMAND SHELL="System" CONFIRM="FALSE">
buf = new StringBuilder(100);
buf.append(java);
if (!ms.equals("")){
buf.append(" -ms");
buf.append(ms);
buf.append("m");
}
if (!mx.equals("")){
buf.append(" -mx");
buf.append(mx);
buf.append("m");
}
buf.append(" -jar ");
buf.append(processingpy);
buf.append(" ");
buf.append(sketch.replace(" ", "\\ "));
buf.toString();
</COMMAND>
</COMMANDS>
</COMMANDO>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment