2.2.6 release

This commit is contained in:
sojamo 2016-04-14 18:39:16 +08:00
parent 665b0c1aa5
commit 1f7cb64986
84 changed files with 1296 additions and 650 deletions

View File

@ -471,7 +471,7 @@ convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
controlP5 is a processing gui library.
Copyright (C) 2006-2014 andreas schlegel
Copyright (C) 2006-2015 andreas schlegel
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public

View File

@ -42,13 +42,13 @@ public void controlEvent(ControlEvent c) {
int b = int(c.getArrayValue(2));
int a = int(c.getArrayValue(3));
color col = color(r,g,b,a);
println("event\talpha:"+a+"\tred:"+r+"\tgreen:"+g+"\tblue:"+b+"\tcol"+col);
println("event \talpha:"+a+"\tred:"+r+"\tgreen:"+g+"\tblue:"+b+"\tcol"+col);
}
}
// color information from ColorPicker 'picker' are forwarded to the picker(int) function
void picker(int col) {
println("picker\talpha:"+alpha(col)+"\tred:"+red(col)+"\tgreen:"+green(col)+"\tblue:"+blue(col)+"\tcol"+col);
println("picker\talpha:"+int(alpha(col))+"\tred:"+int(red(col))+"\tgreen:"+int(green(col))+"\tblue:"+int(blue(col))+"\tcol"+col);
}
@ -183,6 +183,4 @@ java.lang.Object : boolean equals(Object)
created: 2015/03/24 12:20:58
*/
*/

View File

@ -1,98 +1,112 @@
/**
* ControlP5 Controlframe
* with controlP5 2.0 all java.awt dependencies have been removed
* as a consequence the option to display controllers in a separate
* window had to be removed as well.
* this example shows you how to create a java.awt.frame and use controlP5
*
* by Andreas Schlegel, 2012
* this example shows you how to create separate window to
* display and use controllers with processing 3
*
* by Andreas Schlegel, 2016
* www.sojamo.de/libraries/controlp5
*
*/
import java.awt.Frame;
import java.awt.BorderLayout;
import controlP5.*;
private ControlP5 cp5;
ControlFrame cf;
int def;
float speed;
float pos;
float c0, c1, c2, c3;
boolean auto;
void settings() {
size(400, 400, P3D);
}
void setup() {
size(400, 400);
cp5 = new ControlP5(this);
// by calling function addControlFrame() a
// new frame is created and an instance of class
// ControlFrame is instanziated.
cf = addControlFrame("extra", 200,200);
// add Controllers to the 'extra' Frame inside
// the ControlFrame class setup() method below.
cf = new ControlFrame(this, 400, 800, "Controls");
surface.setLocation(420, 10);
noStroke();
}
void draw() {
background(def);
}
ControlFrame addControlFrame(String theName, int theWidth, int theHeight) {
Frame f = new Frame(theName);
ControlFrame p = new ControlFrame(this, theWidth, theHeight);
f.add(p);
p.init();
f.setTitle(theName);
f.setSize(p.w, p.h);
f.setLocation(100, 100);
f.setResizable(false);
f.setVisible(true);
return p;
if (auto) pos += speed;
background(0);
translate(width/2, height/2);
rotateY(pos);
lights();
fill(c0, c1, c2, c3);
box(100);
}
// the ControlFrame class extends PApplet, so we
// are creating a new processing applet inside a
// new frame with a controlP5 object loaded
public class ControlFrame extends PApplet {
class ControlFrame extends PApplet {
int w, h;
int abc = 100;
public void setup() {
size(w, h);
frameRate(25);
cp5 = new ControlP5(this);
cp5.addSlider("abc").setRange(0, 255).setPosition(10,10);
cp5.addSlider("def").plugTo(parent,"def").setRange(0, 255).setPosition(10,30);
}
public void draw() {
background(abc);
}
private ControlFrame() {
}
public ControlFrame(Object theParent, int theWidth, int theHeight) {
parent = theParent;
w = theWidth;
h = theHeight;
}
public ControlP5 control() {
return cp5;
}
PApplet parent;
ControlP5 cp5;
Object parent;
public ControlFrame(PApplet _parent, int _w, int _h, String _name) {
super();
parent = _parent;
w=_w;
h=_h;
PApplet.runSketch(new String[]{this.getClass().getName()}, this);
}
}
public void settings() {
size(w, h);
}
public void setup() {
surface.setLocation(10, 10);
cp5 = new ControlP5(this);
cp5.addToggle("auto")
.plugTo(parent, "auto")
.setPosition(10, 70)
.setSize(50, 50)
.setValue(true);
cp5.addKnob("blend")
.plugTo(parent, "c3")
.setPosition(100, 300)
.setSize(200, 200)
.setRange(0, 255)
.setValue(200);
cp5.addNumberbox("color-red")
.plugTo(parent, "c0")
.setRange(0, 255)
.setValue(255)
.setPosition(100, 10)
.setSize(100, 20);
cp5.addNumberbox("color-green")
.plugTo(parent, "c1")
.setRange(0, 255)
.setValue(128)
.setPosition(100, 70)
.setSize(100, 20);
cp5.addNumberbox("color-blue")
.plugTo(parent, "c2")
.setRange(0, 255)
.setValue(0)
.setPosition(100, 130)
.setSize(100, 20);
cp5.addSlider("speed")
.plugTo(parent, "speed")
.setRange(0, 0.1)
.setValue(0.01)
.setPosition(100, 240)
.setSize(200, 30);
}
void draw() {
background(190);
}
}

