@Override protected void setMouseInside( boolean mouseInside ) { super.setMouseInside( mouseInside ); if( !mouseInside ) setMouseOverDropDown( false ); }
/** * Sets the text of this button, some button implementations may ignore the text. * @param text the new text, can be <code>null</code> */ public void setText( String text ){ String oldText = this.text; this.text = text; for( BasicButtonModelListener listener : listeners() ){ listener.textChanged( this, oldText, text ); } changed(); }
public void showTextChanged( ButtonContentFilter filter, Dockable dockable, DockAction action ){ if( (action == null || action == getAction()) && (dockable == null || dockable == getDockable())){ buttonView.updateText(); } } };
public void unbind(){ if( bound ){ bound = false; background.setController( null ); for( BorderHandle handle : borders.values() ){ handle.setController( null ); } model.setController( null ); } }
@Override public void bind() { super.bind(); getAction().addSelectableListener( listener ); getModel().setSelected( getAction().isSelected( getDockable() ) ); }
@Override public Icon getPaintIcon() { return super.getPaintIcon( isEnabled() && isSelectionEnabled() ); }
/** * Gets the icon which should be painted on the view. * @return the icon to paint, can be <code>null</code> */ public Icon getPaintIcon(){ return getPaintIcon( isEnabled() ); }
public void setDockableRepresentation( Dockable dockable ){ if( isBound() ){ getModel().setDockableRepresentative( dockable ); } } }
public void actionPerformed(java.awt.event.ActionEvent e){ if( mousePressed ){ setMousePressed( false ); if( isEnabled() ){ trigger(); } } } });
/** * Called when the left mouse button has been pressed and released within * the {@link #getOwner() owner} and when this model is {@link #isEnabled() enabled}. */ protected void trigger(){ if( trigger != null ){ trigger.triggered(); } for( BasicButtonModelListener listener : listeners() ){ listener.triggered(); } }
/** * Removes any icon that was ever set by {@link #setIcon(ActionContentModifier, Icon)}. */ public void clearIcons(){ for( ActionContentModifier key : getIconContexts() ){ setIcon( key, null ); } }
/** * Sets the <code>selected</code> property. The view may be painted in * a different way dependent on this value. * @param selected the new value */ public void setSelected( boolean selected ) { if( this.selected != selected ){ this.selected = selected; for( BasicButtonModelListener listener : listeners() ){ listener.selectedStateChanged( this, selected ); } changed(); } }
public void setTooltip( String tooltip ){ getModel().setToolTipText( tooltip ); }
public void setOrientation( Orientation orientation ){ getModel().setOrientation( orientation ); }
public ActionContentModifier[] getIconContexts(){ return getModel().getIconContexts(); }
public void setEnabled( boolean enabled ){ getModel().setSelectionEnabled( enabled ); }
public void setOrientation( Orientation orientation ) { getModel().setOrientation( orientation ); }
/** * Gets the {@link Dockable} for which the button is shown. This method may return <code>null</code> * because not every button is connected to a {@link Dockable}. * @return the dockable or <code>null</code> */ public Dockable getDockable(){ if( trigger == null ){ return null; } return trigger.getDockable(); }
public void unbind(){ if( bound ){ bound = false; background.setController( null ); for( BorderHandle handle : borders.values() ){ handle.setController( null ); } model.setController( null ); } }