Please look at
http://home.mindspring.com/~hawkwind/dump.zipI have two widgets, one that display due to mouse over, one that shows for a fixed time. Widgets are embedded into a hacked HUDT3DTest. Zip includes some images. Change as needed.

Soo... I have "assimilated" your Widgets. I think the result is a lot easier and more common. Please have a look at org.xith3d.ui.hud.utils.WidgetMover and org.xith3d.ui.hud.utils.MouseHoverWidgetMover. WidgetMover moves any Widget type from its current location to some destination location. MouseHoverWidgetMover reacts on the onMouseEntered and onMouseLeft events and moves the Widget. It has a builtin delay and blocking functionality.
To use the MouseHoverWidgetMover you can use the following code:
class PinnableHeaderWidget extends WindowHeaderWidget
{
private ToggleButton pinner;
public ToggleButton getPinner()
{
return( pinner );
}
protected void init()
{
super.init();
final Tuple2f cbLoc = getWidgetAssembler().getPosition( getCloseButton() );
this.pinner = new ToggleButton( 16f, 16f, 1 );
final Tuple2f threePixels = getContainer().getSizeOfPixels( 3, 3 );
getWidgetAssembler().addWidget( pinner, cbLoc.x - threePixels.x - pinner.getWidth(),
(getHeight() - pinner.getHeight()) / 2f );
}
public PinnableHeaderWidget(float width, float height, String title)
{
super( width, height, title );
}
}
PinnableHeaderWidget headerWidget = new PinnableHeaderWidget( 150f, 20f, "Test" );
Frame f1 = new Frame( 150f, 300f, headerWidget );
f1.setDefaultCloseOperation( null );
this.addWidget( f1, this.getResX() - 30f, 200f );
final MouseHoverWidgetMover widgetMover = new MouseHoverWidgetMover( f1 );
widgetMover.setDestinationLocation( this.getResX() - f1.getWidth() - 10f, f1.getTop() );
widgetMover.setSpeed( 100f );
widgetMover.setMouseLeftDelay( 1000L );
headerWidget.getPinner().addButtonListener( new ButtonListener() {
public void onButtonClicked(Button button, Object userObject)
{
widgetMover.setBlocked( ((ToggleButton)button).isToggled() );
}
} );
This one is the same, but as a Frame extension:
class PinnableSlidingFrame extends Frame
{
private MouseHoverWidgetMover widgetMover;
protected WindowHeaderWidget createHeaderWidget(WindowHeaderWidget.Description headerDesc, String title)
{
return( new WindowHeaderWidget( getWidth(), 20f, headerDesc, title ) {
protected void init()
{
super.init();
final Tuple2f cbLoc = getWidgetAssembler().getPosition( getCloseButton() );
ToggleButton pinner = new ToggleButton( 16f, 16f, 1 );
final Tuple2f threePixels = getContainer().getSizeOfPixels( 3, 3 );
getWidgetAssembler().addWidget( pinner, cbLoc.x - threePixels.x - pinner.getWidth(),
(getHeight() - pinner.getHeight()) / 2f );
pinner.addButtonListener( new ButtonListener() {
public void onButtonClicked(Button button, Object userObject)
{
widgetMover.setBlocked( ((ToggleButton)button).isToggled() );
}
} );
}
} );
}
public PinnableSlidingFrame(float width, float height, float locX, float locY, float destLocX, float destLocY, String title)
{
super( width, height, title );
this.setDefaultCloseOperation( null );
this.setLocation( locX, locY );
this.widgetMover = new MouseHoverWidgetMover( this );
widgetMover.setDestinationLocation( destLocX, destLocY );
widgetMover.setSpeed( 100f );
widgetMover.setMouseLeftDelay( 1000L );
}
}
PinnableSlidingFrame f1 = new PinnableSlidingFrame( 150f, 300f,
this.getResX() - 30f, 200f,
this.getResX() - 160f, 200f,
"Test" );
this.addWidget( f1 );
And this one replaces the close Button:
class PinnableSlidingFrame extends Frame
{
private ToggleButton pinner;
private MouseHoverWidgetMover widgetMover;
protected WindowHeaderWidget createHeaderWidget(WindowHeaderWidget.Description headerDesc, String title)
{
return( new WindowHeaderWidget( getWidth(), 20f, headerDesc, title ) {
protected Button createCloseButton(Description desc)
{
PinnableSlidingFrame.this.pinner = new ToggleButton( 16f, 16f, 1 );
return( pinner );
}
} );
}
protected void onCloseButtonClicked()
{
widgetMover.setBlocked( pinner.isToggled() );
}
public PinnableSlidingFrame(float width, float height, float locX, float locY, float destLocX, float destLocY, String title)
{
super( width, height, title );
this.setLocation( locX, locY );
this.widgetMover = new MouseHoverWidgetMover( this );
widgetMover.setDestinationLocation( destLocX, destLocY );
widgetMover.setSpeed( 100f );
widgetMover.setMouseLeftDelay( 1000L );
}
}
PinnableSlidingFrame f1 = new PinnableSlidingFrame( 150f, 300f,
this.getResX() - 30f, 200f,
this.getResX() - 160f, 200f,
"Test" );
this.addWidget( f1 );
Please tell me, if I missed anything.
Marvin