From 2a516872a837ab65185478507da689b1969521fe Mon Sep 17 00:00:00 2001 From: sojamo Date: Sat, 16 Aug 2014 17:49:39 +0800 Subject: [PATCH] disabling tooltip --- src/controlP5/ControlP5Legacy.java | 43 +++++++++++++++--------------- src/controlP5/Tooltip.java | 27 +++---------------- 2 files changed, 25 insertions(+), 45 deletions(-) diff --git a/src/controlP5/ControlP5Legacy.java b/src/controlP5/ControlP5Legacy.java index 5ba6c83..64e9e57 100644 --- a/src/controlP5/ControlP5Legacy.java +++ b/src/controlP5/ControlP5Legacy.java @@ -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 ); } diff --git a/src/controlP5/Tooltip.java b/src/controlP5/Tooltip.java index 646d0f9..3fac96d 100755 --- a/src/controlP5/Tooltip.java +++ b/src/controlP5/Tooltip.java @@ -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( ) {