mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 03:58:21 +00:00
8372974: Add missing @Override annotations in "com.sun.java.swing.plaf.gtk" package
Reviewed-by: prr
This commit is contained in:
parent
dc1b0b5f81
commit
01adf28c94
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2025, 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
|
||||
@ -122,6 +122,7 @@ class GTKColorChooserPanel extends AbstractColorChooserPanel implements
|
||||
/**
|
||||
* Returns a user presentable description of this GTKColorChooserPane.
|
||||
*/
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return (String)UIManager.get("GTKColorChooserPanel.nameText");
|
||||
}
|
||||
@ -129,6 +130,7 @@ class GTKColorChooserPanel extends AbstractColorChooserPanel implements
|
||||
/**
|
||||
* Returns the mnemonic to use with <code>getDisplayName</code>.
|
||||
*/
|
||||
@Override
|
||||
public int getMnemonic() {
|
||||
String m = (String)UIManager.get("GTKColorChooserPanel.mnemonic");
|
||||
|
||||
@ -145,6 +147,7 @@ class GTKColorChooserPanel extends AbstractColorChooserPanel implements
|
||||
/**
|
||||
* Character to underline that represents the mnemonic.
|
||||
*/
|
||||
@Override
|
||||
public int getDisplayedMnemonicIndex() {
|
||||
String m = (String)UIManager.get(
|
||||
"GTKColorChooserPanel.displayedMnemonicIndex");
|
||||
@ -159,14 +162,17 @@ class GTKColorChooserPanel extends AbstractColorChooserPanel implements
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getSmallDisplayIcon() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getLargeDisplayIcon() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uninstallChooserPanel(JColorChooser enclosingChooser) {
|
||||
super.uninstallChooserPanel(enclosingChooser);
|
||||
removeAll();
|
||||
@ -175,6 +181,7 @@ class GTKColorChooserPanel extends AbstractColorChooserPanel implements
|
||||
/**
|
||||
* Builds and configures the widgets for the GTKColorChooserPanel.
|
||||
*/
|
||||
@Override
|
||||
protected void buildChooser() {
|
||||
triangle = new ColorTriangle();
|
||||
triangle.setName("GTKColorChooserPanel.triangle");
|
||||
@ -307,6 +314,7 @@ class GTKColorChooserPanel extends AbstractColorChooserPanel implements
|
||||
/**
|
||||
* Refreshes the display from the model.
|
||||
*/
|
||||
@Override
|
||||
public void updateChooser() {
|
||||
if (!settingColor) {
|
||||
lastLabel.setBackground(getColorFromModel());
|
||||
@ -490,6 +498,7 @@ class GTKColorChooserPanel extends AbstractColorChooserPanel implements
|
||||
/**
|
||||
* ChangeListener method, updates the necessary display widgets.
|
||||
*/
|
||||
@Override
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
if (settingColor) {
|
||||
return;
|
||||
@ -687,6 +696,7 @@ class GTKColorChooserPanel extends AbstractColorChooserPanel implements
|
||||
return circleY + getIndicatorSize() / 2 - getWheelYOrigin();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void processEvent(AWTEvent e) {
|
||||
|
||||
if (!(getGTKColorChooserPanel().isEnabled())) {
|
||||
@ -741,6 +751,7 @@ class GTKColorChooserPanel extends AbstractColorChooserPanel implements
|
||||
super.processEvent(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintComponent(Graphics g) {
|
||||
super.paintComponent(g);
|
||||
|
||||
@ -1259,6 +1270,7 @@ class GTKColorChooserPanel extends AbstractColorChooserPanel implements
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
ColorTriangle triangle = (ColorTriangle)e.getSource();
|
||||
|
||||
@ -1318,6 +1330,7 @@ class GTKColorChooserPanel extends AbstractColorChooserPanel implements
|
||||
|
||||
@SuppressWarnings("serial") // Superclass is not serializable across versions
|
||||
private static class OpaqueLabel extends JLabel {
|
||||
@Override
|
||||
public boolean isOpaque() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -188,6 +188,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
super(filechooser);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ActionMap createActionMap() {
|
||||
ActionMap map = new ActionMapUIResource();
|
||||
map.put("approveSelection", getApproveSelectionAction());
|
||||
@ -197,6 +198,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public String getFileName() {
|
||||
JFileChooser fc = getFileChooser();
|
||||
@ -243,6 +245,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFileName(String fileName) {
|
||||
if (fileNameTextField != null) {
|
||||
fileNameTextField.setText(fileName);
|
||||
@ -253,18 +256,22 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
// return pathField.getText();
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void setDirectoryName(String dirname) {
|
||||
pathField.setText(dirname);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ensureFileIsVisible(JFileChooser fc, File f) {
|
||||
// PENDING
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rescanCurrentDirectory(JFileChooser fc) {
|
||||
getModel().validateFileCache();
|
||||
}
|
||||
|
||||
@Override
|
||||
public JPanel getAccessoryPanel() {
|
||||
return accessoryPanel;
|
||||
}
|
||||
@ -273,6 +280,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
// * FileView operations *
|
||||
// ***********************
|
||||
|
||||
@Override
|
||||
public FileView getFileView(JFileChooser fc) {
|
||||
return fileView;
|
||||
}
|
||||
@ -282,16 +290,20 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
iconCache = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearIconCache() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getCachedIcon(File f) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cacheIcon(File f, Icon i) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon(File f) {
|
||||
return (f != null && f.isDirectory()) ? directoryIcon : fileIcon;
|
||||
}
|
||||
@ -317,6 +329,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doSelectedFileChanged(PropertyChangeEvent e) {
|
||||
super.doSelectedFileChanged(e);
|
||||
File f = (File) e.getNewValue();
|
||||
@ -325,6 +338,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doDirectoryChanged(PropertyChangeEvent e) {
|
||||
directoryList.clearSelection();
|
||||
ListSelectionModel sm = directoryList.getSelectionModel();
|
||||
@ -357,6 +371,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
super.doDirectoryChanged(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doAccessoryChanged(PropertyChangeEvent e) {
|
||||
if (getAccessoryPanel() != null) {
|
||||
if (e.getOldValue() != null) {
|
||||
@ -374,6 +389,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doFileSelectionModeChanged(PropertyChangeEvent e) {
|
||||
directoryList.clearSelection();
|
||||
rightPanel.setVisible(((Integer)e.getNewValue()).intValue() != JFileChooser.DIRECTORIES_ONLY);
|
||||
@ -381,6 +397,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
super.doFileSelectionModeChanged(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doMultiSelectionChanged(PropertyChangeEvent e) {
|
||||
if (getFileChooser().isMultiSelectionEnabled()) {
|
||||
fileList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
||||
@ -395,6 +412,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
super.doMultiSelectionChanged(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doControlButtonsChanged(PropertyChangeEvent e) {
|
||||
super.doControlButtonsChanged(e);
|
||||
|
||||
@ -407,6 +425,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
updateDefaultButton();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doAncestorChanged(PropertyChangeEvent e) {
|
||||
if (e.getOldValue() == null && e.getNewValue() != null) {
|
||||
// Ancestor was added, set initial focus
|
||||
@ -424,6 +443,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
// ************ Create Listeners **************
|
||||
// ********************************************
|
||||
|
||||
@Override
|
||||
public ListSelectionListener createListSelectionListener(JFileChooser fc) {
|
||||
return new SelectionListener();
|
||||
}
|
||||
@ -434,6 +454,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
|
||||
if (!getFileChooser().isEnabled()) {
|
||||
@ -464,6 +485,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseEntered(MouseEvent evt) {
|
||||
if (list != null) {
|
||||
TransferHandler th1 = getFileChooser().getTransferHandler();
|
||||
@ -478,6 +500,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MouseListener createDoubleClickListener(JFileChooser fc, JList<?> list) {
|
||||
return new DoubleClickListener(list);
|
||||
}
|
||||
@ -486,6 +509,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
protected class SelectionListener implements ListSelectionListener {
|
||||
@Override
|
||||
public void valueChanged(ListSelectionEvent e) {
|
||||
if (!e.getValueIsAdjusting()) {
|
||||
JFileChooser chooser = getFileChooser();
|
||||
@ -547,6 +571,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
return new GTKFileChooserUI((JFileChooser)c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void installUI(JComponent c) {
|
||||
accessoryPanel = new JPanel(new BorderLayout(10, 10));
|
||||
accessoryPanel.setName("GTKFileChooser.accessoryPanel");
|
||||
@ -554,6 +579,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
super.installUI(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uninstallUI(JComponent c) {
|
||||
c.removePropertyChangeListener(filterComboBoxModel);
|
||||
super.uninstallUI(c);
|
||||
@ -565,6 +591,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
getFileChooser().removeAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void installComponents(JFileChooser fc) {
|
||||
super.installComponents(fc);
|
||||
|
||||
@ -623,6 +650,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
|
||||
JPanel comboBoxPanel = new JPanel(new FlowLayout(FlowLayout.CENTER,
|
||||
0, 0) {
|
||||
@Override
|
||||
public void layoutContainer(Container target) {
|
||||
super.layoutContainer(target);
|
||||
JComboBox<?> comboBox = directoryComboBox;
|
||||
@ -733,6 +761,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
curDirName = currentDirectory.getPath();
|
||||
}
|
||||
JLabel tmp = new JLabel(curDirName) {
|
||||
@Override
|
||||
public Dimension getMaximumSize() {
|
||||
Dimension d = super.getMaximumSize();
|
||||
d.height = getPreferredSize().height;
|
||||
@ -747,6 +776,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
|
||||
// add the fileName field
|
||||
JTextField tmp2 = new JTextField() {
|
||||
@Override
|
||||
public Dimension getMaximumSize() {
|
||||
Dimension d = super.getMaximumSize();
|
||||
d.height = getPreferredSize().height;
|
||||
@ -811,6 +841,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void installListeners(JFileChooser fc) {
|
||||
super.installListeners(fc);
|
||||
|
||||
@ -822,6 +853,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
return SwingUtilities2.getUIDefaultsInt(key, l);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void uninstallListeners(JFileChooser fc) {
|
||||
super.uninstallListeners(fc);
|
||||
|
||||
@ -831,6 +863,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
}
|
||||
|
||||
private class GTKFCPropertyChangeListener implements PropertyChangeListener {
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent e) {
|
||||
String prop = e.getPropertyName();
|
||||
if (prop.equals("GTKFileChooser.showDirectoryIcons")) {
|
||||
@ -841,6 +874,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void installDefaults(JFileChooser fc) {
|
||||
super.installDefaults(fc);
|
||||
readOnly = UIManager.getBoolean("FileChooser.readOnly");
|
||||
@ -850,11 +884,13 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
Boolean.TRUE.equals(fc.getClientProperty("GTKFileChooser.showFileIcons"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void installIcons(JFileChooser fc) {
|
||||
directoryIcon = UIManager.getIcon("FileView.directoryIcon");
|
||||
fileIcon = UIManager.getIcon("FileView.fileIcon");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void installStrings(JFileChooser fc) {
|
||||
super.installStrings(fc);
|
||||
|
||||
@ -894,6 +930,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
filterLabelMnemonic = UIManager.getInt("FileChooser.filterLabelMnemonic");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void uninstallStrings(JFileChooser fc) {
|
||||
super.uninstallStrings(fc);
|
||||
|
||||
@ -972,14 +1009,17 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
return scrollpane;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createModel() {
|
||||
model = new GTKDirectoryModel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BasicDirectoryModel getModel() {
|
||||
return model;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Action getApproveSelectionAction() {
|
||||
return approveSelectionAction;
|
||||
}
|
||||
@ -990,6 +1030,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
super(getFileChooser());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void sort(Vector<? extends File> v) {
|
||||
FileSystemView fsv = getFileChooser().getFileSystemView();
|
||||
if (fsv == null) {
|
||||
@ -1028,6 +1069,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
directoryChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSize() {
|
||||
return getModel().getDirectories().size() + 1;
|
||||
}
|
||||
@ -1038,10 +1080,12 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
curDir;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void intervalAdded(ListDataEvent e) {
|
||||
fireIntervalAdded(this, e.getIndex0(), e.getIndex1());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void intervalRemoved(ListDataEvent e) {
|
||||
fireIntervalRemoved(this, e.getIndex0(), e.getIndex1());
|
||||
}
|
||||
@ -1055,6 +1099,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
|
||||
// PENDING - fire the correct interval changed - currently sending
|
||||
// out that everything has changed
|
||||
@Override
|
||||
public void contentsChanged(ListDataEvent e) {
|
||||
fireContentsChanged();
|
||||
}
|
||||
@ -1071,6 +1116,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
getModel().addListDataListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSize() {
|
||||
return getModel().getFiles().size();
|
||||
}
|
||||
@ -1088,10 +1134,12 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
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());
|
||||
}
|
||||
@ -1104,6 +1152,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
}
|
||||
|
||||
// PENDING - fire the interval changed
|
||||
@Override
|
||||
public void contentsChanged(ListDataEvent e) {
|
||||
fireContentsChanged();
|
||||
}
|
||||
@ -1112,6 +1161,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
|
||||
@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) {
|
||||
|
||||
@ -1129,6 +1179,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
|
||||
@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) {
|
||||
|
||||
@ -1178,6 +1229,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
c.setAlignmentY(JComponent.TOP_ALIGNMENT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Action getNewFolderAction() {
|
||||
if (newFolderAction == null) {
|
||||
newFolderAction = new NewFolderAction();
|
||||
@ -1252,15 +1304,18 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
setSelectedItem(canonical);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSelectedItem(Object selectedDirectory) {
|
||||
this.selectedDirectory = (File)selectedDirectory;
|
||||
fireContentsChanged(this, -1, -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getSelectedItem() {
|
||||
return selectedDirectory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSize() {
|
||||
return directories.size();
|
||||
}
|
||||
@ -1280,6 +1335,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
super("DirectoryComboBoxAction");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
File f = (File)directoryComboBox.getSelectedItem();
|
||||
getFileChooser().setCurrentDirectory(f);
|
||||
@ -1294,6 +1350,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
protected NewFolderAction() {
|
||||
super(FilePane.ACTION_NEW_FOLDER);
|
||||
}
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (readOnly) {
|
||||
return;
|
||||
@ -1327,6 +1384,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
|
||||
@SuppressWarnings("serial") // Superclass is not serializable across versions
|
||||
private class GTKApproveSelectionAction extends ApproveSelectionAction {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (isDirectorySelected()) {
|
||||
File dir = getDirectory();
|
||||
@ -1362,6 +1420,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
protected RenameFileAction() {
|
||||
super(FilePane.ACTION_EDIT_FILE_NAME);
|
||||
}
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (getFileName().isEmpty()) {
|
||||
return;
|
||||
@ -1405,6 +1464,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
*/
|
||||
@SuppressWarnings("serial") // Superclass is not serializable across versions
|
||||
public class FilterComboBoxRenderer extends DefaultListCellRenderer {
|
||||
@Override
|
||||
public String getName() {
|
||||
// As SynthComboBoxRenderer's are asked for a size BEFORE they
|
||||
// are parented getName is overridden to force the name to be
|
||||
@ -1417,6 +1477,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Component getListCellRendererComponent(JList<?> list, Object value,
|
||||
int index, boolean isSelected,
|
||||
boolean cellHasFocus) {
|
||||
@ -1457,6 +1518,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
filters = getFileChooser().getChoosableFileFilters();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent e) {
|
||||
String prop = e.getPropertyName();
|
||||
if (prop == JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) {
|
||||
@ -1467,6 +1529,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSelectedItem(Object filter) {
|
||||
if (filter != null) {
|
||||
getFileChooser().setFileFilter((FileFilter) filter);
|
||||
@ -1474,6 +1537,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getSelectedItem() {
|
||||
// Ensure that the current filter is in the list.
|
||||
// NOTE: we shouldn't have to do this, since JFileChooser adds
|
||||
@ -1495,6 +1559,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
return getFileChooser().getFileFilter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSize() {
|
||||
if (filters != null) {
|
||||
return filters.length;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2025, 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
|
||||
@ -41,6 +41,7 @@ import sun.swing.MnemonicHandler;
|
||||
* @author Joshua Outwater
|
||||
*/
|
||||
class GTKGraphicsUtils extends SynthGraphicsUtils {
|
||||
@Override
|
||||
public void paintText(SynthContext context, Graphics g, String text,
|
||||
int x, int y, int mnemonicIndex) {
|
||||
if (text == null || text.length() <= 0) {
|
||||
@ -83,6 +84,7 @@ class GTKGraphicsUtils extends SynthGraphicsUtils {
|
||||
* @param bounds Bounds of the text to be drawn.
|
||||
* @param mnemonicIndex Index to draw string at.
|
||||
*/
|
||||
@Override
|
||||
public void paintText(SynthContext context, Graphics g, String text,
|
||||
Rectangle bounds, int mnemonicIndex) {
|
||||
if (text == null || text.length() <= 0) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2025, 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
|
||||
@ -163,6 +163,7 @@ class GTKIconFactory {
|
||||
this.method = methodName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintIcon(SynthContext context, Graphics g,
|
||||
int x, int y, int w, int h) {
|
||||
if (context != null) {
|
||||
@ -171,10 +172,12 @@ class GTKIconFactory {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconWidth(SynthContext context) {
|
||||
return getIconDimension(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconHeight(SynthContext context) {
|
||||
return getIconDimension(context);
|
||||
}
|
||||
@ -248,6 +251,7 @@ class GTKIconFactory {
|
||||
super(method);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintIcon(SynthContext context, Graphics g, int x, int y,
|
||||
int w, int h) {
|
||||
if (context != null) {
|
||||
@ -256,6 +260,7 @@ class GTKIconFactory {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
int getIconDimension(SynthContext context) {
|
||||
updateSizeIfNecessary(context);
|
||||
return (iconDimension == -1) ? DEFAULT_ICON_SIZE :
|
||||
@ -285,10 +290,12 @@ class GTKIconFactory {
|
||||
super(TOOL_BAR_HANDLE_ICON);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<?>[] getMethodParamTypes() {
|
||||
return PARAM_TYPES;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintIcon(SynthContext context, Graphics g, int x, int y,
|
||||
int w, int h) {
|
||||
if (context != null) {
|
||||
@ -309,6 +316,7 @@ class GTKIconFactory {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconWidth(SynthContext context) {
|
||||
if (context == null) {
|
||||
return 10;
|
||||
@ -321,6 +329,7 @@ class GTKIconFactory {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconHeight(SynthContext context) {
|
||||
if (context == null) {
|
||||
return 10;
|
||||
@ -344,10 +353,12 @@ class GTKIconFactory {
|
||||
super(MENU_ARROW_ICON);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<?>[] getMethodParamTypes() {
|
||||
return PARAM_TYPES;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintIcon(SynthContext context, Graphics g, int x, int y,
|
||||
int w, int h) {
|
||||
if (context != null) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2025, 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
|
||||
@ -261,6 +261,7 @@ public class GTKLookAndFeel extends SynthLookAndFeel {
|
||||
region == Region.TREE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UIDefaults getDefaults() {
|
||||
// We need to call super for basic's properties file.
|
||||
UIDefaults table = super.getDefaults();
|
||||
@ -301,6 +302,7 @@ public class GTKLookAndFeel extends SynthLookAndFeel {
|
||||
"com.sun.java.swing.plaf.gtk.resources.gtk");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initComponentDefaults(UIDefaults table) {
|
||||
// For compatibility with apps expecting certain defaults we'll
|
||||
// populate the table with the values from basic.
|
||||
@ -511,6 +513,7 @@ public class GTKLookAndFeel extends SynthLookAndFeel {
|
||||
FontLazyValue(Region region) {
|
||||
this.region = region;
|
||||
}
|
||||
@Override
|
||||
public Object createValue(UIDefaults table) {
|
||||
SynthStyleFactory factory = getStyleFactory();
|
||||
GTKStyle style = (GTKStyle)factory.getStyle(null, region);
|
||||
@ -556,6 +559,7 @@ public class GTKLookAndFeel extends SynthLookAndFeel {
|
||||
|
||||
"ColorChooser.showPreviewPanelText", Boolean.FALSE,
|
||||
"ColorChooser.panels", new UIDefaults.ActiveValue() {
|
||||
@Override
|
||||
public Object createValue(UIDefaults table) {
|
||||
return new AbstractColorChooserPanel[] {
|
||||
new GTKColorChooserPanel() };
|
||||
@ -1168,6 +1172,7 @@ public class GTKLookAndFeel extends SynthLookAndFeel {
|
||||
|
||||
"TitledBorder.titleColor", controlText,
|
||||
"TitledBorder.border", new UIDefaults.LazyValue() {
|
||||
@Override
|
||||
public Object createValue(UIDefaults table) {
|
||||
return new GTKPainter.TitledBorder();
|
||||
}
|
||||
@ -1184,6 +1189,7 @@ public class GTKLookAndFeel extends SynthLookAndFeel {
|
||||
|
||||
"ToolBar.separatorSize", new DimensionUIResource(10, 10),
|
||||
"ToolBar.handleIcon", new UIDefaults.ActiveValue() {
|
||||
@Override
|
||||
public Object createValue(UIDefaults table) {
|
||||
return GTKIconFactory.getToolBarHandleIcon();
|
||||
}
|
||||
@ -1312,6 +1318,7 @@ public class GTKLookAndFeel extends SynthLookAndFeel {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initSystemColorDefaults(UIDefaults table) {
|
||||
SynthStyleFactory factory = getStyleFactory();
|
||||
GTKStyle windowStyle =
|
||||
@ -1492,6 +1499,7 @@ public class GTKLookAndFeel extends SynthLookAndFeel {
|
||||
|
||||
public String getKey() { return key; }
|
||||
|
||||
@Override
|
||||
public void propertyChange(final PropertyChangeEvent pce) {
|
||||
final GTKLookAndFeel lnf = get();
|
||||
|
||||
@ -1504,6 +1512,7 @@ public class GTKLookAndFeel extends SynthLookAndFeel {
|
||||
// We are using invokeLater here because we are getting called
|
||||
// on the AWT-Motif thread which can cause a deadlock.
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String name = pce.getPropertyName();
|
||||
/* We are listening for GTK desktop text AA settings:
|
||||
@ -1531,30 +1540,36 @@ public class GTKLookAndFeel extends SynthLookAndFeel {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSupportedLookAndFeel() {
|
||||
Toolkit toolkit = Toolkit.getDefaultToolkit();
|
||||
return (toolkit instanceof SunToolkit &&
|
||||
((SunToolkit)toolkit).isNativeGTKAvailable());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNativeLookAndFeel() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "GTK look and feel";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "GTK look and feel";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getID() {
|
||||
return "GTK";
|
||||
}
|
||||
|
||||
// Subclassed to pass in false to the superclass, we don't want to try
|
||||
// and load the system colors.
|
||||
@Override
|
||||
protected void loadSystemColors(UIDefaults table, String[] systemColors, boolean useNative) {
|
||||
super.loadSystemColors(table, systemColors, false);
|
||||
}
|
||||
@ -1663,6 +1678,7 @@ public class GTKLookAndFeel extends SynthLookAndFeel {
|
||||
* <code>SynthStyles</code> from the <code>SynthStyleFactory</code>
|
||||
* when the ancestor changed.
|
||||
*/
|
||||
@Override
|
||||
public boolean shouldUpdateStyleOnAncestorChanged() {
|
||||
return true;
|
||||
}
|
||||
@ -1670,6 +1686,7 @@ public class GTKLookAndFeel extends SynthLookAndFeel {
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public LayoutStyle getLayoutStyle() {
|
||||
return GnomeLayoutStyle.INSTANCE;
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2025, 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
|
||||
@ -77,17 +77,20 @@ class GTKPainter extends SynthPainter {
|
||||
context.getComponent().getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintCheckBoxBackground(SynthContext context,
|
||||
Graphics g, int x, int y, int w, int h) {
|
||||
paintRadioButtonBackground(context, g, x, y, w, h);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintCheckBoxMenuItemBackground(SynthContext context,
|
||||
Graphics g, int x, int y, int w, int h) {
|
||||
paintRadioButtonMenuItemBackground(context, g, x, y, w, h);
|
||||
}
|
||||
|
||||
// FORMATTED_TEXT_FIELD
|
||||
@Override
|
||||
public void paintFormattedTextFieldBackground(SynthContext context,
|
||||
Graphics g, int x, int y,
|
||||
int w, int h) {
|
||||
@ -97,6 +100,7 @@ class GTKPainter extends SynthPainter {
|
||||
//
|
||||
// TOOL_BAR_DRAG_WINDOW
|
||||
//
|
||||
@Override
|
||||
public void paintToolBarDragWindowBackground(SynthContext context,
|
||||
Graphics g, int x, int y,
|
||||
int w, int h) {
|
||||
@ -107,6 +111,7 @@ class GTKPainter extends SynthPainter {
|
||||
//
|
||||
// TOOL_BAR
|
||||
//
|
||||
@Override
|
||||
public void paintToolBarBackground(SynthContext context,
|
||||
Graphics g, int x, int y,
|
||||
int w, int h) {
|
||||
@ -126,6 +131,7 @@ class GTKPainter extends SynthPainter {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintToolBarContentBackground(SynthContext context,
|
||||
Graphics g,
|
||||
int x, int y, int w, int h) {
|
||||
@ -144,6 +150,7 @@ class GTKPainter extends SynthPainter {
|
||||
//
|
||||
// PASSWORD_FIELD
|
||||
//
|
||||
@Override
|
||||
public void paintPasswordFieldBackground(SynthContext context,
|
||||
Graphics g, int x, int y,
|
||||
int w, int h) {
|
||||
@ -153,6 +160,7 @@ class GTKPainter extends SynthPainter {
|
||||
//
|
||||
// TEXT_FIELD
|
||||
//
|
||||
@Override
|
||||
public void paintTextFieldBackground(SynthContext context, Graphics g,
|
||||
int x, int y, int w, int h) {
|
||||
if (getName(context) == "Tree.cellEditor") {
|
||||
@ -166,6 +174,7 @@ class GTKPainter extends SynthPainter {
|
||||
// RADIO_BUTTON
|
||||
//
|
||||
// NOTE: this is called for JCheckBox too
|
||||
@Override
|
||||
public void paintRadioButtonBackground(SynthContext context,
|
||||
Graphics g, int x, int y,
|
||||
int w, int h) {
|
||||
@ -204,6 +213,7 @@ class GTKPainter extends SynthPainter {
|
||||
// RADIO_BUTTON_MENU_ITEM
|
||||
//
|
||||
// NOTE: this is called for JCheckBoxMenuItem too
|
||||
@Override
|
||||
public void paintRadioButtonMenuItemBackground(SynthContext context,
|
||||
Graphics g, int x, int y,
|
||||
int w, int h) {
|
||||
@ -218,6 +228,7 @@ class GTKPainter extends SynthPainter {
|
||||
//
|
||||
// LABEL
|
||||
//
|
||||
@Override
|
||||
public void paintLabelBackground(SynthContext context,
|
||||
Graphics g, int x, int y,
|
||||
int w, int h) {
|
||||
@ -247,6 +258,7 @@ class GTKPainter extends SynthPainter {
|
||||
//
|
||||
// INTERNAL_FRAME
|
||||
//
|
||||
@Override
|
||||
public void paintInternalFrameBorder(SynthContext context,
|
||||
Graphics g, int x, int y,
|
||||
int w, int h) {
|
||||
@ -256,6 +268,7 @@ class GTKPainter extends SynthPainter {
|
||||
//
|
||||
// DESKTOP_PANE
|
||||
//
|
||||
@Override
|
||||
public void paintDesktopPaneBackground(SynthContext context,
|
||||
Graphics g, int x, int y,
|
||||
int w, int h) {
|
||||
@ -266,12 +279,14 @@ class GTKPainter extends SynthPainter {
|
||||
//
|
||||
// DESKTOP_ICON
|
||||
//
|
||||
@Override
|
||||
public void paintDesktopIconBorder(SynthContext context,
|
||||
Graphics g, int x, int y,
|
||||
int w, int h) {
|
||||
Metacity.INSTANCE.paintFrameBorder(context, g, x, y, w, h);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintButtonBackground(SynthContext context, Graphics g,
|
||||
int x, int y, int w, int h) {
|
||||
String name = getName(context);
|
||||
@ -388,6 +403,7 @@ class GTKPainter extends SynthPainter {
|
||||
//
|
||||
// ARROW_BUTTON
|
||||
//
|
||||
@Override
|
||||
public void paintArrowButtonForeground(SynthContext context, Graphics g,
|
||||
int x, int y, int w, int h,
|
||||
int direction) {
|
||||
@ -437,6 +453,7 @@ class GTKPainter extends SynthPainter {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintArrowButtonBackground(SynthContext context,
|
||||
Graphics g, int x, int y, int w, int h) {
|
||||
Region id = context.getRegion();
|
||||
@ -515,12 +532,14 @@ class GTKPainter extends SynthPainter {
|
||||
//
|
||||
// LIST
|
||||
//
|
||||
@Override
|
||||
public void paintListBackground(SynthContext context, Graphics g,
|
||||
int x, int y, int w, int h) {
|
||||
// Does not call into ENGINE for better performance
|
||||
fillArea(context, g, x, y, w, h, GTKColorType.TEXT_BACKGROUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintMenuBarBackground(SynthContext context, Graphics g,
|
||||
int x, int y, int w, int h) {
|
||||
Region id = context.getRegion();
|
||||
@ -544,6 +563,7 @@ class GTKPainter extends SynthPainter {
|
||||
//
|
||||
// MENU
|
||||
//
|
||||
@Override
|
||||
public void paintMenuBackground(SynthContext context,
|
||||
Graphics g,
|
||||
int x, int y, int w, int h) {
|
||||
@ -551,6 +571,7 @@ class GTKPainter extends SynthPainter {
|
||||
}
|
||||
|
||||
// This is called for both MENU and MENU_ITEM
|
||||
@Override
|
||||
public void paintMenuItemBackground(SynthContext context,
|
||||
Graphics g,
|
||||
int x, int y, int w, int h) {
|
||||
@ -561,6 +582,7 @@ class GTKPainter extends SynthPainter {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintPopupMenuBackground(SynthContext context, Graphics g,
|
||||
int x, int y, int w, int h) {
|
||||
Region id = context.getRegion();
|
||||
@ -604,6 +626,7 @@ class GTKPainter extends SynthPainter {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintProgressBarBackground(SynthContext context,
|
||||
Graphics g,
|
||||
int x, int y, int w, int h) {
|
||||
@ -618,6 +641,7 @@ class GTKPainter extends SynthPainter {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintProgressBarForeground(SynthContext context, Graphics g,
|
||||
int x, int y, int w, int h,
|
||||
int orientation) {
|
||||
@ -637,6 +661,7 @@ class GTKPainter extends SynthPainter {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintViewportBorder(SynthContext context, Graphics g,
|
||||
int x, int y, int w, int h) {
|
||||
Region id = context.getRegion();
|
||||
@ -650,6 +675,7 @@ class GTKPainter extends SynthPainter {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintSeparatorBackground(SynthContext context,
|
||||
Graphics g,
|
||||
int x, int y, int w, int h,
|
||||
@ -768,6 +794,7 @@ class GTKPainter extends SynthPainter {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintSliderTrackBackground(SynthContext context,
|
||||
Graphics g,
|
||||
int x, int y, int w,int h) {
|
||||
@ -830,6 +857,7 @@ class GTKPainter extends SynthPainter {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintSliderThumbBackground(SynthContext context,
|
||||
Graphics g, int x, int y, int w, int h, int dir) {
|
||||
Region id = context.getRegion();
|
||||
@ -856,6 +884,7 @@ class GTKPainter extends SynthPainter {
|
||||
//
|
||||
// SPINNER
|
||||
//
|
||||
@Override
|
||||
public void paintSpinnerBackground(SynthContext context,
|
||||
Graphics g,
|
||||
int x, int y, int w, int h) {
|
||||
@ -865,6 +894,7 @@ class GTKPainter extends SynthPainter {
|
||||
//
|
||||
// SPLIT_PANE_DIVIDER
|
||||
//
|
||||
@Override
|
||||
public void paintSplitPaneDividerBackground(SynthContext context,
|
||||
Graphics g,
|
||||
int x, int y, int w, int h) {
|
||||
@ -886,12 +916,14 @@ class GTKPainter extends SynthPainter {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintSplitPaneDragDivider(SynthContext context,
|
||||
Graphics g,int x, int y, int w, int h,
|
||||
int orientation) {
|
||||
paintSplitPaneDividerForeground(context, g, x, y, w, h, orientation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintTabbedPaneContentBackground(SynthContext context,
|
||||
Graphics g, int x, int y, int w, int h) {
|
||||
JTabbedPane pane = (JTabbedPane)context.getComponent();
|
||||
@ -931,6 +963,7 @@ class GTKPainter extends SynthPainter {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintTabbedPaneTabBackground(SynthContext context,
|
||||
Graphics g,
|
||||
int x, int y, int w, int h,
|
||||
@ -958,6 +991,7 @@ class GTKPainter extends SynthPainter {
|
||||
//
|
||||
// TEXT_PANE
|
||||
//
|
||||
@Override
|
||||
public void paintTextPaneBackground(SynthContext context, Graphics g,
|
||||
int x, int y, int w, int h) {
|
||||
paintTextAreaBackground(context, g, x, y, w, h);
|
||||
@ -966,6 +1000,7 @@ class GTKPainter extends SynthPainter {
|
||||
//
|
||||
// EDITOR_PANE
|
||||
//
|
||||
@Override
|
||||
public void paintEditorPaneBackground(SynthContext context, Graphics g,
|
||||
int x, int y, int w, int h) {
|
||||
paintTextAreaBackground(context, g, x, y, w, h);
|
||||
@ -974,6 +1009,7 @@ class GTKPainter extends SynthPainter {
|
||||
//
|
||||
// TEXT_AREA
|
||||
//
|
||||
@Override
|
||||
public void paintTextAreaBackground(SynthContext context, Graphics g,
|
||||
int x, int y, int w, int h) {
|
||||
// Does not call into ENGINE for better performance
|
||||
@ -1076,6 +1112,7 @@ class GTKPainter extends SynthPainter {
|
||||
//
|
||||
// ROOT_PANE
|
||||
//
|
||||
@Override
|
||||
public void paintRootPaneBackground(SynthContext context, Graphics g,
|
||||
int x, int y, int w, int h) {
|
||||
// Does not call into ENGINE for better performance
|
||||
@ -1085,6 +1122,7 @@ class GTKPainter extends SynthPainter {
|
||||
//
|
||||
// TOGGLE_BUTTON
|
||||
//
|
||||
@Override
|
||||
public void paintToggleButtonBackground(SynthContext context,
|
||||
Graphics g,
|
||||
int x, int y, int w, int h) {
|
||||
@ -1103,6 +1141,7 @@ class GTKPainter extends SynthPainter {
|
||||
//
|
||||
// SCROLL_BAR
|
||||
//
|
||||
@Override
|
||||
public void paintScrollBarBackground(SynthContext context,
|
||||
Graphics g,
|
||||
int x, int y, int w,int h) {
|
||||
@ -1148,6 +1187,7 @@ class GTKPainter extends SynthPainter {
|
||||
//
|
||||
// SCROLL_BAR_THUMB
|
||||
//
|
||||
@Override
|
||||
public void paintScrollBarThumbBackground(SynthContext context,
|
||||
Graphics g, int x, int y, int w, int h, int dir) {
|
||||
Region id = context.getRegion();
|
||||
@ -1206,6 +1246,7 @@ class GTKPainter extends SynthPainter {
|
||||
//
|
||||
// TOOL_TIP
|
||||
//
|
||||
@Override
|
||||
public void paintToolTipBackground(SynthContext context, Graphics g,
|
||||
int x, int y, int w,int h) {
|
||||
Region id = context.getRegion();
|
||||
@ -1224,6 +1265,7 @@ class GTKPainter extends SynthPainter {
|
||||
//
|
||||
// TREE_CELL
|
||||
//
|
||||
@Override
|
||||
public void paintTreeCellBackground(SynthContext context, Graphics g,
|
||||
int x, int y, int w, int h) {
|
||||
Region id = context.getRegion();
|
||||
@ -1243,6 +1285,7 @@ class GTKPainter extends SynthPainter {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintTreeCellFocus(SynthContext context, Graphics g,
|
||||
int x, int y, int w, int h) {
|
||||
Region id = Region.TREE_CELL;
|
||||
@ -1254,6 +1297,7 @@ class GTKPainter extends SynthPainter {
|
||||
//
|
||||
// TREE
|
||||
//
|
||||
@Override
|
||||
public void paintTreeBackground(SynthContext context, Graphics g,
|
||||
int x, int y, int w, int h) {
|
||||
// As far as I can tell, these don't call into the ENGINE.
|
||||
@ -1264,6 +1308,7 @@ class GTKPainter extends SynthPainter {
|
||||
//
|
||||
// VIEWPORT
|
||||
//
|
||||
@Override
|
||||
public void paintViewportBackground(SynthContext context, Graphics g,
|
||||
int x, int y, int w, int h) {
|
||||
// As far as I can tell, these don't call into the ENGINE.
|
||||
@ -1509,6 +1554,7 @@ class GTKPainter extends SynthPainter {
|
||||
return context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintBorder(Component c, Graphics g, int x, int y,
|
||||
int w, int h) {
|
||||
if (focusedCell) {
|
||||
@ -1523,6 +1569,7 @@ class GTKPainter extends SynthPainter {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Insets getBorderInsets(Component c, Insets i) {
|
||||
SynthContext context = getContext(c);
|
||||
|
||||
@ -1533,6 +1580,7 @@ class GTKPainter extends SynthPainter {
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBorderOpaque() {
|
||||
return true;
|
||||
}
|
||||
@ -1542,6 +1590,7 @@ class GTKPainter extends SynthPainter {
|
||||
@SuppressWarnings("serial") // Superclass is not serializable across versions
|
||||
static class TitledBorder extends AbstractBorder implements UIResource {
|
||||
|
||||
@Override
|
||||
public void paintBorder(Component c, Graphics g, int x, int y,
|
||||
int w, int h) {
|
||||
SynthContext context = getContext((JComponent)c);
|
||||
@ -1559,11 +1608,13 @@ class GTKPainter extends SynthPainter {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Insets getBorderInsets(Component c, Insets i) {
|
||||
SynthContext context = getContext((JComponent)c);
|
||||
return context.getStyle().getInsets(context, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBorderOpaque() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2025, 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
|
||||
@ -142,6 +142,7 @@ class GTKStyle extends SynthStyle implements GTKConstants {
|
||||
return GTKPainter.INSTANCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Color getColorForState(SynthContext context, ColorType type) {
|
||||
if (type == ColorType.FOCUS || type == GTKColorType.BLACK) {
|
||||
return BLACK_COLOR;
|
||||
@ -292,6 +293,7 @@ class GTKStyle extends SynthStyle implements GTKConstants {
|
||||
return font;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Font getFontForState(SynthContext context) {
|
||||
Font propFont = UIManager
|
||||
.getFont(context.getRegion().getName() + ".font");
|
||||
@ -1053,6 +1055,7 @@ class GTKStyle extends SynthStyle implements GTKConstants {
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintIcon(SynthContext context, Graphics g, int x,
|
||||
int y, int w, int h) {
|
||||
Icon icon = getIcon(context);
|
||||
@ -1067,6 +1070,7 @@ class GTKStyle extends SynthStyle implements GTKConstants {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconWidth(SynthContext context) {
|
||||
Icon icon = getIcon(context);
|
||||
|
||||
@ -1076,6 +1080,7 @@ class GTKStyle extends SynthStyle implements GTKConstants {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconHeight(SynthContext context) {
|
||||
Icon icon = getIcon(context);
|
||||
|
||||
@ -1135,6 +1140,7 @@ class GTKStyle extends SynthStyle implements GTKConstants {
|
||||
this.methodName = methodName;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public Object createValue(UIDefaults table) {
|
||||
try {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2025, 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
|
||||
@ -58,6 +58,7 @@ class GTKStyleFactory extends SynthStyleFactory {
|
||||
* @param c this parameter isn't used, may be null.
|
||||
* @param id of the region to get the style.
|
||||
*/
|
||||
@Override
|
||||
public synchronized SynthStyle getStyle(JComponent c, Region id) {
|
||||
WidgetType wt = GTKEngine.getWidgetType(c, id);
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2025, 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
|
||||
@ -693,6 +693,7 @@ class Metacity implements SynthConstants {
|
||||
return new ImageIcon(context.getComponent().createImage(producer)).getImage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int filterRGB(int x, int y, int rgb) {
|
||||
// Assume all rgb values are shades of gray
|
||||
double grayLevel = 2 * (rgb & 0xff) / 255.0;
|
||||
@ -729,12 +730,16 @@ class Metacity implements SynthConstants {
|
||||
|
||||
|
||||
protected class TitlePaneLayout implements LayoutManager {
|
||||
@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) {
|
||||
JComponent titlePane = (JComponent)c;
|
||||
Container titlePaneParent = titlePane.getParent();
|
||||
@ -794,6 +799,7 @@ class Metacity implements SynthConstants {
|
||||
return new Dimension(width, height);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void layoutContainer(Container c) {
|
||||
JComponent titlePane = (JComponent)c;
|
||||
Container titlePaneParent = titlePane.getParent();
|
||||
@ -1943,10 +1949,12 @@ class Metacity implements SynthConstants {
|
||||
return token;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasMoreTokens() {
|
||||
return (token != null || super.hasMoreTokens());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String nextToken() {
|
||||
if (token != null) {
|
||||
String t = token;
|
||||
@ -2000,18 +2008,22 @@ class Metacity implements SynthConstants {
|
||||
this.archeight = arch;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getX() {
|
||||
return (double)x;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getY() {
|
||||
return (double)y;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getWidth() {
|
||||
return (double)width;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getHeight() {
|
||||
return (double)height;
|
||||
}
|
||||
@ -2024,10 +2036,12 @@ class Metacity implements SynthConstants {
|
||||
return (double)archeight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
return false; // Not called
|
||||
}
|
||||
|
||||
@Override
|
||||
public Rectangle2D getBounds2D() {
|
||||
return null; // Not called
|
||||
}
|
||||
@ -2036,10 +2050,12 @@ class Metacity implements SynthConstants {
|
||||
return corners;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFrame(double x, double y, double w, double h) {
|
||||
// Not called
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean contains(double x, double y) {
|
||||
return false; // Not called
|
||||
}
|
||||
@ -2048,14 +2064,17 @@ class Metacity implements SynthConstants {
|
||||
return 0; // Not called
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean intersects(double x, double y, double w, double h) {
|
||||
return false; // Not called
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean contains(double x, double y, double w, double h) {
|
||||
return false; // Not called
|
||||
}
|
||||
|
||||
@Override
|
||||
public PathIterator getPathIterator(AffineTransform at) {
|
||||
return new RoundishRectIterator(this, at);
|
||||
}
|
||||
@ -2148,18 +2167,22 @@ class Metacity implements SynthConstants {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWindingRule() {
|
||||
return WIND_NON_ZERO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDone() {
|
||||
return index >= ctrlpts.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void next() {
|
||||
index++;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int currentSegment(float[] coords) {
|
||||
if (isDone()) {
|
||||
throw new NoSuchElementException("roundrect iterator out of bounds");
|
||||
@ -2176,6 +2199,7 @@ class Metacity implements SynthConstants {
|
||||
return types[index];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int currentSegment(double[] coords) {
|
||||
if (isDone()) {
|
||||
throw new NoSuchElementException("roundrect iterator out of bounds");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user