|
What this is
Other links
The source code/*
* Sun Public License Notice
*
* The contents of this file are subject to the Sun Public License
* Version 1.0 (the "License"). You may not use this file except in
* compliance with the License. A copy of the License is available at
* http://www.sun.com/
*
* The Original Code is NetBeans. The Initial Developer of the Original
* Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
* Microsystems, Inc. All Rights Reserved.
*/
package org.netbeans.core.windows.services;
import org.openide.util.NbBundle;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ResourceBundle;
// XXX Before as org.netbeans.core.awt.ButtonBarButton;
/** The ButtonBarButton represents a single button on a ButtonBar.
* @author Ian Formanek, Petr Hamernik
* @version 0.23, May 29, 1998
*/
final class ButtonBarButton extends JButton {
/** generated Serialized Version UID */
static final long serialVersionUID = -4251349097612749034L;
/** Bundle - i18n */
static ResourceBundle bundle;
/** Default color of the text of the button when the user moves a mouse over it */
public Color DEFAULT_HIGHLIGHTED = new Color(128, 128, 255);
/** Default color of the text of the button when it is disabled */
public Color DEFAULT_DISABLED = Color.lightGray;
/** Constructs a new ButtonBarButton with label "Button". */ // NOI18N
public ButtonBarButton() {
this(getString("CTL_Button"));
}
/** Constructs a new ButtonBarButton with specified label.
* @param aLabel the label for the button
*/
public ButtonBarButton(String aLabel) {
super (aLabel);
label = aLabel;
// enableEvents(AWTEvent.MOUSE_EVENT_MASK);
// enableEvents(AWTEvent.KEY_EVENT_MASK);
}
/** Called by a ButtonBar to notify this ButtonBarButton that
* it has been added to the ButtonBar.
* @param bat The ButtonBar, this Button has been added to
*/
void attachButton(ButtonBar bar) {
buttonBar = bar;
addActionListener (new ActionListener () {
public void actionPerformed (ActionEvent e) {
buttonBar.buttonPressed(ButtonBarButton.this, e.getModifiers());
}
}
);
}
/** Getter method for the Label property.
* @return Current Label value
*/
public String getText() {
return label;
}
/** Setter method for the Label property.
* @param value New Label value
*/
public void setText(String value) {
label = value;
super.setText (value);
// repaint();
}
/** Getter method for the HighlightedColor property.
* @return Current HighlightedColor value
*/
public Color getHighlightedColor() {
return highlightedColor;
}
/** Setter method for the HighlightedColor property.
* @param value New HighlightedColor value
*/
public void setHighlightedColor(Color value) {
highlightedColor = value;
if (highlighted)
repaint();
}
/** Getter method for the DisabledColor property.
* @return Current DisabledColor value
*/
public Color getDisabledColor() {
return disabledColor;
}
/** Setter method for the DisabledColor property.
* @param value New DisabledColor value
*/
public void setDisabledColor(Color value) {
disabledColor = value;
if (!enabled)
repaint();
}
/** Sets this button to be default. It's included only
* for compatibility. The
|
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.