View File

@ -1,102 +1,102 @@
<project name="controlP5" default="build" basedir="../">
<description>
ant build file for controlP5, a gui processing library.
</description>
<property name="processing" location="${user.home}/Documents/Processing/libraries"/>
<property name="libraryClasspath" location="../libs"/>
<property name="libraryClasspath" location="../libs"/>
<path id="library-classpath">
<fileset dir="${libraryClasspath}" >
<fileset dir="${libraryClasspath}" >
<include name="core.jar"/>
</fileset>
</path>
</path>
<property name="javaVersion" value="1.6"/>
<property name="author" value="Andreas Schlegel"/>
<property name="copyright" value="(c) 2006-2015"/>
<property name="author" value="Andreas Schlegel"/>
<property name="copyright" value="(c) 2006-2016"/>
<property name="libraryName" value="controlP5"/>
<property name="versionNumber" value="2.2.5"/>
<property name="versionNumber" value="2.2.6"/>
<property name="yourLink" value="http://www.sojamo.de" />
<property name="keywords" value="gui, ui, controller, interface, user interface" />
<property name="tested:platform" value="osx, windows, linux" />
<property name="tested:processingVersion" value="2.2.1" />
<property name="tested:processingVersion" value="3.0.2" />
<property name="tested:dependencies" value="none" />
<property name="source:host" value="github" />
<property name="source:url" value="https://github.com/sojamo/controlp5" />
<property name="source:repository" value="https://github.com/sojamo/controlp5/tree/master/src" />
<!-- no changes or adjustments required below -->
<!-- Create the time stamp -->
<tstamp>
<tstamp>
<format property="date" pattern="MM/dd/yyyy" offset="0" unit="hour"/>
</tstamp>
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="./resources/code/ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
<property name="jarFile" value="${libraryName}.jar"/>
<property name="src" location="src"/>
<property name="bin" location="bin"/>
<property name="reference" location="reference"/>
<property name="dist" location="distribution"/>
<property name="resources" location="resources"/>
<target name="init">
<echo>
--------------------------------------------------------------------------------------------
${date} compiling ${libraryName} ${versionNumber}
--------------------------------------------------------------------------------------------
Properties initialized
--------------------------------------------------------------------------------------------
src path ${src}
bin path ${bin}
libraryClasspath ${libraryClasspath}
processing Libraries ${processing}
java version ${javaVersion}
</echo>
</echo>
<echo>
--------------------------------------------------------------------------------------------
building library ...
</echo>
<delete dir="${bin}"/>
<mkdir dir="${bin}"/>
<delete dir="${dist}"/>
<delete dir="${dist}"/>
<mkdir dir="${dist}"/>
</target>
<!-- compile the library -->
<target name="compile" depends="init" description="compile the source" >
<target name="compile" depends="init" description="compile the source" >
<javac srcdir="${src}" destdir="${bin}" source="${javaVersion}" target="${javaVersion}">
<classpath>
<path refid="library-classpath"/>
</classpath>
</javac>
</target>
<!-- build the distribution of the library -->
<target name="prepare" depends="compile" description="generate the distribution" >
<!-- delete the previous content of the ${dist} folder -->
<delete dir="${dist}" />
<!-- build the structure for ${dist} -->
<mkdir dir="${dist}" />
<mkdir dir="${dist}/library" />
@ -109,48 +109,48 @@
</copy>
<copy todir="${dist}/src">
<fileset dir="src"/>
</copy>
</copy>
<path id="src.contents"><fileset dir="${dist}/src" includes="**/*.java" /></path>
<property name="src.list" refid="src.contents" />
<foreach list="${src.list}" param="file" target="versionSourcefile" delimiter=":" />
</target>
<target name="build" depends="prepare" description="generate the reference" >
<!-- create the java reference of the library -->
<echo>Generating JavaDoc Reference</echo>
<mkdir dir="${reference}" />
<javadoc bottom="processing library ${libraryName} by ${author}. ${copyright}"
classpath="${libraryClasspath}/core.jar"
destdir="${reference}"
verbose="false"
nodeprecated="true"
<javadoc bottom="processing library ${libraryName} by ${author}. ${copyright}"
classpath="${libraryClasspath}/core.jar"
destdir="${reference}"
verbose="false"
nodeprecated="true"
stylesheetfile="resources/stylesheet.css"
doctitle="Javadocs: ${libraryName}"
public="true" version="false"
doctitle="Javadocs: ${libraryName}"
public="true" version="false"
windowtitle="Javadocs: ${libraryName}">
<taglet name="ExampleTaglet" path="resources/code" />
<fileset dir="${src}" defaultexcludes="yes">
<include name="**/*.java"/>
</fileset>
</javadoc>
<copy todir="${dist}/reference">
<fileset dir="${reference}" />
</copy>
<!-- copy the jar file to processing's libraries -->
<mkdir dir="${processing}/${libraryName}" />
<copy todir="${processing}/${libraryName}">
<fileset dir="${dist}"/>
</copy>
</copy>
<mkdir dir="${dist}/${libraryName}-${versionNumber}" />
<mkdir dir="${dist}/${libraryName}-${versionNumber}/controlP5" />
@ -165,7 +165,7 @@
<copy todir="${dist}/${libraryName}-${versionNumber}/controlP5/examples"><fileset dir="${dist}/examples"/></copy>
<copy todir="${dist}/${libraryName}-${versionNumber}/controlP5/reference"><fileset dir="${dist}/reference"/></copy>
<copy todir="${dist}/${libraryName}-${versionNumber}/controlP5/library"><fileset dir="${dist}/library"/></copy>
<copyfile src="${resources}/install_instructions.txt" dest="${dist}/tmp/install_instructions.txt"/>
<copyfile src="${resources}/library.properties" dest="${dist}/tmp/controlP5/library.properties"/>
@ -178,64 +178,64 @@
basedir="${dist}/tmp"
excludes="**/.DS_Store"
/>
<!-- <rename src="${dist}/${libraryName}.zip" dest="${dist}/${libraryName}_${versionNumber}.zip" /> -->
<!-- organize the ${dist} folder -->
<mkdir dir="${dist}/web" />
<move todir="${dist}/web/reference">
<fileset dir="${dist}/reference" />
</move>
<move todir="${dist}/web/examples">
<fileset dir="${dist}/examples" />
</move>
<delete dir="${dist}/library" />
<copy todir="${dist}/web">
<fileset dir="web" />
</copy>
<!--
format the index.html file.
regular expressions are used to parse the web index.html file.
key words starting and ending with ## are replaced by values
format the index.html file.
regular expressions are used to parse the web index.html file.
key words starting and ending with ## are replaced by values
defined earlier in the beginning of this build file.
-->
<replaceregexp file="${dist}/web/index.html"
match="##yourLibrary##"
replace="${libraryName}"
flags="g" />
<replaceregexp file="${dist}/web/index.html"
match="##author##"
replace="${author}"
flags="g" />
<replaceregexp file="${dist}/web/index.html"
match="##versionNumber##"
replace="${versionNumber}"
flags="g" />
<replaceregexp file="${dist}/web/index.html"
match="##yourLink##"
replace="${yourLink}"
flags="g" />
<replaceregexp file="${dist}/web/index.html"
match="##date##"
replace="${date}"
flags="g" />
<replaceregexp file="${dist}/web/index.html"
match="##keywords##"
replace="${keywords}"
flags="g" />
<replaceregexp file="${dist}/web/index.html"
match="##tested:platform##"
replace="${tested:platform}"
@ -261,34 +261,34 @@
replace="${source:repository}"
flags="g" />
<echo>--------------------------------------------------------------------------------------------</echo>
<antcall target="processExamples" />
<echo>--------------------------------------------------------------------------------------------</echo>
<replaceregexp file="${dist}/web/index.html"
match="##examples##"
replace=""
flags="g" />
<!-- finish organizing library's distribution -->
<mkdir dir="${dist}/web/download" />
<copy file="${dist}/${libraryName}-${versionNumber}.zip" todir="${dist}/web/download" />
<copy todir="${processing}/${libraryName}/reference">
<fileset dir="${reference}" />
</copy>
<!-- done, finished. -->
<echo>--------------------------------------------------------------------------------------------
done, finished compiling ${libraryName} ${versionNumber}
--------------------------------------------------------------------------------------------
</echo>
</target>
<!-- parsing the examples folder -->
<target name="processExamples">
<dirset id="examples.contents" dir="examples" />
@ -296,7 +296,7 @@
<foreach list="${examples.list}" target="addExamples" param="exampleDir" delimiter=";">
</foreach>
</target>
<target name="addExamples">
<echo>${exampleDir}</echo>
<propertyregex property="pde"
@ -326,12 +326,11 @@
</else>
</if>
</target>
<target name="versionSourcefile">
<echo>${file}</echo>
<replaceregexp file="${file}" match="##version##" replace="${versionNumber}" flags="g" />
<replaceregexp file="${file}" match="##date##" replace="${date}" flags="g" />
</target>
</project>

