mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 03:58:21 +00:00
8374493: Add missing @Override annotations in "com.sun.java.swing.plaf.motif" package
Reviewed-by: tr, prr, aivanov
This commit is contained in:
parent
3007365b73
commit
6ad9f4ef68
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -67,6 +67,7 @@ public class MotifBorders {
|
||||
this.lightShadow = lightShadow;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) {
|
||||
g.setColor((isRaised) ? lightShadow : darkShadow);
|
||||
g.drawLine(x, y, x+w-1, y); // top
|
||||
@ -77,6 +78,7 @@ public class MotifBorders {
|
||||
g.drawLine(x+w-1, y+h-1, x+w-1, y+1); // right
|
||||
}
|
||||
|
||||
@Override
|
||||
public Insets getBorderInsets(Component c, Insets insets) {
|
||||
insets.set(1, 1, 1, 1);
|
||||
return insets;
|
||||
@ -99,6 +101,7 @@ public class MotifBorders {
|
||||
this.focus = focus;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) {
|
||||
if (c.hasFocus()) {
|
||||
g.setColor(focus);
|
||||
@ -109,6 +112,7 @@ public class MotifBorders {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Insets getBorderInsets(Component c, Insets insets) {
|
||||
insets.set(1, 1, 1, 1);
|
||||
return insets;
|
||||
@ -130,6 +134,7 @@ public class MotifBorders {
|
||||
this.focus = focus;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) {
|
||||
boolean isPressed = false;
|
||||
boolean hasFocus = false;
|
||||
@ -187,6 +192,7 @@ public class MotifBorders {
|
||||
g.drawLine(bx1+1, by2, bx2, by2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Insets getBorderInsets(Component c, Insets insets) {
|
||||
int thickness = (c instanceof JButton && ((JButton)c).isDefaultCapable())? 8 : 2;
|
||||
insets.set(thickness, thickness, thickness, thickness);
|
||||
@ -202,6 +208,7 @@ public class MotifBorders {
|
||||
super(shadow, highlight, darkShadow, focus);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintBorder(Component c, Graphics g, int x, int y,
|
||||
int width, int height) {
|
||||
if (c instanceof AbstractButton) {
|
||||
@ -223,6 +230,7 @@ public class MotifBorders {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Insets getBorderInsets(Component c, Insets insets) {
|
||||
insets.set(2, 2, 3, 3);
|
||||
return insets;
|
||||
@ -236,6 +244,7 @@ public class MotifBorders {
|
||||
super(shadow, highlight, darkShadow, focus);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
|
||||
if (!(c instanceof JMenuBar)) {
|
||||
return;
|
||||
@ -249,6 +258,7 @@ public class MotifBorders {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Insets getBorderInsets(Component c, Insets insets) {
|
||||
insets.set(6, 6, 6, 6);
|
||||
return insets;
|
||||
@ -297,6 +307,7 @@ public class MotifBorders {
|
||||
return frameShadow;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Insets getBorderInsets(Component c, Insets newInsets) {
|
||||
newInsets.set(BORDER_SIZE, BORDER_SIZE, BORDER_SIZE, BORDER_SIZE);
|
||||
return newInsets;
|
||||
@ -424,6 +435,7 @@ public class MotifBorders {
|
||||
* <b>drawTitleBar</b>, <b>drawLeftBorder</b>, <b>drawRightBorder</b> and
|
||||
* <b>drawBottomBorder</b>.
|
||||
*/
|
||||
@Override
|
||||
public void paintBorder(Component c, Graphics g,
|
||||
int x, int y, int width, int height) {
|
||||
if (isActiveFrame()) {
|
||||
@ -487,6 +499,7 @@ public class MotifBorders {
|
||||
|
||||
/** Draws the InternalFrameBorder's top border.
|
||||
*/
|
||||
@Override
|
||||
protected boolean drawTopBorder(Component c, Graphics g,
|
||||
int x, int y, int width, int height) {
|
||||
if (super.drawTopBorder(c, g, x, y, width, height) &&
|
||||
@ -506,6 +519,7 @@ public class MotifBorders {
|
||||
|
||||
/** Draws the InternalFrameBorder's left border.
|
||||
*/
|
||||
@Override
|
||||
protected boolean drawLeftBorder(Component c, Graphics g, int x, int y,
|
||||
int width, int height) {
|
||||
if (super.drawLeftBorder(c, g, x, y, width, height) &&
|
||||
@ -525,6 +539,7 @@ public class MotifBorders {
|
||||
|
||||
/** Draws the InternalFrameBorder's right border.
|
||||
*/
|
||||
@Override
|
||||
protected boolean drawRightBorder(Component c, Graphics g, int x, int y,
|
||||
int width, int height) {
|
||||
if (super.drawRightBorder(c, g, x, y, width, height) &&
|
||||
@ -545,6 +560,7 @@ public class MotifBorders {
|
||||
|
||||
/** Draws the InternalFrameBorder's bottom border.
|
||||
*/
|
||||
@Override
|
||||
protected boolean drawBottomBorder(Component c, Graphics g, int x, int y,
|
||||
int width, int height) {
|
||||
if (super.drawBottomBorder(c, g, x, y, width, height) &&
|
||||
@ -567,6 +583,7 @@ public class MotifBorders {
|
||||
}
|
||||
|
||||
// Returns true if the associated internal frame has focus.
|
||||
@Override
|
||||
protected boolean isActiveFrame() {
|
||||
return frame.isSelected();
|
||||
}
|
||||
@ -667,6 +684,7 @@ public class MotifBorders {
|
||||
* @param width the width of the painted border
|
||||
* @param height the height of the painted border
|
||||
*/
|
||||
@Override
|
||||
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
|
||||
if (!(c instanceof JPopupMenu)) {
|
||||
return;
|
||||
@ -713,6 +731,7 @@ public class MotifBorders {
|
||||
* @param c the component for which this border insets value applies
|
||||
* @param insets the object to be reinitialized
|
||||
*/
|
||||
@Override
|
||||
public Insets getBorderInsets(Component c, Insets insets) {
|
||||
if (!(c instanceof JPopupMenu)) {
|
||||
return insets;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -42,6 +42,7 @@ public class MotifButtonListener extends BasicButtonListener {
|
||||
super(b);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void checkOpacity(AbstractButton b) {
|
||||
b.setOpaque( false );
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -74,6 +74,7 @@ public class MotifButtonUI extends BasicButtonUI {
|
||||
// ********************************
|
||||
// Create Listeners
|
||||
// ********************************
|
||||
@Override
|
||||
protected BasicButtonListener createButtonListener(AbstractButton b){
|
||||
return new MotifButtonListener(b);
|
||||
}
|
||||
@ -81,6 +82,7 @@ public class MotifButtonUI extends BasicButtonUI {
|
||||
// ********************************
|
||||
// Install Defaults
|
||||
// ********************************
|
||||
@Override
|
||||
public void installDefaults(AbstractButton b) {
|
||||
super.installDefaults(b);
|
||||
if(!defaults_initialized) {
|
||||
@ -90,6 +92,7 @@ public class MotifButtonUI extends BasicButtonUI {
|
||||
LookAndFeel.installProperty(b, "opaque", Boolean.FALSE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void uninstallDefaults(AbstractButton b) {
|
||||
super.uninstallDefaults(b);
|
||||
defaults_initialized = false;
|
||||
@ -106,12 +109,14 @@ public class MotifButtonUI extends BasicButtonUI {
|
||||
// ********************************
|
||||
// Paint Methods
|
||||
// ********************************
|
||||
@Override
|
||||
public void paint(Graphics g, JComponent c) {
|
||||
fillContentArea( g, (AbstractButton)c , c.getBackground() );
|
||||
super.paint(g,c);
|
||||
}
|
||||
|
||||
// Overridden to ensure we don't paint icon over button borders.
|
||||
@Override
|
||||
protected void paintIcon(Graphics g, JComponent c, Rectangle iconRect) {
|
||||
Shape oldClip = g.getClip();
|
||||
Rectangle newClip =
|
||||
@ -127,10 +132,12 @@ public class MotifButtonUI extends BasicButtonUI {
|
||||
g.setClip(oldClip);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void paintFocus(Graphics g, AbstractButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect){
|
||||
// focus painting is handled by the border
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void paintButtonPressed(Graphics g, AbstractButton b) {
|
||||
|
||||
fillContentArea( g, b , selectColor );
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -50,12 +50,14 @@ public class MotifCheckBoxMenuItemUI extends BasicCheckBoxMenuItemUI
|
||||
return new MotifCheckBoxMenuItemUI();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void installListeners() {
|
||||
super.installListeners();
|
||||
changeListener = createChangeListener(menuItem);
|
||||
menuItem.addChangeListener(changeListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void uninstallListeners() {
|
||||
super.uninstallListeners();
|
||||
menuItem.removeChangeListener(changeListener);
|
||||
@ -66,23 +68,28 @@ public class MotifCheckBoxMenuItemUI extends BasicCheckBoxMenuItemUI
|
||||
}
|
||||
|
||||
protected class ChangeHandler implements ChangeListener {
|
||||
@Override
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
JMenuItem c = (JMenuItem)e.getSource();
|
||||
LookAndFeel.installProperty(c, "borderPainted", c.isArmed());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MouseInputListener createMouseInputListener(JComponent c) {
|
||||
return new MouseInputHandler();
|
||||
}
|
||||
|
||||
|
||||
protected class MouseInputHandler implements MouseInputListener {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {}
|
||||
@Override
|
||||
public void mousePressed(MouseEvent e) {
|
||||
MenuSelectionManager manager = MenuSelectionManager.defaultManager();
|
||||
manager.setSelectedPath(getPath());
|
||||
}
|
||||
@Override
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
MenuSelectionManager manager =
|
||||
MenuSelectionManager.defaultManager();
|
||||
@ -99,11 +106,15 @@ public class MotifCheckBoxMenuItemUI extends BasicCheckBoxMenuItemUI
|
||||
manager.processMouseEvent(e);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void mouseEntered(MouseEvent e) {}
|
||||
@Override
|
||||
public void mouseExited(MouseEvent e) {}
|
||||
@Override
|
||||
public void mouseDragged(MouseEvent e) {
|
||||
MenuSelectionManager.defaultManager().processMouseEvent(e);
|
||||
}
|
||||
@Override
|
||||
public void mouseMoved(MouseEvent e) { }
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -60,6 +60,7 @@ public class MotifCheckBoxUI extends MotifRadioButtonUI {
|
||||
return motifCheckBoxUI;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPropertyPrefix() {
|
||||
return propertyPrefix;
|
||||
}
|
||||
@ -67,6 +68,7 @@ public class MotifCheckBoxUI extends MotifRadioButtonUI {
|
||||
// ********************************
|
||||
// Defaults
|
||||
// ********************************
|
||||
@Override
|
||||
public void installDefaults(AbstractButton b) {
|
||||
super.installDefaults(b);
|
||||
if(!defaults_initialized) {
|
||||
@ -75,6 +77,7 @@ public class MotifCheckBoxUI extends MotifRadioButtonUI {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void uninstallDefaults(AbstractButton b) {
|
||||
super.uninstallDefaults(b);
|
||||
defaults_initialized = false;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -65,6 +65,7 @@ public class MotifComboBoxUI extends BasicComboBoxUI implements Serializable {
|
||||
return new MotifComboBoxUI();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void installUI(JComponent c) {
|
||||
super.installUI(c);
|
||||
arrowIcon = new MotifComboBoxArrowIcon(UIManager.getColor("controlHighlight"),
|
||||
@ -72,6 +73,7 @@ public class MotifComboBoxUI extends BasicComboBoxUI implements Serializable {
|
||||
UIManager.getColor("control"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getMinimumSize( JComponent c ) {
|
||||
if ( !isMinimumSizeDirty ) {
|
||||
return new Dimension( cachedMinimumSize );
|
||||
@ -89,6 +91,7 @@ public class MotifComboBoxUI extends BasicComboBoxUI implements Serializable {
|
||||
return size;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ComboPopup createPopup() {
|
||||
return new MotifComboPopup( comboBox );
|
||||
}
|
||||
@ -106,10 +109,12 @@ public class MotifComboBoxUI extends BasicComboBoxUI implements Serializable {
|
||||
/**
|
||||
* Motif combo popup should not track the mouse in the list.
|
||||
*/
|
||||
@Override
|
||||
public MouseMotionListener createListMouseMotionListener() {
|
||||
return new MouseMotionAdapter() {};
|
||||
}
|
||||
|
||||
@Override
|
||||
public KeyListener createKeyListener() {
|
||||
return super.createKeyListener();
|
||||
}
|
||||
@ -121,6 +126,7 @@ public class MotifComboBoxUI extends BasicComboBoxUI implements Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void installComponents() {
|
||||
if ( comboBox.isEditable() ) {
|
||||
addEditor();
|
||||
@ -129,11 +135,13 @@ public class MotifComboBoxUI extends BasicComboBoxUI implements Serializable {
|
||||
comboBox.add( currentValuePane );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void uninstallComponents() {
|
||||
removeEditor();
|
||||
comboBox.removeAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paint(Graphics g, JComponent c) {
|
||||
boolean hasFocus = comboBox.hasFocus();
|
||||
Rectangle r;
|
||||
@ -180,6 +188,7 @@ public class MotifComboBoxUI extends BasicComboBoxUI implements Serializable {
|
||||
currentValuePane.removeAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintCurrentValue(Graphics g,Rectangle bounds,boolean hasFocus) {
|
||||
ListCellRenderer<Object> renderer = comboBox.getRenderer();
|
||||
Component c;
|
||||
@ -226,6 +235,7 @@ public class MotifComboBoxUI extends BasicComboBoxUI implements Serializable {
|
||||
return b;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Rectangle rectangleForCurrentValue() {
|
||||
int width = comboBox.getWidth();
|
||||
int height = comboBox.getHeight();
|
||||
@ -251,11 +261,13 @@ public class MotifComboBoxUI extends BasicComboBoxUI implements Serializable {
|
||||
return arrowIcon.getIconWidth() + (3 * HORIZ_MARGIN) + 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureEditor() {
|
||||
super.configureEditor();
|
||||
editor.setBackground( UIManager.getColor( "text" ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected LayoutManager createLayoutManager() {
|
||||
return new ComboBoxLayoutManager();
|
||||
}
|
||||
@ -273,6 +285,7 @@ public class MotifComboBoxUI extends BasicComboBoxUI implements Serializable {
|
||||
public ComboBoxLayoutManager() {
|
||||
MotifComboBoxUI.this.super();
|
||||
}
|
||||
@Override
|
||||
public void layoutContainer(Container parent) {
|
||||
if ( motifGetEditor() != null ) {
|
||||
Rectangle cvb = rectangleForCurrentValue();
|
||||
@ -298,6 +311,7 @@ public class MotifComboBoxUI extends BasicComboBoxUI implements Serializable {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void paintIcon(Component c, Graphics g, int xo, int yo) {
|
||||
int w = getIconWidth();
|
||||
int h = getIconHeight();
|
||||
@ -322,10 +336,12 @@ public class MotifComboBoxUI extends BasicComboBoxUI implements Serializable {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconWidth() {
|
||||
return 11;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconHeight() {
|
||||
return 11;
|
||||
}
|
||||
@ -336,6 +352,7 @@ public class MotifComboBoxUI extends BasicComboBoxUI implements Serializable {
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
@Override
|
||||
protected PropertyChangeListener createPropertyChangeListener() {
|
||||
return new MotifPropertyChangeListener();
|
||||
}
|
||||
@ -345,6 +362,7 @@ public class MotifComboBoxUI extends BasicComboBoxUI implements Serializable {
|
||||
*/
|
||||
private class MotifPropertyChangeListener
|
||||
extends BasicComboBoxUI.PropertyChangeHandler {
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent e) {
|
||||
super.propertyChange(e);
|
||||
String propertyName = e.getPropertyName();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -74,6 +74,7 @@ public class MotifDesktopIconUI extends BasicDesktopIconUI
|
||||
public MotifDesktopIconUI() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void installDefaults(){
|
||||
super.installDefaults();
|
||||
setDefaultIcon(UIManager.getIcon("DesktopIcon.icon"));
|
||||
@ -94,12 +95,15 @@ public class MotifDesktopIconUI extends BasicDesktopIconUI
|
||||
JLayeredPane.putLayer(desktopIcon, JLayeredPane.getLayer(frame));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void installComponents(){
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void uninstallComponents(){
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void installListeners(){
|
||||
super.installListeners();
|
||||
desktopIconActionListener = createDesktopIconActionListener();
|
||||
@ -149,6 +153,7 @@ public class MotifDesktopIconUI extends BasicDesktopIconUI
|
||||
return new DesktopIconMouseListener();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void uninstallDefaults(){
|
||||
super.uninstallDefaults();
|
||||
desktopIcon.setLayout(null);
|
||||
@ -156,6 +161,7 @@ public class MotifDesktopIconUI extends BasicDesktopIconUI
|
||||
desktopIcon.remove(iconLabel);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void uninstallListeners(){
|
||||
super.uninstallListeners();
|
||||
iconButton.removeActionListener(desktopIconActionListener);
|
||||
@ -163,6 +169,7 @@ public class MotifDesktopIconUI extends BasicDesktopIconUI
|
||||
sysMenuTitlePane.uninstallListeners();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getMinimumSize(JComponent c) {
|
||||
JInternalFrame iframe = desktopIcon.getInternalFrame();
|
||||
|
||||
@ -180,10 +187,12 @@ public class MotifDesktopIconUI extends BasicDesktopIconUI
|
||||
return new Dimension(w, h);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getPreferredSize(JComponent c) {
|
||||
return getMinimumSize(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getMaximumSize(JComponent c){
|
||||
return getMinimumSize(c);
|
||||
}
|
||||
@ -213,26 +222,33 @@ public class MotifDesktopIconUI extends BasicDesktopIconUI
|
||||
|
||||
// Forward mouse events to titlebar for moves.
|
||||
addMouseMotionListener(new MouseMotionListener() {
|
||||
@Override
|
||||
public void mouseDragged(MouseEvent e) {
|
||||
forwardEventToParent(e);
|
||||
}
|
||||
@Override
|
||||
public void mouseMoved(MouseEvent e) {
|
||||
forwardEventToParent(e);
|
||||
}
|
||||
});
|
||||
addMouseListener(new MouseListener() {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
forwardEventToParent(e);
|
||||
}
|
||||
@Override
|
||||
public void mousePressed(MouseEvent e) {
|
||||
forwardEventToParent(e);
|
||||
}
|
||||
@Override
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
forwardEventToParent(e);
|
||||
}
|
||||
@Override
|
||||
public void mouseEntered(MouseEvent e) {
|
||||
forwardEventToParent(e);
|
||||
}
|
||||
@Override
|
||||
public void mouseExited(MouseEvent e) {
|
||||
forwardEventToParent(e);
|
||||
}
|
||||
@ -251,16 +267,19 @@ public class MotifDesktopIconUI extends BasicDesktopIconUI
|
||||
getParent().dispatchEvent(newEvent);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean isFocusTraversable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getMinimumSize() {
|
||||
return new Dimension(defaultIcon.getIconWidth() + 1,
|
||||
LABEL_HEIGHT + LABEL_DIVIDER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getPreferredSize() {
|
||||
String title = frame.getTitle();
|
||||
FontMetrics fm = frame.getFontMetrics(defaultTitleFont);
|
||||
@ -271,6 +290,7 @@ public class MotifDesktopIconUI extends BasicDesktopIconUI
|
||||
return new Dimension(w, LABEL_HEIGHT + LABEL_DIVIDER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paint(Graphics g) {
|
||||
super.paint(g);
|
||||
|
||||
@ -308,28 +328,35 @@ public class MotifDesktopIconUI extends BasicDesktopIconUI
|
||||
this.icon = icon;
|
||||
// Forward mouse events to titlebar for moves.
|
||||
addMouseMotionListener(new MouseMotionListener() {
|
||||
@Override
|
||||
public void mouseDragged(MouseEvent e) {
|
||||
forwardEventToParent(e);
|
||||
}
|
||||
@Override
|
||||
public void mouseMoved(MouseEvent e) {
|
||||
forwardEventToParent(e);
|
||||
}
|
||||
});
|
||||
addMouseListener(new MouseListener() {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
forwardEventToParent(e);
|
||||
}
|
||||
@Override
|
||||
public void mousePressed(MouseEvent e) {
|
||||
forwardEventToParent(e);
|
||||
}
|
||||
@Override
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
if (!systemMenu.isShowing()) {
|
||||
forwardEventToParent(e);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void mouseEntered(MouseEvent e) {
|
||||
forwardEventToParent(e);
|
||||
}
|
||||
@Override
|
||||
public void mouseExited(MouseEvent e) {
|
||||
forwardEventToParent(e);
|
||||
}
|
||||
@ -347,6 +374,7 @@ public class MotifDesktopIconUI extends BasicDesktopIconUI
|
||||
getParent().dispatchEvent(newEvent);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean isFocusTraversable() {
|
||||
return false;
|
||||
@ -355,6 +383,7 @@ public class MotifDesktopIconUI extends BasicDesktopIconUI
|
||||
|
||||
|
||||
protected class DesktopIconActionListener implements ActionListener {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e){
|
||||
systemMenu.show(iconButton, 0, getDesktopIcon().getHeight());
|
||||
}
|
||||
@ -362,6 +391,7 @@ public class MotifDesktopIconUI extends BasicDesktopIconUI
|
||||
|
||||
protected class DesktopIconMouseListener extends MouseAdapter {
|
||||
// if we drag or move we should deengage the popup
|
||||
@Override
|
||||
public void mousePressed(MouseEvent e){
|
||||
if (e.getClickCount() > 1) {
|
||||
try {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -59,6 +59,7 @@ public class MotifDesktopPaneUI extends javax.swing.plaf.basic.BasicDesktopPaneU
|
||||
public MotifDesktopPaneUI() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void installDesktopManager() {
|
||||
desktopManager = desktop.getDesktopManager();
|
||||
if(desktopManager == null) {
|
||||
@ -75,6 +76,7 @@ public class MotifDesktopPaneUI extends javax.swing.plaf.basic.BasicDesktopPaneU
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
@SuppressWarnings("serial") // Superclass is not serializable across versions
|
||||
private static class DragPane extends JComponent {
|
||||
@Override
|
||||
public void paint(Graphics g) {
|
||||
g.setColor(Color.darkGray);
|
||||
g.drawRect(0, 0, getWidth()-1, getHeight()-1);
|
||||
@ -92,6 +94,7 @@ public class MotifDesktopPaneUI extends javax.swing.plaf.basic.BasicDesktopPaneU
|
||||
int iconWidth, iconHeight;
|
||||
|
||||
// PENDING(klobad) this should be optimized
|
||||
@Override
|
||||
public void setBoundsForFrame(JComponent f, int newX, int newY,
|
||||
int newWidth, int newHeight) {
|
||||
if(!usingDragPane) {
|
||||
@ -112,6 +115,7 @@ public class MotifDesktopPaneUI extends javax.swing.plaf.basic.BasicDesktopPaneU
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beginDraggingFrame(JComponent f) {
|
||||
usingDragPane = false;
|
||||
if(f.getParent() instanceof JLayeredPane) {
|
||||
@ -125,10 +129,12 @@ public class MotifDesktopPaneUI extends javax.swing.plaf.basic.BasicDesktopPaneU
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dragFrame(JComponent f, int newX, int newY) {
|
||||
setBoundsForFrame(f, newX, newY, f.getWidth(), f.getHeight());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endDraggingFrame(JComponent f) {
|
||||
if(usingDragPane) {
|
||||
layeredPaneForDragPane.remove(dragPane);
|
||||
@ -143,6 +149,7 @@ public class MotifDesktopPaneUI extends javax.swing.plaf.basic.BasicDesktopPaneU
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beginResizingFrame(JComponent f, int direction) {
|
||||
usingDragPane = false;
|
||||
if(f.getParent() instanceof JLayeredPane) {
|
||||
@ -157,11 +164,13 @@ public class MotifDesktopPaneUI extends javax.swing.plaf.basic.BasicDesktopPaneU
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resizeFrame(JComponent f, int newX, int newY,
|
||||
int newWidth, int newHeight) {
|
||||
setBoundsForFrame(f, newX, newY, newWidth, newHeight);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endResizingFrame(JComponent f) {
|
||||
if(usingDragPane) {
|
||||
JLayeredPane p = (JLayeredPane)f.getParent();
|
||||
@ -172,6 +181,7 @@ public class MotifDesktopPaneUI extends javax.swing.plaf.basic.BasicDesktopPaneU
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void iconifyFrame(JInternalFrame f) {
|
||||
JInternalFrame.JDesktopIcon icon = f.getDesktopIcon();
|
||||
Point p = icon.getLocation();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -55,6 +55,7 @@ public class MotifEditorPaneUI extends BasicEditorPaneUI {
|
||||
*
|
||||
* @return the caret object
|
||||
*/
|
||||
@Override
|
||||
protected Caret createCaret() {
|
||||
return MotifTextUI.createCaret();
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -141,6 +141,7 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
|
||||
super(filechooser);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFileName() {
|
||||
if(filenameTextField != null) {
|
||||
return filenameTextField.getText();
|
||||
@ -149,30 +150,37 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFileName(String filename) {
|
||||
if(filenameTextField != null) {
|
||||
filenameTextField.setText(filename);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDirectoryName() {
|
||||
return pathField.getText();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDirectoryName(String dirname) {
|
||||
pathField.setText(dirname);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ensureFileIsVisible(JFileChooser fc, File f) {
|
||||
// PENDING(jeff)
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rescanCurrentDirectory(JFileChooser fc) {
|
||||
getModel().validateFileCache();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropertyChangeListener createPropertyChangeListener(JFileChooser fc) {
|
||||
return new PropertyChangeListener() {
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent e) {
|
||||
String prop = e.getPropertyName();
|
||||
if(prop.equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) {
|
||||
@ -266,10 +274,12 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
|
||||
return new MotifFileChooserUI((JFileChooser)c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void installUI(JComponent c) {
|
||||
super.installUI(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uninstallUI(JComponent c) {
|
||||
c.removePropertyChangeListener(filterComboBoxModel);
|
||||
approveButton.removeActionListener(getApproveSelectionAction());
|
||||
@ -277,11 +287,13 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
|
||||
super.uninstallUI(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void installComponents(JFileChooser fc) {
|
||||
fc.setLayout(new BorderLayout(10, 10));
|
||||
fc.setAlignmentX(JComponent.CENTER_ALIGNMENT);
|
||||
|
||||
JPanel interior = new JPanel() {
|
||||
@Override
|
||||
public Insets getInsets() {
|
||||
return insets;
|
||||
}
|
||||
@ -305,6 +317,7 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
|
||||
}
|
||||
|
||||
JTextField tmp1 = new JTextField(curDirName, 35) {
|
||||
@Override
|
||||
public Dimension getMaximumSize() {
|
||||
Dimension d = super.getMaximumSize();
|
||||
d.height = getPreferredSize().height;
|
||||
@ -340,6 +353,7 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
|
||||
leftPanel.add(l);
|
||||
|
||||
JComboBox<FileFilter> tmp2 = new JComboBox<FileFilter>() {
|
||||
@Override
|
||||
public Dimension getMaximumSize() {
|
||||
Dimension d = super.getMaximumSize();
|
||||
d.height = getPreferredSize().height;
|
||||
@ -417,6 +431,7 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
|
||||
interior.add(fileNameLabel);
|
||||
|
||||
JTextField tmp3 = new JTextField(35) {
|
||||
@Override
|
||||
public Dimension getMaximumSize() {
|
||||
Dimension d = super.getMaximumSize();
|
||||
d.height = getPreferredSize().height;
|
||||
@ -441,6 +456,7 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
|
||||
buttonPanel.add(Box.createGlue());
|
||||
|
||||
JButton tmp4 = new JButton(getApproveButtonText(fc)) {
|
||||
@Override
|
||||
public Dimension getMaximumSize() {
|
||||
return new Dimension(MAX_SIZE.width, this.getPreferredSize().height);
|
||||
}
|
||||
@ -456,6 +472,7 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
|
||||
buttonPanel.add(Box.createGlue());
|
||||
|
||||
JButton updateButton = new JButton(updateButtonText) {
|
||||
@Override
|
||||
public Dimension getMaximumSize() {
|
||||
return new Dimension(MAX_SIZE.width, this.getPreferredSize().height);
|
||||
}
|
||||
@ -470,6 +487,7 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
|
||||
buttonPanel.add(Box.createGlue());
|
||||
|
||||
JButton cancelButton = new JButton(cancelButtonText) {
|
||||
@Override
|
||||
public Dimension getMaximumSize() {
|
||||
return new Dimension(MAX_SIZE.width, this.getPreferredSize().height);
|
||||
}
|
||||
@ -484,6 +502,7 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
|
||||
buttonPanel.add(Box.createGlue());
|
||||
|
||||
JButton helpButton = new JButton(helpButtonText) {
|
||||
@Override
|
||||
public Dimension getMaximumSize() {
|
||||
return new Dimension(MAX_SIZE.width, this.getPreferredSize().height);
|
||||
}
|
||||
@ -520,6 +539,7 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uninstallComponents(JFileChooser fc) {
|
||||
fc.removeAll();
|
||||
bottomPanel = null;
|
||||
@ -528,6 +548,7 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void installStrings(JFileChooser fc) {
|
||||
super.installStrings(fc);
|
||||
|
||||
@ -555,11 +576,13 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
|
||||
return SwingUtilities2.getUIDefaultsInt(key, l);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void installIcons(JFileChooser fc) {
|
||||
// Since motif doesn't have button icons, leave this empty
|
||||
// which overrides the supertype icon loading
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void uninstallIcons(JFileChooser fc) {
|
||||
// Since motif doesn't have button icons, leave this empty
|
||||
// which overrides the supertype icon loading
|
||||
@ -580,6 +603,7 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
|
||||
fileList.addListSelectionListener(createListSelectionListener(getFileChooser()));
|
||||
fileList.addMouseListener(createDoubleClickListener(getFileChooser(), fileList));
|
||||
fileList.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
JFileChooser chooser = getFileChooser();
|
||||
if (SwingUtilities.isLeftMouseButton(e) && !chooser.isMultiSelectionEnabled()) {
|
||||
@ -650,6 +674,7 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
|
||||
|
||||
@SuppressWarnings("serial") // Superclass is not serializable across versions
|
||||
protected class FileCellRenderer extends DefaultListCellRenderer {
|
||||
@Override
|
||||
public Component getListCellRendererComponent(JList<?> list, Object value, int index,
|
||||
boolean isSelected, boolean cellHasFocus) {
|
||||
|
||||
@ -665,6 +690,7 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
|
||||
|
||||
@SuppressWarnings("serial") // Superclass is not serializable across versions
|
||||
protected class DirectoryCellRenderer extends DefaultListCellRenderer {
|
||||
@Override
|
||||
public Component getListCellRendererComponent(JList<?> list, Object value, int index,
|
||||
boolean isSelected, boolean cellHasFocus) {
|
||||
|
||||
@ -684,18 +710,22 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
|
||||
getModel().addListDataListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSize() {
|
||||
return getModel().getDirectories().size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public File getElementAt(int index) {
|
||||
return getModel().getDirectories().elementAt(index);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void intervalAdded(ListDataEvent e) {
|
||||
fireIntervalAdded(this, e.getIndex0(), e.getIndex1());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void intervalRemoved(ListDataEvent e) {
|
||||
fireIntervalRemoved(this, e.getIndex0(), e.getIndex1());
|
||||
}
|
||||
@ -709,6 +739,7 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
|
||||
|
||||
// PENDING(jeff) - fire the correct interval changed - currently sending
|
||||
// out that everything has changed
|
||||
@Override
|
||||
public void contentsChanged(ListDataEvent e) {
|
||||
fireContentsChanged();
|
||||
}
|
||||
@ -721,6 +752,7 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
|
||||
getModel().addListDataListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSize() {
|
||||
return getModel().getFiles().size();
|
||||
}
|
||||
@ -733,14 +765,17 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
|
||||
return getModel().getFiles().indexOf(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public File getElementAt(int index) {
|
||||
return getModel().getFiles().elementAt(index);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void intervalAdded(ListDataEvent e) {
|
||||
fireIntervalAdded(this, e.getIndex0(), e.getIndex1());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void intervalRemoved(ListDataEvent e) {
|
||||
fireIntervalRemoved(this, e.getIndex0(), e.getIndex1());
|
||||
}
|
||||
@ -753,6 +788,7 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
|
||||
}
|
||||
|
||||
// PENDING(jeff) - fire the interval changed
|
||||
@Override
|
||||
public void contentsChanged(ListDataEvent e) {
|
||||
fireContentsChanged();
|
||||
}
|
||||
@ -779,6 +815,7 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
|
||||
*/
|
||||
@SuppressWarnings("serial") // Superclass is not serializable across versions
|
||||
public class FilterComboBoxRenderer extends DefaultListCellRenderer {
|
||||
@Override
|
||||
public Component getListCellRendererComponent(JList<?> list,
|
||||
Object value, int index, boolean isSelected,
|
||||
boolean cellHasFocus) {
|
||||
@ -805,6 +842,7 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
|
||||
filters = getFileChooser().getChoosableFileFilters();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent e) {
|
||||
String prop = e.getPropertyName();
|
||||
if(prop.equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY)) {
|
||||
@ -815,6 +853,7 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSelectedItem(Object filter) {
|
||||
if(filter != null) {
|
||||
getFileChooser().setFileFilter((FileFilter) filter);
|
||||
@ -822,6 +861,7 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getSelectedItem() {
|
||||
// Ensure that the current filter is in the list.
|
||||
// NOTE: we shouldn't have to do this, since JFileChooser adds
|
||||
@ -843,6 +883,7 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
|
||||
return getFileChooser().getFileFilter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSize() {
|
||||
if(filters != null) {
|
||||
return filters.length;
|
||||
@ -851,6 +892,7 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public FileFilter getElementAt(int index) {
|
||||
if(index > getSize() - 1) {
|
||||
// This shouldn't happen. Try to recover gracefully.
|
||||
@ -864,6 +906,7 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JButton getApproveButton(JFileChooser fc) {
|
||||
return approveButton;
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -93,6 +93,7 @@ public class MotifIconFactory implements Serializable
|
||||
private Color highlight = UIManager.getColor("controlHighlight");
|
||||
private Color lightShadow = UIManager.getColor("controlLightShadow");
|
||||
|
||||
@Override
|
||||
public void paintIcon(Component c, Graphics g, int x, int y) {
|
||||
AbstractButton b = (AbstractButton) c;
|
||||
ButtonModel model = b.getModel();
|
||||
@ -158,10 +159,12 @@ public class MotifIconFactory implements Serializable
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconWidth() {
|
||||
return csize;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconHeight() {
|
||||
return csize;
|
||||
}
|
||||
@ -258,6 +261,7 @@ public class MotifIconFactory implements Serializable
|
||||
private Color highlight = UIManager.getColor("controlHighlight");
|
||||
private Color shadow = UIManager.getColor("controlShadow");
|
||||
|
||||
@Override
|
||||
public void paintIcon(Component c, Graphics g, int x, int y) {
|
||||
// fill interior
|
||||
AbstractButton b = (AbstractButton) c;
|
||||
@ -303,10 +307,12 @@ public class MotifIconFactory implements Serializable
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconWidth() {
|
||||
return 14;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconHeight() {
|
||||
return 14;
|
||||
}
|
||||
@ -315,10 +321,13 @@ public class MotifIconFactory implements Serializable
|
||||
@SuppressWarnings("serial") // Same-version serialization only
|
||||
private static class MenuItemCheckIcon implements Icon, UIResource, Serializable
|
||||
{
|
||||
@Override
|
||||
public void paintIcon(Component c,Graphics g, int x, int y)
|
||||
{
|
||||
}
|
||||
@Override
|
||||
public int getIconWidth() { return 0; }
|
||||
@Override
|
||||
public int getIconHeight() { return 0; }
|
||||
} // end class MenuItemCheckIcon
|
||||
|
||||
@ -326,10 +335,13 @@ public class MotifIconFactory implements Serializable
|
||||
@SuppressWarnings("serial") // Same-version serialization only
|
||||
private static class MenuItemArrowIcon implements Icon, UIResource, Serializable
|
||||
{
|
||||
@Override
|
||||
public void paintIcon(Component c,Graphics g, int x, int y)
|
||||
{
|
||||
}
|
||||
@Override
|
||||
public int getIconWidth() { return 0; }
|
||||
@Override
|
||||
public int getIconHeight() { return 0; }
|
||||
} // end class MenuItemArrowIcon
|
||||
|
||||
@ -340,6 +352,7 @@ public class MotifIconFactory implements Serializable
|
||||
private Color shadow = UIManager.getColor("controlShadow");
|
||||
private Color highlight = UIManager.getColor("controlHighlight");
|
||||
|
||||
@Override
|
||||
public void paintIcon(Component c, Graphics g, int x, int y) {
|
||||
AbstractButton b = (AbstractButton) c;
|
||||
ButtonModel model = b.getModel();
|
||||
@ -414,7 +427,9 @@ public class MotifIconFactory implements Serializable
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public int getIconWidth() { return 10; }
|
||||
@Override
|
||||
public int getIconHeight() { return 10; }
|
||||
} // End class MenuArrowIcon
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -66,20 +66,24 @@ public class MotifInternalFrameTitlePane
|
||||
super(frame);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void installDefaults() {
|
||||
setFont(UIManager.getFont("InternalFrame.titleFont"));
|
||||
setPreferredSize(new Dimension(100, BUTTON_SIZE));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void uninstallListeners() {
|
||||
// Get around protected method in superclass
|
||||
super.uninstallListeners();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyChangeListener createPropertyChangeListener() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected LayoutManager createLayout() {
|
||||
return this;
|
||||
}
|
||||
@ -88,6 +92,7 @@ public class MotifInternalFrameTitlePane
|
||||
return systemMenu;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void assembleSystemMenu() {
|
||||
systemMenu = new JPopupMenu();
|
||||
JMenuItem mi = systemMenu.add(restoreAction);
|
||||
@ -106,12 +111,14 @@ public class MotifInternalFrameTitlePane
|
||||
|
||||
systemButton = new SystemButton();
|
||||
systemButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
systemMenu.show(systemButton, 0, BUTTON_SIZE);
|
||||
}
|
||||
});
|
||||
|
||||
systemButton.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mousePressed(MouseEvent evt) {
|
||||
try {
|
||||
frame.setSelected(true);
|
||||
@ -137,6 +144,7 @@ public class MotifInternalFrameTitlePane
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createButtons() {
|
||||
minimizeButton = new MinimizeButton();
|
||||
minimizeButton.addActionListener(iconifyAction);
|
||||
@ -146,6 +154,7 @@ public class MotifInternalFrameTitlePane
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void addSubComponents() {
|
||||
title = new Title(frame.getTitle());
|
||||
title.setFont(getFont());
|
||||
@ -156,6 +165,7 @@ public class MotifInternalFrameTitlePane
|
||||
add(maximizeButton);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintComponent(Graphics g) {
|
||||
}
|
||||
|
||||
@ -165,9 +175,11 @@ public class MotifInternalFrameTitlePane
|
||||
shadow = s;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
String prop = evt.getPropertyName();
|
||||
JInternalFrame f = (JInternalFrame)evt.getSource();
|
||||
@ -194,16 +206,21 @@ public class MotifInternalFrameTitlePane
|
||||
enableActions();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addLayoutComponent(String name, Component c) {}
|
||||
@Override
|
||||
public void removeLayoutComponent(Component c) {}
|
||||
@Override
|
||||
public Dimension preferredLayoutSize(Container c) {
|
||||
return minimumLayoutSize(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension minimumLayoutSize(Container c) {
|
||||
return new Dimension(100, BUTTON_SIZE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void layoutContainer(Container c) {
|
||||
int w = getWidth();
|
||||
systemButton.setBounds(0, 0, BUTTON_SIZE, BUTTON_SIZE);
|
||||
@ -226,6 +243,7 @@ public class MotifInternalFrameTitlePane
|
||||
title.setBounds(BUTTON_SIZE, 0, x, BUTTON_SIZE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void showSystemMenu(){
|
||||
systemMenu.show(systemButton, 0, BUTTON_SIZE);
|
||||
}
|
||||
@ -245,23 +263,28 @@ public class MotifInternalFrameTitlePane
|
||||
setBorderPainted(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean isFocusTraversable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestFocus() {
|
||||
// ignore request.
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getMinimumSize() {
|
||||
return buttonDimension;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getPreferredSize() {
|
||||
return buttonDimension;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintComponent(Graphics g) {
|
||||
Dimension d = getSize();
|
||||
int maxX = d.width - 1;
|
||||
@ -284,6 +307,7 @@ public class MotifInternalFrameTitlePane
|
||||
|
||||
@SuppressWarnings("serial") // Superclass is not serializable across versions
|
||||
private class MinimizeButton extends FrameButton {
|
||||
@Override
|
||||
public void paintComponent(Graphics g) {
|
||||
super.paintComponent(g);
|
||||
g.setColor(highlight);
|
||||
@ -297,6 +321,7 @@ public class MotifInternalFrameTitlePane
|
||||
|
||||
@SuppressWarnings("serial") // Superclass is not serializable across versions
|
||||
private class MaximizeButton extends FrameButton {
|
||||
@Override
|
||||
public void paintComponent(Graphics g) {
|
||||
super.paintComponent(g);
|
||||
int max = BUTTON_SIZE - 5;
|
||||
@ -312,9 +337,12 @@ public class MotifInternalFrameTitlePane
|
||||
|
||||
@SuppressWarnings("serial") // Superclass is not serializable across versions
|
||||
private class SystemButton extends FrameButton {
|
||||
@Override
|
||||
public boolean isFocusTraversable() { return false; }
|
||||
@Override
|
||||
public void requestFocus() {}
|
||||
|
||||
@Override
|
||||
public void paintComponent(Graphics g) {
|
||||
super.paintComponent(g);
|
||||
g.setColor(highlight);
|
||||
@ -339,26 +367,33 @@ public class MotifInternalFrameTitlePane
|
||||
|
||||
// Forward mouse events to titlebar for moves.
|
||||
addMouseMotionListener(new MouseMotionListener() {
|
||||
@Override
|
||||
public void mouseDragged(MouseEvent e) {
|
||||
forwardEventToParent(e);
|
||||
}
|
||||
@Override
|
||||
public void mouseMoved(MouseEvent e) {
|
||||
forwardEventToParent(e);
|
||||
}
|
||||
});
|
||||
addMouseListener(new MouseListener() {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
forwardEventToParent(e);
|
||||
}
|
||||
@Override
|
||||
public void mousePressed(MouseEvent e) {
|
||||
forwardEventToParent(e);
|
||||
}
|
||||
@Override
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
forwardEventToParent(e);
|
||||
}
|
||||
@Override
|
||||
public void mouseEntered(MouseEvent e) {
|
||||
forwardEventToParent(e);
|
||||
}
|
||||
@Override
|
||||
public void mouseExited(MouseEvent e) {
|
||||
forwardEventToParent(e);
|
||||
}
|
||||
@ -377,6 +412,7 @@ public class MotifInternalFrameTitlePane
|
||||
getParent().dispatchEvent(newEvent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintComponent(Graphics g) {
|
||||
super.paintComponent(g);
|
||||
if (frame.isSelected()) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -81,11 +81,13 @@ public class MotifInternalFrameUI extends BasicInternalFrameUI {
|
||||
super(w);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void installUI(JComponent c) {
|
||||
super.installUI(c);
|
||||
setColors((JInternalFrame)c);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void installDefaults() {
|
||||
Border frameBorder = frame.getBorder();
|
||||
frame.setLayout(internalFrameLayout = createLayoutManager());
|
||||
@ -95,6 +97,7 @@ public class MotifInternalFrameUI extends BasicInternalFrameUI {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void installKeyboardActions(){
|
||||
super.installKeyboardActions();
|
||||
// We replace the
|
||||
@ -103,6 +106,7 @@ public class MotifInternalFrameUI extends BasicInternalFrameUI {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void uninstallDefaults() {
|
||||
LookAndFeel.uninstallBorder(frame);
|
||||
frame.setLayout(null);
|
||||
@ -113,15 +117,18 @@ public class MotifInternalFrameUI extends BasicInternalFrameUI {
|
||||
return frame;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent createNorthPane(JInternalFrame w) {
|
||||
titlePane = new MotifInternalFrameTitlePane(w);
|
||||
return titlePane;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getMaximumSize(JComponent x) {
|
||||
return Toolkit.getDefaultToolkit().getScreenSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void uninstallKeyboardActions(){
|
||||
super.uninstallKeyboardActions();
|
||||
if (isKeyBindingRegistered()){
|
||||
@ -132,6 +139,7 @@ public class MotifInternalFrameUI extends BasicInternalFrameUI {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setupMenuOpenKey(){
|
||||
super.setupMenuOpenKey();
|
||||
ActionMap map = SwingUtilities.getUIActionMap(frame);
|
||||
@ -141,9 +149,11 @@ public class MotifInternalFrameUI extends BasicInternalFrameUI {
|
||||
// titlePane ivar in BasicInternalFrameUI, making supers action throw
|
||||
// an NPE for us.
|
||||
map.put("showSystemMenu", new AbstractAction(){
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e){
|
||||
titlePane.showSystemMenu();
|
||||
}
|
||||
@Override
|
||||
public boolean isEnabled(){
|
||||
return isKeyBindingActive();
|
||||
}
|
||||
@ -151,13 +161,16 @@ public class MotifInternalFrameUI extends BasicInternalFrameUI {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setupMenuCloseKey(){
|
||||
ActionMap map = SwingUtilities.getUIActionMap(frame);
|
||||
if (map != null) {
|
||||
map.put("hideSystemMenu", new AbstractAction(){
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e){
|
||||
titlePane.hideSystemMenu();
|
||||
}
|
||||
@Override
|
||||
public boolean isEnabled(){
|
||||
return isKeyBindingActive();
|
||||
}
|
||||
@ -184,6 +197,7 @@ public class MotifInternalFrameUI extends BasicInternalFrameUI {
|
||||
if (diActionMap == null) {
|
||||
diActionMap = new ActionMapUIResource();
|
||||
diActionMap.put("hideSystemMenu", new AbstractAction(){
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e){
|
||||
JInternalFrame.JDesktopIcon icon = getFrame().
|
||||
getDesktopIcon();
|
||||
@ -191,6 +205,7 @@ public class MotifInternalFrameUI extends BasicInternalFrameUI {
|
||||
getUI();
|
||||
micon.hideSystemMenu();
|
||||
}
|
||||
@Override
|
||||
public boolean isEnabled(){
|
||||
return isKeyBindingActive();
|
||||
}
|
||||
@ -201,12 +216,14 @@ public class MotifInternalFrameUI extends BasicInternalFrameUI {
|
||||
|
||||
/** This method is called when the frame becomes selected.
|
||||
*/
|
||||
@Override
|
||||
protected void activateFrame(JInternalFrame f) {
|
||||
super.activateFrame(f);
|
||||
setColors(f);
|
||||
}
|
||||
/** This method is called when the frame is no longer selected.
|
||||
*/
|
||||
@Override
|
||||
protected void deactivateFrame(JInternalFrame f) {
|
||||
setColors(f);
|
||||
super.deactivateFrame(f);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -56,24 +56,29 @@ import sun.swing.SwingUtilities2;
|
||||
@Deprecated(since="13", forRemoval=true)
|
||||
public class MotifLookAndFeel extends BasicLookAndFeel
|
||||
{
|
||||
@Override
|
||||
public String getName() {
|
||||
return "CDE/Motif";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getID() {
|
||||
return "Motif";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "The CDE/Motif Look and Feel";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isNativeLookAndFeel() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isSupportedLookAndFeel() {
|
||||
return true;
|
||||
}
|
||||
@ -87,6 +92,7 @@ public class MotifLookAndFeel extends BasicLookAndFeel
|
||||
* values, otherwise we create color objects whose values match
|
||||
* the default CDE/Motif colors.
|
||||
*/
|
||||
@Override
|
||||
protected void initSystemColorDefaults(UIDefaults table)
|
||||
{
|
||||
String[] defaultSystemColors = {
|
||||
@ -123,6 +129,7 @@ public class MotifLookAndFeel extends BasicLookAndFeel
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void initClassDefaults(UIDefaults table)
|
||||
{
|
||||
super.initClassDefaults(table);
|
||||
@ -178,6 +185,7 @@ public class MotifLookAndFeel extends BasicLookAndFeel
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void initComponentDefaults(UIDefaults table)
|
||||
{
|
||||
super.initComponentDefaults(table);
|
||||
@ -255,36 +263,42 @@ public class MotifLookAndFeel extends BasicLookAndFeel
|
||||
));
|
||||
|
||||
Object menuItemCheckIcon = new UIDefaults.LazyValue() {
|
||||
@Override
|
||||
public Object createValue(UIDefaults table) {
|
||||
return MotifIconFactory.getMenuItemCheckIcon();
|
||||
}
|
||||
};
|
||||
|
||||
Object menuItemArrowIcon = new UIDefaults.LazyValue() {
|
||||
@Override
|
||||
public Object createValue(UIDefaults table) {
|
||||
return MotifIconFactory.getMenuItemArrowIcon();
|
||||
}
|
||||
};
|
||||
|
||||
Object menuArrowIcon = new UIDefaults.LazyValue() {
|
||||
@Override
|
||||
public Object createValue(UIDefaults table) {
|
||||
return MotifIconFactory.getMenuArrowIcon();
|
||||
}
|
||||
};
|
||||
|
||||
Object checkBoxIcon = new UIDefaults.LazyValue() {
|
||||
@Override
|
||||
public Object createValue(UIDefaults table) {
|
||||
return MotifIconFactory.getCheckBoxIcon();
|
||||
}
|
||||
};
|
||||
|
||||
Object radioButtonIcon = new UIDefaults.LazyValue() {
|
||||
@Override
|
||||
public Object createValue(UIDefaults table) {
|
||||
return MotifIconFactory.getRadioButtonIcon();
|
||||
}
|
||||
};
|
||||
|
||||
Object unselectedTabBackground = new UIDefaults.LazyValue() {
|
||||
@Override
|
||||
public Object createValue(UIDefaults table) {
|
||||
Color c = table.getColor("control");
|
||||
return new ColorUIResource(Math.max((int)(c.getRed()*.85),0),
|
||||
@ -294,6 +308,7 @@ public class MotifLookAndFeel extends BasicLookAndFeel
|
||||
};
|
||||
|
||||
Object unselectedTabForeground = new UIDefaults.LazyValue() {
|
||||
@Override
|
||||
public Object createValue(UIDefaults table) {
|
||||
Color c = table.getColor("controlText");
|
||||
return new ColorUIResource(Math.max((int)(c.getRed()*.85),0),
|
||||
@ -303,6 +318,7 @@ public class MotifLookAndFeel extends BasicLookAndFeel
|
||||
};
|
||||
|
||||
Object unselectedTabShadow = new UIDefaults.LazyValue() {
|
||||
@Override
|
||||
public Object createValue(UIDefaults table) {
|
||||
Color c = table.getColor("control");
|
||||
Color base = new Color(Math.max((int)(c.getRed()*.85),0),
|
||||
@ -313,6 +329,7 @@ public class MotifLookAndFeel extends BasicLookAndFeel
|
||||
};
|
||||
|
||||
Object unselectedTabHighlight = new UIDefaults.LazyValue() {
|
||||
@Override
|
||||
public Object createValue(UIDefaults table) {
|
||||
Color c = table.getColor("control");
|
||||
Color base = new Color(Math.max((int)(c.getRed()*.85),0),
|
||||
@ -462,18 +479,21 @@ public class MotifLookAndFeel extends BasicLookAndFeel
|
||||
"icons/TreeClosed.gif");
|
||||
|
||||
Object treeLeafIcon = new UIDefaults.LazyValue() {
|
||||
@Override
|
||||
public Object createValue(UIDefaults table) {
|
||||
return MotifTreeCellRenderer.loadLeafIcon();
|
||||
}
|
||||
};
|
||||
|
||||
Object treeExpandedIcon = new UIDefaults.LazyValue() {
|
||||
@Override
|
||||
public Object createValue(UIDefaults table) {
|
||||
return MotifTreeUI.MotifExpandedIcon.createExpandedIcon();
|
||||
}
|
||||
};
|
||||
|
||||
Object treeCollapsedIcon = new UIDefaults.LazyValue() {
|
||||
@Override
|
||||
public Object createValue(UIDefaults table) {
|
||||
return MotifTreeUI.MotifCollapsedIcon.createCollapsedIcon();
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -50,12 +50,14 @@ public class MotifMenuItemUI extends BasicMenuItemUI
|
||||
return new MotifMenuItemUI();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void installListeners() {
|
||||
super.installListeners();
|
||||
changeListener = createChangeListener(menuItem);
|
||||
menuItem.addChangeListener(changeListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void uninstallListeners() {
|
||||
super.uninstallListeners();
|
||||
menuItem.removeChangeListener(changeListener);
|
||||
@ -65,12 +67,14 @@ public class MotifMenuItemUI extends BasicMenuItemUI
|
||||
return new ChangeHandler();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MouseInputListener createMouseInputListener(JComponent c) {
|
||||
return new MouseInputHandler();
|
||||
}
|
||||
|
||||
protected class ChangeHandler implements ChangeListener {
|
||||
|
||||
@Override
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
JMenuItem c = (JMenuItem)e.getSource();
|
||||
LookAndFeel.installProperty(c, "borderPainted",
|
||||
@ -79,11 +83,14 @@ public class MotifMenuItemUI extends BasicMenuItemUI
|
||||
}
|
||||
|
||||
protected class MouseInputHandler implements MouseInputListener {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {}
|
||||
@Override
|
||||
public void mousePressed(MouseEvent e) {
|
||||
MenuSelectionManager manager = MenuSelectionManager.defaultManager();
|
||||
manager.setSelectedPath(getPath());
|
||||
}
|
||||
@Override
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
MenuSelectionManager manager =
|
||||
MenuSelectionManager.defaultManager();
|
||||
@ -97,11 +104,15 @@ public class MotifMenuItemUI extends BasicMenuItemUI
|
||||
manager.processMouseEvent(e);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void mouseEntered(MouseEvent e) {}
|
||||
@Override
|
||||
public void mouseExited(MouseEvent e) {}
|
||||
@Override
|
||||
public void mouseDragged(MouseEvent e) {
|
||||
MenuSelectionManager.defaultManager().processMouseEvent(e);
|
||||
}
|
||||
@Override
|
||||
public void mouseMoved(MouseEvent e) { }
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -33,15 +33,19 @@ import javax.swing.MenuSelectionManager;
|
||||
* @author Arnaud Weber
|
||||
*/
|
||||
class MotifMenuMouseListener extends MouseAdapter {
|
||||
@Override
|
||||
public void mousePressed(MouseEvent e) {
|
||||
MenuSelectionManager.defaultManager().processMouseEvent(e);
|
||||
}
|
||||
@Override
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
MenuSelectionManager.defaultManager().processMouseEvent(e);
|
||||
}
|
||||
@Override
|
||||
public void mouseEntered(MouseEvent e) {
|
||||
MenuSelectionManager.defaultManager().processMouseEvent(e);
|
||||
}
|
||||
@Override
|
||||
public void mouseExited(MouseEvent e) {
|
||||
MenuSelectionManager.defaultManager().processMouseEvent(e);
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -33,10 +33,12 @@ import javax.swing.MenuSelectionManager;
|
||||
* @author Arnaud Weber
|
||||
*/
|
||||
class MotifMenuMouseMotionListener implements MouseMotionListener {
|
||||
@Override
|
||||
public void mouseDragged(MouseEvent e) {
|
||||
MenuSelectionManager.defaultManager().processMouseEvent(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseMoved(MouseEvent e) {
|
||||
MenuSelectionManager.defaultManager().processMouseEvent(e);
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -61,6 +61,7 @@ public class MotifMenuUI extends BasicMenuUI
|
||||
// menuItem.removeChangeListener(changeListener);
|
||||
// }
|
||||
|
||||
@Override
|
||||
protected ChangeListener createChangeListener(JComponent c) {
|
||||
return new MotifChangeHandler((JMenu)c, this);
|
||||
}
|
||||
@ -76,6 +77,7 @@ public class MotifMenuUI extends BasicMenuUI
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MouseInputListener createMouseInputListener(JComponent c) {
|
||||
return new MouseInputHandler();
|
||||
}
|
||||
@ -86,6 +88,7 @@ public class MotifMenuUI extends BasicMenuUI
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
JMenuItem c = (JMenuItem)e.getSource();
|
||||
if (c.isArmed() || c.isSelected()) {
|
||||
@ -100,7 +103,9 @@ public class MotifMenuUI extends BasicMenuUI
|
||||
}
|
||||
|
||||
protected class MouseInputHandler implements MouseInputListener {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {}
|
||||
@Override
|
||||
public void mousePressed(MouseEvent e) {
|
||||
MenuSelectionManager manager = MenuSelectionManager.defaultManager();
|
||||
JMenu menu = (JMenu)e.getComponent();
|
||||
@ -129,6 +134,7 @@ public class MotifMenuUI extends BasicMenuUI
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
MenuSelectionManager manager =
|
||||
MenuSelectionManager.defaultManager();
|
||||
@ -139,11 +145,15 @@ public class MotifMenuUI extends BasicMenuUI
|
||||
manager.processMouseEvent(e);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void mouseEntered(MouseEvent e) {}
|
||||
@Override
|
||||
public void mouseExited(MouseEvent e) {}
|
||||
@Override
|
||||
public void mouseDragged(MouseEvent e) {
|
||||
MenuSelectionManager.defaultManager().processMouseEvent(e);
|
||||
}
|
||||
@Override
|
||||
public void mouseMoved(MouseEvent e) { }
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -57,6 +57,7 @@ public class MotifOptionPaneUI extends BasicOptionPaneUI
|
||||
* Creates and returns a Container containing the buttons. The buttons
|
||||
* are created by calling <code>getButtons</code>.
|
||||
*/
|
||||
@Override
|
||||
protected Container createButtonArea() {
|
||||
Container b = super.createButtonArea();
|
||||
|
||||
@ -69,17 +70,21 @@ public class MotifOptionPaneUI extends BasicOptionPaneUI
|
||||
/**
|
||||
* Returns null, CDE/Motif does not impose a minimum size.
|
||||
*/
|
||||
@Override
|
||||
public Dimension getMinimumOptionPaneSize() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Container createSeparator() {
|
||||
return new JPanel() {
|
||||
|
||||
@Override
|
||||
public Dimension getPreferredSize() {
|
||||
return new Dimension(10, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paint(Graphics g) {
|
||||
int width = getWidth();
|
||||
g.setColor(Color.darkGray);
|
||||
@ -95,6 +100,7 @@ public class MotifOptionPaneUI extends BasicOptionPaneUI
|
||||
* <code>getIcon</code> to <code>top</code>. This is messaged from
|
||||
* <code>createMessageArea</code>
|
||||
*/
|
||||
@Override
|
||||
protected void addIcon(Container top) {
|
||||
/* Create the icon. */
|
||||
Icon sideIcon = getIcon();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -55,6 +55,7 @@ public class MotifPasswordFieldUI extends BasicPasswordFieldUI {
|
||||
*
|
||||
* @return the caret object
|
||||
*/
|
||||
@Override
|
||||
protected Caret createCaret() {
|
||||
return MotifTextUI.createCaret();
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -47,6 +47,7 @@ public class MotifPopupMenuSeparatorUI extends MotifSeparatorUI
|
||||
return new MotifPopupMenuSeparatorUI();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paint( Graphics g, JComponent c )
|
||||
{
|
||||
Dimension s = c.getSize();
|
||||
@ -58,6 +59,7 @@ public class MotifPopupMenuSeparatorUI extends MotifSeparatorUI
|
||||
g.drawLine( 0, 1, s.width, 1 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getPreferredSize( JComponent c )
|
||||
{
|
||||
return new Dimension( 0, 2 );
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -61,6 +61,7 @@ public class MotifPopupMenuUI extends BasicPopupMenuUI {
|
||||
/* This has to deal with the fact that the title may be wider than
|
||||
the widest child component.
|
||||
*/
|
||||
@Override
|
||||
public Dimension getPreferredSize(JComponent c) {
|
||||
LayoutManager layout = c.getLayout();
|
||||
Dimension d = layout.preferredLayoutSize(c);
|
||||
@ -94,10 +95,12 @@ public class MotifPopupMenuUI extends BasicPopupMenuUI {
|
||||
|
||||
protected ChangeListener createChangeListener(JPopupMenu m) {
|
||||
return new ChangeListener() {
|
||||
@Override
|
||||
public void stateChanged(ChangeEvent e) {}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean isPopupTrigger(MouseEvent e) {
|
||||
return ((e.getID()==MouseEvent.MOUSE_PRESSED)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -55,12 +55,14 @@ public class MotifRadioButtonMenuItemUI extends BasicRadioButtonMenuItemUI
|
||||
return new MotifRadioButtonMenuItemUI();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void installListeners() {
|
||||
super.installListeners();
|
||||
changeListener = createChangeListener(menuItem);
|
||||
menuItem.addChangeListener(changeListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void uninstallListeners() {
|
||||
super.uninstallListeners();
|
||||
menuItem.removeChangeListener(changeListener);
|
||||
@ -72,23 +74,28 @@ public class MotifRadioButtonMenuItemUI extends BasicRadioButtonMenuItemUI
|
||||
|
||||
@SuppressWarnings("serial") // Same-version serialization only
|
||||
protected class ChangeHandler implements ChangeListener, Serializable {
|
||||
@Override
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
JMenuItem c = (JMenuItem)e.getSource();
|
||||
LookAndFeel.installProperty(c, "borderPainted", c.isArmed());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MouseInputListener createMouseInputListener(JComponent c) {
|
||||
return new MouseInputHandler();
|
||||
}
|
||||
|
||||
|
||||
protected class MouseInputHandler implements MouseInputListener {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {}
|
||||
@Override
|
||||
public void mousePressed(MouseEvent e) {
|
||||
MenuSelectionManager manager = MenuSelectionManager.defaultManager();
|
||||
manager.setSelectedPath(getPath());
|
||||
}
|
||||
@Override
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
MenuSelectionManager manager =
|
||||
MenuSelectionManager.defaultManager();
|
||||
@ -105,11 +112,15 @@ public class MotifRadioButtonMenuItemUI extends BasicRadioButtonMenuItemUI
|
||||
manager.processMouseEvent(e);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void mouseEntered(MouseEvent e) {}
|
||||
@Override
|
||||
public void mouseExited(MouseEvent e) {}
|
||||
@Override
|
||||
public void mouseDragged(MouseEvent e) {
|
||||
MenuSelectionManager.defaultManager().processMouseEvent(e);
|
||||
}
|
||||
@Override
|
||||
public void mouseMoved(MouseEvent e) { }
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -68,6 +68,7 @@ public class MotifRadioButtonUI extends BasicRadioButtonUI {
|
||||
// ********************************
|
||||
// Install Defaults
|
||||
// ********************************
|
||||
@Override
|
||||
public void installDefaults(AbstractButton b) {
|
||||
super.installDefaults(b);
|
||||
if(!defaults_initialized) {
|
||||
@ -76,6 +77,7 @@ public class MotifRadioButtonUI extends BasicRadioButtonUI {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void uninstallDefaults(AbstractButton b) {
|
||||
super.uninstallDefaults(b);
|
||||
defaults_initialized = false;
|
||||
@ -92,6 +94,7 @@ public class MotifRadioButtonUI extends BasicRadioButtonUI {
|
||||
// ********************************
|
||||
// Paint Methods
|
||||
// ********************************
|
||||
@Override
|
||||
protected void paintFocus(Graphics g, Rectangle t, Dimension d){
|
||||
g.setColor(getFocusColor());
|
||||
g.drawRect(0,0,d.width-1,d.height-1);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -64,6 +64,7 @@ public class MotifScrollBarButton extends BasicArrowButton
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Dimension getPreferredSize() {
|
||||
switch (direction) {
|
||||
case NORTH:
|
||||
@ -76,18 +77,22 @@ public class MotifScrollBarButton extends BasicArrowButton
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getMinimumSize() {
|
||||
return getPreferredSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getMaximumSize() {
|
||||
return getPreferredSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFocusTraversable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paint(Graphics g)
|
||||
{
|
||||
int w = getWidth();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -52,6 +52,7 @@ public class MotifScrollBarUI extends BasicScrollBarUI
|
||||
return new MotifScrollBarUI();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getPreferredSize(JComponent c) {
|
||||
Insets insets = c.getInsets();
|
||||
int dx = insets.left + insets.right;
|
||||
@ -61,19 +62,23 @@ public class MotifScrollBarUI extends BasicScrollBarUI
|
||||
: new Dimension(dx + 33, dy + 11);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JButton createDecreaseButton(int orientation) {
|
||||
return new MotifScrollBarButton(orientation);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JButton createIncreaseButton(int orientation) {
|
||||
return new MotifScrollBarButton(orientation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintTrack(Graphics g, JComponent c, Rectangle trackBounds) {
|
||||
g.setColor(trackColor);
|
||||
g.fillRect(trackBounds.x, trackBounds.y, trackBounds.width, trackBounds.height);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds) {
|
||||
if (thumbBounds.isEmpty() || !scrollbar.isEnabled()) {
|
||||
return;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -64,22 +64,27 @@ public class MotifSliderUI extends BasicSliderUI {
|
||||
return new MotifSliderUI((JSlider)b);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getPreferredHorizontalSize() {
|
||||
return PREFERRED_HORIZONTAL_SIZE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getPreferredVerticalSize() {
|
||||
return PREFERRED_VERTICAL_SIZE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getMinimumHorizontalSize() {
|
||||
return MINIMUM_HORIZONTAL_SIZE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getMinimumVerticalSize() {
|
||||
return MINIMUM_VERTICAL_SIZE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Dimension getThumbSize() {
|
||||
if ( slider.getOrientation() == JSlider.HORIZONTAL ) {
|
||||
return new Dimension( 30, 15 );
|
||||
@ -89,12 +94,15 @@ public class MotifSliderUI extends BasicSliderUI {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintFocus(Graphics g) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintTrack(Graphics g) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintThumb(Graphics g) {
|
||||
Rectangle knobBounds = thumbRect;
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -84,6 +84,7 @@ public class MotifSplitPaneDivider extends BasicSplitPaneDivider
|
||||
* overrides to hardcode the size of the divider
|
||||
* PENDING(jeff) - rewrite JSplitPane so that this isn't needed
|
||||
*/
|
||||
@Override
|
||||
public void setDividerSize(int newSize) {
|
||||
Insets insets = getInsets();
|
||||
int borderSize = 0;
|
||||
@ -109,6 +110,7 @@ public class MotifSplitPaneDivider extends BasicSplitPaneDivider
|
||||
*/
|
||||
// PENDING(jeff) - the thumb's location and size is currently hard coded.
|
||||
// It should be dynamic.
|
||||
@Override
|
||||
public void paint(Graphics g) {
|
||||
Color bgColor = getBackground();
|
||||
Dimension size = getSize();
|
||||
@ -179,6 +181,7 @@ public class MotifSplitPaneDivider extends BasicSplitPaneDivider
|
||||
/**
|
||||
* The minimums size is the same as the preferredSize
|
||||
*/
|
||||
@Override
|
||||
public Dimension getMinimumSize() {
|
||||
return getPreferredSize();
|
||||
}
|
||||
@ -187,6 +190,7 @@ public class MotifSplitPaneDivider extends BasicSplitPaneDivider
|
||||
* Sets the SplitPaneUI that is using the receiver. This is completely
|
||||
* overridden from super to create a different MouseHandler.
|
||||
*/
|
||||
@Override
|
||||
public void setBasicSplitPaneUI(BasicSplitPaneUI newUI) {
|
||||
if (splitPane != null) {
|
||||
splitPane.removePropertyChangeListener(this);
|
||||
@ -268,6 +272,7 @@ public class MotifSplitPaneDivider extends BasicSplitPaneDivider
|
||||
* in.
|
||||
*/
|
||||
private class MotifMouseHandler extends MouseHandler {
|
||||
@Override
|
||||
public void mousePressed(MouseEvent e) {
|
||||
// Constrain the mouse pressed to the thumb.
|
||||
if (e.getSource() == MotifSplitPaneDivider.this &&
|
||||
@ -277,6 +282,7 @@ public class MotifSplitPaneDivider extends BasicSplitPaneDivider
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseMoved(MouseEvent e) {
|
||||
if (getDragger() != null) {
|
||||
return;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -51,6 +51,7 @@ public class MotifSplitPaneUI extends BasicSplitPaneUI
|
||||
/**
|
||||
* Creates the default divider.
|
||||
*/
|
||||
@Override
|
||||
public BasicSplitPaneDivider createDefaultDivider() {
|
||||
return new MotifSplitPaneDivider(this);
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -61,6 +61,7 @@ public class MotifTabbedPaneUI extends BasicTabbedPaneUI
|
||||
// UI Installation/De-installation
|
||||
|
||||
|
||||
@Override
|
||||
protected void installDefaults() {
|
||||
super.installDefaults();
|
||||
|
||||
@ -70,6 +71,7 @@ public class MotifTabbedPaneUI extends BasicTabbedPaneUI
|
||||
unselectedTabHighlight = UIManager.getColor("TabbedPane.unselectedTabHighlight");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void uninstallDefaults() {
|
||||
super.uninstallDefaults();
|
||||
|
||||
@ -81,6 +83,7 @@ public class MotifTabbedPaneUI extends BasicTabbedPaneUI
|
||||
|
||||
// UI Rendering
|
||||
|
||||
@Override
|
||||
protected void paintContentBorderTopEdge(Graphics g, int tabPlacement,
|
||||
int selectedIndex,
|
||||
int x, int y, int w, int h) {
|
||||
@ -104,6 +107,7 @@ public class MotifTabbedPaneUI extends BasicTabbedPaneUI
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement,
|
||||
int selectedIndex,
|
||||
int x, int y, int w, int h) {
|
||||
@ -126,6 +130,7 @@ public class MotifTabbedPaneUI extends BasicTabbedPaneUI
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void paintContentBorderRightEdge(Graphics g, int tabPlacement,
|
||||
int selectedIndex,
|
||||
int x, int y, int w, int h) {
|
||||
@ -148,6 +153,7 @@ public class MotifTabbedPaneUI extends BasicTabbedPaneUI
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void paintTabBackground(Graphics g,
|
||||
int tabPlacement, int tabIndex,
|
||||
int x, int y, int w, int h,
|
||||
@ -174,6 +180,7 @@ public class MotifTabbedPaneUI extends BasicTabbedPaneUI
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void paintTabBorder(Graphics g,
|
||||
int tabPlacement, int tabIndex,
|
||||
int x, int y, int w, int h,
|
||||
@ -225,6 +232,7 @@ public class MotifTabbedPaneUI extends BasicTabbedPaneUI
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void paintFocusIndicator(Graphics g, int tabPlacement,
|
||||
Rectangle[] rects, int tabIndex,
|
||||
Rectangle iconRect, Rectangle textRect,
|
||||
@ -263,10 +271,12 @@ public class MotifTabbedPaneUI extends BasicTabbedPaneUI
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getTabRunIndent(int tabPlacement, int run) {
|
||||
return run*3;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getTabRunOverlay(int tabPlacement) {
|
||||
tabRunOverlay = (tabPlacement == LEFT || tabPlacement == RIGHT)?
|
||||
(int)Math.round((float)maxTabWidth * .10) :
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -57,6 +57,7 @@ public class MotifTextAreaUI extends BasicTextAreaUI {
|
||||
*
|
||||
* @return the caret object
|
||||
*/
|
||||
@Override
|
||||
protected Caret createCaret() {
|
||||
return MotifTextUI.createCaret();
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -55,6 +55,7 @@ public class MotifTextFieldUI extends BasicTextFieldUI {
|
||||
*
|
||||
* @return the caret object
|
||||
*/
|
||||
@Override
|
||||
protected Caret createCaret() {
|
||||
return MotifTextUI.createCaret();
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -55,6 +55,7 @@ public class MotifTextPaneUI extends BasicTextPaneUI {
|
||||
*
|
||||
* @return the caret object
|
||||
*/
|
||||
@Override
|
||||
protected Caret createCaret() {
|
||||
return MotifTextUI.createCaret();
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -75,6 +75,7 @@ public class MotifTextUI {
|
||||
* @param e the focus event
|
||||
* @see FocusListener#focusGained
|
||||
*/
|
||||
@Override
|
||||
public void focusGained(FocusEvent e) {
|
||||
super.focusGained(e);
|
||||
getComponent().repaint();
|
||||
@ -88,6 +89,7 @@ public class MotifTextUI {
|
||||
* @param e the focus event
|
||||
* @see FocusListener#focusLost
|
||||
*/
|
||||
@Override
|
||||
public void focusLost(FocusEvent e) {
|
||||
super.focusLost(e);
|
||||
getComponent().repaint();
|
||||
@ -101,6 +103,7 @@ public class MotifTextUI {
|
||||
* @param r the current location of the caret, does nothing if null
|
||||
* @see #paint
|
||||
*/
|
||||
@Override
|
||||
protected void damage(Rectangle r) {
|
||||
if (r != null) {
|
||||
x = r.x - IBeamOverhang - 1;
|
||||
@ -121,6 +124,7 @@ public class MotifTextUI {
|
||||
* @param g the graphics context
|
||||
* @see #damage
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public void paint(Graphics g) {
|
||||
if(isVisible()) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -71,6 +71,7 @@ public class MotifToggleButtonUI extends BasicToggleButtonUI
|
||||
// ********************************
|
||||
// Install Defaults
|
||||
// ********************************
|
||||
@Override
|
||||
public void installDefaults(AbstractButton b) {
|
||||
super.installDefaults(b);
|
||||
if(!defaults_initialized) {
|
||||
@ -80,6 +81,7 @@ public class MotifToggleButtonUI extends BasicToggleButtonUI
|
||||
LookAndFeel.installProperty(b, "opaque", Boolean.FALSE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void uninstallDefaults(AbstractButton b) {
|
||||
super.uninstallDefaults(b);
|
||||
defaults_initialized = false;
|
||||
@ -96,6 +98,7 @@ public class MotifToggleButtonUI extends BasicToggleButtonUI
|
||||
// ********************************
|
||||
// Paint Methods
|
||||
// ********************************
|
||||
@Override
|
||||
protected void paintButtonPressed(Graphics g, AbstractButton b) {
|
||||
if (b.isContentAreaFilled()) {
|
||||
Color oldColor = g.getColor();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -70,6 +70,7 @@ public class MotifTreeCellRenderer extends DefaultTreeCellRenderer
|
||||
highlight = UIManager.getColor("Tree.iconHighlight");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintIcon(Component c, Graphics g, int x, int y) {
|
||||
g.setColor(bg);
|
||||
|
||||
@ -90,10 +91,12 @@ public class MotifTreeCellRenderer extends DefaultTreeCellRenderer
|
||||
g.drawLine(x + 9, y + 8, x + 7, y + 6);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconWidth() {
|
||||
return LEAF_SIZE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconHeight() {
|
||||
return LEAF_SIZE;
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -54,12 +54,14 @@ public class MotifTreeUI extends BasicTreeUI
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void installUI(JComponent c) {
|
||||
super.installUI(c);
|
||||
}
|
||||
|
||||
// BasicTreeUI overrides
|
||||
|
||||
@Override
|
||||
protected void paintVerticalLine( Graphics g, JComponent c, int x, int top, int bottom )
|
||||
{
|
||||
if (tree.getComponentOrientation().isLeftToRight()) {
|
||||
@ -69,6 +71,7 @@ public class MotifTreeUI extends BasicTreeUI
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void paintHorizontalLine( Graphics g, JComponent c, int y, int left, int right )
|
||||
{
|
||||
g.fillRect( left, y, right - left + 1, 2 );
|
||||
@ -96,6 +99,7 @@ public class MotifTreeUI extends BasicTreeUI
|
||||
return new MotifExpandedIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintIcon(Component c, Graphics g, int x, int y) {
|
||||
g.setColor(highlight);
|
||||
g.drawLine(x, y, x+SIZE-1, y);
|
||||
@ -113,7 +117,9 @@ public class MotifTreeUI extends BasicTreeUI
|
||||
g.drawLine(x+3, y+HALF_SIZE, x+SIZE-4, y+HALF_SIZE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconWidth() { return SIZE; }
|
||||
@Override
|
||||
public int getIconHeight() { return SIZE; }
|
||||
}
|
||||
|
||||
@ -126,6 +132,7 @@ public class MotifTreeUI extends BasicTreeUI
|
||||
return new MotifCollapsedIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintIcon(Component c, Graphics g, int x, int y) {
|
||||
super.paintIcon(c, g, x, y);
|
||||
g.drawLine(x + HALF_SIZE-1, y + 3, x + HALF_SIZE-1, y + (SIZE - 4));
|
||||
@ -141,6 +148,7 @@ public class MotifTreeUI extends BasicTreeUI
|
||||
* Returns the default cell renderer that is used to do the
|
||||
* stamping of each node.
|
||||
*/
|
||||
@Override
|
||||
public TreeCellRenderer createDefaultCellRenderer() {
|
||||
return new MotifTreeCellRenderer();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user