This commit is contained in:
prrace 2026-01-16 14:57:23 -08:00
parent b7346c307f
commit d26d965596
5 changed files with 9 additions and 45 deletions

View File

@ -42,8 +42,6 @@ import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicButtonListener;
import javax.swing.plaf.basic.BasicButtonUI;
import sun.awt.AppContext;
/**
* MotifButton implementation
*
@ -55,20 +53,13 @@ public class MotifButtonUI extends BasicButtonUI {
private boolean defaults_initialized = false;
private static final Object MOTIF_BUTTON_UI_KEY = new Object();
private static final MotifButtonUI MOTIF_BUTTON_UI = new MotifButtonUI();
// ********************************
// Create PLAF
// ********************************
public static ComponentUI createUI(JComponent c) {
AppContext appContext = AppContext.getAppContext();
MotifButtonUI motifButtonUI =
(MotifButtonUI) appContext.get(MOTIF_BUTTON_UI_KEY);
if (motifButtonUI == null) {
motifButtonUI = new MotifButtonUI();
appContext.put(MOTIF_BUTTON_UI_KEY, motifButtonUI);
}
return motifButtonUI;
return MOTIF_BUTTON_UI;
}
// ********************************

View File

@ -30,8 +30,6 @@ import javax.swing.JComponent;
import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
import sun.awt.AppContext;
/**
* MotifCheckBox implementation
*
@ -39,7 +37,7 @@ import sun.awt.AppContext;
*/
public class MotifCheckBoxUI extends MotifRadioButtonUI {
private static final Object MOTIF_CHECK_BOX_UI_KEY = new Object();
private static final MotifCheckBoxUI MOTIF_CHECK_BOX_UI = new MotifCheckBoxUI();
private static final String propertyPrefix = "CheckBox" + ".";
@ -50,14 +48,7 @@ public class MotifCheckBoxUI extends MotifRadioButtonUI {
// Create PLAF
// ********************************
public static ComponentUI createUI(JComponent c) {
AppContext appContext = AppContext.getAppContext();
MotifCheckBoxUI motifCheckBoxUI =
(MotifCheckBoxUI) appContext.get(MOTIF_CHECK_BOX_UI_KEY);
if (motifCheckBoxUI == null) {
motifCheckBoxUI = new MotifCheckBoxUI();
appContext.put(MOTIF_CHECK_BOX_UI_KEY, motifCheckBoxUI);
}
return motifCheckBoxUI;
return MOTIF_CHECK_BOX_UI;
}
@Override

View File

@ -29,8 +29,6 @@ import javax.swing.JComponent;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicLabelUI;
import sun.awt.AppContext;
/**
* A Motif {@literal L&F} implementation of LabelUI.
* This merely sets up new default values in MotifLookAndFeel.
@ -39,16 +37,9 @@ import sun.awt.AppContext;
*/
public class MotifLabelUI extends BasicLabelUI
{
private static final Object MOTIF_LABEL_UI_KEY = new Object();
private static final MotifLabelUI MOTIF_LABEL_UI = new MotifLabelUI();
public static ComponentUI createUI(JComponent c) {
AppContext appContext = AppContext.getAppContext();
MotifLabelUI motifLabelUI =
(MotifLabelUI) appContext.get(MOTIF_LABEL_UI_KEY);
if (motifLabelUI == null) {
motifLabelUI = new MotifLabelUI();
appContext.put(MOTIF_LABEL_UI_KEY, motifLabelUI);
}
return motifLabelUI;
return MOTIF_LABEL_UI;
}
}

View File

@ -39,8 +39,6 @@ import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.UIResource;
import javax.swing.plaf.basic.BasicToggleButtonUI;
import sun.awt.AppContext;
/**
* BasicToggleButton implementation.
*
@ -48,7 +46,7 @@ import sun.awt.AppContext;
*/
public class MotifToggleButtonUI extends BasicToggleButtonUI
{
private static final Object MOTIF_TOGGLE_BUTTON_UI_KEY = new Object();
private static final MotifToggleButtonUI MOTIF_TOGGLE_BUTTON_UI = new MotifToggleButtonUI();
protected Color selectColor;
@ -58,14 +56,7 @@ public class MotifToggleButtonUI extends BasicToggleButtonUI
// Create PLAF
// ********************************
public static ComponentUI createUI(JComponent b) {
AppContext appContext = AppContext.getAppContext();
MotifToggleButtonUI motifToggleButtonUI =
(MotifToggleButtonUI) appContext.get(MOTIF_TOGGLE_BUTTON_UI_KEY);
if (motifToggleButtonUI == null) {
motifToggleButtonUI = new MotifToggleButtonUI();
appContext.put(MOTIF_TOGGLE_BUTTON_UI_KEY, motifToggleButtonUI);
}
return motifToggleButtonUI;
return MOTIF_TOGGLE_BUTTON_UI;
}
// ********************************

View File

@ -150,7 +150,7 @@ public class DefaultMetalTheme extends MetalTheme {
/**
* Returns the ideal font style for the font identified by key.
*/
static int getDefaultFontStyle(int key) {
public static int getDefaultFontStyle(int key) {
if (key != WINDOW_TITLE_FONT) {
Object boldMetal = null;
if (AppContext.getAppContext().get(