View File

@ -1,4 +1,4 @@
cd $HOME/Documents/workspace/controlp5/bin
jar cf ../test/controlP5.jar .
cp ../test/controlP5.jar $HOME/Documents/Processing/libraries/controlP5/library
cp ../test/controlP5.jar $HOME/Documents/Processing3/libraries/controlP5/library
echo "controlP5 compiled on $(date)"

View File

@ -38,7 +38,7 @@ paragraph = Includes interface elements such as slider, button, knob, toggle, te
# is used to compare different versions of the same library, and
# check if an update is available. You should think of it as a
# counter, counting the total number of releases you've had.
version = 84 # This must be parsable as an int
version = 85 # This must be parsable as an int
# The version as the user will see it. If blank, the version attribute will be used here
prettyVersion = 2.2.5 # This is treated as a String
prettyVersion = 2.2.6 # This is treated as a String

View File

@ -3,7 +3,7 @@ package controlP5;
/**
* controlP5 is a processing gui library.
*
* 2006-2014 by Andreas Schlegel
* 2006-2015 by Andreas Schlegel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License

View File

@ -1,5 +1,30 @@
package controlP5;
/**
* controlP5 is a processing gui library.
*
* 2006-2015 by Andreas Schlegel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*
* @author Andreas Schlegel (http://www.sojamo.de)
* @modified ##date##
* @version ##version##
*
*/
public class Background extends ControlGroup< Background > {
public Background( ControlP5 theControlP5 , ControllerGroup< ? > theParent , String theName , int theX , int theY , int theW , int theH ) {

View File

@ -3,7 +3,7 @@ package controlP5;
/**
* controlP5 is a processing gui library.
*
* 2006-2014 by Andreas Schlegel
* 2006-2015 by Andreas Schlegel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License

View File

@ -2,9 +2,9 @@ package controlP5;
/**
* controlP5 is a processing gui library.
*
* 2006-2014 by Andreas Schlegel
*
*
* 2006-2015 by Andreas Schlegel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1
@ -13,16 +13,16 @@ package controlP5;
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*
* @author Andreas Schlegel (http://www.sojamo.de)
* @modified ##date##
* @version ##version##
*
*
* @author Andreas Schlegel (http://www.sojamo.de)
* @modified ##date##
* @version ##version##
*
*/
import java.lang.reflect.Constructor;

View File

@ -3,7 +3,7 @@ package controlP5;
/**
* controlP5 is a processing gui library.
*
* 2006-2014 by Andreas Schlegel
* 2006-2015 by Andreas Schlegel
*
* This library is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser

View File

@ -1,5 +1,32 @@
package controlP5;
/**
* controlP5 is a processing gui library.
*
* 2006-2015 by Andreas Schlegel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*
* @author Andreas Schlegel (http://www.sojamo.de)
* @modified ##date##
* @version ##version##
*
*/
import static controlP5.ControlP5.b;
import java.util.ArrayList;

View File

@ -3,7 +3,7 @@ package controlP5;
/**
* controlP5 is a processing gui library.
*
* 2006-2012 by Andreas Schlegel
* 2006-2015 by Andreas Schlegel
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free

View File

@ -3,7 +3,7 @@ package controlP5;
/**
* controlP5 is a processing gui library.
*
* 2006-2012 by Andreas Schlegel
* 2006-2015 by Andreas Schlegel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License

View File

@ -1,5 +1,30 @@
package controlP5;
/**
* controlP5 is a processing gui library.
*
* 2006-2015 by Andreas Schlegel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*
* @author Andreas Schlegel (http://www.sojamo.de)
* @modified ##date##
* @version ##version##
*
*/
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Array;
import java.net.URLEncoder;
@ -7,8 +32,6 @@ import java.text.CharacterIterator;
import java.text.StringCharacterIterator;
import java.util.List;
import processing.core.PVector;
public class CP {
/**
@ -224,10 +247,7 @@ public class CP {
return c.toString( ).startsWith( pattern ) ? c.toString( ).substring( pattern.length( ) ) : c.toString( );
}
static public boolean inside( int[] theRect , PVector theVector ) {
return inside( theRect , theVector.x , theVector.y );
}
static public boolean inside( int[] theRect , float theX , float theY ) {
if ( theRect.length == 4 ) {
return ( theX > theRect[ 0 ] && theX < theRect[ 2 ] && theY > theRect[ 1 ] && theY < theRect[ 3 ] );

View File

@ -3,7 +3,7 @@ package controlP5;
/**
* controlP5 is a processing gui library.
*
* 2006-2014 by Andreas Schlegel
* 2006-2015 by Andreas Schlegel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License

View File

@ -3,7 +3,7 @@ package controlP5;
/**
* controlP5 is a processing gui library.
*
* 2006-2012 by Andreas Schlegel
* 2006-2015 by Andreas Schlegel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License

View File

@ -1,5 +1,30 @@
package controlP5;
/**
* controlP5 is a processing gui library.
*
* 2006-2015 by Andreas Schlegel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*
* @author Andreas Schlegel (http://www.sojamo.de)
* @modified ##date##
* @version ##version##
*
*/
import processing.core.PApplet;
import processing.core.PGraphics;

View File

@ -1,5 +1,30 @@
package controlP5;
/**
* controlP5 is a processing gui library.
*
* 2006-2015 by Andreas Schlegel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*
* @author Andreas Schlegel (http://www.sojamo.de)
* @modified ##date##
* @version ##version##
*
*/
import java.util.Iterator;
import java.util.LinkedHashMap;

View File

@ -1,5 +1,30 @@
package controlP5;
/**
* controlP5 is a processing gui library.
*
* 2006-2015 by Andreas Schlegel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*
* @author Andreas Schlegel (http://www.sojamo.de)
* @modified ##date##
* @version ##version##
*
*/
/**
* Used by Chart, single chart data is stored here including value, (label) text, and color.
*/

View File

@ -1,5 +1,30 @@
package controlP5;
/**
* controlP5 is a processing gui library.
*
* 2006-2015 by Andreas Schlegel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*
* @author Andreas Schlegel (http://www.sojamo.de)
* @modified ##date##
* @version ##version##
*
*/
import java.util.ArrayList;
import java.util.ListIterator;

View File

@ -1,16 +1,9 @@
package controlP5;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import processing.core.PImage;
/**
* controlP5 is a processing gui library.
*
* 2006-2012 by Andreas Schlegel
* 2006-2015 by Andreas Schlegel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@ -32,6 +25,13 @@ import processing.core.PImage;
*
*/
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import processing.core.PImage;
/**
* A multiple-choice radioButton. items are added to a checkBox and can be organized in rows and
* columns. items of a checkBox are of type Toggle.

View File

@ -1,5 +1,30 @@
package controlP5;
/**
* controlP5 is a processing gui library.
*
* 2006-2015 by Andreas Schlegel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*
* @author Andreas Schlegel (http://www.sojamo.de)
* @modified ##date##
* @version ##version##
*
*/
class ColorPalette extends ControlGroup< ColorPalette > {
protected ColorPalette( ControlP5 theControlP5 , ControllerGroup< ? > theParent , String theName , int theX , int theY , int theWidth , int theHeight ) {

View File

@ -3,19 +3,21 @@ package controlP5;
/**
* controlP5 is a processing gui library.
*
* 2006-2012 by Andreas Schlegel
* 2006-2015 by Andreas Schlegel
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version. This library is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*
* @author Andreas Schlegel (http://www.sojamo.de)
* @modified ##date##
@ -169,7 +171,7 @@ public class ColorPicker extends ControlGroup< ColorPicker > {
if ( _myPlug != null ) {
try {
Method method = _myPlug.getClass( ).getMethod( _myPlugName , int.class );
method.invoke( _myPlug , ( int ) _myValue );
method.invoke( _myPlug , ( int ) getColorValue( ) );
} catch ( SecurityException ex ) {
ex.printStackTrace( );
} catch ( NoSuchMethodException ex ) {

View File

@ -1,5 +1,30 @@
package controlP5;
/**
* controlP5 is a processing gui library.
*
* 2006-2015 by Andreas Schlegel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*
* @author Andreas Schlegel (http://www.sojamo.de)
* @modified ##date##
* @version ##version##
*
*/
import java.util.HashMap;
import java.util.Map;
@ -175,9 +200,9 @@ public class ColorWheel extends Controller< ColorWheel > {
buffer.ellipse( buffer.width / 2 , buffer.height / 2 , ( inner_radius + 1 ) * 2 , ( inner_radius + 1 ) * 2 );
for ( int y = 0 ; y < h ; y++ ) {
int dy = ( int ) ( y(center) - y );
int dy = ( int ) ( y( center ) - y );
for ( int x = 0 ; x < w ; x++ ) {
int dx = ( int ) ( x(center) - x );
int dx = ( int ) ( x( center ) - x );
double dist = Math.sqrt( dx * dx + dy * dy );
if ( dist >= inner_radius && dist <= outer_radius ) {
double theta = Math.atan2( dy , dx );
@ -234,9 +259,9 @@ public class ColorWheel extends Controller< ColorWheel > {
float y = _myColorResources.get( "default" ).height / 2 - ( float ) Math.sin( theta ) * s;
set( _myCursor , x , y );
setSaturation( t[ 1 ] );
// TODO resolve rounding error issue as reported here https://github.com/sojamo/controlp5/issues/21
_myColorValue = HSLtoRGB( hsl );
setValue( _myColorValue );
return this;
}

View File

@ -2,9 +2,9 @@ package controlP5;
/**
* controlP5 is a processing gui library.
*
* 2006-2012 by Andreas Schlegel
*
*
* 2006-2015 by Andreas Schlegel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1
@ -13,16 +13,16 @@ package controlP5;
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*
* @author Andreas Schlegel (http://www.sojamo.de)
* @modified ##date##
* @version ##version##
*
*
* @author Andreas Schlegel (http://www.sojamo.de)
* @modified ##date##
* @version ##version##
*
*/
/**

View File

@ -3,7 +3,7 @@ package controlP5;
/**
* controlP5 is a processing gui library.
*
* 2006-2012 by Andreas Schlegel
* 2006-2015 by Andreas Schlegel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License

View File

@ -1,5 +1,30 @@
package controlP5;
/**
* controlP5 is a processing gui library.
*
* 2006-2015 by Andreas Schlegel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*
* @author Andreas Schlegel (http://www.sojamo.de)
* @modified ##date##
* @version ##version##
*
*/
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

View File

@ -3,7 +3,7 @@ package controlP5;
/**
* controlP5 is a processing gui library.
*
* 2006-2012 by Andreas Schlegel
* 2006-2015 by Andreas Schlegel
*
* This library is free software; you can redistribute it and/or
</