mirror of
https://github.com/sojamo/controlp5
synced 2024-11-22 05:57:57 +01:00
disabling tooltip
This commit is contained in:
parent
e056913c43
commit
2a516872a8
@ -8,6 +8,7 @@ import static controlP5.Controller.*;
|
||||
public class ControlP5Legacy {
|
||||
|
||||
private ControlP5Base base;
|
||||
public static boolean DEBUG = false;
|
||||
|
||||
void init( ControlP5Base theControlP5 ) {
|
||||
base = theControlP5;
|
||||
@ -56,6 +57,7 @@ public class ControlP5Legacy {
|
||||
}
|
||||
|
||||
public Tooltip addTooltip( ) {
|
||||
println( "Tooltip is not available with this Version (" , ControlP5.VERSION , ") of ControlP5" );
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -542,6 +544,26 @@ public class ControlP5Legacy {
|
||||
return addController( null , "" , theName , theClass , theX , theY );
|
||||
}
|
||||
|
||||
static public void println( final Object ... strs ) {
|
||||
for ( Object str : strs ) {
|
||||
System.out.print( str + " " );
|
||||
}
|
||||
System.out.println( );
|
||||
}
|
||||
|
||||
static public void debug( final Object ... strs ) {
|
||||
if ( DEBUG ) {
|
||||
println( strs );
|
||||
}
|
||||
}
|
||||
|
||||
static public void printerr( final Object ... strs ) {
|
||||
for ( Object str : strs ) {
|
||||
System.err.print( str + " " );
|
||||
}
|
||||
System.err.println( );
|
||||
}
|
||||
|
||||
@Deprecated public Controller< ? > getController( String theName , Object theObject ) {
|
||||
if ( base._myObjectToControllerMap.containsKey( theObject ) ) {
|
||||
ArrayList< ControllerInterface< ? >> cs = base._myObjectToControllerMap.get( theObject );
|
||||
@ -570,27 +592,6 @@ public class ControlP5Legacy {
|
||||
}
|
||||
|
||||
@Deprecated public ControlWindow addControlWindow( final String theName , final int theX , final int theY , final int theWidth , final int theHeight , String theRenderer , int theFrameRate ) {
|
||||
|
||||
// for (int i = 0; i < cp5.controlWindowList.size();
|
||||
// i++) {
|
||||
// if (((ControlWindow)
|
||||
// cp5.controlWindowList.get(i)).name().equals(theWindowName))
|
||||
// {
|
||||
// ControlP5.logger().warning("ControlWindow with name "
|
||||
// + theWindowName +
|
||||
// " already exists. overwriting now.");
|
||||
// }
|
||||
// }
|
||||
// PAppletWindow myPAppletWindow = new
|
||||
// PAppletWindow(cp5, theWindowName, theX, theY,
|
||||
// theWidth, theHeight, theRenderer,
|
||||
// theFrameRate);
|
||||
// myPAppletWindow.setParent(cp5);
|
||||
// myPAppletWindow.setMode(PAppletWindow.ECONOMIC);
|
||||
// ControlWindow myControlWindow = new
|
||||
// ControlWindow(cp5, myPAppletWindow);
|
||||
// cp5.controlWindowList.add(myControlWindow);
|
||||
// return myControlWindow;
|
||||
return addControlWindow( theName );
|
||||
}
|
||||
|
||||
|
@ -17,43 +17,24 @@ import processing.core.PVector;
|
||||
public class Tooltip {
|
||||
|
||||
private ControllerView< ? > _myView;
|
||||
|
||||
private PVector position = new PVector( );
|
||||
|
||||
private PVector currentPosition = new PVector( );
|
||||
|
||||
private PVector previousPosition = new PVector( );
|
||||
|
||||
private PVector offset = new PVector( );
|
||||
|
||||
private Controller< ? > _myController;
|
||||
|
||||
private long startTime = 0;
|
||||
|
||||
private long _myDelayInMillis = 500;
|
||||
|
||||
private int _myMode = ControlP5.INACTIVE;
|
||||
|
||||
private int _myHeight = 20;
|
||||
|
||||
private int _myBackgroundColor = 0xffffffb4;
|
||||
|
||||
private int _myMaxAlpha = 255;
|
||||
|
||||
private int _myAlpha = 0;
|
||||
|
||||
private Map< Controller< ? > , String > map;
|
||||
|
||||
private Label _myLabel;
|
||||
|
||||
private boolean enabled = true;
|
||||
|
||||
private int _myBorder;
|
||||
|
||||
private ControlP5 cp5;
|
||||
|
||||
private int _myAlignH = ControlP5.RIGHT;
|
||||
|
||||
private int _myColor = 0x00000000;
|
||||
|
||||
Tooltip( ControlP5 theControlP5 ) {
|
||||
@ -122,6 +103,7 @@ public class Tooltip {
|
||||
* @param theWindow
|
||||
*/
|
||||
void draw( ControlWindow theWindow ) {
|
||||
/*
|
||||
if ( enabled ) {
|
||||
|
||||
if ( _myMode >= ControlP5.WAIT ) {
|
||||
@ -180,11 +162,7 @@ public class Tooltip {
|
||||
theWindow.papplet( ).pushMatrix( );
|
||||
theWindow.papplet( ).translate( position.x , position.y );
|
||||
theWindow.papplet( ).translate( offset.x , offset.y );
|
||||
/* TODO should request the
|
||||
* current PGraphics element,
|
||||
* not only the PApplet context.
|
||||
* What if we render into a
|
||||
* PGraphics buffer? */
|
||||
// TODO should request the current PGraphics element, not only the PApplet context. What if we render into a PGraphics buffer?
|
||||
_myView.display( theWindow.papplet( ).g , null );
|
||||
theWindow.papplet( ).popMatrix( );
|
||||
}
|
||||
@ -197,6 +175,7 @@ public class Tooltip {
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
private boolean moved( ) {
|
||||
|
Loading…
Reference in New Issue
Block a user