Browse Source

Removed lambda parameter from PaintUtil.drawString in favour of an additional PaintUtil.drawStringUnderlineCharAt method to reduce painting overhead.

Fixed JTextPane not using correct foreground color and font.
pull/173/head
weisj 5 years ago
parent
commit
66ecb2d299
  1. 3
      change_notes.md
  2. 42
      core/src/main/java/com/github/weisj/darklaf/graphics/PaintUtil.java
  3. 19
      core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonUI.java
  4. 48
      core/src/main/java/com/github/weisj/darklaf/ui/label/DarkLabelUI.java
  5. 49
      core/src/main/java/com/github/weisj/darklaf/ui/tabframe/DarkTabFrameTabLabelUI.java
  6. 13
      core/src/main/java/com/github/weisj/darklaf/ui/text/DarkTextPaneUI.java
  7. 2
      core/src/main/java/com/github/weisj/darklaf/ui/text/DarkTextUI.java
  8. 3
      core/src/main/java/com/github/weisj/darklaf/ui/text/bridge/DarkEditorPaneUIBridge.java
  9. 8
      core/src/main/java/com/github/weisj/darklaf/ui/text/dummy/DummyEditorPane.java
  10. 14
      core/src/main/java/com/github/weisj/darklaf/ui/text/dummy/DummyEditorPaneUI.java
  11. 65
      core/src/main/java/com/github/weisj/darklaf/ui/text/dummy/DummyTextPaneUI.java
  12. 40
      core/src/main/java/com/github/weisj/darklaf/ui/text/dummy/DummyTextUIMethods.java
  13. 9
      core/src/main/java/com/github/weisj/darklaf/ui/togglebutton/radiobutton/DarkRadioButtonUI.java
  14. 8
      core/src/main/java/com/github/weisj/darklaf/ui/tooltip/DarkToolTipUI.java
  15. 1
      core/src/main/resources/com/github/weisj/darklaf/properties/globals.properties
  16. 1
      core/src/main/resources/com/github/weisj/darklaf/properties/ui/text.properties
  17. 2
      core/src/test/java/defaults/SampleRenderer.java
  18. 1
      core/src/test/java/ui/tabFrame/TabFrameDemo.java

3
change_notes.md

@ -4,10 +4,10 @@
- Support for insert text mode.
- Text cursor will now show directional hints for bidi text.
- Added cut/copy/paste context menu for text components.
- On macOS Catalina the default font will now be `Helvetica Neue` due to karning issues with the `San Francisco` font.
- Balloons tooltips are now enabled by default for buttons.
- Improved html style sheet.
- On Windows (Vista and later) darklaf will now use the system font.
- On macOS Catalina the default font will now be `Helvetica Neue` due to karning issues with the `San Francisco` font.
- Better interoperability with custom cell renderers.
- Improved selection painting.
- Added property to control whether the selection is extended to the end of the text component.
@ -41,3 +41,4 @@
- Incorrect popup location when using multiple monitors with different resolutions. #162 59e3c8e5f07479a1a717e42d48b82d763cf8f8cc
- Poor performance when using bidirectional text with non zero margins. #167 252885df6fa18044c215361cbbe200cdf3358cf5
- Text isn't painted when using the toggle button slider variant. 0d1f2913dd25d5a684fa2567c37a94b549f030b0
- Kerning issues on macOS Catalina. #128 d3fd5dedabe11d84685e593a03b1941b8ea56836

42
core/src/main/java/com/github/weisj/darklaf/graphics/PaintUtil.java

