mirror of
https://github.com/sojamo/controlp5
synced 2024-11-25 15:17:57 +01:00
- removed reference to PApplet.setBounds(int, int, int, int) as it seems not to exist in Processing 3 anymore
- added TickMark distance from component and fixed its relation to TickMark length
This commit is contained in:
parent
1f7cb64986
commit
752e1ac0a5
@ -843,7 +843,7 @@ public final class ControlWindow {
|
|||||||
_myApplet.frame.removeNotify( );
|
_myApplet.frame.removeNotify( );
|
||||||
_myApplet.frame.setUndecorated( isUndecorated );
|
_myApplet.frame.setUndecorated( isUndecorated );
|
||||||
_myApplet.setSize( _myApplet.width , _myApplet.height );
|
_myApplet.setSize( _myApplet.width , _myApplet.height );
|
||||||
_myApplet.setBounds( 0 , 0 , _myApplet.width , _myApplet.height );
|
//_myApplet.setBounds( 0 , 0 , _myApplet.width , _myApplet.height );
|
||||||
_myApplet.frame.setSize( _myApplet.width , _myApplet.height );
|
_myApplet.frame.setSize( _myApplet.width , _myApplet.height );
|
||||||
_myApplet.frame.addNotify( );
|
_myApplet.frame.addNotify( );
|
||||||
}
|
}
|
||||||
|
13
src/controlP5/TickMark.java
Executable file → Normal file
13
src/controlP5/TickMark.java
Executable file → Normal file
@ -20,8 +20,8 @@ package controlP5;
|
|||||||
* Boston, MA 02111-1307 USA
|
* Boston, MA 02111-1307 USA
|
||||||
*
|
*
|
||||||
* @author Andreas Schlegel (http://www.sojamo.de)
|
* @author Andreas Schlegel (http://www.sojamo.de)
|
||||||
* @modified ##date##
|
* @modified 03/15/2018
|
||||||
* @version ##version##
|
* @version 2.2.6
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import processing.core.PApplet;
|
import processing.core.PApplet;
|
||||||
@ -35,6 +35,7 @@ public class TickMark implements CDrawable {
|
|||||||
protected Controller< ? > _myParent;
|
protected Controller< ? > _myParent;
|
||||||
|
|
||||||
protected int _myLen = 4;
|
protected int _myLen = 4;
|
||||||
|
protected int _myDistance = _myLen;
|
||||||
|
|
||||||
protected Label _myLabel;
|
protected Label _myLabel;
|
||||||
|
|
||||||
@ -52,14 +53,14 @@ public class TickMark implements CDrawable {
|
|||||||
theGraphics.pushMatrix( );
|
theGraphics.pushMatrix( );
|
||||||
switch ( theDirection ) {
|
switch ( theDirection ) {
|
||||||
case ( ControlP5Constants.HORIZONTAL ):
|
case ( ControlP5Constants.HORIZONTAL ):
|
||||||
theGraphics.translate( 0 , _myLen );
|
theGraphics.translate( 0 , _myDistance );
|
||||||
theGraphics.rect( 0 , 0 , 1 , _myLen );
|
theGraphics.rect( 0 , 0 , 1 , _myLen );
|
||||||
if ( isLabel ) {
|
if ( isLabel ) {
|
||||||
_myLabel.draw( theGraphics , 0 , _myLen + 4 , _myParent );
|
_myLabel.draw( theGraphics , 0 , _myLen + 4 , _myParent );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ( ControlP5Constants.VERTICAL ):
|
case ( ControlP5Constants.VERTICAL ):
|
||||||
theGraphics.translate( -_myLen , 0 );
|
theGraphics.translate( -_myDistance - _myLen , 0 );
|
||||||
theGraphics.rect( 0 , 0 , _myLen , 1 );
|
theGraphics.rect( 0 , 0 , _myLen , 1 );
|
||||||
if ( isLabel ) {
|
if ( isLabel ) {
|
||||||
_myLabel.draw( theGraphics , -_myLabel.getWidth( ) , 0 , _myParent );
|
_myLabel.draw( theGraphics , -_myLabel.getWidth( ) , 0 , _myParent );
|
||||||
@ -74,6 +75,10 @@ public class TickMark implements CDrawable {
|
|||||||
_myLen = theLength;
|
_myLen = theLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setDistance( int theDistance) {
|
||||||
|
_myDistance = theDistance;
|
||||||
|
}
|
||||||
|
|
||||||
public Label setLabel( String theLabeltext ) {
|
public Label setLabel( String theLabeltext ) {
|
||||||
if ( _myLabel == null ) {
|
if ( _myLabel == null ) {
|
||||||
_myLabel = new Label( _myParent.cp5 , theLabeltext );
|
_myLabel = new Label( _myParent.cp5 , theLabeltext );
|
||||||
|
Loading…
Reference in New Issue
Block a user