@ -33,6 +33,8 @@ import java.awt.geom.RoundRectangle2D;
import javax.swing.*;
import javax.swing.text.View;
import sun.swing.SwingUtilities2;
import com.github.weisj.darklaf.ui.html.DarkHTML;
import com.github.weisj.darklaf.util.PropertyUtil;
import com.github.weisj.darklaf.util.Scale;
@ -248,10 +250,14 @@ public class PaintUtil {
g.fillRect(x, y + height - thickness, width, thickness);
}
public static <T extends JComponent> void drawString(final Graphics g, final T c,
final String text, final Rectangle textRect) {
drawString(g, c, text, textRect, SwingUtilities2.getFontMetrics(c, g));
}
public static <T extends JComponent> void drawString(final Graphics g, final T c,
final String text, final Rectangle textRect,
final FontMetrics fm,
final PaintMethod<T> paintMethod) {
final FontMetrics fm) {
GraphicsContext context = GraphicsUtil.setupAntialiasing(g);
g.clipRect(textRect.x, textRect.y, textRect.width, textRect.height);
Font font = c.getFont();
@ -262,19 +268,41 @@ public class PaintUtil {
v.paint(g, textRect);
} else {
textRect.y += fm.getAscent();
paintMethod.paintText(g, c, textRect, text);
SwingUtilities2.drawString(c, g, text, textRect.x, textRect.y);
}
}
context.restore();
}
public static void fillRect(final Graphics g, final Rectangle r) {
g.fillRect(r.x, r.y, r.width, r.height);
public static <T extends JComponent> void drawStringUnderlineCharAt(final Graphics g, final T c,
final String text, final int mnemIndex,
final Rectangle textRect) {
drawStringUnderlineCharAt(g, c, text, mnemIndex, textRect, SwingUtilities2.getFontMetrics(c, g));
}
public interface PaintMethod<T extends JComponent> {
public static <T extends JComponent> void drawStringUnderlineCharAt(final Graphics g, final T c,
final String text, final int mnemIndex,
final Rectangle textRect,
final FontMetrics fm) {
GraphicsContext context = GraphicsUtil.setupAntialiasing(g);
g.clipRect(textRect.x, textRect.y, textRect.width, textRect.height);
Font font = c.getFont();
g.setFont(font);
void paintText(final Graphics g, final T c, final Rectangle rect, final String text);
if (text != null && !text.equals("")) {
View v = PropertyUtil.getObject(c, DarkHTML.propertyKey, View.class);
if (v != null) {
v.paint(g, textRect);
} else {
textRect.y += fm.getAscent();
SwingUtilities2.drawStringUnderlineCharAt(c, g, text, mnemIndex, textRect.x, textRect.y);
}
}
context.restore();
}
public static void fillRect(final Graphics g, final Rectangle r) {
g.fillRect(r.x, r.y, r.width, r.height);
}
public enum Outline {

19
core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonUI.java

@ -273,23 +273,14 @@ public class DarkButtonUI extends BasicButtonUI implements ButtonConstants {
}
}
@Override
protected void paintText(final Graphics g, final JComponent c,
final Rectangle textRect, final String text) {
AbstractButton button = (AbstractButton) c;
ButtonModel model = button.getModel();
g.setColor(getForeground(button));
int mnemonicIndex = button.getDisplayedMnemonicIndex();
protected void paintText(final Graphics g, final AbstractButton b, final String text) {
ButtonModel model = b.getModel();
g.setColor(getForeground(b));
int mnemonicIndex = b.getDisplayedMnemonicIndex();
if (!model.isEnabled()) {
mnemonicIndex = -1;
}
SwingUtilities2.drawStringUnderlineCharAt(c, g, text, mnemonicIndex,
textRect.x + getTextShiftOffset(),
textRect.y + getTextShiftOffset());
}
protected void paintText(final Graphics g, final AbstractButton b, final String text) {
PaintUtil.drawString(g, b, text, textRect, SwingUtilities2.getFontMetrics(b, g), this::paintText);
PaintUtil.drawStringUnderlineCharAt(g, b, text, mnemonicIndex, textRect);
}
protected void paintIcon(final Graphics g, final AbstractButton b, final JComponent c) {

48
core/src/main/java/com/github/weisj/darklaf/ui/label/DarkLabelUI.java

@ -78,6 +78,8 @@ public class DarkLabelUI extends BasicLabelUI implements PropertyChangeListener
String text = label.getText();
Icon icon = getIcon(label);
paintBackground(g, c);
if ((icon == null) && (text == null)) {
return;
}
@ -90,34 +92,34 @@ public class DarkLabelUI extends BasicLabelUI implements PropertyChangeListener
config.restoreClip();
}
PaintUtil.drawString(g, c, clippedText, paintTextR, fm, (g2, c2, rect, t) -> {
if (label.isEnabled()) {
paintEnabledText(label, g2, t, rect.x, rect.y);
} else {
paintDisabledText(label, g2, t, rect.x, rect.y);
}
});
paintText(g, label, fm, clippedText);
}
@Override
protected void paintEnabledText(final JLabel l, final Graphics g, final String s,
final int textX, final int textY) {
int mnemIndex = l.getDisplayedMnemonicIndex();
g.setColor(l.getForeground());
SwingUtilities2.drawStringUnderlineCharAt(l, g, s, mnemIndex,
textX, textY);
protected void paintBackground(final Graphics g, final JComponent c) {}
public void paintText(final Graphics g, final JLabel label, final FontMetrics fm, final String clippedText) {
int mnemIndex = label.isEnabled() ? label.getDisplayedMnemonicIndex() : -1;
g.setColor(getForeground(label));
PaintUtil.drawStringUnderlineCharAt(g, label, clippedText, mnemIndex, paintTextR, fm);
}
@Override
protected void paintDisabledText(final JLabel l, final Graphics g, final String s,
final int textX, final int textY) {
int accChar = l.getDisplayedMnemonicIndex();
g.setColor(l.getForeground());
if (!DarkUIUtil.isInCell(l)) {
g.setColor(inactiveForeground);
protected Color getForeground(final Component label) {
if (label.isEnabled()) {
return getEnabledForeground(label);
} else {
return getDisabledForeground(label);
}
}
protected Color getEnabledForeground(final Component label) {
return label.getForeground();
}
protected Color getDisabledForeground(final Component label) {
if (!DarkUIUtil.isInCell(label)) {
return inactiveForeground;
}
SwingUtilities2.drawStringUnderlineCharAt(l, g, s, accChar,
textX, textY);
return getEnabledForeground(label);
}
protected Icon getIcon(final JLabel label) {

49
core/src/main/java/com/github/weisj/darklaf/ui/tabframe/DarkTabFrameTabLabelUI.java

@ -36,13 +36,9 @@ import javax.swing.*;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.UIResource;
import sun.swing.SwingUtilities2;
import com.github.weisj.darklaf.components.tabframe.JTabFrame;
import com.github.weisj.darklaf.components.tabframe.TabFrameTab;
import com.github.weisj.darklaf.components.tabframe.TabFrameTabLabel;
import com.github.weisj.darklaf.graphics.GraphicsContext;
import com.github.weisj.darklaf.graphics.PaintUtil;
import com.github.weisj.darklaf.icons.RotatableIcon;
import com.github.weisj.darklaf.listener.HoverListener;
import com.github.weisj.darklaf.ui.label.DarkLabelUI;
@ -79,42 +75,9 @@ public class DarkTabFrameTabLabelUI extends DarkLabelUI implements PropertyChang
}
@Override
public void paint(final Graphics g, final JComponent c) {
GraphicsContext config = new GraphicsContext(g);
protected void paintBackground(final Graphics g, final JComponent c) {
g.setColor(getBackground(tabComponent));
g.fillRect(0, 0, tabComponent.getWidth(), tabComponent.getHeight());
JLabel label = (JLabel) c;
String text = label.getText();
Icon icon = getIcon();
if ((icon == null) && (text == null)) {
return;
}
FontMetrics fm = SwingUtilities2.getFontMetrics(label, g);
String clippedText = layout(label, fm, c.getWidth(), c.getHeight());
if (icon != null) {
icon.paintIcon(c, g, paintIconR.x, paintIconR.y);
config.restoreClip();
}
PaintUtil.drawString(g, c, clippedText, paintTextR, fm, (g2, c2, rect, t) -> {
if (label.isEnabled()) {
paintEnabledText(label, g2, t, rect.x, rect.y);
} else {
paintDisabledText(label, g2, t, rect.x, rect.y);
}
});
}
@Override
protected void paintEnabledText(final JLabel l, final Graphics g, final String s,
final int textX, final int textY) {
int mnemIndex = l.getDisplayedMnemonicIndex();
g.setColor(getForeground(tabComponent));
SwingUtilities2.drawStringUnderlineCharAt(l, g, s, mnemIndex, textX, textY);
}
@Override
@ -259,7 +222,12 @@ public class DarkTabFrameTabLabelUI extends DarkLabelUI implements PropertyChang
: tab.getBackground();
}
public Color getForeground(final TabFrameTabLabel tab) {
@Override
protected Color getEnabledForeground(final Component label) {
return getTabForeground((TabFrameTabLabel) label);
}
public Color getTabForeground(final TabFrameTabLabel tab) {
if (printing) return tab.getForeground();
return tab.isSelected()
? selectedFontColor
@ -268,7 +236,8 @@ public class DarkTabFrameTabLabelUI extends DarkLabelUI implements PropertyChang
: tab.getForeground();
}
protected Icon getIcon() {
@Override
protected Icon getIcon(final JLabel label) {
Icon icon = (tabComponent.isEnabled()) ? tabComponent.getIcon() : tabComponent.getDisabledIcon();
rotatableIcon.setIcon(icon);
if (rotatableIcon.getOrientation() == null) {

13
core/src/main/java/com/github/weisj/darklaf/ui/text/DarkTextPaneUI.java

@ -24,21 +24,24 @@
*/
package com.github.weisj.darklaf.ui.text;
import java.awt.*;
import javax.swing.*;
import javax.swing.plaf.ComponentUI;
import com.github.weisj.darklaf.ui.text.dummy.DummyTextPaneUI;
/**
* @author Jannis Weis
*/
public class DarkTextPaneUI extends DarkEditorPaneUI {
public static ComponentUI createUI(final JComponent c) {
return new DarkTextPaneUI();
static {
basicEditorPaneUI = new DummyTextPaneUI();
}
@Override
public void installUI(final JComponent c) {
super.installUI(c);
public static ComponentUI createUI(final JComponent c) {
return new DarkTextPaneUI();
}
@Override

2
core/src/main/java/com/github/weisj/darklaf/ui/text/DarkTextUI.java

@ -135,7 +135,7 @@ public abstract class DarkTextUI extends BasicTextUI implements PropertyChangeLi
protected void uninstallPopupMenu() {
JPopupMenu popupMenu = editor.getComponentPopupMenu();
if (popupMenu instanceof UIResource) {
editor.setComponentOrientation(null);
editor.setComponentPopupMenu(null);
}
}

3
core/src/main/java/com/github/weisj/darklaf/ui/text/bridge/DarkEditorPaneUIBridge.java

@ -34,6 +34,7 @@ import javax.swing.text.JTextComponent;
import com.github.weisj.darklaf.ui.text.DarkTextUI;
import com.github.weisj.darklaf.ui.text.dummy.DummyEditorPane;
import com.github.weisj.darklaf.ui.text.dummy.DummyEditorPaneUI;
import com.github.weisj.darklaf.ui.text.dummy.DummyTextUIMethods;
import com.github.weisj.darklaf.util.PropertyKey;
/**
@ -42,7 +43,7 @@ import com.github.weisj.darklaf.util.PropertyKey;
public abstract class DarkEditorPaneUIBridge extends DarkTextUI {
private static final DummyEditorPane editorPane = new DummyEditorPane();
private static final DummyEditorPaneUI basicEditorPaneUI = new DummyEditorPaneUI();
protected static DummyTextUIMethods basicEditorPaneUI = new DummyEditorPaneUI();
private PropertyChangeListener propertyChangeListener;

8
core/src/main/java/com/github/weisj/darklaf/ui/text/dummy/DummyEditorPane.java

@ -46,6 +46,14 @@ public class DummyEditorPane extends JEditorPane {
public void setEditorPane(final JEditorPane editorPane) {
this.editorPane = editorPane;
if (editorPane != null) {
copyProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES);
copyProperty(JEditorPane.W3C_LENGTH_UNITS);
}
}
protected void copyProperty(final String key) {
putClientProperty(key, editorPane.getClientProperty(key));
}
public PropertyChangeListener getPropertyChangeListener() {

14
core/src/main/java/com/github/weisj/darklaf/ui/text/dummy/DummyEditorPaneUI.java

@ -27,8 +27,9 @@ package com.github.weisj.darklaf.ui.text.dummy;
import java.beans.PropertyChangeEvent;
import javax.swing.plaf.basic.BasicEditorPaneUI;
import javax.swing.text.JTextComponent;
public class DummyEditorPaneUI extends BasicEditorPaneUI {
public class DummyEditorPaneUI extends BasicEditorPaneUI implements DummyTextUIMethods {
@Override
protected void installDefaults() {}
@ -42,12 +43,23 @@ public class DummyEditorPaneUI extends BasicEditorPaneUI {
@Override
protected void installKeyboardActions() {}
@Override
public void installKeyBoardActionsReal() {
super.installKeyboardActions();
}
@Override
public void installUI(final JTextComponent editor) {
super.installUI(editor);
}
@Override
public void propertyChange(final PropertyChangeEvent evt) {
super.propertyChange(evt);
}
@Override
public void uninstallUI(final JTextComponent editor) {
super.uninstallUI(editor);
}
}

65
core/src/main/java/com/github/weisj/darklaf/ui/text/dummy/DummyTextPaneUI.java

@ -0,0 +1,65 @@
/*
* MIT License
*
* Copyright (c) 2020 Jannis Weis
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package com.github.weisj.darklaf.ui.text.dummy;
import java.beans.PropertyChangeEvent;
import javax.swing.plaf.basic.BasicTextPaneUI;
import javax.swing.text.JTextComponent;
public class DummyTextPaneUI extends BasicTextPaneUI implements DummyTextUIMethods {
@Override
protected void installDefaults() {}
@Override
protected void installListeners() {}
@Override
protected void modelChanged() {}
@Override
protected void installKeyboardActions() {}
@Override
public void installKeyBoardActionsReal() {
super.installKeyboardActions();
}
@Override
public void installUI(final JTextComponent editor) {
super.installUI(editor);
}
@Override
public void propertyChange(final PropertyChangeEvent evt) {
super.propertyChange(evt);
}
@Override
public void uninstallUI(final JTextComponent editor) {
super.uninstallUI(editor);
}
}

40
core/src/main/java/com/github/weisj/darklaf/ui/text/dummy/DummyTextUIMethods.java

@ -0,0 +1,40 @@
/*
* MIT License
*
* Copyright (c) 2020 Jannis Weis
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package com.github.weisj.darklaf.ui.text.dummy;
import java.beans.PropertyChangeEvent;
import javax.swing.text.JTextComponent;
public interface DummyTextUIMethods {
void installKeyBoardActionsReal();
void installUI(final JTextComponent editor);
void propertyChange(final PropertyChangeEvent event);
void uninstallUI(final JTextComponent editor);
}

9
core/src/main/java/com/github/weisj/darklaf/ui/togglebutton/radiobutton/DarkRadioButtonUI.java

@ -165,13 +165,8 @@ public class DarkRadioButtonUI extends MetalRadioButtonUI implements PropertyCha
final Color disabledTextColor) {
g.setFont(b.getFont());
g.setColor(b.isEnabled() ? b.getForeground() : disabledTextColor);
PaintUtil.drawString(g, b, text, textRect, fm, (g2, c2, rect, t) -> {
int textX = rect.x;
int textY = rect.y;
SwingUtilities2.drawStringUnderlineCharAt(b, g2, t,
b.getDisplayedMnemonicIndex(),
textX, textY);
});
int mnemIndex = b.isEnabled() ? b.getDisplayedMnemonicIndex() : -1;
PaintUtil.drawStringUnderlineCharAt(g, b, text, mnemIndex, textRect, fm);
}
protected Icon getStateIcon(final AbstractButton b) {

8
core/src/main/java/com/github/weisj/darklaf/ui/tooltip/DarkToolTipUI.java

@ -36,8 +36,6 @@ import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicToolTipUI;
import javax.swing.text.View;
import sun.swing.SwingUtilities2;
import com.github.weisj.darklaf.components.tooltip.ToolTipStyle;
import com.github.weisj.darklaf.graphics.Animator;
import com.github.weisj.darklaf.graphics.GraphicsContext;
@ -187,8 +185,6 @@ public class DarkToolTipUI extends BasicToolTipUI implements PropertyChangeListe
}
protected void paintText(final Graphics g, final JComponent c) {
Font font = c.getFont();
FontMetrics metrics = SwingUtilities2.getFontMetrics(c, g, font);
Dimension size = c.getSize();
g.setColor(c.getForeground());
@ -198,9 +194,7 @@ public class DarkToolTipUI extends BasicToolTipUI implements PropertyChangeListe
Rectangle paintTextR = new Rectangle(insets.left, insets.top,
size.width - (insets.left + insets.right),
size.height - (insets.top + insets.bottom));
PaintUtil.drawString(g, c, tipText, paintTextR, metrics, (g2, c2, r, t) -> {
SwingUtilities2.drawString(c, g, t, r.x, r.y);
});
PaintUtil.drawString(g, c, tipText, paintTextR);
}
protected String getTipText(final JToolTip c) {

1
core/src/main/resources/com/github/weisj/darklaf/properties/globals.properties

@ -52,6 +52,7 @@ ArrowButton.down.icon = navigation/arrowDown.svg[themed]
html.pendingImage = files/pendingImage.svg[themed](32,32)
html.missingImage = files/missingImage.svg[themed](32,32)
textInactiveText = %textForegroundInactive
link.foreground = %hyperlink
Hyperlink.linkColor = %hyperlink
swing.boldMetal = false

1
core/src/main/resources/com/github/weisj/darklaf/properties/ui/text.properties

@ -60,6 +60,7 @@ TextField.insets = 4,4,4,4
TextPane.selectionBackground = %textCompSelectionBackground
TextPane.selectionForeground = %textCompSelectionForeground
TextPane.background = %textBackground
TextPane.foreground = %textForeground
TextPane.disabledBackground = %textBackgroundInactive
TextPane.inactiveBackground = %textBackgroundInactive
TextPane.border = com.github.weisj.darklaf.ui.text.DarkPlainTextBorder

2
core/src/test/java/defaults/SampleRenderer.java

@ -57,7 +57,7 @@ public class SampleRenderer extends JLabel implements TableCellRenderer {
setText("");
if (sample instanceof Color) {
setBackground((Color) sample);
setBackground(new Color(((Color) sample).getRGB()));
} else if (sample instanceof Border) {
setBorder((Border) sample);
} else if (sample instanceof Font) {

1
core/src/test/java/ui/tabFrame/TabFrameDemo.java

@ -51,7 +51,6 @@ public class TabFrameDemo implements ComponentDemo {
NumberedTextComponent numberPane = new NumberedTextComponent(new NonWrappingTextPane() {
{
setText(StringUtil.repeat(DemoResources.LOREM_IPSUM, 10));
setFont(new Font(Font.MONOSPACED, Font.PLAIN, getFont().getSize()));
}
});
NumberingPane numbering = numberPane.getNumberingPane();

Loading…
Cancel
Save